1 / 45

Topic 2 Data Link Layer Part B

Topic 2 Data Link Layer Part B.

eilis
Download Presentation

Topic 2 Data Link Layer Part B

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Topic 2Data Link LayerPart B The majority of the slides in this course are adapted from the accompanying slides to the books by Larry Peterson and Bruce Davie and by Jim Kurose and Keith Ross. Additional slides and/or figures from other sources and from Vasos Vassiliou are also included in this presentation. DataLink Layer

  2. Link Control Mechanisms 3 techniques at link level: • Stop-and-wait • Go-back-N • Selective-reject Latter 2 are special cases of sliding-window Assume 2 end systems connected by direct link DataLink Layer

  3. Flow Control • Ensuring the sending entity does not overwhelm the receiving entity • Limits the amount or rate of data that is sent • Preventing buffer overflow • Source may send PDUs faster than destination can process headers • Higher-level protocol user at destination may be slow in retrieving data • Destination may need to limit incoming flow to match outgoing flow for retransmission DataLink Layer

  4. Flow Control Scope • Hop Scope • Between intermediate systems that are directly connected • Network interface • Between end system and network • Entry-to-exit • Between entry to network and exit from network • End-to-end • Between end user systems DataLink Layer

  5. Figure 11.2 DataLink Layer

  6. Flow Control at Multiple Protocol Layers • Multiple TCP connections over HDLC link • Flow control at higher level applied to each logical connection independently • Flow control at lower level applied to total traffic DataLink Layer

  7. Figure 11.1 DataLink Layer

  8. Sequence of Frames Source breaks up message into sequence of frames • Buffer size of receiver may be limited • Longer transmission are more likely to have an error • On a shared medium, avoids one station monopolizing medium DataLink Layer

  9. Model of Frame Transmission DataLink Layer

  10. Automatic Repeat Request (ARQ) • Uses: • Error detection • Timers • Acknowledgements • Retransmissions • Algorithms • Stop and wait • Go back N • Selective reject (selective retransmission) DataLink Layer

  11. Stop and Wait • Source transmits frame • Destination receives frame and replies with acknowledgement • Source waits for ACK before sending next frame • Destination can stop flow by not sending ACK • Works well for a few large frames DataLink Layer

  12. Stop and Wait • 2 kinds of errors: • Damaged frame at destination • Damaged acknowledgement at source • If received frame damaged, discard it • Transmitter has timeout • If no ACK within timeout, retransmit • If ACK damaged,transmitter will not recognize it • Transmitter will retransmit • Receive gets two copies of frame • Use ACK0 and ACK1 DataLink Layer

  13. Stop-and-Wait ARQ DataLink Layer

  14. Figure 11.4 DataLink Layer

  15. Stop-and-Wait Link Utilization • If Tprop large relative to Tframe then throughput reduced • If propagation delay is long relative to transmission time, line is mostly idle • Problem is only one frame in transit at a time • Stop-and-Wait rarely used because of inefficiency DataLink Layer

  16. Fragmentation • Large block of data may be split into small frames • Limited buffer size • Errors detected sooner • On error, retransmission of smaller frames is needed • Prevents one station occupying medium for long periods • Stop and wait becomes inadequate DataLink Layer

  17. Sliding Windows Flow Control • Allow multiple frames to be in transit • Receiver has buffer W long • Transmitter can send up to W frames without ACK • Each frame is numbered • ACK includes number of next frame expected • Sequence number bounded by size of field (k) • Frames are numbered modulo 2k DataLink Layer

  18. Sliding Window DataLink Layer

  19. Example of a Sliding Window Protocol DataLink Layer

  20. Sliding Window Enhancements • Receiver can acknowledge frames without permitting further transmission (Receive Not Ready) • Must send a normal acknowledge to resume • If duplex, use piggybacking • If no data to send, use acknowledgement frame • If data but no acknowledgement to send, send last acknowledgement number again, or have ACK valid flag (TCP) DataLink Layer

  21. Go-Back-N ARQ • Based on sliding window • If no error, ACK as usual with next frame expected • Use window to control number of outstanding frames • If error, reply with rejection • Discard that frame and all future frames until error frame received correctly • Transmitter must go back and retransmit that frame and all subsequent frames DataLink Layer

  22. Go Back N - Damaged Frame • Receiver detects error in frame i • Receiver sends rejection-i • Transmitter gets rejection-i • Transmitter retransmits frame i and all subsequent DataLink Layer

  23. Go Back N - Lost Frame (1) • Frame i lost and no additional frame sent • Receiver gets nothing and returns neither acknowledgement nor rejection • Transmitter times out and sends acknowledgement frame with P bit set to 1 • Receiver interprets this as command which it acknowledges with the number of the next frame it expects (frame i ) • Transmitter then retransmits frame i DataLink Layer

  24. Go Back N - Damaged Acknowledgement • Receiver gets frame i and send acknowledgement (i+1) which is lost • Acknowledgements are cumulative, so next acknowledgement (i+n) may arrive before transmitter times out on frame i • If transmitter times out, it sends acknowledgement with P bit set as before • This can be repeated a number of times before a reset procedure is initiated DataLink Layer

  25. Go Back N - Damaged Rejection • As for lost frame (2) DataLink Layer

  26. Go-Back-N ARQ Protocol DataLink Layer

  27. Selective Reject • Also called selective retransmission • Only rejected frames are retransmitted • Subsequent frames are accepted by the receiver and buffered • Minimizes retransmission • Receiver must maintain large enough buffer • More complex login in transmitter DataLink Layer

  28. Selective Reject - Lost Frame • Frame i lost • Transmitter sends i+1 • Receiver gets frame i+1 out of sequence • Receiver send reject i • Transmitter goes back to frame i and retransmits DataLink Layer

  29. Selective Reject -Diagram DataLink Layer

  30. Figure 11.7 DataLink Layer

  31. Error-Free Stop and Wait T = Tframe + Tprop + Tproc + Tack + Tprop Tframe = time to transmit frame Tprop = propagation time Tproc = processing time at station Tack = time to transmit ack Assume Tproc andTack relatively small DataLink Layer

  32. Error-Free Stop and Wait T ≈ Tframe + 2Tprop Throughput = 1/T = 1/(Tframe + 2Tprop) frames/sec Normalize by link data rate: 1/ Tframe frames/sec S = 1/(Tframe + 2Tprop) = Tframe = 1 1/ Tframe Tframe + 2Tprop 1 + 2a where a = Tprop / Tframe DataLink Layer

  33. Figure 11.8 DataLink Layer

  34. Stop-and-Wait ARQ with Errors P = probability a single frame is in error Nx = 1 1 - P = average number of times each frame must be transmitted due to errors S = 1 = 1 - P Nx (1 + 2a) (1 + 2a) DataLink Layer

  35. The Parameter a a = propagation time = d/V = Rd transmission time L/R VL where d = distance between stations V = velocity of signal propagation L = length of frame in bits R = data rate on link in bits per sec DataLink Layer

  36. Values of α DataLink Layer

  37. Figure 11.9 DataLink Layer

  38. Error-Free Sliding Window ARQ • Case 1: W ≥ 2a + 1 Ack for frame 1 reaches A before A has exhausted its window • Case 2: W < 2a +1 A exhausts its window at t = W and cannot send additional frames until t = 2a + 1 DataLink Layer

  39. Figure 11.10 DataLink Layer

  40. Normalized Throughput 1 W ≥ 2a + 1 S = W W < 2a +1 2a + 1 DataLink Layer

  41. Selective Reject ARQ 1 - P W ≥ 2a + 1 S = W(1 - P) W < 2a +1 2a + 1 DataLink Layer

  42. Go-Back-N ARQ 1 - P W ≥ 2a + 1 S = 1 + 2aP W(1 - P) W < 2a +1 (2a + 1)(1 – P + WP) DataLink Layer

  43. Figure 11.11 DataLink Layer

  44. Figure 11.12 DataLink Layer

  45. Figure 11.13 DataLink Layer

More Related