Back to the 2019 paper

Module 2: Data Link Layer & MAC Sublayer

201914m

With the help of neat figures, explain sliding window mechanism.

Worked SolutionAI Assisted

The sliding window mechanism allows a sender to transmit multiple frames before receiving an acknowledgement for the first one, pipelining transmission to make efficient use of the link instead of idling after every single frame (as in Stop-and-Wait).

Sender and Receiver Windows

Sequence numbers:  0   1   2   3   4   5   6   7   (wrap around, mod 2^m)

Sender's window (size N=4), showing state at some instant:

  [ACKed] [ACKed] [sent,unACKed] [sent,unACKed] [sent,unACKed] [can send] [not yet]
     0        1          2              3              4           5         6
           <----------------- window (N=4) ------------------>

The sender may transmit any frame within its current window without waiting for an ACK. Each time the oldest unacknowledged frame (left edge of window) gets ACKed, the window slides forward by one position (or more, for cumulative ACKs), opening room for new frames on the right edge.

Receiver's window defines which sequence numbers it is currently willing to accept:

  • Go-Back-N: receiver window size = 1 (accepts only the next expected frame in strict order; discards anything else).
  • Selective Repeat: receiver window size = N (matches sender), allowing it to buffer out-of-order frames.

Step-by-step operation (Go-Back-N example, window=3)

Time -->

Sender:    send0  send1  send2   [window full, wait]
Receiver:                 recv0(ACK1) recv1(ACK2) recv2(ACK3)

As ACK1 arrives, window slides -> sender sends frame3
As ACK2 arrives, window slides -> sender sends frame4
...and so on, continuously, as long as ACKs keep arriving in time.
  Before ACK1 arrives:        After ACK1 arrives (window slides by 1):
  [0][1][2][ ][ ]              [0][1][2][3][ ]
   ^ base                          ^ base (now at 1)
  window: {0,1,2}                 window: {1,2,3}

Handling a lost frame

If frame 1 is lost:

Receiver gets: 0 (accept, ACK1) -> 2 (discard, out of order, resend ACK1)
                                 -> 3 (discard, out of order, resend ACK1)
Sender's timer for frame 1 expires -> resends frames 1, 2, 3 (go back to 1)

Why it improves throughput

By keeping up to N frames "in flight" simultaneously rather than one at a time, the sliding window mechanism keeps the transmission link continuously busy across the round-trip time, rather than leaving it idle while waiting for each individual ACK — this is especially critical on links with a large bandwidth-delay product (high speed and/or long distance), where Stop-and-Wait would waste the vast majority of available capacity.

Similar questions

Student FinanceWeb Platform

Pocketly — Personal Finance for Students

Keep your hostel and college expenses under control. Track accounts, log spending in seconds, and stay within your monthly budget.