ifconfig and netstat
Due date
Check the course schedule
for the due date.
Introduction
Experiment with network tools available on any UNIX-like
system.
Goals
- Use
ifconfig to learn about
network interfaces.
- Experiment with the multifaceted capabilities of
netstat.
Logistics
You may work individually or in pairs. You have one week to
complete this assignment.
Preparation
No particular preparation is required. You may complete this
assignment using any machine on the MathLAN. If you prefer, you may use
your own UNIX or Mac OS machine, though the locations of the tools may
be different.
Assignment
Part A: ifconfig
- Skim the manpage for
ifconfig.
What is it used for? What does it do if it is invoked without any
arguments?
- Invoke
/sbin/ifconfig with no
arguments. Paste the results into your lab notebook.
- Choose an interface other than the local loopback. (On the MathLAN workstations, the only two interfaces should be
lo and eth0.) Answer
the following questions.
- What is the maximum transmission unit (MTU) for this
interface? (This is determined by the link layer protocol.)
- Has the interface received or transmitted more packets?
- Using the number of packets and bytes received and
transmitted, compute the average size of packets received and the
average size of packets transmitted. How do these compare to the MTU?
- Has this interface detected any collisions?
Part B: netstat
- Skim the manpage for netstat. What is it used for? What
does it do if it is invoked without any arguments?
- Invoke
netstat -i. Paste the
results into your lab notebook. How do the results compare with
what you learned from ifconfig?
- Invoke
netstat -t -u. Paste the
results into your lab notebook. What applications or services
have TCP sockets open?
- Invoke
netstat -t -u -l. Paste
the results into your lab notebook.
- What network servers are running on your machine?
- What ports are being listened to by unnamed
applications?
- Invoke
netstat -s. Paste the
results into your lab notebook.
- For what protocols are statistics listed?
- How many times has TCP timed out after losing a packet?
- How many times has a TCP connection been aborted due to a
timeout?
- List any questions you have about what you see.
- Invoke
netstat -r. What happens?
Try to interpret what you see. You may find the manpage for route helpful.
Assessment
There is no A-option for this lab because it is so short.
Advice
Just do it. If you have questions, ask away.
Lab Notebook
Include your answers to the questions in parts A and B and the
discussion questions below.
Discussion Questions
- Suggest a reason why you did or did not see collisions
on your network interface in Part A.
- How might these tools be useful to an application programmer or system administrator? (Write just a few sentences.)
- Are there other questions I should have asked?
- How long did you take to complete this lab?
Janet
Davis (davisjan@cs.grinnell.edu)
Created February 18, 2009
Last revised February 18, 2009