Back to the 2021 paper

Module 4: Transport Layer & Congestion Control

20217m

Explain how sliding window protocol works at transport layer.

Worked SolutionAI Assisted

Sliding Window Protocol at the Transport Layer

The sliding window protocol combines pipelined transmission with reliability and flow control. Instead of waiting for an ACK after every segment (stop-and-wait), both sender and receiver maintain a window — a contiguous range of sequence numbers that may be outstanding at any instant.

Sender side

  • The send window covers [SND.UNA … SND.NXT + usable space]: every sequence number inside it may be transmitted immediately, without waiting for an acknowledgement, so the link stays busy (pipelining).
  • The window slides right only when a cumulative ACK arrives, which frees sequence space for new data.
  • The usable window is min(cwnd, rwnd) — the congestion window (network congestion control) and the receiver's advertised window (flow control) — so the sender can overflow neither the network nor the receiver's buffer.
  • On a time-out or 3 duplicate ACKs, the unacknowledged part of the window is retransmitted (Go-Back-N retransmits the whole window; Selective Repeat / TCP retransmits only the missing segments, optionally with SACK).

Receiver side

  • The receive window is the set of sequence numbers it is currently willing to accept, decided by its free buffer space.
  • This size is advertised to the sender in every segment (TCP Window field, 16 bits) — this is TCP's flow-control mechanism.
  • The receiver returns cumulative ACKs; out-of-order segments are buffered (TCP, Selective Repeat) or discarded (Go-Back-N).

Example — window size = 4

Sender:   [ 1  2  3  4 ]                 initial window: 4 unacked segments
            send 1,2,3,4  ---------------------------->   Receiver accepts 1-4
ACK for 1 arrives ->  [ 2  3  4  5 ]      window slides, slot freed
ACK for 1,2,3 arrives ->       [ 4  5  6  7 ]
(ACK lost / time-out)  ->  retransmit from SND.UNA onward

Comparison of window-based protocols

Aspect Go-Back-N Selective Repeat TCP
Out-of-order frame Discarded Buffered & accepted Buffered & accepted
What is retransmitted Entire window Only lost frames Only lost segments (SACK)
Sender window ≤ 2ⁿ − 1 ≤ 2ⁿ⁻¹ min(cwnd, rwnd)
Receiver window 1 > 1 > 1
Error control Time-out / dup ACK Time-out per frame Time-out + fast retransmit

Advantages: high link utilisation, natural place for flow control and error recovery, and it bounds the number of unacknowledged bytes. Limitation: the window must never exceed the sequence-number space (hence the 2ⁿ⁻¹ / 2ⁿ − 1 limits), or duplicate sequence numbers would be ambiguous.

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.