Due - Tuesday April 5, 2011
This project will give you experience implementing a reliable application-layer protocol over UDP. While your protocol will not be as complex as TCP and will not operate at the transport layer, this assignment will give you an appreciation for the difficulty associated with implementing the components of a reliable protocol.
In your implementation of Lab 4, your proxies used TCP to exchange the contents of a web object cached at one proxy but not at another. For this lab, you will modify your proxies so that they use a UDP connection to exchange web objects, and you will implement a reliable protocol to ensure that all contents of a web object arrive at the receiver and are processed by the application in the correct order.
It is up to you to design your protocol, but your grade will be based on the following elements:
You will execute, at minimum, the following steps:
Your demo must clearly demonstrate the following. It is recommended that you generously log events so that you may show how your program behaves. Your log messages need not look exactly like the examples, but they should look similar.
1. Connection setup - demonstrate that when p2 and p3 discover that p1 has a desired object, they send a message to initiate a connection, and p1 responds to the connection request.
Example:
on p2: [timestamp] Connection request sent to <p1 IP>.
on p1: [timestamp] Connection request received from <p2 IP>.
on p1: [timestamp] Connection request ACK sent to <p2 IP>.
on p2: [timestamp] Connection request ACK received from <p1 IP>.
on p2: [timestamp] Request for object <o1> sent to <p1 IP>.
on p1: [timestamp] Request for object <o1> received from <p2 IP>.
2. Sequence numbers - demonstrate that each packet has an associate sequence number.
Example:
on p1: [timestamp] Sending packet with SEQNO <number> to <p2 IP>.
on p2: [timestamp] Received packet with SEQNO <number> from <p1 IP>.
3. Acknowledgements - demonstrate that ACKs are sent for each packet. You may use cumulative ACKs or NACKs, so a single feedback packet may apply to more than one data packet.
Example:
on p1: [timestamp] Sending packet with SEQNO <number> to <p2 IP>.
on p2: [timestamp] Received packet with SEQNO <number> from <p1 IP>.
on p2: [timestamp] Sending ACK for packet <number> to <p1 IP>.
on p1: [timestamp] Received ACK for packet <number> from <p2 IP>.
4.Timeouts - demonstrate that timeouts occur when packets are lost.
Example:
on p2: [timestamp] Dropping ACK for packet <number>.
on p1: [timestamp] Timeout for packet <number>.
on p1: [timestamp] Resend packet <number>.
5. Packet reordering - demonstrate that your protocol correctly handles reordering of packets. Note, what you do when you receive an out-of-order packet depends on your algorithm. If you are implementing GBN, you will discard and you should log a message indicating this. Otherwise, you will buffer the packet. In either case, log whether you send a NACK or ACK for the lost packet. Your log messages will also demonstrate what happens when the delayed packet is eventually received.
Example:
on p1: [timestamp] Delay send of <number> to <p2 IP>.
on p1: [timestamp] Sending packet with SEQNO <number+1> to <p2 IP>.
on p2: [timestamp] Received out-of-order packet with SEQNO <number+1> from <p1 IP>.
6. Pipelining - demonstrate that multiple packets may be in-flight at any given time.
Example:
on p1: [timestamp] Sending packet with SEQNO <number> to <p2 IP>.
on p1: [timestamp] Sending packet with SEQNO <number+1> to <p2 IP>.
on p1: [timestamp] Sending packet with SEQNO <number+2> to <p2 IP>.
on p1: [timestamp] Received ACK for packet <number> from <p2 IP>.
on p1: [timestamp] Sending packet with SEQNO <number+3> to <p2 IP>.
on p1: [timestamp] Received ACK for packet <number+1> from <p2 IP>.
7. Multiple connections - demonstrate that p1 can maintain multiple simultaneous connections.
Example:
on p1: [timestamp] Sending packet with SEQNO <number> to <p2 IP>.
on p1: [timestamp] Sending packet with SEQNO <number+1> to <p2 IP>.
on p1: [timestamp] Sending packet with SEQNO <number> to <p3 IP>.
on p1: [timestamp] Received ACK for packet <number> from <p2 IP>.
on p1: [timestamp] Sending packet with SEQNO <number+2> to <p2 IP>.
on p1: [timestamp] Received ACK for packet <number> from <p3 IP>.
8. Connection teardown - demonstrate that the connection is closed when the transfer is complete.
Example:
on p1: [timestamp] Received ACK for packet <number> from <p2 IP>.
on p1: [timestamp] Transfer to <p2 IP> complete.
on p1: [timestamp] Connection teardown sent to <p2 IP>.
on p2: [timestamp] Connection teardown received from <p1 IP>.
on p2: [timestamp] Connection teardown ACK sent to <p1 IP>.
on p2: [timestamp] Connection to <p1 IP> closed.
on p1: [timestamp] Connection teardown ACK received from <p2 IP>.
on p1: [timestamp] Connection to <p2 IP> closed.