Sliding window protocol is used where a reliable transmitting of frame is required. It relies on packeting the frame queue to a definable window size which is provided to sender and receiver. Sliding window protocol defines maximum transmitter window size, Ws which is always one less than the sequence number. How transmitter window is defined:
It is contains the data that are ready to be send. The lower limit in transmitter window which is waiting for acknowledgement is Slast .The upper limit frame in transmitter window is Slast + ws -1.Also each transmitted frame is allocated by a timer that when itès expire sender determines to retransmit that frame. On the other side, receiver pointer is pointing to the next expecting frame by Rnext. R next goes forward by each error free frame. To have an accurate transitions receiver request this has to be established: Rnext Slast let’s say sLast is 2 it means the last frame, sender has send is 2 so receiver should request next one which is 3. If assume there is 8 sequence numbers N=0, 1, 2,3,4 so the size of transmitter sliding window is (2N -1). Receiver is not going to get frame 7 till sender get the “Ack” of frame 0 otherwise if we send all 0 to 4 and by the accident sender could not get the”Ack” of frame 0 when the timer expires frame 0 will be retransmitted and since receiver’s window is pointing to the next 0-4 frames and expecting new frame 0, is going to take it as the new frame0 which is in the wrong place. Duplicate is happened. The diagram is providing on next page shows different steps while a window with the size of 3 frames is transmitted meanwhile frame 0 acknowledgment has lost on the way to sender. That’s why if we have one less size for the sliding window always there is frame 4 which in the situation of lost Ack it helps the receiver to determine this is an old frame 0.