Homework 6

This homework is continuation of hw6 with addition of pipelining. The homework template is available at:

svn://cs450.cs.uic.edu/pub/homeworks/hw6

To simulate an unreliable link in a single computer, sender and receiver communicate through a third "proxy" process. This proxy listens on two ports to get data from sender and receiver. And forwards the received data at those two listening ports after some delay and with some forwarding probability to another two ports at which the receiver and sender are listening. However, to make things easier, you can only supply a base port to all programs and it will configure all the ports automatically using the base port. To start the proxy, run

./proxy -p <base port> -l <latency> -f <forwarding probability> -b <buffer size>

At a high level, your job is to change the reliable transport protocol implementation in the template so that the following example execution always produces the correct result. In one terminal, you run the receiver in the following way, and it produces output as shown below.

./hw6_receiver 127.0.0.1 <base port> > RECEIVED_FILE
# later on, this happens...
File received, exiting.

In a separate terminal, you run the sender:

cat ORIGINAL_FILE | ./hw6_sender 127.0.0.1 <base port>
Sent 1020544 bytes in 25 seconds: 35 kB/s
Estimated RTT: 1029 ms

A few things to pay attention to:

  • hw6_sender.c, hw6_receiver.c - these are to be thought of as 'applications', using the 'library' you implement in hw5.c. You may change these files, but we will use the original files when grading.
  • hw6.c - this is where your code should go. You will need to make major changes to rel_socket(), rel_connect(), rel_send(), rel_receive() and rel_close().
  • The file transferred: your program should work for any file, and reproduce it exactly. You can check this with the md5sum utility, or diff.
  • The RTT: you are to dynamically estimate the RTT using the EWMA technique, and use this to set your timeout period. With correctly tuned timeouts, lower RTT will result in higher throughput.
  • Keep your packets smaller than or equal to MAX_PACKET (1400 bytes).

Finally:

  • Pay attention to the end of the connection. Ensure that both sides of the connection finish without user assistance, even if packet losses occur, while guaranteeing that the entire file is transferred. Look at the FIN/FINACK/ACK sequence in TCP for ideas.

HINTS

  • For trying out your code, you can tune the packet loss ratios and round-trip latencies by changing the parameters to the proxy process.
  • Note that we'll use our own proxy process when grading, changing proxy.c is only going to hurt your chances.
  • In rel_close(), you may want to just wait for some time, to make sure the last ack didn't get lost (leaving one end hanging).

Turn-in instructions

Same story as previous homeworks, except that your makefile should generate two binaries called hw6_ receiver and hw6_sender.

Topic revision: r1 - 2011-10-03 - 19:57:16 - Main.amusa2
 
Copyright 2016 The Board of Trustees
of the University of Illinois.webmaster@cs.uic.edu
WISEST
Helping Women Faculty Advance
Funded by NSF