CS625, Fall 2003, Assignment-1

Instructions


Brief Overview and Background

In this assignment you will be studying the performance behaviour of TCP, first on wired links, and then on lossy/wireless links. You will use the ns-2 Network Simulator. It has been installed in the cs625 account. To use ns, set your shell PATH variable to include "/3u3/course/cs625/ns-allinone-2.26/bin".

You can look at an NS tutorial on the web, such as this one here. You can download some example script, view some animations and have fun to begin with. I suggest you go through the explanation of the example script since it will help you in the exercise below.

The NS documentation is available at "/3u3/course/cs625/ns_doc.pdf". I will be referring to this copy of the documentation in guiding you through the various steps below. You can also go through the introduction chapter of this documentation.


Part 1 (warm up)

For your exercises, you will be creating the following simple topology, where you have a source node, a destination node, and an intermediate router (marked "S", "D", and "R" respectively).

The part between node "S" and node "R" is marked as link-1, and the part between node "R" and node "D" is marked as link-2. Link-1 is supposed to be the wired part of the network, with high bandwidth, and (almost) no errors. Link-2 is supposed to be the wireless hop of the network, with lower bandwidth, and high error probability (although you will introduce wireless errors only in a later part of the assignment).

Here are the steps in this part:

  1. In this part, you are supposed to create in ns-2, the above topology, with the following parameters:
  2. In addition, create a TCP connection with an FTP flow running on top of it, with the TCP source at node "S", and the TCP destination at node "D".
  3. Make sure that the TCP source you create is the Reno variant. This you will do for example by having the line "set tcp [new Agent/TCP/Reno]" when you create the TCP source object in your TCL code.
  4. Have the simulation run from time 0 to 51 seconds, and the FTP run from 0.5 to 50.5 seconds (for a duration of 50 seconds).
  5. Have the ns-2 code generate a trace-file under the name "out.tr". You will use the command "$ns trace-all $f" for this.
  6. Also animate the above using NAM (it should be easy to do this, if you had gone through the example in the ns-2 tutorial). You will use the command "$ns namtrace-all $nf" for this. Create the nam output under the name "out.nam".
  7. You can refer to the ns_doc.pdf file, the introduction chapter, for information on trace-all and namtrace-all commands.
  8. Answer the following question in your main file (answers.txt). Look at the last few lines of out.tr you generated. Look for a line containing the word "ack". The last-but-one column gives the sequence number. As you can see from any of the lines containing the word "tcp", the packet size is "1040 bytes". The last (ack) sequence number should give you the number of packets successfully received in the 50 seconds of simulation (do not care about plus-minus-1 here). From the packet size information, what in the number of bytes transmitted in 50 seconds? What is the throughput achieved? How does this compare with the bottleneck bandwidth in your topology? (Beware of the 1024 vs. 1000 notation difference while checking your numbers here).

Here's what to submit for this part (in sub-dir "part-1"):


Part 2 (TCP slow-start and congestion avoidance)

From here on, you will just have to make minor modifications to the ns-2 TCL code you have written above. First, you are going to make the following modifications:

What to submit for this part (in sub-dir part-2):

  1. The ns-2 TCL code
  2. The three plots that you generated above (any UNIX-viewable format is fine, png is preferred).

Part 3 (TCP and wireless losses)

In this part, you will be studying the behaviour of TCP under wireless losses. See section 13.4 of ns_doc.pdf for this. In fact, you will use the last few lines of page 127, and the "link-lossmodel" command in the subsequent page.

What to submit for this part (in sub-dir part-3):

  1. Submit the plot that you generated above (any UNIX readable format acceptable, png is preferred).

Checklist before submission

In answers.txt, you should have answers for one question in part-1, and four questions in part-2.

The tree of files/directories should be:

assignment1-xyzabc/
	answers.txt
	part-1/
		code.tcl
		screenshot.jpg
	part-2/
		code.tcl
		cwnd.png
		maxseq.png
		rtt.png
	part-3/
		throughput-plot.png

Bhaskaran Raman
Last modified: Wed Sep 10 16:21:38 IST 2003