Sliding windows protocol works as follows:
- Sender sends a fixed number of frames without acknowledgments.
- Each frame is labelled with a sequence number.
- On getting acknowledgments from the receiver.
- Sender sends more frames.
- Each acknowledgement is labelled with a respective frames sequence number.
Precautions:
There should not be duplicate sequence numbers.
Example of Sliding window protocol;
Window size is 7.
Sender can transmit 7 frames without acknowledgement.
Frame no. 1,2,3,4,5,6,7.
1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 |
Now sender transmit 4 frames and received an acknowledgment that thefirst 3 frames are successfully received.
1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 |
The window will slide forward by three frames.
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
Now sender will cover next 7 frames.
Frame no. 4,5,6,7,8,9,10.
Which looks like windows is sliding from left to right.