Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Direct Link Networks: Reliable Transmission Sections 2.5.

Similar presentations


Presentation on theme: "1 Direct Link Networks: Reliable Transmission Sections 2.5."— Presentation transcript:

1 1 Direct Link Networks: Reliable Transmission Sections 2.5

2 2 Outline Stop-and Wait (2.5.1) Sliding Window Algorithm (2.5.2) –(will not cover implementation pp. (109-115)

3 3 Recovering Lost Frames Protocol must recover from discarded (lost) frames A “lost” frame: a frame that was corrupted –corruption detected by receiver >> frame discarded Use acknowledgments and timeouts to implement reliable delivery (Automatic Repeat Request, ARQ).

4 4 Reliable Transmissions: Stop-and- Wait

5 5 Duplicate Frames sender sends a frame receiver acknowledges acknowledgment lost or delayed sender times out and retransmits frame receive think it is the next frame –duplicate copies frame delivered

6 6 Dealing with Duplicate Frames Header includes a 1-bit sequence number Sequence numbers used for frames alternate If sender retransmits frame 0 –receiver >> a second copy of frame 0 >> ignore it (still acknowledges it)

7 7 Stop-and-Wait with 1-bit Sequence Number

8 8 Stop-and-Wait Shortcoming Problem: keeping the pipe full Example –1.5Mbps link ; 45ms RTT; Delay x Bandwidth Product = 67.5Kb –Stop-and Wait max sending rate =BitsPerFrame/TimePerFrame –For 1KB frames, max sending rate = (1024 x 8) / 0.045 = 182 Kbps –link utilization =.182 Mbps/1.5 Mbps = 1/8 –Link capacity = 67.5Kb ~ 8KB 8 frames could be in the pipe instead of just 1 frame utilization = (1 frame)/(8 frames) = 1/8th link utilization Sender Receiver

9 9 Improve Stop-and-Wait For the previous example, optimally Allow sender to transmit 8 frames before waiting to receive any ACK Sender transmits the ninth frame at the same time the ACK for the first frame arrives

10 10 Sliding Window Allow multiple outstanding (un-ACKed) frames Upper bound on un-ACKed frames, called window

11 11 Sliding Window, SW: Sender Assign sequence number to each frame ( SeqNum ) Maintain three state variables: –sender window size ( SWS ) –last acknowledgment received ( LAR ) –last frame sent ( LFS ) –Maintain the relationship: LFS - LAR <= SWS –For example, for a window size, SWS, 7, you could have LFS = 30, LAR = 23 Buffer a number of frames up to a maximum of SWS frames After a frame times out, retransmit. Repeat until frame is acknowledged Advance LAR when ACK arrives < ■ ■ ■ ─ SWS LAR = 23LFS = 30 26 25 24 23 27 2829 303121 22 32 7

12 12 SW: Receiver Maintain three state variables –receiver window size ( RWS ) (upper bound on no. of out-of-order frames receiver accepts) –largest frame acceptable ( LFA ) –last frame received ( LFR ) –Maintain the relationship: LFA - LFR <= RWS Frame SeqNum arrives: –if LFR < SeqNum < = LFA ; accept –if SeqNum LFA discarded Send cumulative ACKs RWS LFR = 25LFA = 32 ■ ■ ■ < ─ 25 28 30 24 3334 7

13 13 Cumulative Acknowledgment SeqNumToAck = the largest sequence number of frames which are received but not yet acknowledged When all frames with sequence numbers <= SeqNumToAck have been received –Receiver acknowledges receipt of SeqNumToAck frame (even if higher-numbered frames have been received) Cumulative Acknowledgment Receiver then sets LFR = SeqNumToAck and adjusts LFA to LFR + RWS

14 14 Frame 27 arrives Frame 26 arrives SeqNumToAck = 28 Receiver acknowledges receipt of frame 28 which is a “Cumulative Acknowledgment” Receiver then sets LFR = 28 and adjusts LFA to LFR + RWS = 28 + 7 = 35 RWS LFR = 25LFA = 32 ■ ■ ■ < ─ 25 28 30 24 3334 27 26 7 RWS LFR = 25LFA = 32 ■ ■ ■ < ─ 25 28 30 24 3334 7 RWS LFR = 28LFA = 35 ■ ■ ■ < ─ 28 27 3637 30 7 Example

15 15 Choosing SWS & RWS Objective: keep the pipe full SWS >>> how many frames are outstanding on the link –SWS chosen based on delay x bandwidth Common RWS settings: 1 & SWS

16 16 Sequence Number Space SeqNum field is finite –Sequence #s: 0, 1, 2, …, MaxSeqNum, 0, 1, 2,... Sequence numbers wrap around Need to distinguish between different incarnations of sequence #s –number of outstanding frames < sequence number space (which is MaxSeqNum +1)

17 17 Sequence Number Space SWS = MaxSeqNum is not sufficient –suppose 3-bit field for SeqNum (8 possible values of SeqNum 0..7) –SWS=RWS=7 {(outstanding frames=7)<(sequence number space=8)} –sender transmit frames 0..6 –frames arrive successfully, but ACKs lost –sender retransmits 0..6 –receiver expecting new frames 7, 0, 1,...5, but receives old frames with #s 0..5 receiver cannot distinguish between reincarnations of same frames For RWS=SWS, correct rule is SWS <= (MaxSeqNum+1)/2 Intuitively, SeqNum “slides” between two halves of sequence number space

18 18 Concurrent Logical Channels Data Link Protocol used in the ARPANET –keeps the link full without sliding window protocol Node multiplexes 8 logical channels over a single link Run stop-and-wait on each logical channel Maintain three state bits per channel –channel busy –current sequence number out –next sequence number in When the node has a frame to send, it uses the lowest idle channel A different frame can be outstanding on each logical channel –sender keeps link full Header: 3-bit channel num, 1-bit sequence num –This is exactly the number of bits of the SeqNum field for sliding window protocol to support (8 -1= 7) outstanding frames when RWS=SWS


Download ppt "1 Direct Link Networks: Reliable Transmission Sections 2.5."

Similar presentations


Ads by Google