Back to the 2020 paper

Module 2: Data Link Layer & MAC Sublayer

20207m

Explain how sliding window protocol works at data link layer.

Worked SolutionAI Assisted

The sliding window protocol at the Data Link layer allows a sender to transmit multiple frames before requiring an acknowledgement for each one, improving throughput compared to stop-and-wait, while still providing flow control.

How it works

  1. Both sender and receiver maintain a window — a range of sequence numbers currently valid for sending (sender's window) or accepting (receiver's window).
Sender's window (size N):

  [sent & ACKed] [sent, unACKed] [can send now] [cannot send yet]
       ...         S1  S2  S3          -            -
                   <----- window (size N) ----->
  1. The sender can transmit any frame whose sequence number falls within its current window without waiting for an individual ACK — up to N outstanding (unacknowledged) frames at once.

  2. As the receiver correctly receives frames, it sends back ACKs (either individually or cumulatively, depending on the variant — Go-Back-N uses cumulative ACKs, Selective Repeat uses individual ACKs).

  3. Each time the sender receives an ACK for the oldest outstanding frame (the left edge of its window), the window "slides" forward by one (or more) positions, freeing up room to send new frames.

  4. If a frame is lost or corrupted (detected via timeout or NACK), depending on the variant:

    • Go-Back-N: the sender resends the lost frame and every frame sent after it (since the receiver discards out-of-order frames).
    • Selective Repeat: only the specific lost frame is resent, since the receiver buffers out-of-order frames until the gap is filled.
  5. The receiver's window similarly defines which sequence numbers it's currently willing to accept; for Go-Back-N the receiver window size is 1 (strict in-order only), while for Selective Repeat it matches the sender's window size to allow buffering.

Purpose: by keeping multiple frames "in flight" at once (pipelining), the sliding window protocol keeps the transmission link busy instead of idling while waiting for each individual ACK's round-trip time, significantly improving throughput on high-bandwidth or long-delay links.

Similar questions

AI LearningWeb Platform

Coursify — Personal AI Course Generator

Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.