TWiki
>
CS450fall09 Web
>
Homeworks
>
Homework4
(revision 4) (raw view)
Edit
Attach
---+ 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: <verbatim> svn://bits.cs.uic.edu/cs450f09/homeworks/hw4 </verbatim> 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. <verbatim> ./hw4_receiver 10080 > RECEIVED_FILE UR: Minimum delay for this run is 274 ms # later on, this happens... File received, exiting. </verbatim> In a separate terminal, you run the sender: <verbatim> 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 </verbatim> 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
|
P
rint version
|
H
istory
:
r5
<
r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r4 - 2009-09-20 - 18:35:27 - Main.jakob
CS450fall09
Syllabus
Lecture Notes
-
References
Homeworks
-
Subversion
-
VMWare
-
schedule
-
hints
list archives
FAQ
ERF2054 map
[edit this
]
Log In
CS450fall09 Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
ABOUT US
Our Department
Recent News
Contact Us
ACADEMICS
Prospective Students
Undergraduate
CS Minor
Graduate
Courses
RESEARCH
Overview
By Faculty
Labs
PEOPLE
Faculty
Adjuncts
Staff
Students
Alumni
Copyright 2016 The Board of Trustees
of the University of Illinois.
webmaster@cs.uic.edu
WISEST
Helping Women Faculty Advance
Funded by NSF