0% found this document useful (0 votes)
81 views17 pages

Data Link Layer Flow Control

The document discusses various data link layer flow control mechanisms. It describes stop-and-wait flow control for both noiseless and noisy channels. For noisy channels, it covers stop-and-wait ARQ, go-back-N ARQ, and selective repeat ARQ. It provides details on the operation of each protocol including the use of sequence numbers, sliding windows, and control variables at the sender and receiver. It also discusses normal operation and how each protocol handles lost or damaged frames and acknowledgements.

Uploaded by

Aathmika Vijay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views17 pages

Data Link Layer Flow Control

The document discusses various data link layer flow control mechanisms. It describes stop-and-wait flow control for both noiseless and noisy channels. For noisy channels, it covers stop-and-wait ARQ, go-back-N ARQ, and selective repeat ARQ. It provides details on the operation of each protocol including the use of sequence numbers, sliding windows, and control variables at the sender and receiver. It also discusses normal operation and how each protocol handles lost or damaged frames and acknowledgements.

Uploaded by

Aathmika Vijay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

12-10-2022

DATA LINK LAYER FLOW CONTROL

FLOW CONTROL

 Noiseless channel
 Simplest
 Stop and Wait

 Noisy channel
 Stop and Wait ARQ
 Go back N ARQ
 Selective Repeat

1
12-10-2022

SIMPLEST

STOP AND WAIT

The sender sends


one frame, stops
until it receives
confirmation from
the receiver (okay
to go ahead), and
then sends the
next frame.

2
12-10-2022

FLOW CONTROL NOISY


CHANNEL
 There are three types of flow control mechanism
 Stop-and-Wait ARQ (Automatic Repeat Request)
 Stop-and-Wait ARQ - lost ACK frame
 Stop-and-Wait - delayed ACK frame
 Piggybacking

 Go-Back-N ARQ
 Go-Back-N ARQ - normal operation
 Go-Back-N ARQ - lost frame
 Go-Back-N ARQ - damaged/lost/delayed ACK

 Selective-Repeat ARQ
 Sender and receiver windows
 Selective Repeat ARQ - lost frame

STOP-AND-WAIT ARQ

3
12-10-2022

STOP-AND-WAIT ARQ

STOP-AND-WAIT ARQ

 Sender keeps a copy of the last frame until it receives an acknowledgement.


 Both data frames and acknowledgement (ACK) frames are numbered alternatively 0
and 1.
 Sender has a control variable (S) that holds the number of the recently sent frame. (0
or 1)
 Receiver has a control variable (R) that holds the number of the next frame expected
(0 or 1).
 Receiver send only positive ACK if the frame is intact.
 ACK number always defines the number of the next expected frame

4
12-10-2022

STOP-AND-WAIT, LOST ACK FRAME

STOP-AND-WAIT, LOST ACK FRAME

 If the sender receives a damaged ACK, it discards it.


 When the timer of the sender expires, the sender retransmits
frame 1.
 Receiver has already received frame 1 and expecting to
receive frame 0 (R=0). Therefore it discards the second copy
of frame 1.

5
12-10-2022

STOP-AND-WAIT, DELAYED ACK FRAME

PIGGYBACKING

 A method to combine a data frame with


ACK.
 Station A and B both have data to send.
 Instead of sending separately, station A
sends a data frame that includes an
ACK.
 Station B does the same thing.
 Piggybacking saves bandwidth.

6
12-10-2022

DISADVANTAGE OF STOP-AND-WAIT

 In stop-and-wait, at any point in time, there is only one frame that is


sent and waiting to be acknowledged.
 This is not a good use of transmission medium.
 To improve efficiency, multiple frames should be in transition while
waiting for ACK.
 Two protocol use the above concept,
 Go-Back-N ARQ
 Selective Repeat ARQ

GO-BACK-N ARQ

 Sender can send up to W frames before


worrying about ACKs.
 Sender keeps the copy of these frames until the
ACKs arrive.
 This procedure requires additional features to
be added to Stop-and-Wait ARQ.

7
12-10-2022

SEQUENCE NUMBERS

 Frames from a sender are numbered sequentially.


 We need to set a limit since we need to include the sequence
number of each frame in the header.
 If the header of the frame allows m bits, the sequence numbers
range from 0 to 2m – 1.
 for m = 3, sequence numbers are: 1, 2, 3, 4, 5, 6, 7.
 We can repeat the sequence number.
 Sequence numbers are:
0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, …

Sender Sliding Window


 At the sending site, to hold the outstanding
frames until they are acknowledged, the concept
of a window is used.
 The size of the window is at most 2m -1 where
m is the number of bits for the sequence
number.
 Size of the window can be variable.
 The window slides to include new unsent
frames when the correct ACKs are received

8
12-10-2022

Receiver Sliding Window


 Size of the window at the receiving
site is always 1 in this protocol.
 Receiver is always looking for a
specific frame to arrive in a specific
order.
 Any frame arriving out of order is
discarded and needs to be resent.
 Receiver window slides as shown in
fig. Receiver is waiting for frame 0 in
part a.

CONTROL VARIABLES

9
12-10-2022

CONTROL VARIABLES …

 Sender has 3 variables: S, SF and SL


 S holds the sequence number of recently sent frame
 SF holds the sequence number of the first frame
 SL holds the sequence number of the last frame
 Receiver only has the one variable, R, that holds the sequence
number of the frame it expects to receive. If the seq. no. is the
same as the value of R, the frame is accepted, otherwise
rejected.

ACKNOWLEDGEMENT

 Receiver sends positive ACK if a frame is arrived safe and in order.


 If the frames are damaged/out of order, receiver doesn’t respond and
discard all subsequent frames until it receives the one it is expecting.
 The silence of the receiver causes the timer of the unacknowledged frame
to expire.
 Then the sender resends all frames, beginning with the one with the
expired timer.
 For example, suppose the sender has sent frame 6, but the timer for frame
3 expires (i.e. frame 3 has not been acknowledged), then the sender goes
back and sends frames 3, 4, 5, 6 again.Thus it is called Go-Back-N-ARQ
 The receiver does not have to acknowledge each frame received, it can
send one cumulative ACK for several frames.

10
12-10-2022

11
12-10-2022

GO-BACK-N ARQ, NORMAL OPERATION

 The sender keeps track of the outstanding frames and updates the variables and windows as the
ACKs arrive.

12
12-10-2022

GO-BACK-N ARQ, LOST FRAME

GO-BACK-N ARQ, LOST FRAME

 Frame 2 is lost
 When the receiver receives frame 3, it discards frame 3 as it
is expecting frame 2 (according to window).
 After the timer for frame 2 expires at the sender site, the
sender sends frame 2 and 3. (go back to 2)

13
12-10-2022

GO-BACK-N ARQ, DAMAGED/LOST/DELAYED ACK

 If an ACK is damaged/lost, we can have two situations:


 If the next ACK arrives before the expiration of any timer, there is no need for
retransmission of frames because ACKs are cumulative in this protocol.
 If ACK1, ACK2, and ACK3 are lost, ACK4 covers them if it arrives before the timer
expires.
 If ACK4 arrives after time-out, the last frame and all the frames after that
are resent.
 Receiver never resends an ACK.
 A delayed ACK also triggers the resending of frames.

GO-BACK-N ARQ, SENDER WINDOW SIZE

14
12-10-2022

GO-BACK-N ARQ, SENDER WINDOW SIZE

 Size of the sender window must be less than 2 m.


 Size of the receiver is always 1.
 If m = 2, window size = 2 m – 1 = 3.
 Fig compares a window size of 3 and 4.

SELECTIVE REPEAT ARQ, SENDER AND


RECEIVER WINDOWS
 Go-Back-N ARQ simplifies the process at the receiver site.
 Receiver only keeps track of only one variable
 There is no need to buffer out-of-order frames, they are simply discarded.
 Go-Back-N ARQ protocol is inefficient for noisy link.
 It bandwidth inefficient and slows down the transmission.

 In Selective Repeat ARQ, only the damaged frame is resent.


 More bandwidth efficient but more complex processing at receiver.
 It defines a Negative ACK (NAK) to report the sequence number of a
damaged frame before the timer expires.

15
12-10-2022

SELECTIVE REPEAT ARQ - LOST FRAME

16
12-10-2022

SELECTIVE REPEAT ARQ - LOST FRAME

 Frames 0 and 1 are accepted


when received because they are in
the range specified by the receiver
window. Same for frame 3.
 Receiver sends a NAK2 to show
that frame 2 has not been
received and then sender resends
only frame 2 and it is accepted as
it is in the range of the window.

REFERENCES

 Computer Networks: A Systems Approach, Larry Peterson and Bruce Davie, 5th Ed, The Morgan
Kaufmann Series, Elsevier, 2011.
 Computer Networking: A Top-Down Approach Featuring the Internet, J. F. Kurose and K. W. Ross,
6th Ed., Pearson Education,2012.
 Data Communications and Networking, Behrouz A. Forouzan, McGraw Hill Education, 5th Ed., 2012
 TCP/IP Protocol Suite, Behrouz A. Forouzan, McGraw-Hill Education, 4 Ed., 2009
 Data and Computer Communications,William Stallings, Pearson Education,10th Ed,2013.

17

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy