CS/EE 145A Reliable Transmission over Unreliable Channel - PowerPoint PPT Presentation

1 / 37
About This Presentation
Title:

CS/EE 145A Reliable Transmission over Unreliable Channel

Description:

What happens if the udp client cannot receive my message? Shall I receive and print the message on the client side? I did some extra work... – PowerPoint PPT presentation

Number of Views:28
Avg rating:3.0/5.0
Slides: 38
Provided by: xiaol59
Category:

less

Transcript and Presenter's Notes

Title: CS/EE 145A Reliable Transmission over Unreliable Channel


1
CS/EE 145AReliable Transmission over Unreliable
Channel
  • Netlab.caltech.edu/course

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

3
Lab 1
  • Clients

4
Lab 1
  • Server (Basic Functions)

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

6
Lab 1
  • 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)
  • 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)
Stream
Stream
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
13
Reliable Transmission over Unreliable Channel (I)
Stream
Stream
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
P1, P2,
???
14
Reliable Transmission over Unreliable Channel
Goals
  • 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 dont want to waste time.
  • We dont want to waste bandwidth.

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

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

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

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

19
Split a file
Sender
Whats inside a packet?
File
File
Receiver
20
Inside a packet
  • Data
  • Header
  • Help to reassembly
  • Help to detect errors

21
(No Transcript)
22
One Example TCP Header
Packet Identification
Detect Packet Corruption
  • Source http//linux-ip.net/gl/tcng/node39.html

23
Sequence Number (Packet ID)
Sender
File
1
2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
File
Receiver
24
In case of packet loss
Sender
Why?
File
1
2
3
4
5
6
7
8
1
2
4
5
6
7
8
Please Retransmit packet 3
Receiver
25
In case of packets reordering
Sender
Why?
File
1
2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
Receiver
26
Packet duplication
Sender
Why?
File
1
2
3
4
5
6
7
8
8
1
3
4
2
5
6
7
2
1
2
3
4
6
7
8
5
Receiver
27
Sequence Number (Packet ID)
  • 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.

28
CS/EE 145A Lab 2Packet
  • 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
  • Implement conversion from a file to packets, at
    sender side.
  • Implement error detection and file reassembly, at
    receiver side.

30
Sequence Number (Packet ID)
Sender
File
1
2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
File
Receiver
31
Sender
  • sender ltfilenamegt ltPacketSizegt
  • Read the file specified by ltfilenamegt (The file
    contains English characters and numbers only)
  • Convert this file into packets, each packet has
    at most ltPacketSizegt bytes, including header.
  • Save each packet to one file, with a file name as
    P0000001.txt, P0000002.txt,

32
Receiver
  • receiver ltnumber of packetsgt ltPacketSizegt
    ltfilenamegt
  • Read the files for packets ( P0000001.txt,
    P0000002.txt)
  • WARNING The filenames are always from 1 to
    ltnumber of packetsgt. 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
    ltfilenamegt. Use one character to indicate
    each lost packet.

33
Example
  • File abcdefg
  • Packet Size10 bytes
  • Header size 7 bytes
  • Payload 3 bytes
  • Sender Output 3 files
  • P0000001.txt ltheadergt abc
  • P0000002.txt ltheadergt def
  • P0000003.txt ltheadergt g

34
Example
  • After reordering (by a program written by TA)
  • P0000001.txt ltheadergt abc
  • P0000002.txt ltheadergt g
  • P0000003.txt ltheadergt def
  • Receiver
  • Output a file abcdefg

35
Example
  • After packet loss (by a program written by TA)
  • P0000001.txt ltheadergt g
  • P0000002.txt ltheadergt def
  • Receiver
  • Output a file defg

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

37
Submission (due Nov 7th 235959)
  • Task sender.c receiver.c readme.txt
  • Mailto weixl_at_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)
  • Documentation and comments (20)
  • Program style (10)

TA Hours
  • Tue 2000 2200 JRG 170
  • Thu 2000 2200 JRG 170
Write a Comment
User Comments (0)
About PowerShow.com