Skip to main content
networking

Sliding Window

The sliding window is TCP's mechanism for sending multiple packets before requiring acknowledgment. The window size determines how much data can be in-flight simultaneously. Without windowing, the sender waits for each ACK before sending the next segment – wasting bandwidth on high-latency links.

Definition

TCP's sliding window allows the sender to transmit multiple segments without waiting for individual ACKs. The window 'slides' forward as ACKs arrive, opening space for new data. Window size is the minimum of the receiver's advertised window (rwnd – flow control) and the congestion window (cwnd – congestion control). On a 100ms RTT link, a 64 KB window allows only 5.12 Mbps throughput regardless of link bandwidth. Window scaling (RFC 7323) uses a shift count negotiated in the SYN to expand the window up to 1 GB, enabling full utilization of high-bandwidth, high-latency paths. The sender tracks three pointers: the oldest unacknowledged byte (left edge), the next byte to send, and the right edge of the window. Data between left edge and send pointer is sent-but-unacked. Data between send pointer and right edge is sendable. Data beyond the right edge must wait.

Examples

  • sysctl net.ipv4.tcp_window_scaling=1 – enable window scaling
  • ss -i shows snd_wscale and rcv_wscale (window scale factors)
  • BDP = bandwidth * RTT = required window size for full utilization

Related Protocols

Related Terms