Flow Control in Data Link Layer

Flow control in the data link layer is important because different nodes in the network have different capacities and transfer speeds; for the purpose of successful communication between these nodes, reliable flow control of data is very important. Let’s see how to manage the flow control through the data link layer.

Approaches To Flow Control

Flow Control can be handled through the following approaches.

Approaches To Flow Control

1. Feedback-based Flow Control: In these protocols, the sender sends frames to the receiver and then waits for an acknowledgment signal from the receiver. This approach is used in the data link layer.

2. Rate-based Flow Control: These kinds of protocols do not use any feedback or acknowledgment signals. These protocols have built-in mechanisms to limit or restrict the rate of data transmission from sender to receiver. This approach is mostly used in the network layer and the transport layer.

 Flow Control Protocols in Data Link Layer

There are basically two types of techniques used to control the flow of data. One for the Noiseless channel and the other for the Noisy Channel, as shown in the following figure.

Flow Control Protocols in Data Link Layer

1. Noiseless Channel Protocols

For Flow control of Noiseless channels, we assume an ideal channel where no frames are lost, corrupted, or duplicated. Protocols in flow control for Noiseless channels are of following two kinds

Noiseless Channel Protocols

i. Simplest Protocol

It is a very simple and easy-to-implement protocol. It is a unidirectional protocol in which data frames travel only from sender to receiver.

In the simplest protocol, the sender sends sequence numbers of frames without thinking about the receiver.  No concept of acknowledgment is used by the receiver.

The following figure explains all

Simplest Protocol

ii. Stop and Wait Protocol

In stop and wait, the sender sends one frame and waits for Acknowledgement (feedback) from the receiver. When the Acknowledgement arrives, the sender sends the next frame.

So, it is a half-duplex in direction, as shown in the following figure

Stop and Wait Protocol

The most important thing about stop and wait is that it does not use any timer. If the frame is lost after transmission, then the receiver has to wait for an infinite amount of time.

In the same way, if ACK is lost after transmission, then the sender has to wait for an infinite amount of time.

Stop and Wait Protocol

Note: If the speed of the sender is higher than that of the receiver, then frames must be stored until their use, and after consumption of the frame, feedback is compulsory in stop and wait.

2. Noisy Channels Protocols

For Flow Control of a Noisy channel, we assume a non-ideal channel where frames are lost, corrupted, or duplicated. There are two Protocols in flow control for noisy channels are 

Noisy Channels Protocols

i. Stop and Wait for the ARQ protocol

  • The sender sends a frame and waits for acknowledgment. Once the receiver receives the frame, it sends an acknowledgment frame back to the sender.
  • On receiving the acknowledgment frame from the receiver, the sender understands that the receiver is ready to accept the next frame, and then it transmits the next frame.

Stop and Wait for the ARQ protocol

All possible scenarios of this protocol are explained under

Stop and Wait for the ARQ protocol

What is more important in Stop and Wait ARQ is that it uses the timer. If the acknowledgment is not received in some period of time, then timer-out, and the sender again retransmit that frame.

The concept of timer is not used in Stop and wait of Noiseless channel protocols.

ii. Sliding Window ARQ Protocol

In the sliding window, both sender and receiver agree on the number of data frames after which the acknowledgment signal should be sent. So, the sender and receiver can interchange multiple frames without acknowledgment. It receives the frames in the sequence of IN-ORDER. The sliding window follows the rule of pipelining.

It has two types

A). Go Back to N

  • Both the sender and the receiver have finite-sized buffers, which is called window size.
  • The number of frames to be sent depends upon the window size of the sender.
  • When the sending buffer is full, it waits for acknowledgment, which will be received after the receiving buffer is full.
  • If the acknowledgment of a frame is not received within an agreed period of time, then all frames in the current window are retransmitted.

Note: In go back N, the N is the window size

Example

For example, suppose there are 11 frames required for transmitting, and the sender window size is 4 (22 bits). Then the sequence number will be 0,1,2,3, 0,1,2,3, 0, 1 and 2. The number of bits in sequence number is 2 to generate the binary sequence 00, 01, 10, 11.

Let’s explain this example through the following steps

Step 1: 11 frames (0-10), window size, sender and receiver are shown below

Go Back to N - Step 1

Step 2: After sending all frames equal to window size, Sender waits for ACK from the receiver of the first frame (i.e., 0).

Go Back to N - Step 2

Step 3: After receiving the ACK, the Sliding window moves one position next and transmits frame 4, and frame No.4 is transmitted.

Go Back to N - Step 3

Step 4: After transmission of frame No.4, Sender waits for ACK from the receiver of the Second frame (i.e., 1).

Go Back to N - Step 4

Step 5: After receiving ACK for Frame No.1, the, the Sender transmits the next Frame No.5 by moving the sliding window one position next and so on.

Go Back to N - Step 5

Problem with GO BACK N: Successfully transmitted frames may require retransmitting.

Example: Suppose the following situation where ACK of frame No 2 is lost. At this time, the sliding window holds frames No 2, 3, 4, and 5.

Problem with GO BACK N

All these frames (2, 3, 4, and 5) are retransmitted even though frames 4 and 5 have already been transmitted.

Problem with GO BACK N- last step

 B). Selective Repeat ARQ

It works just like GO BACK N ARQ, but In Selective repeat ARQ, only the lost frames are retransmitted, while the correct frames are not re-transmitted.

It sends the negative ACK for missing or damaged frames so that it can be re-transmitted.

As the NACK of frame No.2 is received, only the damaged frame no 2 is re-transmitted.

So, it is the solution of GO Back N, where correct frames were also retransmitted. The following diagram explains all.

Selective Repeat ARQ

Flow Control Protocols Numerical

Numerical flow control protocols are mainly required to calculate efficiency. Before efficiency calculation, let’s learn all the basic factors in protocols.

Stop and Wait

Go Back N Selective Repeat
Only one frame can transmit at a time Multiple frame transmissions at a time Multiple frame transmissions at a time
Sender window size =1 Sender window size = 2K-1 Sender window size = 2K-1
Receiver window size =1 Receiver window size =1 Receiver window size = 2K-1

Note: K is the number of bits to represent the window size.

To find the Efficiency of any protocol, use any of the following formula

Flow Control Protocols Numerical