TWiki> CS450fall09 Web>Homeworks>Homework4 (revision 4)EditAttach

Homework 4 - due Mon Sept 28 at 2 pm

In this homework, we implement reliable communication over a highly unreliable link. The homework template is available at:

svn://bits.cs.uic.edu/cs450f09/homeworks/hw4

Your job is to change 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.

./hw4_receiver 10080 > RECEIVED_FILE
UR: Minimum delay for this run is 274 ms
# later on, this happens...
File received, exiting.

In a separate terminal, you run the sender:

cat ORIGINAL_FILE | ./hw4_sender 127.0.0.1 10080
UR: Minimum delay for this run is 634 ms
Sent 1020544 bytes in 25 seconds: 35 kB/s
Estimated RTT: 1029 ms

For this homework, you can only have a single outstanding packet at any time. If you send a second packet before the first one arrives at the destination, the first packet will get 'clobbered', so it is important that you get your timeouts and your acknowledgments right.

A few things to pay attention to:

  • unreliable.{h,c} - do not edit these files: your turned in homework will be graded with a different unreliable.c. You can only depend on what is declared in unreliable.h
  • hw4_sender.c, hw4_receiver.c - these are to be thought of as 'applications', using the 'library' you implement in hw4.c. You may change these files, but it is unlikely that you would want to put significant new code in these.
  • hw4.c - this is where the majority of your code should go. You will need to make major changes to rel_socket(), rel_send(), rel_receive() and rel_close().
  • ur_socket(), ur_send(), ur_sendto() and ur_recvfrom(). You must use these calls to create your sockets and to send your packets. No sendto(), recvfrom() or connect() calls anywhere except in unreliable.c
  • 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, 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 LOSE_ONE_OUT_OF and MIN_DELAY_IN_MSEC in unreliable.c
  • Note that unreliable.c will be overwritten with a new version upon grading, so changes to these files are just for your own testing.
  • 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 hw4_ receiver and hw4_sender.

Edit | Attach | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r4 - 2009-09-20 - 18:35:27 - Main.jakob
 
Copyright 2016 The Board of Trustees
of the University of Illinois.webmaster@cs.uic.edu
WISEST
Helping Women Faculty Advance
Funded by NSF