1 / 40

Data link layer (basic) – no MAC sublayer

Data link layer (basic) – no MAC sublayer. Outline Two functions Error control Flow control. Malathi Veeraraghavan Univ. of Virginia. Some of the figures in this talk are from A. Tanenbaum's book and a few from A. Leon-Garcia and I. Widjaja’s book. Error control. Error detection

mason
Télécharger la présentation

Data link layer (basic) – no MAC sublayer

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. Data link layer (basic) – no MAC sublayer • Outline • Two functions • Error control • Flow control Malathi Veeraraghavan Univ. of Virginia Some of the figures in this talk are from A. Tanenbaum's book and a few from A. Leon-Garcia and I. Widjaja’s book

  2. Error control • Error detection • Parity check • Cyclic Redundancy Code (CRC) or polynomial codes • Error correction • Automatic Repeat reQuest (ARQ) • Forward Error Correction (FEC) Slides mainly from web site of textbook by A. Leon-Garcia and I. Widjaja (with modifications by M. Veeraraghavan)

  3. ARQ error/loss detectionand recovery • Send a frame • Hold frame in a retransmission buffer at the sender so that if there is a loss/error, the frame can be resent • Wait for Acknowledgment (ACK) from receiver • If a received frame had errors, the receiver detects the presence of errors using CRC, and then sends a notification • sender resends errored frame • But what happens if the frame itself was lost or the receiver's notification of an error is lost? • Solution: • Start a timer at the sender upon sending a frame • If timer times out before ACK arrives, retransmit frame

  4. Error correction:Different ARQ schemes • Stop-and-Wait • Sliding window

  5. Header Stop-and-Wait ARQ Transmit a frame, wait for ACK Error-free frame Information frame (user data frame) Timer set after each frame transmission Receiver (Process B) Transmitter (Process A) ACK expected before timer expires Control frame ACK: Acknowledgment CRC Information bits Header CRC Control frame: ACKs Information frame; also called user data frame

  6. Stop-and-Wait Efficiency Last frame bit enters channel ACK arrives First frame bit enters channel Channel idle while transmitter waits for ACK t A B t Receiver processes frame and prepares ACK First frame bit arrives at receiver Last frame bit arrives at receiver

  7. Stop-and-Wait Model • t0 = total time A tproc B data frame emission time tf tprop tprop tproc tack one-way propagation delay user data frame size ACK frame size processing delay channel transmission rate

  8. Stop-and-Wait efficiency on an error-free channel bits for header & CRC Effective transmission rate: Transmission efficiency: Effect of frame overhead Effect of Bandwidth-delay product Effect of ACK frame

  9. Propagation vs.processing delays • Propagation delay is determined by speed of light • If distance = 1000km, propagation delay is on the order of milliseconds • Processing delays are on the order of micro-seconds • Therefore, we often ignore tproc • 2tprop = Round-trip propagation delay • Because tprop is one-way propagation delay

  10. Examples (ignoring processing delay) Bandwidth-delay product = Round-trip prop. delay x BW = Round-trip prop.delay BW = r In Physical Layer lecture, we learned the word "bandwidth" as H in Hz. We used the word "transmission rate" as r in bits/sec, which determines emission (transmission) delay. On this slide, we are using the word "Bandwidth" for transmission rate, r. Commonly accepted language in networking community. 1 sec x 109 b/s = 109 bits

  11. Transmission efficiency, 0 nf = 1250 bytes = 10000 bits na =no= 25 bytes = 200 bits Round-trip prop. delay BW The higher the bandwidth-delay product, the lower the transmission efficiency or effective transmission rate

  12. We conclude that • Stop-and-Wait ARQ solution does not work well on high bandwidth-delay product paths

  13. Error correction:Different ARQ schemes • Stop-and-Wait • Sliding window

  14. Sliding window scheme • Basic operation (no errors/losses) • Relation between sending window size and sequence number

  15. Basic operation • Improve Stop-and-Wait by not waiting! • Keep channel busy by continuing to send frames • Transmit a window of Ws frames before waiting for an ACK • If ACK for oldest frame arrives before window is exhausted (which means before sender has transmitted out Ws frames), then there is no "WAIT" period. Leads to an efficient use of the link.

  16. Sequence numbers and ACKs • Sequence numbers in frame headers • Add a sequence number in each frame header • Use an m-bit sequence number to identify frames • Example: if m=3, sequence numbers are 0, 1, 2, 3, 4, 5, 6, 7. The next frame will start over with sequence number 0. • ACK frames • ACK frame carries the sequence number of the next expected frame • Called cumulative ACK • More efficient to say "I received everything up to this frame and am expecting this next frame" rather than to ACK every frame one-by-one.

  17. New term: outstanding frames • Means unacknowledged • At any instant of time, there can be only Ws outstanding frames • these frames were transmitted but the sender has not yet received an ACK for any of the frames

  18. Operation of Sliding Window Scheme • Sending window vs. permitted-to-send window: • Permitted-to-send window: set of frames that the sender is permitted to send • Sending window: permitted-to-send frames + outstanding frames (already transmitted but as-yet unacknowledged frames) sending window size Ws = 7 Wp = 7 permitted-to-send window size No outstanding frames at this point in time

  19. Operation of Sliding Window Ws = 7 Wp = 7 • Operations at the sender: Wp changes to 4 (note Ws is still 7; frames 6, 7, 0 are outstanding) ACKs not yet received for 6, 7, 0 permitted-to-send window sending window

  20. Operation of Sliding Window • Operations at the sender: ACK 1 is cumulative ACK It means frames 6, 7, 0 have all been received Notice how the window slides with time - hence the name "Sliding window" No more outstanding frames; therefore Ws = Wp = 7

  21. Analysis of Sliding Windows Use nf as size of each frame and R as transmission rate Processing delays are neglected

  22. Analysis of Sliding Windows • If the window size is sufficiently large the sender can transmit packets continuously • If: • Ignoring frame header/CRC overhead, ACK frame size and processing delays: • transmission efficiency = 100%

  23. Sending window size • Sending window size, Ws, should be at least as large as W (previous slide) so that no time is wasted waiting for an ACK with the sender idling In most protocols, frames are of variable length, and therefore window size is usually expressed in bytes. For simplicity, in this lecture, we have assumed that all frames are of equal length (size Sf). Under this assumption, Ws should always be an integer, as it represents a number of fixed-length frames.

  24. Sliding window scheme outline check • Basic operation (no errors/losses) • Relation between sending window size and sequence number

  25. What happens if sending window size Ws = 2m? Sender timer times out for frame 0 since ACK is not received and sender retransmits frame 0 Example: m=2 and Ws = 4 fr 0 fr 2 fr 1 fr 3 Time fr 0 A ACKs lost B ACK1 ACK 0 ACK2 ACK3 Receiver has Rnext= 0; so it will accept the frame assuming it is a new frame, when in reality it is a duplicate frame Rnext 0 1 2 3 0 Rnext: Sequence number of the next expected frame

  26. Conclusion: Maximum Allowable Sending Window Size max(Ws) = 2m-1 Example: m=2 and Ws = 3 Sender timer times out for frame 0 since ACK is not received and sender retransmits frame 0 fr 3 fr 0 fr 0 fr 2 fr 1 Time A ACKs lost ACK2 ACK3 ACK1 B ACK3 Receiver has Rnext= 3 , so it rejects the duplicate frame 0, and sends ACK 3. If this ACK reaches the sender, sender will conclude that frames 0, 1 and 2 were successfully received and it will send frame 3 Rnext 0 1 2 3

  27. Relation between sending window size and sequence number • Sending window size, Ws • Sequence number is m-bits long

  28. ACK Piggybacking in Bidirectional Communication Frames have sequence numbers; ACKs have numbers Piggybacking means carrying an ACK number within data-carrying frame header A B Header Trailer DATA Receiver Transmitter Transmitter Receiver DATA S: Sequence number of frame Rnext: Next expected frame at the receiver: ACK number In normal operation, what can we say about the relation between SB and RAnext?

  29. Status check • Outline • Two functions • Error control • Flow control

  30. T T H H T H Flow control problem • Rates of the transmitter and receiver at the physical layer are matched. • The flow control problem arises because the layer above the DLL at the receiver does not deplete the buffer at the same rate at which data is being passed to the DLL at the sender (Rsnd Rrcv) Host Switch or host Rsnd Receive buffer Rrcv Data units Data-link layer (DLL) Data-link layer (DLL) Physical layer Physical layer transmission rate: r

  31. Different rates • Rsnd: Rate at which the higher layer passes data to the DLL at the sender • Rrcv: Rate at which the higher layer removes data from the DLL buffer at the receiver • r: physical-layer transmission rate

  32. Techniques for flow control • Flow control mechanisms prevent buffer overflow by regulating the rate at which source is allowed to send information • Stop-and-wait flow control • ON-OFF flow control • Sliding window flow control • Rate based flow control (skip for this class)

  33. Stop-and-wait flow control • No problem if ACK is sent back after higher layer depletes the buffer holding the single frame’s payload

  34. ON /OFF flow control Sender Receiver Recall:What is Rsnd? What is Rrcv? B Round-trip propagation delay 2tprop OFF Bleft Bleft=2tprop(Rsnd – Rrcv) Assume that the physical-layertransmission rate, r, is same as Rsnd When should the OFF signal be sent?

  35. Sliding Window Flow Control • Sliding Window Flow Control • Receiver has a receive buffer • Receiver sends reports of available space in this buffer to the sender • This is called flow window or advertised window • Sender uses this number to determine the maximum number of frames it can have outstanding (i.e., unacknowledged)

  36. Sliding window FC illustrated Receive buffer can hold 11 frames Receiver notifies the sender as to how much space is available in its receive buffer Ws=7 flow window = 11 Sending buffer If m=3, i.e. 3-bit sequence number, then Ws can be 7, why? Receiving buffer (flow control)

  37. Sliding window FC illustrated Because the receiving buffer has space to hold 8 more packets Because the receiver is expecting packet with sequence number 3 6 5 4 Ws=7 3 Since 0, 1, 2 are ACK'ed, they can be removed from the send buffer 2 2 1 1 0 0 Sending buffer Receiving buffer flow window = 8; ack 3

  38. Flow window • Flow window is the: • Left-over space in the receiver’s buffer • In previous slide, flow window of 8 is a report of how much space is left in the receiver’s buffer (enough to hold 8 frames) • Flow window is also called "advertised window" or "receiver’s window"

  39. Sliding window FC illustrated 1 1 0 0 7 7 6 6 Ws=7 5 5 4 4 3 3 2 1 0 Sending buffer flow window = 4; ack 2 Receiving buffer Watch with animation; frames 0, 1, 2 are read out of the receive buffer by the higher-layer, which is why the flow window indication is 4

  40. At any instant in time, what is the maximum number of frames that the sender is permitted to send? • Maximum number of outstanding frames at any instant in time is a minimum of sending window,Ws, and the flow window indicated by the receiver • Three steps: • Find X = min (Ws, flow window) • Find Y = number of outstanding frames (already sent but unacknowledged) • Maximum number of frames that the sender is permitted to send = X- Y • Result: if X-Y frames are sent, then the number of outstanding frames will become X (which is the max. limit for no. of outstanding frames) • After the sender receives the indication that flow window = 4 and ACK = 2 as shown on the previous slide, how many frames can the sender send? What are the sequence numbers of the frames that it will send (assume that the higher-layer keeps passing frames down to the DLL at the sender)?

More Related