Sliding Window Protocols — Architecture & Dynamics
Overview
Sliding window protocols regulate how many packets a sender may transmit before requiring acknowledgment. They provide a structured way to manage ordering, reliability, and throughput in communication systems. By maintaining a window of outstanding, unacknowledged packets, these protocols balance link utilization with receiver capacity and network conditions.
Sliding window mechanisms are foundational in transport protocols (TCP), link‑layer ARQ systems, and wireless MACs, and they complement both ARQ and flow control mechanisms.
Architectural Principles
Window Concept
The sender maintains a window of sequence numbers representing packets that may be transmitted but are not yet acknowledged. The window “slides” forward as ACKs arrive.
A window is defined by:
- Lower edge — the oldest unacknowledged packet
- Upper edge — the highest sequence number allowed for transmission
- Window size — the number of packets allowed in flight
Sender Responsibilities
The sender must:
- transmit packets within the window
- buffer unacknowledged packets
- retransmit lost or corrupted packets
- advance the window when ACKs arrive
Receiver Responsibilities
The receiver must:
- detect missing or out‑of‑order packets
- buffer packets (Selective Repeat) or discard them (Go‑Back‑N)
- generate ACKs or NACKs
- maintain ordering for delivery to upper layers
Window Types
Fixed Window
The window size is constant and determined by protocol parameters or buffer constraints.
Dynamic Window
The window size adapts to:
- network congestion
- receiver capacity
- round‑trip time
- error rate
TCP uses a dynamic window through congestion control and flow control mechanisms.
Core Sliding Window Variants
Stop‑and‑Wait
A degenerate sliding window with size 1.
- sender transmits one packet
- waits for ACK
- retransmits on timeout
Pros: simple, minimal state
Cons: extremely low throughput on high‑latency links
Go‑Back‑N (GBN)
A sender may transmit up to N unacknowledged packets.
- receiver accepts packets in order only
- on error, sender retransmits from the missing packet onward
- cumulative ACKs
Pros: simple receiver
Cons: inefficient when error rate is high
Selective Repeat (SR)
The most efficient sliding window variant.
- receiver accepts packets out of order
- only missing packets are retransmitted
- requires per‑packet ACKs or selective ACKs
- requires reordering buffers
Pros: high throughput, minimal retransmission
Cons: more complex state machines and larger buffers
Window Dynamics
Window Advancement
The window slides forward when:
- ACKs arrive
- timeouts expire (triggering retransmission)
- receiver advertises new buffer space
Sequence Number Space
Sequence numbers must be large enough to avoid ambiguity between:
- new packets
- retransmissions
- wrapped sequence numbers
Selective Repeat requires a sequence space at least twice the window size.
ACK Strategies
- Cumulative ACKs — acknowledge all packets up to a sequence number
- Selective ACKs (SACK) — explicitly acknowledge non‑contiguous packets
- NACKs — request retransmission of specific packets
Performance Considerations
Throughput
Throughput depends on:
Larger windows improve throughput, especially on high‑latency links.
Latency
Latency is influenced by:
- retransmission delays
- ACK frequency
- window size
- buffering at sender and receiver
Efficiency
Selective Repeat is the most efficient under moderate to high error rates.
Go‑Back‑N is simpler but wastes bandwidth on retransmissions.
Integration with ARQ and Flow Control
With ARQ
Sliding window protocols define when to retransmit.
ARQ defines what to retransmit and how errors are detected.
With Flow Control
Flow control (credit‑based or rate‑based) limits how much data can be in flight.
Sliding windows limit how many unacknowledged packets can be in flight.
Together they ensure:
- no buffer overflow
- no congestion collapse
- ordered, reliable delivery
Use Cases in Real Systems
TCP
TCP uses a dynamic sliding window with:
- cumulative ACKs
- selective acknowledgments (SACK)
- congestion control (slow start, congestion avoidance)
- flow control (receiver‑advertised window)
TCP’s sliding window is central to Internet reliability and performance.
Wireless MACs
Wi‑Fi and cellular systems use sliding windows to manage:
- variable channel quality
- retransmissions
- out‑of‑order reception
Often combined with HARQ for improved robustness.
Link‑Layer Protocols
Many link‑layer ARQ systems (e.g., HDLC, PPP extensions) use Go‑Back‑N or Selective Repeat.
Comparison of Sliding Window Variants
| Variant | Out‑of‑Order Reception | Retransmission Strategy | Complexity | Efficiency |
|---|---|---|---|---|
| Stop‑and‑Wait | No | Retransmit single packet | Very Low | Very Low |
| Go‑Back‑N | No | Retransmit from error onward | Low | Medium |
| Selective Repeat | Yes | Retransmit only missing packets | Medium‑High | High |
Design Tradeoffs
- Window Size vs Memory — larger windows require more buffering.
- Sequence Space vs Complexity — Selective Repeat requires larger sequence spaces.
- Latency vs Throughput — larger windows improve throughput but may increase latency.
- Error Rate vs Efficiency — Selective Repeat excels in noisy channels.
Related Pages
- ARQ — Automatic Repeat Request
- Credit‑Based Flow Control — Architecture & Use Cases
- Protocol Flow Control — Architecture & Mechanisms
- Retransmission Strategies — Architecture & Tradeoffs
- Link Layer Reliability Mechanisms
Summary
Sliding window protocols regulate how many packets may be in flight, balancing throughput, reliability, and ordering. They are fundamental to modern communication systems, from TCP to wireless MACs, and they integrate tightly with ARQ and flow control mechanisms to ensure efficient, reliable data transfer.