Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS/EE 145A Reliable Transmission over Unreliable Channel Netlab.caltech.edu/course.

Similar presentations


Presentation on theme: "CS/EE 145A Reliable Transmission over Unreliable Channel Netlab.caltech.edu/course."— Presentation transcript:

1 CS/EE 145A Reliable Transmission over Unreliable Channel Netlab.caltech.edu/course

2 Lab 1 Q&A: What happens if the udp client cannot receive my message? What happens if the udp client cannot receive my message? Shall I receive and print the message on the client side? Shall I receive and print the message on the client side? I did some extra work … I did some extra work … How do you grade my work? How do you grade my work?

3 Lab 1 Clients: Clients:

4 Lab 1 Server (Basic Functions): Server (Basic Functions):

5 Lab 1 Server (Advanced Function 1, Multi-connection): Server (Advanced Function 1, Multi-connection):

6 Lab 1 Server (Advanced Function 2, 3-connections): Server (Advanced Function 2, 3-connections):

7 Lab 1: Multiplexing Multiple Processes:  One process for each active TCP connection, one UDP process and one Listening process  How to tell the main process when the child processes finish the TCP connection?  SIGCHILD (with a handler in the main function)

8 Lab 1: Multiplexing Multiple Threads:  Similar to Multiple Processes  pthread_create

9 Lab 1: Multiplexing Single Process:  Check status of all ports with a single “ select ” function  Timeout of the “ select ” ?

10 Topics of this thread How does TCP/IP work? (roughly) How does TCP/IP work? (roughly) Design and implementation of protocols Design and implementation of protocols Application (HTTP, FTP, SSH, SMTP … ) Transportation (TCP) Networking (IP) MAC Physical Lab 1 Lab 2, 3, 4

11 Reliable Transmission over Unreliable Channel (I) TCP: Reliable Transmission Guarantee: The packets sent will be received with the same order. IP: Unreliable Transmission Best Efforts: Packets can be dropped, can be reordered, can be duplicated, can be …

12 Reliable Transmission over Unreliable Channel (I) TCP: Reliable Transmission Guarantee: The packets sent will be received with the same order. IP: Unreliable Transmission Best Efforts: Packets can be dropped, can be reordered, can be duplicated, can be … Stream

13 Reliable Transmission over Unreliable Channel (I) TCP: Reliable Transmission Guarantee: The packets sent will be received with the same order. IP: Unreliable Transmission Best Efforts: Packets can be dropped, can be reordered, can be duplicated, can be … Stream P1, P2, … ???

14 Reliable Transmission over Unreliable Channel: Goals We want the file to be transmitted without any error. We want the file to be transmitted without any error. We cannot make any assumption on the channel (The packet may be dropped, re-ordered, duplicated … in the middle). We cannot make any assumption on the 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.

15 Reliable Transmission over Unreliable Channel: Difficulties How to split a file into packets? How to split a file into packets? How to detect errors (packet corruption, packet loss, duplication, reordering … )? How to detect errors (packet corruption, packet loss, duplication, reordering … )? How to recover from packets reordering? How to recover from packets reordering? How to recover from loss? How to recover from loss? How to use the bandwidth efficiently? How to use the bandwidth efficiently? How to share the bandwidth fairly? How to share the bandwidth fairly? …

16 Lab 2 How to split a file into packets? How to split a file into packets? How to detect errors (packet corruption, packet loss, duplication, reordering … )? How to detect errors (packet corruption, packet loss, duplication, reordering … )? How to recover from packets reordering? How to recover from packets reordering? How to recover from loss? How to recover from loss? How to use the bandwidth efficiently? How to use the bandwidth efficiently? How to share the bandwidth fairly? How to share the bandwidth fairly? …

17 Lab 3 How to split a file into packets? How to split a file into packets? How to detect errors (packet corruption, packet loss, duplication, reordering … )? How to detect errors (packet corruption, packet loss, duplication, reordering … )? How to recover from packets reordering? How to recover from packets reordering? How to recover from loss? How to recover from loss? How to use the bandwidth efficiently? How to use the bandwidth efficiently? How to share the bandwidth fairly? How to share the bandwidth fairly? …

18 Lab 4 How to split a file into packets? How to split a file into packets? How to detect errors (packet corruption, packet loss, duplication, reordering … )? How to detect errors (packet corruption, packet loss, duplication, reordering … )? How to recover from packets reordering? How to recover from packets reordering? How to recover from loss? How to recover from loss? How to use the bandwidth efficiently? How to use the bandwidth efficiently? How to share the bandwidth fairly? How to share the bandwidth fairly? …

19 Split a file File Sender Receiver What ’ s inside a packet?

20 Inside a packet Data Data Header Header  Help to reassembly  Help to detect errors

21

22 One Example: TCP Header Source: http://linux-ip.net/gl/tcng/node39.html Detect Packet Corruption Packet Identification

23 Sequence Number (Packet ID) 12345678 File 12345678 Sender Receiver

24 In case of packet loss … 12345678 File 1245678 Sender Receiver Why? Please Retransmit: packet 3

25 In case of packets reordering … 12345678 File 12345678 Sender Receiver Why? 12345678

26 8 Packet duplication 12345678 File 1342567 Sender Receiver 2 Why? 12346785

27 Sequence Number (Packet ID) With the packet ID, the receiver side can recover from packet reordering and packet duplication. With the packet ID, the receiver side can recover from packet reordering and packet duplication. The receiver can detect packet loss. But it has to call sender for retransmission. The receiver can detect packet loss. But it has to call sender for retransmission.

28 CS/EE 145A Lab 2 Packet Netlab.caltech.edu/course

29 Tasks for Lab 2 ( Not a network programming! ) Assume there is no “ packet corruption ” : Design a packet format that can be used to transmit data reliably, over unreliable channels Design a packet format that can be used to transmit data reliably, over unreliable channels Implement conversion from a file to packets, at sender side. Implement conversion from a file to packets, at sender side. Implement error detection and file reassembly, at receiver side. Implement error detection and file reassembly, at receiver side.

30 Sequence Number (Packet ID) 12345678 File 12345678 Sender Receiver

31 Sender sender sender Read the file specified by (The file contains English characters and numbers only) Read the file specified by (The file contains English characters and numbers only) Convert this file into packets, each packet has at most bytes, including header. Convert this file into packets, each packet has at most bytes, including header. Save each packet to one file, with a file name as “ P0000001.txt ”, “ P0000002.txt ”, … Save each packet to one file, with a file name as “ P0000001.txt ”, “ P0000002.txt ”, …

32 Receiver receiver receiver Read the files for packets ( “ P0000001.txt ”, “ P0000002.txt ” ) Read the files for packets ( “ P0000001.txt ”, “ P0000002.txt ” ) WARNING: The filenames are always from 1 to. But packets may not have the same filenames assigned by the sender, due to “ packet loss ”, “ packet reordering ” or “ packet duplication ”. WARNING: The filenames are always from 1 to. But packets may not have the same filenames assigned by the sender, due to “ packet loss ”, “ packet reordering ” or “ packet duplication ”. Convert the packets into a file, specified by. Use one character “ # ” to indicate each lost packet. Convert the packets into a file, specified by. Use one character “ # ” to indicate each lost packet.

33 Example File: “ abcdefg ” Packet Size=10 bytes Header size = 7 bytes Payload = 3 bytes Sender: Output 3 files: P0000001.txt: + “ abc ” P0000002.txt: + “ def ” P0000003.txt: + “ g ”

34 Example After “ reordering ” (by a program written by TA): P0000001.txt: + “ abc ” P0000002.txt: + “ g ” P0000003.txt: + “ def ” Receiver: Output a file: “ abcdefg ”

35 Example After “ packet loss ” (by a program written by TA): P0000001.txt: + “ g ” P0000002.txt: + “ def ” Receiver: Output a file: “ #defg ”

36 Tips For the unknown commands, use “ man ” / “ info ”. For the unknown commands, use “ man ” / “ info ”. Be careful of the data structures Be careful of the data structures Testing: design some small examples to test your program Testing: design some small examples to test your program Start Earlier! Start Earlier!

37 Submission (due Nov 7 th 23:59:59) Task: sender.c; receiver.c; readme.txt Mailto: weixl@cs.caltech.edu Documents:  How to use the programs: compile, run …  Design, testing cases, the problems you met  Any other comments

38 Grading Correctness (70%) Correctness (70%) Documentation and comments (20%) Documentation and comments (20%) Program style (10%) Program style (10%) TA Hours Tue: 20:00 ~22:00 JRG 170 Tue: 20:00 ~22:00 JRG 170 Thu: 20:00 ~22:00 JRG 170 Thu: 20:00 ~22:00 JRG 170


Download ppt "CS/EE 145A Reliable Transmission over Unreliable Channel Netlab.caltech.edu/course."

Similar presentations


Ads by Google