In a network, the sender sends the data and the receiver receives the data. But suppose a situation where the sender is sending the data at a speed higher than the receiver is able to receive and process it, then the data will get lost. Flow-control methods will help in ensuring this. The flow control method will keep a check that the senders send the data only at a speed that the receiver is able to receive and process. So, let's get started with the blog and learn more about flow control.
Flow control tells the sender how much data should be sent to the receiver so that it is not lost. This mechanism makes the sender wait for an acknowledgment before sending the next data. There are two ways to control the flow of data:
It is the simplest flow control method. In this, the sender will send one frame at a time to the receiver. Until then, the sender will stop and wait for the acknowledgment from the receiver. When the sender gets the acknowledgment then it will send the next data packet to the receiver and wait for the acknowledgment again and this process will continue. This can be understood by the diagram below.
Suppose if any frame sent is not received by the receiver and is lost. So the receiver will not send any acknowledgment as it has not received any frame. Also, the sender will not send the next frame as it will wait for the acknowledgment for the previous frame which it had sent. So a deadlock situation can be created here. To avoid any such situation there is a time-out timer. The sender will wait for this fixed amount of time for the acknowledgment and if the acknowledgment is not received then it will send the frame again.
There are two types of delays while sending these frames:
Td = D / B
Tp = d / s ; where d = distance between sender and receiver, s = wave propagation speed
The propagation delay for sending the data frame and the acknowledgment frame is the same as distance and speed will remain the same for both frames. Hence, the total time required to send a frame is
Total time= Td(Transmission Delay) + Tp(Propagation Delay for data frame) + Tp(Propagation Delay for acknowledgment frame)
The sender is doing work only for Td time and for the rest 2Tp time the sender is waiting for the acknowledgment.
Efficiency = Useful Time/ Total Time
η=Td / (Td+2Tp)
As we saw that the disadvantage of the stop and wait protocol is that the sender waits for the acknowledgment and during that time the sender is idle. In sliding window protocol we will utilize this time. We will change this waiting time into transmission time.
A window is a buffer where we store the frames. Each frame in a window is numbered. If the window size is n then the frames are numbered from the number 0 to n-1. A sender can send n frames at a time. When the receiver sends the acknowledgment of the frame then we need not store that frame in our window as it has already been received by the receiver. So, the window in the sender side slides to the next frame and this window will now contain a new frame along with all the previous unacknowledged frames of the window. At any instance of time window will only contain the unacknowledged frames. This can be understood with the example below:
Using sliding window protocol, the efficiency can be made maximum i.e. 1. In sliding window protocol we are using the propagation delay time also for the transmission. For doing this we the sender should be sending the data frame all the time i.e for Td+2Tp time. So, what should be the number of packets such that the efficiency is maximum?
We will apply a simple unitary method to find this. In Td units of time, we can send one packet. So in one unit of time, we can send 1/Td packets. We have total time as Td+2Tp. Therefore, in Td+2Tp time we can send (Td+2Tp)/Td packets. Let a=Tp/Td. So, if we send 1+2a packets then the efficiency is 1.
Td units of time → 1 packet transmitted
1 unit of time → (1/ Td) packet transmitted
Td + 2Tp units of time → (Td + 2Tp) / Td packets transmitted
This is how the flow of data is controlled using the above two mechanisms. Hope you learned something new today.
Do share this blog with your friends to spread the knowledge. Visit our YouTube channel for more content. You can read more blogs from here .
Keep Learning :)
Team AfterAcademy!
Flow control is defined, in its broad sense, as a synchronization protocol that dictates the advance of information from a sender to a receiver. Flow control determines how resources in a network are allocated to packets traversing the network. First, basic definitions and types of flow control are introduced. Then, differentiation between flow control and switching is highlighted. Finally, basic flow control mechanisms are described and briefly compared.
Usually, the sender needs to transmit information to the receiver....
The company is the world’s best bronze satin finish, stamped stainless steel sheet supplier, brass satin finish supplier. We are your one-stop shop for all needs. Our staff are highly-specialized and will help you find the product you need.