data link control protocols
DESCRIPTION
Data Link Control Protocols. CSE 3213 Fall 2011. Data Link Control Protocols. When sending data, to achieve control, a layer of logic is added above the physical layer data link control or a data link control protocol To manage exchange of data over a link: frame synchronization - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/1.jpg)
Data Link Control Protocols
CSE 3213Fall 2011
April 22, 2023
![Page 2: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/2.jpg)
Data Link Control Protocols
• When sending data, to achieve control, a layer of logic is added above the physical layer—data link control or a data link control protocol
• To manage exchange of data over a link:—frame synchronization—flow control—error control—addressing—control and data—link management
2
![Page 3: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/3.jpg)
Flow Control
• Ensure sending entity does not overwhelm receiving entity—prevent buffer overflow
• Influenced by:—transmission time
• time taken to emit all bits into medium
—propagation time• time for a bit to traverse the link
• Assumption is all frames are successfully received with no frames lost or arriving with errors.
3
![Page 4: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/4.jpg)
4
Model of Frame Transmission
![Page 5: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/5.jpg)
Stop and Wait• simplest form of
flow control• works well for a
message sent in a few large frames—stop and wait
becomes inadequate if large block of data is split into small frames by source
5
![Page 6: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/6.jpg)
6
Fragmentation• Large block of data may be split into small
frames—Limited buffer size—Errors detected sooner (when whole frame
received)—On error, retransmission of smaller frames is
needed—Prevents one station occupying medium for
long periods
• Stop and wait becomes inadequate
![Page 7: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/7.jpg)
Stop and Wait Link Utilization
7
![Page 8: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/8.jpg)
8
Sliding Window Flow Control• Allow multiple frames to be in transit• Receiver has buffer of W frames long• Transmitter can send up to W frames without
ACK• Each frame is numbered (for error control)• ACK includes number of next frame expected• Sequence number bounded by size of field (k)
—Frames are numbered modulo 2k
• Max window size is (2k– 1)
![Page 9: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/9.jpg)
Sliding Window Diagram
9
![Page 10: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/10.jpg)
Sliding Window Example
10
![Page 11: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/11.jpg)
11
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.
![Page 12: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/12.jpg)
Error Control Techniquesdetection and
correction of errors such as:
lost frames-a frame fails to arrive at the other side
damaged frames-frame arrives but some of the bits are in error
12
ARQ
![Page 13: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/13.jpg)
Automatic Repeat Request (ARQ)
• Collective name for error control mechanisms
• Effect of ARQ is to turn an unreliable data link into a reliable one
• Versions of ARQ:—stop-and-wait—go-back-N—selective-reject (selective retransmission)
13
![Page 14: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/14.jpg)
Stop and Wait ARQ• Source transmits a single frame.• Waits for ACK.
—no other data can be sent until destination’s reply arrives
• If frame received is damaged, discard it.—transmitter has timeout—if no ACK within timeout, retransmit
• If ACK is damaged, transmitter will not recognize—transmitter will retransmit—receiver gets two copies of frame—use alternate numbering and ACK0 / ACK1 14
![Page 15: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/15.jpg)
Stop and Wait ARQ
15
![Page 16: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/16.jpg)
16
Go-Back-N ARQ• Most commonly used error control scheme• 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
![Page 17: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/17.jpg)
Go-Back-NExample
17
![Page 18: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/18.jpg)
18
Lost/Damaged Frame (1)Lost/damaged frame is not the last frame:• Receiver detects error in frame i , discard
it(or frame i was simply lost in transit)
• Receiver receives frame (i+1) out of order
• Receiver sends rejection REJi• Sender gets REJi• Sender retransmits frame i and all
subsequent frames
![Page 19: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/19.jpg)
19
Lost/Damaged Frame (2)Frame i was lost/damaged and is the last frame of the message:
• Receiver gets nothing and returns neither acknowledgement nor rejection
• Sender times out and sends a request for acknowledgment: RR(P=1)
• Receiver responds to the request be sending RRi
• Sender then retransmits frame i
![Page 20: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/20.jpg)
20
Lost/Damaged RRCase 1:• Receiver gets frame i and send acknowledgement
(i+1) which is lost• Acknowledgements are cumulative, so next
acknowledgement (i+n) may arrive before sender times out on frame i
Case 2:• If sender times out, it sends request for ACK with P
bit set as before: RR(P=1)• The RR(P=1) packet is also timed in case it will be
lost.• This can be repeated a number of times before a
reset procedure is initiated
![Page 21: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/21.jpg)
21
Lost/Damaged REJ• Receiver stops accepting data and is
waiting for retransmitted frames.• Sender times out and sends a request for
acknowledgment: RR(P=1)• Receiver responds to the request by
resending REJi• Sender retransmits frame i and all
subsequent frames
![Page 22: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/22.jpg)
22
Go-Back-N Example Sequence numbers are 3 bit long, and start from 0. Window size is 6 frames. A sends data to B and B has no data to send. The sum of the propagation time and the transmission time
for every data frame, and every RR/REJ is 1 time unit. B sends an acknowledgment (either positive or negative)
every 2 time units. The time-out period for each data frame is 4 time units.
Draw the flow diagram showing the sequence of interactions between A and B, assuming that
the 5th frame is damaged, then acknowledgment RR 7 is lost
![Page 23: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/23.jpg)
Go-Back-NExample
23
![Page 24: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/24.jpg)
24
Selective Reject ARQ• 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 logic in transmitter to send frames out
of sequence Go-back-N is more commonly used.
• Useful for satellite links due to long propagation delay
• Max window size (2k–1)• When a data frame is timed-out, the sender
retransmits the frame rather than sending RR(P=1).
![Page 25: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/25.jpg)
Go-Back-N vs.Selective Reject
25
![Page 26: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/26.jpg)
High Level Data Link Control (HDLC)
26
![Page 27: Data Link Control Protocols](https://reader033.vdocuments.us/reader033/viewer/2022051019/56815854550346895dc5ae2d/html5/thumbnails/27.jpg)
Reading• Chapter 7, Stalling’s book• Assigned reading: HDLC
27