A sliding window protocol is a feature of packet-based data transmission
protocols. Sliding window protocols are used where reliable in-order
delivery of packets is required, such as in the Data Link Layer (OSI
model) as well as in the Transmission Control Protocol (TCP).
Conceptually, each portion of the transmission (packets in most data
link layers, but bytes in TCP) is assigned a unique consecutive sequence
number, and the receiver uses the numbers to place received packets in
the correct order, discarding duplicate packets and identifying missing
ones. The problem with this is that there is no limit of the size of the
sequence numbers that can be required.
By placing limits on the number of packets that can be transmitted or received at any given time, a sliding window protocol allows an unlimited number of packets to be communicated using fixed-size sequence numbers.
By placing limits on the number of packets that can be transmitted or received at any given time, a sliding window protocol allows an unlimited number of packets to be communicated using fixed-size sequence numbers.
Working :
When used as the protocol for the delivery of messages, the sending process continues to send a number of frames specified by a window size even after a frame loss. Unlike Go-Back-N ARQ, the receiving process will continue to accept and acknowledge frames sent after an initial error; this is the general case of the sliding window protocol with both transmit and receive window sizes greater than 1.
The receiver process keeps track of the sequence number of the
earliest frame it has not received, and sends that number with every acknowledgement
(ACK) it sends. If a frame from the sender does not reach the receiver,
the sender continues to send subsequent frames until it has emptied its
window. The receiver continues to fill its receiving window with
the subsequent frames, replying each time with an ACK containing the
sequence number of the earliest missing frame. Once the sender has sent all the frames in its window, it re-sends the frame number given by the ACKs, and then continues where it left off.
The size of the sending and receiving windows must be equal, and half
the maximum sequence number (assuming that sequence numbers are
numbered from 0 to n−1) to avoid mis-communication in all cases of
packets being dropped. To understand this, consider the case when all
ACKs are destroyed. If the receiving window is larger than half the
maximum sequence number, some, possibly even all, of the packages that
are resent after timeouts are duplicates that are not recognized as
such. The sender moves its window for every packet that is acknowledged
Video explanation :
0 comments:
Post a Comment