CS 513/EE 506 Introduction to Local and Wide Area Networks
WPI, Fall 1999
Craig E. Wills
Sliding Window Protocols
- Frames are numbered.
- Lost frames can be retransmitted.
- Duplicate frames can be deleted.
- Out of order frames can be reordered.
The sender maintains two variables:
-
the number of the ``oldest'' frame sent, but not ACK'ed. -
the number of the next frame to send that has not ever been
sent. -
the size of the sender's window (the number of sending
buffers needed)
The receiver maintains two variables:
-
lowest numbered frame the receiver is willing to accept -
one more than the highest numbered frame the receiver is
willing to accept. -
size of receiver's window.
Rough algorithm of the sliding window protocols:
- Transmit all frames in the sender's window (no more than from
to
) - Whenever the receiver gets a frame in its window:
- it generates an ACK for the highest frame correctly received (same as
the frame for protocol 5).
- if the frame
has been received it passes
to the host and
bumps
and
(advances the window).
- Whenever the receiver gets a damaged frame or a frame not within its
window it generates a NAK for one less than the frame expected (
)
(only for protocol 6). - Whenever the sender receives an ACK for a frame within its window, it
marks that frame as having been correctly sent and received. If
is
ACKed then increment
and
(advance the sender's window) and
transmit
(last previously unsent frame). - Whenever a timer goes off, retransmit the corresponding frame.
Sequence numbers:
,
Steady state condition:
Interval of active frames:
So
and
where n is the number of bits in the sequence number
Two cases:
- Receiver window size of one (protocol 5):
- Receiver and sender have equal window sizes (protocol 6):
Situation:
- Sender sends sequence numbers 0-3.
- Receiver has ACKed 0-3 (advancing window), but sender has not
received the ACKs.