Sliding Window Protocol (Go-Back-N) — A Comprehensive Explanation

Sliding Window Protocol (Go-Back-N) — A Comprehensive Explanation

Verified Sources
Nov 3, 2026

Sliding window protocols are a family of data link / transport mechanisms that allow a sender to keep multiple frames “in flight” without waiting for an acknowledgment (ACK) for every single frame. Sliding window protocol works by maintaining a sending window (what frames may be sent) and a receiving window (what frames are allowed to be accepted). In Go-Back-N (GBN) ARQ, if an error is detected (e.g., via CRC or timeout), the receiver generally uses cumulative ACKs and the sender retransmits from the last unacknowledged frame, not only the lost one. Go-Back-N ARQ.

Key intuition:

  • The sender can transmit up to NN frames without being “forbidden” by the window limit.
  • ACKs are cumulative: receiving frame kk implies all frames ≤k\le k were received correctly.
  • When a frame error occurs, the receiver discards later frames, and the sender “goes back” to resend everything from the missing frame.

Sliding Window & Go-Back-N ARQ (visual walkthrough)

Core components you must know

  1. Sequence number: lets receiver order frames and detect duplicates/loss.
  2. Cumulative ACK: receiver ACKs the highest in-order frame.
  3. Retransmission (timeout/error): in GBN, sender retransmits from the missing frame.
  4. Window size W: bounds pipeline depth and determines efficiency.

GBN requires the sender to keep a buffer of transmitted frames (at least from the oldest unacknowledged one) until they are cumulatively ACKed.

GBN behavior vs. selective repeat (conceptual comparison)

GBN retransmits more aggressively; selective repeat retransmits only missing frames.

The GBN sliding window: what each side does

Sender (GBN):

  • Maintains a sending window of size WW.
  • Sends frames with sequence numbers within the window.
  • Starts/uses a timer for the oldest unacknowledged frame.
  • On timeout, retransmits all frames starting from the oldest unacknowledged frame (“go back N”).
  • Advances the window when cumulative ACKs arrive.

Receiver (GBN):

  • Expects frames in order.
  • If frame ii is correct and equals the next expected sequence number, deliver it to the upper layer and ACK cumulatively (ACK for ii).
  • If frame ii is corrupt or not the expected one, discard it and ACK the last correctly received in-order frame (ACK for i−1i-1).
    This is why the sender must retransmit from the missing frame: receiver will not “buffer ahead” for later frames in basic GBN.

GBN sender/receiver operation (step-by-step)

  1. 1
    Step 1

    Set nextFrameToSend and oldestUnacked. Set receivingExpected. Window size W constrains nextFrameToSend − oldestUnacked.

  2. 2
    Step 2

    While nextFrameToSend < oldestUnacked + W, send frame with sequence number nextFrameToSend and buffer it for potential retransmission.

  3. 3
    Step 3

    On arrival, receiver checks integrity (CRC) and whether sequence number equals receivingExpected.

  4. 4
    Step 4

    Deliver frame, advance receivingExpected by 1, and send cumulative ACK for the highest contiguous in-order frame.

  5. 5
    Step 5

    Discard the frame and send cumulative ACK for the last contiguous in-order frame (receivingExpected − 1).

  6. 6
    Step 6

    When a cumulative ACK advances beyond oldestUnacked, slide the window forward and update oldestUnacked.

  7. 7
    Step 7

    If the timer expires for oldestUnacked, retransmit all buffered frames from oldestUnacked up to the current send point within the window.

Concrete timeline example (with sequence numbers)

Assume:

  • Window size W=4W=4
  • Sender has frames with sequence numbers 0,1,2,3,4,5,…0,1,2,3,4,5,\dots
  • Receiver expects in-order frames starting at 00

Example event

  1. Sender transmits frames 0,1,2,30,1,2,3.
  2. Frame 11 arrives corrupted.
  3. Receiver discards frame 11 and also discards 2,32,3 if they arrive out of order (basic GBN).
  4. Receiver sends cumulative ACK for the last good in-order frame: ACK for 00.
  5. Sender sees that ACK does not advance beyond frame 00 and/or a timeout occurs.
  6. Sender retransmits starting from frame 11: frames 1,2,31,2,3 (and possibly more within window constraints).

This captures the distinctive property of GBN: after a loss/error at frame ii, the sender retransmits from ii onward, potentially wasting bandwidth.

[Warning]{type="warning", title="Efficiency cost in GBN", content="GBN can retransmit frames that were received correctly but discarded at the receiver due to an earlier error. This increases overhead under high error rates."}

Common misunderstandings & edge cases

Choosing window size: performance intuition

Let:

  • WW = sender window size (max outstanding frames)
  • Larger WW increases the pipeline, potentially improving throughput when errors are rare.
  • But with higher error probability, GBN wastes more transmissions because errors cause retransmission of multiple frames.

A simplified qualitative throughput tradeoff often used in networking courses is:

  • More pipelining (larger WW) helps in low-loss conditions.
  • Higher loss/error rates reduce effective throughput because retransmissions (from the missing frame) consume bandwidth.

[CalloutBlock]{type="tip", title="Exam-ready takeaway", content="To explain GBN: emphasize cumulative ACKs + receiver discards out-of-order frames + sender retransmits from the oldest unacknowledged frame after timeout/error."}

GBN lifecycle (typical operation)

Pipeline frames

1. Send window filled

Sender sends frames up to window limit WW."

ACK progress or discard

2. Receiver checks order/integrity

If in-order and correct -> cumulative ACK advances; else discard and ACK last good."

Go back

3. Error detected

Sender timeout or missing cumulative ACK triggers retransmission from the missing frame."

Window slides

4. ACKs arrive

Cumulative ACKs move the sender window forward; continue sending new frames."

Go-Back-N Sliding Window: Quick Self-Test Deck

1 / 5
Question · Term

What does a cumulative ACK mean in GBN?

Click to reveal
Answer · Definition

It ACKs the highest contiguous in-order frame received; receiver progress is strictly in-order.

Knowledge Check

Question 1 of 4
Q1Single choice

In Go-Back-N ARQ, when frame i is corrupted, what does the receiver typically send?