Sliding Window Protocol is a flow control and error control technique that allows a sender to transmit multiple frames before waiting for acknowledgments. It improves network utilization by keeping multiple frames in transit at the same time.
- Allows multiple frames to be sent before receiving acknowledgments.
- Improves throughput and makes better use of the available bandwidth, especially on high-delay networks.
Working
Sliding Window Protocol allows the sender to send multiple packets before waiting for acknowledgments. The sender maintains a window of packets that can be sent at a time.
For example, with a window size of 4:
- The sender can send packets 0, 1, 2, and 3 without waiting for an acknowledgment.
- When an acknowledgment for packet 0 is received, the window moves forward.
- Packet 4 can then be sent, keeping multiple packets in transit.
This process improves network utilization and throughput by reducing the time spent waiting for acknowledgments.
Terminologies Related to Sliding Window Protocol
1. Transmission Delay (Tt): Time required to place all the bits of a packet onto the communication link.
2. Propagation Delay (Tp): Time taken by the first bit of a packet to travel from the sender to the receiver.
3. Efficiency: Efficiency shows how effectively the communication link is being used for data transmission.
For Stop-and-Wait:
4. Effective Bandwidth(EB) or Throughput: Throughput is the amount of data successfully transmitted through the network per second.
Throughput = Efficiency x Bandwidth
5. Capacity of link: Link capacity is the maximum amount of data that can be present in the link at a given time.
Capacity = Bandwidth x Tp
For a full-duplex channel:
Capacity = 2 x Bandwidth x Tp
Concept of Pipelining
In Stop and Wait , the sender sends one packet and waits for its acknowledgment before sending the next packet. This leaves the communication link idle during the waiting time.
Pipelining allows the sender to transmit multiple packets before receiving their acknowledgments, keeping the link busy and improving network utilization.

Example
Suppose the transmission time Tₜ = 1 ms and the propagation time Tₚ = 1.5 ms.
- With a window size of 4, the sender can transmit packets 0, 1, 2, and 3 without waiting for individual acknowledgments.
- The acknowledgment for packet 0 takes 2Tₚ = 3 ms to make the round trip.
- By the time the acknowledgment arrives, multiple packets have already been transmitted.
For comparison, Stop-and-Wait would take:
Tt ​+ 2Tp ​= 1 + 3 = 4 ms
This shows why pipelining can use the communication link more efficiently.
Window Sliding and Sequence Numbers
When an acknowledgment for packet 0 is received, the sender's window moves forward. The next packet can then be sent using the newly available position in the window.

After receiving ACK for packet 0, the window moves forward and the sender can transmit a new packet. Sequence numbers are reused after the previous packets have been acknowledged.
Minimum Number of Bits For Sender Window
Each packet in the sender window is assigned a sequence number. The maximum window size is:
Maximum Window Size = 1 + 2a
where,
The number of bits required to represent the window is:
Bits = [log2​(1+2a)]
If the sequence number field has N bits, it can represent 2N sequence numbers.
Therefore, the actual window size is limited by both the calculated window size and the available sequence numbers:
Window Size = min(1+2a, 2N)
Types of Sliding Window Protocol
There are two commonly used types of Sliding Window Protocol:
- Go-Back-N ARQ: The sender can send multiple frames before receiving acknowledgments. If a frame is lost or damaged, that frame and all following frames in the current window are retransmitted.
- Selective Repeat ARQ: The sender can send multiple frames before receiving acknowledgments. If a frame is lost or damaged, only that frame is retransmitted.