In this assignment, you will use a network simulator to implement and experiment with reliable communication protocols. The simulator will simulate a 'typical' internet link, with variable bandwidth and latency, packet reordering, and drops. These parameters are all configurable.
What you need to implement is a reliable sliding-window communication protocol. Your protocol should be able to correctly handle dropped and reordered packets, and extract a bandwidth as close as possible to the potential bandwidth on the link. The potential bandwidth is defined as:
For Selective Acks
For Go Back N
The default network parameters are:
Paramter | Default value | Allowable values | Flag |
MTU | 20 bytes | ? | |
Timeout | 1 ms | ? | timeout=<value> |
Bandwidth | 1.0 Mbit/sec | 1.0 - 100.0 Mbit/sec | bandwidth=<value> |
Bandwidth SD | 0.2 Mbit/sec | 1/5 bandwidth | -no-bandwidth-variation |
Bandwidth Walk | 0.5 | 0.0 - 1.0 | bandwidth-walk=<value> |
Latency | 2 ms | 1 - 100 ms | latency=<value> |
Latency SD | 0.5 ms | 1/4 latency | -no-latency-variation |
Latency Walk | 0.5 | 0.0 - 1.0 | latency-walk=<value> |
Drop Prob | 0.25 | 0.0 - 0.25 | drop-prob=<value> |
Turning off latency variation prevents reordering of packets. SD is standard deviation (the quantities are normally distributed). Walk is the tendency of the value's mean to walk with time. 1.0 is the maximum, 0.0 will keep the mean fixed thorugh time.
You are provided with an implementation of a simple stop-and-wait protocol. This is a particularly inefficient protocol (the choice of timeout is particularly poor), and gets somewhere on the order of 3% of the available bandwidth. Nevertheless, you will probably want to use it as a starting point for your sliding window protocol. The major reason for this is that this implementation gives you a bunch of pieces which are really useful for building send and receive algorithms.
The code that you are provided has been divided into the following packages:
The code that you would want to modify is SAWSender.java and SAWReceiver.java in order to implement the sliding window protocol. The code is available in two distributions: a zip file for Windows/Visual J++ and a tar file for Unix. The only differences are the CR/LF convention on the source files, and the workspace/makefile setup:
java project1 [seed=]
[bandwidth=] in Mbps
[bandwidth-walk=]
[no-bandwidth-variation]
[latency=] in ms
[latency-walk=]
[no-latency-variation]
[drop-prob=]
[timeout=] in us
[mtu=]
[debug=""]
so working inside
Visual J++ you will have to set the class to run as project1
and specifiy any arguments in the entry field until
Project/Settings/Debug. The flag arguments are described
above, the <seed> argument is an integer that will seed the
random number generator. If omitted then the seed will be drawn from
the current time. By specifying a seed, you can get consistent
behavior of the network, which will make bug-tracking much easier. I
strongly recommend that when tracking bugs you find a seed that causes
your bug and then fix it until you fix the problem. When you think
your program works, try a few runs without specifying the seed.
java turnin [directories other than application or reliability or project1 that you want to turnin](or jview turnin for Visual J++ systems). You will need to be on a machine which is connected to the internet. Be patient. The server is slow and single threaded.
The program also prompts you before going ahead with the turnin. At this point, make sure that you are turning in all the required files. What you get back from turnin is a short receipt listing files and sizes received, the turnin time and the number of slip days used for this assignment.
If you have any problems with turnin, be sure to mail Neil (nspring@cs.washington.edu), and/or post to the email list.