Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 145A Reliable Communication Netlab.caltech.edu/course.

Similar presentations


Presentation on theme: "CS 145A Reliable Communication Netlab.caltech.edu/course."— Presentation transcript:

1 CS 145A Reliable Communication Netlab.caltech.edu/course

2 Today Reliable Communication Reliable Communication TCP Flow Control TCP Flow Control Lab 4 Lab 4

3 Transmit a file We want the file to be transmitted without any error. We want the file to be transmitted without any error. We only have a un-reliable channel. (The packet may be dropped, re-ordered, duplicated … in the middle). We only have a un-reliable channel. (The packet may be dropped, re-ordered, duplicated … in the middle). We don’t want to waste time. We don’t want to waste time. We don’t want to waste bandwidth. We don’t want to waste bandwidth.

4 Make sure everything is correct Packet: Checksum Checksum “ Length ” in the packet “ Length ” in the packet … Upper Layer: Acknowledge (ACK) Acknowledge (ACK) Negative Acknowledge (NACK) Negative Acknowledge (NACK) Coding Coding …

5 ACK RTT time Source Destination 12W 1 12W data ACKs 12 12W

6 ACK (Loss Detection) Time Out! RTT time Source Destination 12W 12W data ACKs 1 12W

7 ACK (False Loss) Time Out! RTT time Source Destination 12W 1 12W data ACKs 1 12W

8 NACK (Loss Detection) time Source Destination 12W data NACK:3 124 343 3412

9 NACK (NACK Loss) time Source Destination 12 data NACK:3 124 34 3412 W5 5 3 5

10 TCP Flow Control ACK + Window Sequence Number Sequence Number Aggregative ACK Aggregative ACK Self-clocking Self-clocking Receiver Feedback Receiver Feedback Flow control by window Flow control by window …

11 TCP Flow Control ~ W packets per RTT ~ W packets per RTT Lost packet detected by missing/duplicate ACK Lost packet detected by missing/duplicate ACK RTT time Source Destination 12W12W12W data ACKs 12W

12 Lab 4

13 Lab 4 - Task Implement a reliable communication protocol over UDP: Implement a reliable communication protocol over UDP: Define your packet format Define your packet format Implement packet retransmission Implement packet retransmission Improve efficiency Improve efficiency

14 Lab 4 - Requirements  The implementation is based on UDP.  The implementation is able to send a file from one machine to the other.  The network in the middle is not reliable: The network may drop or duplicated some packet in the middle  Assumption: A single packet will not be contaminated. (Don ’ t worry about the error inside one packet)

15 Lab 4 - Details Two programs: “ sender ” and “ receiver ” Two programs: “ sender ” and “ receiver ” Sender should be able to read a file from the local disk, cut it into packets, and send it to the receiver. Sender should be able to read a file from the local disk, cut it into packets, and send it to the receiver. Sender can use a port to listen to the feedback from the receiver. Sender can use a port to listen to the feedback from the receiver. Receiver should be able to listen to a port, get the packets from the sender, and send feedback to the receiver, if necessary. Receiver should be able to listen to a port, get the packets from the sender, and send feedback to the receiver, if necessary. Assumption: Assumption: There is only one sender and one receiver. (All the packets to the sender is from the receiver, and vice versa.) There is only one sender and one receiver. (All the packets to the sender is from the receiver, and vice versa.) is a text file in the local disk is a text file in the local disk

16 Lab 4 – Details: Sender Format: “ sender ” Format: “ sender ” Port1: the port you are listening to the receiver ’ s feedback Port1: the port you are listening to the receiver ’ s feedback IP: the receiver ’ s IP IP: the receiver ’ s IP Port2: the receiver ’ s port Port2: the receiver ’ s port Filename: The file to be sent Filename: The file to be sent The sender should read from, send the content of the file to, and listen to port1 for feedback from the receiver. The sender should read from, send the content of the file to, and listen to port1 for feedback from the receiver.

17 Lab 4 – Details: Receiver Format: “ receiver ” Format: “ receiver ” Port1: the port you are listening to the sender ’ s data Port1: the port you are listening to the sender ’ s data IP: the sender ’ s IP IP: the sender ’ s IP Port2: the sender ’ s listening port Port2: the sender ’ s listening port Filename: The file to be saved Filename: The file to be saved The receiver should listen to for data, write the data to and send feedback to (sender) if necessary. The receiver should listen to for data, write the data to and send feedback to (sender) if necessary.

18 Lab 4 - Possible Problems How to design the packet format? How to design the packet format? What kind of feedback? (ACK/NACK?) What kind of feedback? (ACK/NACK?) How to detect loss? (Timeout? Duplicate ACK … ) How to detect loss? (Timeout? Duplicate ACK … ) How to maintain the window (If you use window scheme)? How to maintain the window (If you use window scheme)?

19 Lab 4 - Tips Re-Use the codes in Lab 1 Re-Use the codes in Lab 1 Packet format? Packet format? Packet type? (initial packet, ack packet, terminating packet … ) Packet type? (initial packet, ack packet, terminating packet … ) Packet length? Packet length? Packet sequence number? Packet sequence number? Data area … Data area … Window maintenance Window maintenance How to Test? How to Test?

20 Lab 4 Due: Dec 6 st (Friday) 23:59:59 Due: Dec 6 st (Friday) 23:59:59 Email: weixl@caltech.edu Email: weixl@caltech.eduweixl@caltech.edu Grading Grading TA hours: TA hours: Tue / Thu (20:00 – 22:00) JRG 170 Except: Nov.19 / Nov.21


Download ppt "CS 145A Reliable Communication Netlab.caltech.edu/course."

Similar presentations


Ads by Google