A sliding window protocol is a feature of packet-based data transmission protocols, used where reliable in-order delivery of packets is required, such as in the data link layer (OSI layer 2) as well as in the Transmission Control Protocol (TCP).
Sending a batch of data, it's necessary that the receiver ensures it was received correctly. When the receiver checks the data, it sends an acknowledgment signal ("ACK") back to the sender to indicate it can send the next packet. In a simple automatic repeat request protocol (ARQ), the sender stops after every packet and waits for the receiver to ACK. This ensures packets arrive in the correct order, as only one may be sent at a time.
The time to receive the ACK signal may represent a significant amount of time compared to the time needed to send the packet. In this case, the overall throughput may be much lower than theoretically possible.
To address this, sliding window protocols allow a selected number of packets, referred to as the window, to be sent without having to wait for an ACK. Each packet receives a sequence number, and the ACKs send back that number. The protocol keeps track of which packets have been ACKed, and when they are received, sends more packets. In this way, the window slides along the stream of packets making up the transfer.
The sliding window method prevents the issue of traffic congestion on the network. The application layer will still be offering data for transmission to TCP without worrying about network traffic congestion as the TCP on sender and receiver side implement sliding windows of packet buffer. The window size may vary dynamically depending on network traffic.
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. If it is not, the protocol will limit the effective bandwidth of the link.
I've also recently bought two blue spruce for which to plant as a screen in the front yard to provide some psychological protection off from the mean streets, which had led to an annoying retail experience while buying them and having to fend off an aggressive Karen clerk. I decided to not plant those two trees because they would grow too big. And so I returned them, and they told me that they weren’t doing returns because corporate policy and due to Covid! After a minor spat and some back-and-forth bickering, i ended up showing them that it said right on the receipt that returns were “within four days” and he had to take them back; and which he did, apparently at his discretion. If you have never worked retail, on the other side of the counter as it were, you may not know this: as a rule they hate you.