Sliding window protocol

The paradigm is similar to a window sliding sideways to allow entry of fresh packets and reject the ones that have already been acknowledged.

In a simple automatic repeat request protocol (ARQ), the sender stops after every packet and waits for the receiver to ACK.

The term window on the transmitter side represents the logical boundary of the total number of packets yet to be acknowledged by the receiver.

The TCP header uses a 16 bit field to report the receiver window size to the sender.

The sliding window method ensures that traffic congestion on the network is avoided.

The application layer will still be offering data for transmission to TCP without worrying about the network traffic congestion issues as the TCP on sender and receiver side implement sliding windows of packet buffer.

For the highest possible throughput, it is important that the transmitter is not forced to stop sending by the sliding window protocol earlier than one round-trip delay time (RTT).

The limit on the amount of data that it can send before stopping to wait for an acknowledgment should be larger than the bandwidth-delay product of the communications link.

In this case, the receiver must acknowledge the retransmission to prevent the data being continually resent, but must otherwise ignore it.

That is: Whenever the transmitter has data to send, it may transmit up to wt packets ahead of the latest acknowledgment na.

In the absence of a communication error, the transmitter soon receives an acknowledgment for all the packets it has sent, leaving na equal to nt.

If this does not happen after a reasonable delay, the transmitter must retransmit the packets between na and nt.

Techniques for defining reasonable delay can be extremely elaborate, but they only affect efficiency; the basic reliability of the sliding window protocol does not depend on the details.

(The acknowledgment may also include information about additional packets received between nr and ns, but that only helps efficiency.)

Note that there is no point having the receive window wr larger than the transmit window wt, because there is no need to worry about receiving a packet that will never be transmitted; the useful range is 1 ≤ wr ≤ wt.

The additional insight is that the receiver does not need to distinguish between sequence numbers that are too low (less than nr) or that are too high (greater than or equal to ns+wr).

As it is common to have wr

Thus, N = 2 possible sequence numbers (conveniently represented by a single bit) are required.

The most general case of the sliding window protocol is Selective Repeat ARQ.

This requires a much more capable receiver, which can accept packets with sequence numbers higher than the current nr and store them until the gap is filled in.

The advantage, however, is that it is not necessary to discard following correct data for one round-trip time before the transmitter can be informed that a retransmission is required.

The window size wr need only be larger than the number of consecutive lost packets that can be tolerated.

The extremely popular HDLC protocol uses a 3-bit sequence number, and has optional provision for selective repeat.

However, if selective repeat is to be used, the requirement that wt+wr ≤ 8 must be maintained; if wr is increased to 2, wt must be decreased to 6.

Suppose that wr =2, but an unmodified transmitter is used with wt =7, as is typically used with the go-back-N variant of HDLC.

Sequence numbers modulo 4, with w r =1. Initially, n t = n r =0