A sliding window is also known as windowing. A sliding window is a method for controlling sending data packets between two network devices where dependable and sequential delivery of data packets is needed, such as using the Data Link Layer (OSI model) or Transmission Control Protocol (TCP).
In the sliding window technique, each data packet (for most data link layers) and byte (in TCP) includes a unique consecutive sequence number used by the receiving computer to place data in the correct order. The objective of the sliding window technique is to use the sequence numbers to avoid duplicate data and to request missing data.
Following are the two types of Sliding Window Protocol −
Go-Back-N Automatic Repeat Query (ARQ) protocol is also referred to as Go-Back-N Automatic Repeat Request. It is a data link layer protocol that helps a sliding window method. In this, if any frame is manipulated or lost, all subsequent frames have to be sent again.
For example, in GO- Back –N, the N is the sender’s window size; if it is GO-Back-5, the sender will send frame 1 to 5 before receiving the knowledge of frame 1.
All the frames are numbers to deal with the most and duplicate frames. If the sender does not receive the receiver’s acknowledgement, then all the frames available in the current window will be retransmitted.
The design of the Go-Back-N protocol is shown below −
Selective Repeat ARQ is also referred to as the Selective Repeat Automatic Repeat Request. It is a data link layer protocol that facilitates a sliding window method. The Goback-N ARQ protocol operates well if it has fewer errors.
In this protocol, the sender window size is always similar to the size of the receiver window. The size of the sliding window is continually greater than 1.
If the receiver obtains a corrupt frame, it does not directly remove it. It sends a negative acknowledgement to the sender. The sender sends that frame again immediately, receiving a negative acknowledgement. There is no waiting for any time-out to share that frame.
The structure of the Selective Repeat ARQ protocol is demonstrated below −