CS 513/EE 506 Introduction to Local and Wide Area Networks WPI, Fall 1999
Craig E. Wills Sliding Window Protocols

Sliding Window Protocols

The sender maintains two variables:

The receiver maintains two variables:

Algorithm

Rough algorithm of the sliding window protocols:

  1. Transmit all frames in the sender's window (no more than from tex2html_wrap_inline42 to tex2html_wrap_inline44 )

  2. Whenever the receiver gets a frame in its window:

    1. it generates an ACK for the highest frame correctly received (same as the frame for protocol 5).

    2. if the frame tex2html_wrap_inline46 has been received it passes tex2html_wrap_inline46 to the host and bumps tex2html_wrap_inline46 and tex2html_wrap_inline52 (advances the window).

  3. 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 ( tex2html_wrap_inline54 ) (only for protocol 6).

  4. Whenever the sender receives an ACK for a frame within its window, it marks that frame as having been correctly sent and received. If tex2html_wrap_inline42 is ACKed then increment tex2html_wrap_inline42 and tex2html_wrap_inline60 (advance the sender's window) and transmit tex2html_wrap_inline44 (last previously unsent frame).

  5. Whenever a timer goes off, retransmit the corresponding frame.

Relationships

Sequence numbers: tex2html_wrap_inline64

tex2html_wrap_inline66 , tex2html_wrap_inline68

Steady state condition: tex2html_wrap_inline70

Interval of active frames: tex2html_wrap_inline72

So tex2html_wrap_inline74 and tex2html_wrap_inline76

where n is the number of bits in the sequence number Two cases:

  1. Receiver window size of one (protocol 5):

    tex2html_wrap_inline80
    tex2html_wrap_inline82
    tex2html_wrap_inline84

  2. Receiver and sender have equal window sizes (protocol 6):

    tex2html_wrap_inline86
    tex2html_wrap_inline88
    tex2html_wrap_inline90

Protocol 6 Example

Situation:

  1. Sender sends sequence numbers 0-3.

  2. Receiver has ACKed 0-3 (advancing window), but sender has not received the ACKs.