Vous êtes sur la page 1sur 1

TCP-UDP Performance Testing CSCI 386 Fall 2017

Write a collection of test programs that use the C socket interface to send messages using TCP
Segments and UDP Datagrams between a pair of workstations on the same LAN. Use these test
programs to perform the following experiments:

1. Measure the round-trip latency of TCP and UDP for different message sizes (1, 100, 200, …,
1000 bytes).
2. Measure the throughput of TCP and UDP for 1 KB, 2 KB, …, 128 KB messages.
3. Measure the throughput of TCP by sending 100 MB of data. Do this in a loop that sends a
message of some size – for example, 1024 iterations of a loop that sends 1 KB messages.
Repeat the experiment with different message sizes in the range 1KB, 2KB, …, 30KB.

In order for the results to be useful (comparable):


1. Be sure your applications are running on the same LAN.
2. Report data rates in bits per second.
3. Report latency in milliseconds.
4. Report the NIC speeds for the computers used.
5. Pair up with another student in the class and compare/reconcile the data each of you has
collected. This analysis will be included in your final project report.

NB:
1. Measuring time is a vexedly difficult problem. Be careful about which of the dozens of C time
functions you use. Include a report on the precision and accuracy of your time function (which
can be affected by the OS) and why you chose to use it.
2. In order to get a measurable time value you will have to do each send/receive many times and
use the average to estimate the individual send/receive time. [Since a single send can take only
a few microseconds measuring elapsed time on just one instance will result in a time value of
zero. Doing it say 100,000 times and computing the average is better.]
3. Be careful to measure only the actual TCP/UDP time and do not include time for other things
your program might be doing.
4. Remember that TCP is a byte stream protocol. That means that the receiver must check that all
data has been received. The send() and recv() functions are part of the C library. That means
that the number of bytes sent is only loosely related to the number of bytes in any resulting TCP
segments. Similarly on the receiving side, the number of bytes delivered by recv() does not
indicate the number of bytes in any segment. The only guarantee is that the total number of
bytes sent will be equal to the total number of bytes received (as long as the receiver keeps
reading until there are no more bytes to be read) and that the bytes are in the correct order.
5. You will need two client-server program pairs. One pair using TCP and the other using UDP;
they are not interchangeable.

Each pair should write a report on your experiments that includes tables of data and graphs of
throughput and latency vs size for each of the 3 experiments for each student’s programs. You must
make sure your measurements agree or explain the differences.
Make note in your report on the observed performances and the NIC advertised performance. Make
note in your report on how you measured time, what the precision and accuracy is, and why you did it
this way.

Vous aimerez peut-être aussi