Assignment 1

Measure the performance (both latency and throughput) of Linux's Internet protocol stack running on a pair of PCs in Friend 010. Turn in a written report that describes your results.

Read Section 5.4 of the textbook for an example of how to measure and report protocol performance. Read the Unix socket man pages to see how to access the network protocol stack; for example, socket(2), socket(7), ip(7), tcp(7), udp(7), and raw(7). The "simplex-talk" example on pp. 45-48 of the textbook (client.c and server.c) is a good starting point.

To measure round-trip latency, use UDP, TCP, and IP to send and receive messages of size 1-byte, 100-bytes, 200-bytes, 300-bytes, ..., and 1000-bytes. Report both the round-trip time for each protocol, and how much latency it contributes to the stack.

To measure throughput, use UDP and TCP send messages of size 1KByte, 2KBytes, 4KBytes, 8KBytes, 16KBytes, and 32KBytes in one direction, with a message of the same size echoed back in the reverse direction. This is the same as the previous test but with larger messages.

As a second measure of TCP throughput (this does not apply to UDP), measure how long it takes to send 1MByte of data from one PC to another (and a 1-byte application-level ACK in the reverse direction), varying the number of messages and size of each message; e.g., 256 x 4KByte messages, 512 x 2KByte messages, 1024 x 1KByte messages, 2048 x 512-byte messages, and so on. Measure enough combinations to discover TCP's performance limits. Run the experiments with Nagle's algorithm turned on and off (using the TCP_NODELAY option), and with different send/receive buffer sizes (using the SO_SNDBUF and SO_RCVBUF options).

Turn in a written report that describes your experiments, presents your results (this means performance tables and graphs), and draws any relevant conclusions. Your report should be in the form of either a postscript or PDF file (i.e., not an MS Word .doc file). Also turn in source code for any test programs you develop.