svn://cs450.cs.uic.edu/pub/homeworks/hw5
$ sudo mn --link tc,delay='10ms',loss=5,max_queue_size=2 -xThis will drop you into a mininet shell. To pull up a terminal on each of your new virtual network hosts, run this in the mininet shell:
mininet> xterm h1 h2Note that you need to have an X Server running and X forwarding enabled for this to work. For windows users, here is a walkthrough for Xming + putty on windows: http://www.math.umn.edu/systems_guide/putty_xwin32.html For Mac users, you need to install XQuartz. If you want to ssh to this virtual machine, add -X parameter, like "ssh -X <username>@<mininet IP>". This creates a minimal network topology with two hosts connected to a switch with 10ms latency on each link, 5% packet loss on each link, and a buffer of size 2. Note that there is no space between parameters. All the operations you perform within these windows are just like if you were using the main linux VM. They work independently like different machines but share the same files on the machine. Usually h1 has IP address 10.0.0.1 and h2 has 10.0.0.2. Try to ping each other. And here are some commands may be useful if you don't use GUI. For more tips, see http://mininet.github.com/walkthrough/.
help % display commands exit % quit pingall % all the machine ping each other to test connectivity xterm h1 % display h1 termial window
./hw5_receiver <base port> > RECEIVED_FILE # later on, this happens... File received, exiting.In a separate terminal of h1, you run the sender:
cat ORIGINAL_FILE | ./hw5_sender 10.0.0.2 <base port> Sent 1020544 bytes in 25 seconds: 35 kB/s Estimated RTT: 1029 msThe link has a total buffer size of two packets (including packets in both directions). This is specified using the parameter max_queue_size=2. This leaves enough room for a single ack and a single packet in flight at the same time. So you only need to implement a simple TCP with ACK works, no pipelining. If you send a second packet before the first one arrives at the destination, chances are that either an ack or the second packet will be lost, so it is important that you get your timeouts and your acknowledgments right. A few things to pay attention to:
./hw5_score username base_port score_file
The grading script will checkout you code from svn, copy a image file supplied in the grading script directory to your directory and run 6 testcases with different latency and forwarding probability. For each test case, there is a minimum throughput requirement and a timeout for your program to exit. The timeout is set as 50% more than the corresponding required throughput. If your program exits normally before the timeout but the content of the received file is invalid then there is 0 point. However, if the program exits normally before the timeout and the received file's content is valid but the throughput obtained is lower than the required minimum throughput then you will get 0.5 point. Finally, if your program doesn't exit before the timeout then it will be killed after timeout and hence the content of the file will be incorrect and you will get 0 point. Sample output from the grading script is following:
[SUCCESS] latency=1000ms packet loss=0% [1]: 1 [throughput (kB/s)=0.26] [SUCCESS] latency=100ms packet loss=0% [1]: 1 [throughput (kB/s)=3.11] [SUCCESS] latency=10ms packet loss=0% [1]: 1 [throughput (kB/s)=28.78] [SUCCESS] latency=100ms packet loss=5% [1]: 1 [throughput (kB/s)=1.36] [SUCCESS] latency=10ms packet loss=5% [1]: 1 [throughput (kB/s)=16.22] [SUCCESS] latency=10ms packet loss=10% [1]: 1 [throughput (kB/s)=4.86] Total score: 6
Copyright 2016 The Board of Trustees of the University of Illinois.webmaster@cs.uic.edu |
WISEST Helping Women Faculty Advance Funded by NSF | ![]() | ![]() |