Professional Documents
Culture Documents
Flow Control is one important design issue for the Data Link Layer that controls the flow of data between sender and
receiver.
In Communication, there is communication medium between sender and receiver. When Sender sends data to receiver
than there can be problem in below case :
1) Sender sends data at higher rate and receive is too sluggish to support that data rate.
To solve the above problem, FLOW CONTROL is introduced in Data Link Layer. It also works on several higher layers.
The main concept of Flow Control is to introduce EFFICIENCY in Computer Networks.
Approaches of Flow Control
Feed back based Flow Control is used in Data Link Layer and Rate based Flow Control is used in Network Layer.
1. TIMER, if sender was not able to get acknowledgment in the particular time than, it sends the buffered data once
again to receiver. When sender starts to send the data, it starts timer.
2. SEQUENCE NUMBER, from this the sender sends the data with the specific sequence number so after receiving
the data, receiver sends the data with that sequence number, and here at sender side it also expect the
acknowledgment of the same sequence number.
This type of scheme is called Positive Acknowledgment with Retransmission (PAR).
1. Sender first start sending the data and receiver start sending data after it receive the data.
2. Receiver and sender both start sending packets simultaneously,
First case is simple and works perfectly, but there will be an error in the second one. That error can be like duplication of
the packet, without any transmission error.
The problem with pipelining is if sender sending 10 packets, but the problem occurs in 8th one than it is needed to resend
whole data. So the protocol called Go back N and Selective Repeat were introduced to solve this problem.In this protocol,
there are two possibility at the receiver’s end, it may be with large window size or it may be with window size one.
The window size at the receiver end may be large or only of one. In the case of window size is one at the receiver, as we
can see in the figure (a), if sender wants to send the packet from one to ten but suppose it has error in 2nd packet, so
sender will start from zero, one, two, etc. here we assume that sender has the time out interval with 8. So the time out will
occur after the 8 packets, up to that it will not wait for the acknowledgment. In this case at the receiver side the 2nd packet
come with error, and other up to 8 were discarded by receiver. So in this case the loss of data is more.
Whether in the other case with the large window size at receiver end as we can see in the figure (b) if the 2nd packet
comes with error than the receiver will accept the 3rd packet but it sends NAK of 2 to the sender and buffer the 3rd
packet. Receiver do the same thing in 4th and 5th packet. When the sender receiver the NAK of 2nd packet it immediately
send the 2nd packet to the receiver. After receiving the 2nd packet, receiver send the ACK of 5th one as saying that it
received up to 5 packet. So there is no need to resend 3rd , 4th and 5th packet again, they are buffered in the receiver side.
iii. A Protocol Using Selective Repeat
Protocol using Go back N is good when the errors are rare, but if the line is poor, it wastes a lot of bandwidth on
retransmitted frames. So to provide reliability, Selective repeat protocol was introduced. In this protocol sender starts it's
window size with 0 and grows to some predefined maximum number. Receiver's window size is fixed and equal to the
maximum number of sender's window size. The receiver has a buffer reserved for each sequence number within its fixed
window.
Whenever a frame arrives, its sequence number is checked by the function to see if it falls within the window, if so and if
it has not already been received, it is accepted and stored. This action is taken whether it is not expected by the network
layer.
Here the buffer size of sender and receiver is 7 and as we can see in the figure (a), the sender sends 7 frames to the
receiver and starts timer. When a receiver gets the frames, it sends the ACK back to the sender and it passes the frames to
the Network Layer. After doing this, receiver empties its buffer and increased sequence number and expects sequence
number 7,0,1,2,3,4,5. But if the ACK is lost, the sender will not receive the ACK. So when the timer expires, the sender
retransmits the original frames, 0 to 6 to the receiver. In this case the receiver accepts the frames 0 to 5 (which are
duplicated) and send it to the network layer. In this case protocol fails.
To solve the problem of duplication, the buffer size of sender and receiver should be (MAX SEQ + 1)/2 that is half of the
frames to be send. As we can see in fig(c ), the sender sends the frames from 0 to 3 as it's window size is 4. Receiver
accepts the frames and sends acknowledgment to the sender and passes the frames to the network layer and increases the
expected sequence number from 4 to 7. If the ACK is lost than sender will send 0 to 3 to receiver again but receiver is
expecting to 4 to 7, so it will not accept it. So this way the problem of duplication is solved.