Flow Control is another important function of data link layer.
Flow Control refers to a set of procedure that tells the sender how much data it can transmit before waiting for acknowledgement from receiver.
Purpose of Flow Control:
§ Any receiving device has a limited speed at which it can process incoming data and also a limited amount of memory to store incoming data.
§ If the source is sending the data at faster rate than the capacity of receiver, there is a possibility of receiver being swamped.
§ The receiver will keep losing some of the frames simply because they are arriving too quickly.
§ Therefore, receiving device must have some mechanism to inform the sender to send fewer frames or stop transmission temporally.
§ In this way, flow control will control the rate of frame transmission.
Methods of Flow Control:
There are two methods or protocols that are used to implement flow control.
§ Stop and Wait Protocol or Method
§ Sliding Window Protocol or Method
Stop and Wait Protocol or Method
§ In this method of flow control, the sender sends a single frame to receiver and waits for an acknowledgement
§ The next frame is sent by the sender only when acknowledgement of previous frame is received.
§ This process of sending a frame and waiting for an acknowledgement continuous as long as the sender has data to send.
§ To end up the transmission sender transmits End of Transmission (EOT).
§ The main advantage of stop and wait protocol, is its accuracy.
§ Next frame is transmitted only when the first frame is acknowledged.
§ So, there is no chance of frame being lot.
§ The main disadvantage of this method is that it is inefficient.
§ It makes the transmission process slow.
§ In this method frame travels from source to destination and single acknowledgement travels from destination to source.
§ As a result, each frame send and receive uses the entire transmission time.
Sliding Window Protocol or Method
§ This method over comes the limitation of stop and wait mechanism.
§ It is universally adopted method.
§ In this mechanism, the frames are transmitted one after the another without waiting for acknowledgement
§ It contains a sliding window refers to an imaginary boxes that holds the frames on both sender and receiver side.
§ Sliding Window has the limit on maximum how many frames can be transmitted.
§ It contains number system telling up to which number of frames are received properly.
§ Each data frame is identified by a sequence number.
§ The window has a specific size in which the frames are number.
§ If the size of window is n then the frames are numbers from 0 to n-1.
§ The number of frames which can stay at a time in window is known as size of window.
§ Its typical value is 7 that most of the windows have their size 7 and 7 frames may stay in it.
§ But its size can be less or more depending on the frame size of sender.
§ It means if the size is 7 then maximum of 7 frames can be sent before an acknowledgement.
§ The sliding window of the sender shrinks from left when frames of data are sent.
§ The sliding window of sender expands to right when acknowledgement received.
§ The sliding window of the receiver shrinks from left when frames of data are received and expands to right when acknowledgement is sent.