"Sliding-Window" protocol
By allowing the sender to transmit multiple packets before waiting for an ACK, "sliding window" overcomes the the shortcoming of "stop-n-wait" protocol which wastes network bandwidth. "sliding window" protocol supports reliable and efficient transmission between nodes, and it also obtains higher throughput than that of "stop-n-wait" protocol.
2. How this protocol works..
1) Normal operation
![]() |
The basic idea behind "sliding window" is to send multiple packets
without waiting for ACK. The number of packets which are sent at a time
is called 'window size'.
In this way, "sliding window" guarantees more efficient transfer while
it provides reliable transfer either.
|
2) Timeout
![]() |
If there is packet loss or ACK loss, the sender retransmits the whole
packets start from the lost packet..
This mechanism is known as "Go-Back-N". |
3. How it is shown in nam (network animator)..
"sliding-window" protocol can be shown as follows
in nam.
1. Sender sends 4 packets which is window size to the receiver and receives 4 ACKs. |
![]() |
2. Sender sends next 4 packets and receives 4 ACKs. |
3. Sender will send next 4 packets.. |
Here is ns script for this simulation. You can downloadns script and nam file and run it by yourself.
4. Shortcoming
As the performance of "sliding window" protocol depends on the window size and the speed at which the network accepts packets, in an environment where the traffic amount is not constant, it could have poor performance and even it could drive network to collide. To avoid and provide end-to-end flow control, "slow start" protocol can be suggested. The detail comparison will be discussed with an example here.