1 / 43

Ch 11. Data Link Control

Ch 11. Data Link Control. Data Link Layer. Functionalities of data link layer Data link control (chapter 11): about node-to-node communication Media access control (chapter 12): about link sharing Data link control Framing (the bits organization) Flow and error control. 11.1 Framing.

nerice
Télécharger la présentation

Ch 11. Data Link Control

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. Ch 11. Data Link Control

  2. Data Link Layer • Functionalities of data link layer • Data link control (chapter 11): about node-to-node communication • Media access control (chapter 12): about link sharing • Data link control • Framing (the bits organization) • Flow and error control

  3. 11.1 Framing • Transmission unit in data link layer • Pack (stream) bits into frames (packets) • Fixed-size framing (size itself is a delimiter) • Variable-size framing • How to distinguish a frame from the other frames? • A character-oriented approach • A bit-oriented approach

  4. Variable-size Framing • Character-oriented framing (old times, designed to transfer text) • A frame starts with a special character of 1 byte (flag) • If data includes “the same bit pattern” as flag (or ESC), do stuffing and unstuffing, using ESC Source and destination address Error correction, detection bits

  5. Variable-size Framing • Bit-oriented framing (graphic, audio, video, text) • Flag is a bit-pattern, e.g., 01111110 • Stuffing and unstuffing are done by adding/removing a single bit, e.g., adding/removing 0 after every “11111”

  6. 11.2 Flow and Error Control • Data link control • Flow control – the sender restricts the amount of data that can be sent, due to speed and buffer limitation at the receiver side • Any receiving device has a limited amount of memory in which to store incoming data. The receiving device must be able to inform the sending device before those limits are reached and to request either slow down and temporarily stop. • Error control – referred to both error detection and error correction. In case of errors, they are often recovered by error correction code, or by retransmission. This process is called automatic repeat request (ARQ).

  7. 11.3 Data Link Control Protocols • Different protocols for • Noiseless channels: Simplest and Stop-and-Wait • Noisy channels: Stop-and-Wait ARQ, Go-Back-N ARQ, and Selective Repeat ARQ • Uni-directional vs. bidirectional • For simplicity, we consider two protocols for each direction (i.e., uni-directional) • In reality, the protocols are bidirectional • Small control frames (e.g., acknowledgement) are piggybacked over frames of the flow in the opposite direction

  8. 11.4 Noiseless Channels • Ideal error-free channels • No frames are lost • Simplest protocol • No flow or error control • Assume thatthe receiver can handle any frame immediately

  9. Procedure of Simplest Protocol SENDER while(true) { WaitForEvent(); if(Event(RequestToSend)) { GetData(); MakeFrame(); SendFrame(); } } RECEIVER while(true) { WaitForEvent(); if(Event(ArrivalNotification)) { ReceiveFrame(); ExtractData() DeliverData(); } }

  10. Flow Diagram of Simplest Protocol Transmission time

  11. Stop-and-Wait Protocol • Receiver-side limitation • Receiver processes frames at a lower rate than transmitter’s sending rate • Frames can be stored at the receiver, but the storage space is limited • Procedure of Stop-and-Wait (buffer size of 1 at receiver) Confirmation frame

  12. Pseudo Code of Stop-and-Wait SENDER canSend = true; while(true) { WaitForEvent(); if(Event(RequestToSend) AND canSend) { GetData(); MakeFrame(); SendFrame(); canSend = false; } if(Event(ArrivalNotification)) { ReceiveFrame(); canSend = true; } } RECEIVER while(true) { WaitForEvent(); if(Event(ArrivalNotification)) { ReceiveFrame(); ExtractData() DeliverData(); SendFrame(); } } ACK sent ACK received

  13. Flow Diagram of Stop-and-Wait

  14. 11.5 Noisy Channels • Noiseless channels are non-existent • Stop-and-Wait Automatic Repeat Request (ARQ) • Add a simple error control to Stop-and-Wait protocol • For corrupted frame, add redundancy bits to detect errors at the receiver • To identify the lost frame, number the frames • Recovery (of Stop-and-Wait ARQ) • Sender starts a timer after transmits a frame • If a frame is corrupted or lost, the receiver will not send an ACK, and the sender can retransmit the frame “when the timer expires” • Sender should keep a copy of a frame for retransmission

  15. Procedure of Stop-and-Wait ARQ • To minimize the frame size, we look for the smallest range of sequence numbers that provides unambiguous communication. • If the field is m bits long, the sequence numbers start form 0, go to 2m – 1 and then are repeated.

  16. Pseudo Code of Stop-and-Wait ARQ SENDER canSend = true; Sn = 0 while(true) { WaitForEvent(); if(Event(RequestToSend) AND canSend) { GetData(); MakeFrame(Sn); SendFrame(Sn); StartTimer(); Sn = Sn + 1; canSend = false; } (continue to the next) if(Event(ArrivalNotification)) { ReceiveFrame(ackNo); if(not corrupted AND ackNo == Sn) { StopTimer(); PurgeFrame(Sn-1); canSend = true; } } if(Event(TimeOut) { ResendFrame(Sn-1); StartTimer(); } } ACK received Timer expiration and retransmission

  17. Pseudo Code of Stop-and-Wait ARQ RECEIVER Rn = 0 while(true) { WaitForEvent(); if(Event(ArrivalNotification)) { if(corrupted) continue; /* do nothing */ if(seqNo == Rn) { ExtractData(); DeliverData(); Rn = Rn + 1; } SendFrame(Rn); } } Discard frame if corrupted Check Seq. No.

  18. Flow Diagram of Stop-and-Wait ARQ

  19. Efficiency of Stop-and-Wait • Reminder: bandwidth-delay product • Channel can be considered as a pipe • The pipe size (volume) is the number of bits that the sender can transmit into the system while waiting for an ACK from the receiver • = bandwidth x delay (round-trip time) • Example 11.4 • The system has a link with bandwidth 1Mbps and 10ms transmission delay (20ms in a round trip). If a frame is 1000 bits in length, what is the utilization under Stop-and-Wait? • 1000 / (bandwidth-delay product) = 1k / (1M x 20m) = 1k/20k = 5% • Stop-and-Wait ARQ protocol is very inefficient!

  20. Go-Back-N ARQ • Improve efficiency of Stop-and-Wait • Sender transmits up to N frames while waiting an ACK • Sliding window: range of sequences at sender that are sent (or can be sent) by the sender, but not acknowledged yet

  21. Go-Back-N ARQ • The receive window makes sure that the correct data frames are received and the correct acknowledgments are sent. • The size of the receive window is always 1. • The receive is always looking for the arrival of a specific frame and other are discarded and needs to be resent.

  22. Procedure of Go-Back-N ARQ • Retransmission • When the timer expires, the sender resends all the outstanding frames (i.e., goes back by N sequence) multiple frames are in transmission

  23. Algorithm 11.7Go-Back-N sender algorithm

  24. (continued) Algorithm 11.7Go-Back-N sender algorithm

  25. Algorithm 11.8Go-Back-N receiver algorithm

  26. Flow Diagram of Go-Back-N ARQ (1) ACK is cumulative: ACK 3 also acknowledge Frame 1

  27. Flow Diagram of Go-Back-N ARQ (2)

  28. Discussion • Stop-and-Wait ARQ can be considered as a special case of Go-Back-N ARQ with sliding window of size 1 • Go-Back-N is also inefficient for noisy channels • It resends all outstanding frames including those that already arrived at the receiver

  29. Selective Repeat ARQ • Receiver stores the out-of-order frames • Receiver informs the sender of which frame is missing by Negative Acknowledgement (NAK or NACK) • Sender needs multiple timers for each frame

  30. Two Sliding Windows • Sender’s sliding window • Receiver’s sliding window The sizes of sender’s and receiver’s windows are the same

  31. Design of Selective Repeat ARQ

  32. Algorithm 11.9Sender-site Selective Repeat algorithm (continued)

  33. (continued) Algorithm 11.9Sender-site Selective Repeat algorithm (continued)

  34. (continued) Algorithm 11.9Sender-site Selective Repeat algorithm

  35. Algorithm 11.10Receiver-site Selective Repeat algorithm

  36. Algorithm 11.10Receiver-site Selective Repeat algorithm

  37. Flow Diagram of Selective Repeat ARQ NAK (or NACK) for an out-of-order frame Timer per each frame

  38. Piggybacking • In bidirectional connection, control information (i.e., ACK and NAK) can be embedded in the data frame of the reverse direction

  39. Size of Sliding Windows • A problem may occur if the sequence number space is limited • Go-Back-N ARQ • The size of sender’s sliding window should be less than N • Selective Repeat ARQ • The size of both sender’s and receiver’s sliding windows should be no greater than N/2 • Refer to Fig. 11.21 for an example

  40. High-level Data Link Control • High-level Data Link Control (HDLC) is a bit-oriented protocol for communication over point-to-point and multipoint links. It implements the ARQ mechanisms in two possible configurations: • Normal response mode (NRM) • Asynchronous balanced mode (ABM)

  41. Figure 11.26 Asynchronous balanced mode Normal response mode Asynchronous balanced mode

  42. HDLC frames • HDLC defines three types of frames: • Information frames (I-frames) • Transmits user data & control information relating to user data (piggybacking). • Supervisory frames (S-frames) • Transmits control information • Unnumbered frames (U-frames) • Reserved for system management. Frame check sequence

  43. Homework • Exercise in Chap. 11 • 18, 24, 25, 29 • Additional problem) A system uses the Stop-and-Wait ARQ protocol. If each packet carries 1000 bits of data and transmitted over a link with rate 100 Kbps, how long does it take to send 1 million bits of data if the distance between the sender and receiver is 5000 Km and the propagation speed is 2x108 m? • Ignore the overhead due to headers and trailers • Assume that each ACK is of 10 bits length • Ignore queuing and processing delay, but do NOT ignore transmission and propagation delay • Assume that no data or ACK frame is lost or damaged

More Related