CS 145A Lab 4 (due: Dec 6th 23:59:59)

Reliable Communication

Tasks for Lab 4: Implement a reliable communication protocol over UDP:



Command Format: "sender <port1> <IP> <port2> <Filename>"

Sender should be able to read the file (specified by <Filename>) from local disk, cut it into packets, and send it to the receiver (specified by <IP> <port2>).

Sender can use <port1> to listen to the feedback from the receiver. Also, the sender should be able to retransmit the loss packet if necessary.


Command Format: "receiver <port1> <IP> <port2> <Filename>"

The receiver should listen to <port1> for data, write the data to <Filename> and send feedback to <IP> <port2> (sender) if necessary.

Possible Problems:


Please submit your code and your documentation (sender.txt and receiver.txt). In the documentation, please write down your design of the program, describe your test suits briefly. Also, please write comments in your codes to help TA to understand your code.


The TA will write two "relayer"s which may drop packets in the middle. The "sender" under test will send data to the relayer and the relayer relays the packets to the "receiver" under test. The same happens in the feedback channel. So, the data packet or feedback packet may dropped in the middle. The implementations that can successfully transmit a >10KB file will get full score. The fastest implementations may get bonus.


TA Hours:

Tue / Thu (20:00 ¨C 22:00) JRG 170
Except: Nov.19 / Nov.21