Stop-and-wait protocols waste bandwidth by waiting for an ACK after each packet. On high-latency links, the sender is idle most of the time, severely under-utilizing available bandwidth.
A protocol that allows a sender to transmit multiple packets before receiving acknowledgments, using sequence numbers and a “window” that slides forward as ACKs are received.
- Sender assigns sequence numbers to packets (or bytes in TCP)
- Sender maintains a window of sequence numbers it’s allowed to send
- Packets within the window can be sent without waiting for ACKs
- As ACKs arrive, the window “slides” forward, allowing new packets to be sent
- Window size limits how many unacknowledged packets can be in transit
- Improves channel utilization over stop-and-wait
- Provides flow control (window size limits in-flight data)
- Enables reliable delivery with sequence numbers
- Used by TCP and many data link protocols
- Built from: Sequence Numbers — identifies packets in window
- Built from: Acknowledgment — slides window forward
- Builds into: TCP — uses sliding window for flow/congestion control
- Related: Flow Control — window size enforces flow control
- Contrasts with: Stop-and-Wait — one packet vs multiple
- Window size must be less than sequence number space to avoid ambiguity
- Selective vs Go-Back-N: different strategies for handling lost packets
- Zero window: receiver can advertise window=0 to stop sender completely