What is Flow Control?

Author:

Flow control, in technical terms, is a methodology that allows two stations operating at different rates to interact with one another. For example, when a high-speed station provides data, flow control gets involved to ensure that the high speed does not affect the slow receiver, resulting in efficient data transmission. 

When a sender delivers data to a receiver, the receiver gets the data in a network. The operation may appear straightforward to us, but the systems may encounter a significant hurdle if the pace at which the incoming data arrives is incompatible with the receiver’s speed. This anomaly will result in substantial data loss.

In this scenario, flow control saves the day by controlling the speed and ensuring that the data is supplied at a rate that the receiver can understand and receive without difficulty.

Flow control in the data link layer limits the number of frames a sender can send before waiting for a response from the receiver.

What Does Flow Control do?

As previously stated, flow control is a mechanism that ensures that the receiver does not experience data loss due to speed disparities between them and the sender.

It is a mechanism that allows two stations that are operating and processing at different speeds to communicate with one another simply. 

Flow control at the Data Link Layer essentially limits and coordinates the number of frames or quantity of data that a transmitter can send before waiting for an acknowledgement from the receiver. It is a series of procedures instructing the transmitter on how much data or frames it can move or broadcast before data overloads the receiver.

However, managing the speed is not only the responsibility of flow control. The receiver’s equipment must have enough storage space to hold the incoming data when receiving data.

However, the sender is unlikely to be aware of the receiver’s storage space. Their responsibility is to ensure that the requested data is sent. As a result, when data of greater size arrives at the receiver, the receiver suffers a significant loss. 

It ensures that this scenario does not occur and that data loss is avoided.

The receiving device likewise has limited speed and memory for storing data. This is why the receiving device should be able to alert or inform the sender about temporarily pausing data transmission or transfer before it approaches a limit. It also requires a buffer, which is a massive block of memory used to store data or frames until they are processed simply. 

Approaches of Flow Control 

There are generally two types of approaches when it comes to flow control. They are as follows:

Feedback–Based Flow Control 

In feedback-based flow control, the sender station delivers data or frame information to the receiving station. This informs the receiving station of the size and speed with which the data will be transmitted.

The receiver transmits data back to the sender after receiving it. The data transmitted by the receiver to the sender includes information about how the receiver processes data and whether it is ready to accept a specific amount of data.

Rate-Based Flow Control

The rate-based flow control uses an inbuilt mechanism to alert the sender.

When the sender delivers data to the receiver, and the receiver is unable to receive it at that high rate, the built-in mechanism kicks in and limits or restricts the overall rate at which the data is arriving. Unlike the feedback-based technique, this one does not necessitate any specific acknowledgement from the sender.

What is Network Flow Control?

The flow control in the network layer is the same as the flow control in the data link layer, except that the flow control in the network layer is used to monitor data transit among multiple networks.

The objective of this process is to control the rate of data transfer between the two nodes. If the speed cannot be managed, the data transmission process becomes extremely slow, and the recipient experiences speed constraints when receiving the data. 

We employ flow control strategies for data transfer to prevent overflow at the receiver’s end.

Techniques of Flow Control

To control the flow of data, two techniques are worth knowing to understand flow control more naturally: 

Stop-and-Wait Flow Control 

The stop-and-wait flow control transmits a request and then waits for an acknowledgement from the receiver.

Basically, the message or information is broken down into multiple frames in this approach, and the receiver indicates their status to receive each frame of data. The sender will only send the data to the receiver after getting the acknowledgement.

This cycle is repeated until the sender sends an EOT (End of Transmission) frame. Only one frame can be transmitted at a time using this method. If the propagation delay is substantially longer than the transmission delay, it results in inefficiency or lower production.

Transmission Time(Td)

Transmission delay (Td) is the length of time it takes for the sender to deliver all of the bits in a frame onto the cable. This is obtained by multiplying the data size by the bandwidth of the data transmission channel.

Td = D / B

Where,

D is the data size 

B is the bandwidth of the channel

Propagation Delay(Tp) 

Propagation delay is the time it takes for the last bit in a frame to go from one side to the other. It’s computed by multiplying the wave propagation speed by the sender’s and receiver’s distances.

Tp = d / s ;

Where,

d is the distance between sender and receiver

s is the wave propagation speed.

The propagation delay for sending the data frame and the acknowledgement frame is the same as the distance, and the speed for both frames will remain constant. Hence, the total time needed to transmit a frame is:

Total time= Td (Transmission Delay) + Tp (Propagation Delay for data frame) + Tp (Propagation Delay for acknowledgment frame)

Efficiency = Useful Time/ Total Time

η=Td / (Td+2Tp)

Pros:

  • This procedure is effortless, and each of the frames is thoroughly checked and acknowledged.
  • It can also filter out noise in busy channels.
  • This procedure is also quite precise.

Cons:

  • This procedure is somewhat slow.
  • Only one packet or frame can be sent at a time in this case.
  • It is inefficient and slows down the transmission process.

Sliding Window Flow Control 

Sliding Window Flow Control is a point-to-point protocol that ensures no other entity attempts to intervene until the present data or frame transmission is complete. Before receiving any acknowledgement, the sender transmits or sends various frames or packets using this method.

In this approach, the sender and receiver first agree on the total amount of data frames to be transferred, and an acknowledgement is delivered to allow the sending process to begin. 

The Data Link Layer requires and uses this approach, which allows the sender to have more than one unacknowledged packet “in-flight” simultaneously. This enhances and increases network throughput.

Pros:

  • It outperforms stop-and-wait flow control significantly.
  • This strategy boosts efficiency.
  • Multiple frames can be sent in succession.

Cons:

  • The fundamental difficulty is the complexity at the sender and receiver due to the transfer of many frames.
  • Out of the sequence, the receiver may get data frames or packets.

Conclusion

Developers must understand the flow control mechanism to understand how data is transferred across networks. We hope you have a better knowledge of how it works and its significance in data transfer and transmission.

New to code? 

If you’re new to software development, then try our free 5 Day Coding Challenge. In this short course, you will learn the basics of HTMLCSS and JavaScript. It takes just one hour a day over five days. Register now through the form below. Alternatively, if you want to learn full-stack software development, read more about our programme here.

What is an AI Developer & How to Become One?

Right now, the world is witnessing an artificial intelligence technological revolution, and AI Developers are at the forefront. AI developers are those who design, develop, and deploy AI-powered solutions. They are shaping the technological future by creating intelligent systems and applications. We look into the world of AI developers, exploring their roles, skills, and the […]

Systems Analyst: A Guide 

A system analyst looks after a company’s computer systems and network and ensures they meet its goals. They ensure that the infrastructure, computers and other systems work efficiently.  Who do you think takes care of all the systems in a company and plans everything out for a firm to meet its needs? Who do you […]

What Does a .NET Developer Do & How to Become One?

.NET developers are essential in the realm of software development. They are in charge of planning, creating, testing, and managing software applications built with the Microsoft .NET framework. As a result, they are in high demand and can command substantial wages in the tech business. In this blog, we will look at what a .NET developer […]