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

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

  1. Skim the manpage for ifconfig. What is it used for? What does it do if it is invoked without any arguments?
  2. Invoke /sbin/ifconfig with no arguments. Paste the results into your lab notebook.
  3. 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.
    1. What is the maximum transmission unit (MTU) for this interface? (This is determined by the link layer protocol.)
    2. Has the interface received or transmitted more packets?
    3. 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?
    4. Has this interface detected any collisions?

Part B: netstat

  1. Skim the manpage for netstat. What is it used for? What does it do if it is invoked without any arguments?
  2. Invoke netstat -i. Paste the results into your lab notebook. How do the results compare with what you learned from ifconfig?
  3. Invoke netstat -t -u. Paste the results into your lab notebook. What applications or services have TCP sockets open?
  4. Invoke netstat -t -u -l. Paste the results into your lab notebook.
    1. What network servers are running on your machine?
    2. What ports are being listened to by unnamed applications?
  5. Invoke netstat -s. Paste the results into your lab notebook.
    1. For what protocols are statistics listed?
    2. How many times has TCP timed out after losing a packet?
    3. How many times has a TCP connection been aborted due to a timeout?
    4. List any questions you have about what you see.
  6. 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

  1. Suggest a reason why you did or did not see collisions on your network interface in Part A.
  2. How might these tools be useful to an application programmer or system administrator? (Write just a few sentences.)
  3. Are there other questions I should have asked?
  4. How long did you take to complete this lab?

Janet Davis (davisjan@cs.grinnell.edu)

Created February 18, 2009
Last revised February 18, 2009