1 / 42

Data Link Control and Protocols

Data Link Control and Protocols. Flow and Error Control. Flow Control. Error Control. Note :. Flow control refers to a set of procedures used to restrict the amount of data that the sender can send before waiting for acknowledgment. Note :.

Download Presentation

Data Link Control and Protocols

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 LinkControland Protocols

  2. Flow and Error Control Flow Control Error Control

  3. Note: Flow control refers to a set of procedures used to restrict the amount of data that the sender can send before waiting for acknowledgment.

  4. Note: Error control in the data link layer is based on automatic repeat request, which is the retransmission of data.

  5. Stop and Wait Protocol Sliding Window Protocol Flow Control Protocols

  6. Data transmission is in one direction at a time (half-duplex) Sender sends a frame and waits for an acknowledgement Avoids flooding frames at receiving end Receiver holds the data in buffer Once complete frame is received, then the acknowledgement is sent i.e. it is ready to receive another frame Stop and Wait Protocol

  7. Only one frame is transmitted at a time Time taken by a station to transmit a frame is ‘transmission time’ Time taken by a bit to reach destination from source is ‘propagation time’ Capacity of medium: Length of link in Bits Calculated as: B=R x (d / v) where, R is Data rate of Link in bps d is length of link in meters v is velocity of propagation Stop and Wait Protocol

  8. Case 1: When transmission time (t=1) is greater than propagation time Case 2: When propagation time (a) is greater than transmission line Two Cases of Stop and Wait Protocol

  9. i.e. propagation time is less than transmission time Frame is so long that, the first bit of frame reaches the destination before the source completes transmitting the whole frame Case when the sender and receiver are at very short distance Eg: LAN Communication Case 1: a<1

  10. Medium capacity (B)=200 bits( R=1Gbps, d=40m, v=2x108m/s) Transmission time=1 second Frame size (L)=800 bits Propagation time (a)= B/L=200/800=0.25= 250 ms At t0, transmission starts After 250 ms, first 200 bits are on transmission line After 1000 ms, final bit of frame is emitted to medium After 1250 ms, final bit reaches the receiver If Ack takes 250 ms to reach sender Total Transmission Time= (1250 +250)=1500ms The Actual Transmission Time for first frame= 1000ms Total Transmission Time =1500ms Numerical Example for a<1

  11. i.e. propagation time is greater than transmission time Sender finishes transmitting complete frame before the first bit of frame could reach the destination The medium is under utilized as the medium is never fully occupied during the frame transmission Case when the distance between sender and receiver is very long Eg: Satellite Communication Case 1: a>1

  12. Medium capacity (B)=10000 bits ( R=1Mbps, d=30000m, v=3x106m/s) Transmission time=1 second Frame size (L)=800 bits Propagation time (a)= B/L=10000/800=25 seconds At t0, transmission starts After 1s, final bit of frame is emitted to medium After 25seconds, first bit of frame reaches the receiver After 26seconds, final bit reaches the receiver If Ack takes 25s to reach sender Total Transmission Time= (26 +25)=51 seconds The Actual Transmission Time = 25seconds Total Transmission Time =51seconds>>25seconds Numerical Example: a>1

  13. Medium Capacity increases if data rate increases as well as if distance increases If capacity increases, propagation time will also slowly increase keeping other values constant Which slowly degrades the efficiency More the propagation delay is, more inefficient is the stop and wait protocol So concluding stop and wait...

  14. Introduced to overcome the limitation of stop and wait protocol of sending only one frame at a time Sends multiple frames say W frames (window-size) Receiver will have buffer size for W frames Sender is allowed to send W number of frames without waiting for an acknowledgement To keep track of frames acknowledged, sequence number is used The number of bits used in sequence number determines the value of W Sender’s window will constitute of frames sent but not acknowledged Receiver’s window will constitute of frames expected Sliding Window Protocol

  15. Whenever receiver receives a frame correctly, it sends a acknowledgement for that frame, and then slides the window next expected frame adding new expected frame to the window Whenever sender receives an acknowledgement for a frame it sends next frame to receiver and slides the window one frame maintaining window size Sliding Window Protocol

  16. Frames are numbered using sequence number If there is 3 bit sequence number, then the maximum possible sequence number is 7 And maximum window size:0-7, i.e 8 But not always max. window size is the required window size The window size of the frames depend upon protocols used How to number frames?

  17. Until now only unidirectional data flow is discussed But what if bidirectional data flow is required What if both station A and B needs to send data At such case, it would be inefficient use of medium to send acknowledgement and data separately Since Acknowledgement is a small piece of information, it would be efficient to append the acknowledgement information with next out-going data This technique of combining a data frame with an acknowledgement in bidirectional transmission system to make the optimum use of the medium is called piggy-backing Piggybacking

  18. One Bit Sliding Window Protocol Go-Back N ARQ (Automatic Repeat reQuest) Selective Repeat ARQ Different Sliding Window Protocols for Error Control

  19. Also known as Stop and Wait ARQ Follows the principle of stop and wait protocol The window size at receiver and sender is 1 frame One-Bit Sliding Protocol

  20. Sender keeps a copy of frame sent until the acknowledgement for that frame is received Data frames and acknowledgement frames are identified with two values 0 and 1 Data frame 0 is acknowledged by ACK 1 and vice versa If receiver receives damaged frame, then it simply discards the frame and doesn’t send an acknowledgement If receiver receives out of order frame, then also it discards the frame and sends no acknowledgement Sender starts timer as soon as it sends a frame and if it doesn’t receive acknowledgement before the timer goes off, it retransmits the frame In case of unidirectional transmission, sender has control variable S to store the number of recently sent frame (0 or 1) and receiver has control variable R to store the number of next frame expected In bidirectional transmission, each station have both control variables One-Bit Sliding Protocol (Features)

  21. Normal operation of One Bit Sliding Protocol

  22. Stop-and-Wait ARQ, lost frame

  23. Stop-and-Wait ARQ, lost ACK frame

  24. Note: In Stop-and-Wait ARQ, numbering frames prevents the retaining of duplicate frames.

  25. Stop-and-Wait ARQ, delayed ACK

  26. Note: Numbered acknowledgments are needed if an acknowledgment is delayed and the next frame is lost.

  27. Piggybacking in Stop and Wait ARQ

  28. Multiple frames can be sent without waiting for the acknowledgments If m bits are used for sequence number, the maximum possible window size that can be used by sender is 2m-1 The receiver window size is always 1 frame window Go-Back-N ARQ

  29. Sender sliding window in Go-Back-N ARQ

  30. Receiver sliding window in Go-Back-N ARQ

  31. Control variables in Go-Back-N ARQ

  32. Multiple frames are sent in this protocol by sender If the receiver doesn’t receive the frame or the frame is damaged then, the acknowledgment is not sent Also the receiver discards all the subsequent frames followed by erroneous frame Receiver also discards all the out of order frames When sender doesn’t get an acknowledgment before the timer goes off, it retransmits all the frames all over again starting from frame whose acknowledgement is not received Acknowledgment can be sent by receiver in the cumulative form as well Go-Back-N ARQ (Operation)

  33. Go-Back-N ARQ, normal operation

  34. Go-Back-N ARQ, lost frame

  35. Go-Back-N ARQ: sender window size

  36. 11.4 Selective-Repeat ARQ Sender and Receiver Windows Operation Sender Window Size Bidirectional Transmission Pipelining

  37. Go-Back-N ARQ would not be efficient protocol with noisy channel where the tendency of error is high resulting high number of retransmissions So for such scenario, there should be mechanism to not resend all N frames but just to send the frame which is damaged Selective Repeat ARQ provides such mechanism Sender and Receiver have same window size which is equal to at most 2m/2 There is use of NAK (Negative ACK) for damaged frames Selective Repeat ARQ

  38. 11.12Selective Repeat ARQ, sender and receiver windows

  39. In selective repeat, if receiver encounters a damaged frame it sends NAK When sender receives a NAK, it resends the frame for which the NAK was sent by receiver Timers are used at both ends to tackle the problem when the frames, ACKS and NAKS are delayed or lost Selective Repeat ARQ(Operation)

  40. 11.13Selective Repeat ARQ, lost frame

  41. Note: In Selective Repeat ARQ, the size of the sender and receiver window must be at most one-half of 2m.

  42. 11.14Selective Repeat ARQ, sender window size

More Related