150 likes | 357 Views
Reliable Transmission Neil Tang 9/29/2008. Outline. Basic Idea Stop-and-Wait Sliding Window Concurrent Logic Channels. Basic Idea. Acknowledgement: The receiver sends a small control frame back to the sender indicating it has received an earlier frame.
E N D
Reliable TransmissionNeil Tang9/29/2008 CS440 Computer Networks
Outline • Basic Idea • Stop-and-Wait • Sliding Window • Concurrent Logic Channels CS440 Computer Networks
Basic Idea • Acknowledgement: The receiver sends a small control frame back to the sender indicating it has received an earlier frame. • Timeout: If the sender does not receive an acknowledgement after a reasonable amount time, then it re-transmits the original frame. • Automatic Repeat Request (ARQ): is the general strategy of using acknowledgements and timeouts to implement the reliable transmission. CS440 Computer Networks
Stop-and-Wait Basic Idea After transmitting one frame, the sender waits for an ACK before transmitting the next frame. If the ACK does not arrive after a certain period of time, the sender times out and re-transmits the original frame. CS440 Computer Networks
Stop-and-Wait Four Cases: CS440 Computer Networks
Sender Receiver Frame 0 ACK 0 Frame 1 ACK 1 Frame 0 ACK 0 Stop-and-Wait Sequence Number: CS440 Computer Networks
Stop-and-Wait Weakness Inefficient in Bandwidth Usage: only one outstanding frame on the link at one time. For example, a link: capacity = 1.5Mbps RTT = 45 ms, frame size = 1KB. Bandwidth in use = (10008)/0.045=178Kbps=1/8 capacity CS440 Computer Networks
Sliding Window Basic Idea Fill the “pipe”. Specifically, if the link has a delay bandwidth product of 8KB and frame size is 1KB, the sender should transmit the 9th frame when the ACK for the first frame arrives. CS440 Computer Networks
< SWS ─ ■ ■ ■ ■ ■ ■ LAR LFS Sliding Window The Sender The sender will retransmit every frame if timeout. SWS: upper bound on the number of outstanding (unacknowledged) frames. LAR: the sequence number of the last ACK received. LFS: the sequence number of the last frame sent. LFS = SWS+ LAR CS440 Computer Networks
< ─ RWS ■ ■ ■ ■ ■ ■ LFR LAF Sliding Window The Receiver Frames with sequence numbers in the window will be buffered, otherwise, discarded. The receiver acks all the frames or the highest-numbered frame received in order. RWS: upper bound on the number of out-of-order frames that the receiver is willing to accept. LFR: the sequence number of the last frame received and acked. LAF: the sequence number of the largest acceptable frame. LAF=LFR+RWS CS440 Computer Networks
Sliding Window Methods to Detect Frame Loss Negative Acknowledgement (NAK): when receiving frame (i+1) but not frame i. Additional Acknowledgement: send an additional ACK for frame LFR to indicate a frame loss. CS440 Computer Networks
Sliding Window Window Size SWS = (bandwidth*delay)/packet size RWS=1: no buffer RWS=SWS: buffer anyframe sent but out of order CS440 Computer Networks
Sliding Window The Number of Sequence Numbers (SeqNum_Space) If RWS = 1, SeqNum_Space SWS + 1 If RWS = SWS, SeqNum_Space 2SWS Check out the demo: http://www2.rad.com/networks/2004/sliding_window/ CS440 Computer Networks
Concurrent Logic Channels Basic Idea: Multiplex several logical channels on a single link and run stop-and-wait algorithm on each channel. CS440 Computer Networks