This is data link layer as well as transport layer protocol which is used for flow control that is for controlling the number of data transmitted by sender such that it does not overflow the receiver side buffer.
The sender and receiver maintains a window of size n which reflects the number of data(frame and bytes respectively for data link and transport layer) which can be send and received by sender and receiver respectively.
Note:
- The size of sender and receiver window need not be same.
- If the sequence number in the header field is m, then the sequence number range in window is 2^m -1
There are some differences in windowing mechanism for data and transport layer:
- Sliding window of TCP is byte oriented where as for data link layer, its frame oriented.
- TCP’s sliding window is of variable size whereas for data link layer its fixed.
Working principle of sliding window:
Sender window:
Sliding window is an abstract concept that defines the range of sequence number that the sender and receiver come across during the communication.
Sender window defines or spans over the sequence number which can be send to the receiver or number of bytes which can be send to the receiver at a time without receiving an acknowledgement.
The value is dealt during two phase:
- During initiation and network convergence. During the initial session (only TCP-SYN packets are transmitted), a TCP three-way handshake occurs to determine the receiver’s link properties.
- During network convergence, in order to control the flow rate. The window size is either scaled or de-scaled to eliminate congestion/delay in the network.
Sender window size is the minimum of:
- The size configured on the sender side
- Receiver window size
- Congestion window size
This window is divided into four region starting from left:
- Bytes which is already send and acknowledged.
- Bytes which are send but not acknowledged.Bytes which can be sent but not received from above application
- Bytes which cannot be send till there is a buffer at the receiver side or cannot be used until window slides.
Receiver window:
This defines the number of data(frames or bytes) which can be received by the receiver buffer before it overflows and data are discarded.
Congestion window: It is the value determined by the network to avoid congestion.
Type of sliding window: There are two types of sliding window protocol:
- Go-Back-N ARQ- receiving window =1
- Selective repeat ARQ – sender n receiver window same
The concept is same in both as stated above but only difference lies what happens when there is a data lost or damaged In the case of Go-Back-N-ARQ, if the acknowledgment is not received for particular data, then the receiver will discard all the subsequent frames until it receive the one it is expecting as the size of window is 1.
In case of selective repeat ARQ, only the frames which is lost or damaged are re transmitted, good data are received and buffered.
Categories: Networking
Leave a Reply