USC CSD Home


Exercise #3

Flow Behavior, Isolation and Service Differentiation in TCP

Due 11:45PM (firm)
 
The goal of this exercise is to understand the behavior of TCP for short and long flows, to study the isolation properties of different queueing disciplines (FIFO and RED), as well as to study how service differentiation (different TCP connections receiving different bandwidths) is implemented in some modern day routers.

What you will get out of this exercise:

  • Exposure to some traffic generation tools, like ttcp and iperf
  • Hands on use of some traffic capture tools like tcpdump
  • Use of some TCP analysis tools
  • Some tweaking of packet handling rules using firewall tools
  • A detailed, packet-level understanding of TCP behavior as well as the impact on TCP of the queueing discipline used in routers.
Electronic submissions only.
 
Resources
Read as many of these resources as possible. As a first step, brush up your knowledge of TCP and its mechanisms (viz. slow start, congestion avoidance, fast recovery and fast retransmit):
 
Output
You will submit a lab report. The lab report should contain answers to the questions listed in the exercise description. The lab report should be in ASCII, PostScript, PDF or HTML. You should name the file ex3.* with the appropriate file extension. You may prepare the report using any good word processing software (MS Word, Latex, Lyx).

In addition, you will be asked to submit data files and other kinds of files. To do this, put your report and all required files into a directory named ex3. Then tar and gzip this directory into a file called ex3.tar.gz and submit it electronically. (Read the documentation for the Unix "tar" command on how to do this).

Even if you are not able to complete the exercise, be sure to submit a partial lab report. You will get partial credit for your efforts.

 
The Topology
Most people agree that today's TCP traffic contains a mix of "mice" and "elephants". Mice represent the short connections or flows. Each short flow transmits a small amount of data. An example of such a flow would be a Web transaction. As a rule of thumb, about 80% of the flows (or connections) in the network are estimated to be short flows. The rest are "elephants" or long flows. A long flow, on the other hand, is exemplified by an FTP file transfer. As a rule of thumb, about 80% of the total traffic (in bytes transferred) belongs to long flows.

This exercise will involve testing TCP on a representative traffic mix. For this, you will use the following topology:

In this topology, B is a Cisco router and all the other machines are workstations.
 
Configuring the Topology
As before, you will be given the bare, unconfigured topology. You will need to log on to the routers and the machines and will configure the topologies.

Setting up the interfaces

You will need to set up an address assignment plan for the topology. Setup the first two bytes of all addresses according to the last four digits of your USC ID. If your USC ID is abcdefghij, then all addresses must begin with 1gh.ij. For example, if your USC ID is xxxxxx1234, then all addresses must be in the form of 112.34.x.x.

Answer these questions in your lab report.

  1. How many subnets are there in your topology?
  2. As with the routing exercise, list all the subnets and the interface addresses.

Setting up routing

Now, you will need to set up routing on the given topology. To do this, read the zebra documentation to figure out how RIP can be configured in zebra and in the Cisco's (by now, you should have figured out how to access the Cisco documentation on the Web).

Answer these questions in your lab report.

  1. What commands did you use to configure RIP on the Cisco router? Include the running-config of the router. Call the file B.conf.
  2. What commands did you use to configure ripd in zebra?

Setting up a Web server

The next step is to set up a web server on machines C, D and E of your topology. For this step, you will need to understand how to configure the Apache web server that comes with most Linux distributions. Basically, you will need to put the following two files into the right place in the file system (you may need to create a directory to do this): so that, when you use a browser from machine A and type the following URL
http://ip_address_of_C/tcpexpt/xorp-1.0.tar.gz
the browser should start downloading the file.

You should install these two files on all three machines C, D and E since they will be needed for your experiment.

Answer the following questions in your lab report:

  1. What commands did you use to configure httpd (the web server) to do this?
  2. Instead of a browser, find a Linux command line tool that allows you to download web pages. Show me that your setup works by including in your submission a script of a Unix session where you actually download the two files on machine A (see the man page for the script command) using this command line tool.
 
Of Mice and Elephants
Now you are ready to do the first part of the exercise. This part of the exercise tests whether TCP is as fair to mice as it is to elephants. That is, you will verify whether TCP gives approximately equal throughput to the small flows as it does to the large flows.

To do this, you will write one or more Shell scripts that, when executed at A, will initiate three concurrent downloads of the large file (the XORP software), one from each of C, D and E (using the Unix command line tool for downloading web URLs that you found in the previous step). Your script will also concurrently (and repeatedly) download 3 copies of the smaller file from each of C, D and E. Thus, at any instant, you should try to (we say try to, because, while the short flows are stopping and starting again, there may be times when you have fewer than 9 short flows that are concurrently active) have 3 long flows and 9 short flows going on. The experiment stops when the last long flow is done downloading the large file.

While the experiment is on going, you should also collect binary packet traces on C, D, and E using tcpdump without filtering out any traffic. Read the man page for tcpdump carefully before embarking on the experiment.

Part A

Once the experiment is done, you should now be ready to analyze the results. To do this, you would use the tcptrace tool (see the Resources section above).

Answer the following questions in your lab report (or perform other actions as necessary):

  1. Include the shell script along with your submission. Name the file tcp_fair.sh.
  2. Compress the traces from each of C, D, and E and include them in your submission. These traces must be named C.tcp_fair.trace.gz, D.tcp_fair.trace.gz etc.
  3. Include three summaries of these traces (i.e run tcptrace -b on them). These files must be text files and must be named: C.tcp_fair.summary, D.tcp_fair.summary etc.
  4. Now use tcptrace to compute the average throughput given to a short flow. Similarly, compute the average throughput achieved by a long flow. What values do you get?
  5. Are these two values different? Would you have expected them to be different? If the values turn out to be different, proceed to the next step. Otherwise stop here.
  6. Include the time-sequence plot (see the tcptrace manual for this) for one short flow from machine C. Name the file C.tcp_fair.short.time-seq.eps. Include a time-sequence plot for the long flow from machine C. Name the file C.tcp_fair.long.time-seq.eps. Do these two files give you an idea why you saw a throughput difference in step 4? Explain.
  7. Is TCP fair to short flows?

Part B

Now, keep the same overall configuration, but figure out how to configure RED (Random Early Detection) in router B (the Cisco router). Keep the default parameters for RED that Cisco uses.

Re-run the same experiments as discussed above and answer the following questions:

  1. What commands did you use to enable RED on the Cisco?
  2. Compress the traces from each of C, D, and E and include them in your submission. These traces must be name C.tcp_fair_red.trace.gz, D.tcp_fair_red.trace.gz etc.
  3. Include three summaries of these traces (i.e run tcptrace -b on them). These files must be text files and must be named: C.tcp_fair_red.summary, D.tcp_fair_red.summary etc.
  4. Now use tcptrace to compute the average throughput given to a short flow. Similarly, compute the average throughput achieved by a long flow. What values do you get?
  5. Are these two values different? Would you have expected them to be different?
  6. How do these values compare with the throughputs obtained using FIFO (the default queueing behavior)?
Now disable RED in the router so that it defaults to using FIFO queueing.
 
Isolation
TCP works well in the Internet largely because almost everyone "plays the game" (that is, all end systems cooperatively back off upon detecting congestion). In this second part of the exercise, you will examine the effects of non-conformant traffic (i.e. traffic that does not react appropriately to congestion) on TCP flows. You will also study if, changing the queueing discipline (e.g. to RED) has any effect at all.

To do this, you will use ttcp or iperf to send UDP large (to determine the largest possible packet you can send, you need to understand what MTU means) packets from C to A. Read about ttcp and iperf and figure out how to send UDP traffic. Update your shell script to add this. That is, your script running on A should not only have the short and long flows as before, but it should also cause C to generate a sequence of back-to-back UDP packets.

Part A

Now, run the script, and obtain the tcpdump traces from machines C, D, and E, as before.
  1. Include the shell script along with your submission. Name the file tcp_iso.sh.
  2. Compress the traces from each of C, D, and E and include them in your submission. These traces must be named C.tcp_iso.trace.gz, D.tcp_iso.trace.gz etc.
  3. Include three summaries of these traces (i.e run tcptrace -b on them). These files must be text files and must be named: C.tcp_iso.summary, D.tcp_iso.summary etc.
  4. Now use tcptrace to compute the average throughput given to a short flow. Similarly, compute the average throughput achieved by a long flow. What values do you get?
  5. Is each of these throughputs different from the corresponding throughput numbers obtained in Part A of the "Mice and Elephants" experiment? If they are explain what you think is happening, using one of the types of plots that tcptrace generates, for one of the flows (we don't tell you which plot will provide the most graphic explanation for what is happening; this is something for you to decide). Name this file iso_plot.eps.

Part B

Now re-enable RED on router B, and re-run the script above and collect the TCP traces.

Answer the following questions:

  1. Compress the traces from each of C, D, and E and include them in your submission. These traces must be named C.tcp_iso_red.trace.gz, D.tcp_iso_red.trace.gz etc.
  2. Include three summaries of these traces (i.e run tcptrace -b on them). These files must be text files and must be named: C.tcp_iso_red.summary, D.tcp_iso_red.summary etc.
  3. Now use tcptrace to compute the average throughput given to a short flow. Similarly, compute the average throughput achieved by a long flow. What values do you get?
  4. Is each of these throughputs different from the corresponding throughput numbers obtained in Part B of the "Mice and Elephants" experiment? If they are explain what you think is happening, using one of the types of plots that tcptrace generates, for one of the flows (we don't tell you which plot will provide the most graphic explanation for what is happening; this is something for you to decide). Name this file iso_red_plot.eps.
After doing this, disable RED in the router.
 
Service Differentiation
In this part of the experiment, we will study how effective router mechanisms for providing service differentiation are. Service differentiation simply means some TCP connections get better service (e.g. more throughput) than others. To do this, routers drop packets of some flows less often than others. Read the Weighted RED documentation in your Cisco manual.

For this part, you will use the script that you used in the "Of Mice and Elephants" section.

The only change between this experiment and that one is that you will need to configure your network so that traffic from E to A gets higher priority. To do this, you will need to:

  • Configure the router B to do weighted RED with two queues.
  • Configure machine E to mark all packets to A with a certain value of the precedence field. We have given enough pointers for you to figure out how to do this.
Once you have done this, run your script and collect tcpdump traces from C, D and E as before.

Answer the following questions:

  1. List the commands you used to configure the router B and machine E.
  2. Compress the traces from each of C, D, and E and include them in your submission. These traces must be named C.tcp_diff.trace.gz, D.tcp_diff.trace.gz etc.
  3. Include three summaries of these traces (i.e run tcptrace -b on them). These files must be text files and must be named: C.tcp_diff.summary, D.tcp_diff.summary etc.
  4. Now use tcptrace to compute the average throughput given to a short flow through E (suppose we call this TS(E)). Similarly, compute the average throughput achieved by the long flow through E (TL(E)). Also compute TS(CD) (the average of short flows from C and D) and TL(CD). What are the values of these four variables?
  5. Are TS(E) and TS(CD) the same or different? How do they compare with the average throughput of a short flow obtained in the first experiment (section "Of Mice and Elephants", Part A)?
  6. Are TL(E) and TL(CD) the same or different? How do they compare with the average throughput of a long flow obtained in the first experiment (section "Of Mice and Elephants", Part A)?
  7. If you found that TCP was unfair to short flows in Section "Of Mice and Elephants" part A, does this experiment suggest a solution to that fairness problem? What solution does this experiment suggest? What are the challenges in designing this solution?
 

   [Please see copyright regarding copying.]