AlgoMaster Logo

Flow Control & the Sliding Window

High Priority32 min readUpdated August 14, 2026

A sender can often produce data faster than the receiving application can consume it.

Imagine a service streaming a large response to a client. The network delivers bytes into the client's TCP receive buffer, but the client is busy, paused, or reading only small chunks. If the server continues sending without a limit, that finite buffer eventually overflows.

TCP flow control prevents this. The receiver continuously advertises how much additional sequence space it is prepared to accept. The sender keeps new data within that boundary.

The boundary is called the receive window, commonly written as rwnd. As acknowledgments advance and buffer space becomes available, the permitted range moves through the sequence space. This moving range is the sliding window.

Flow control is therefore a conversation between two TCP implementations:

  • The receiver reports available capacity.
  • The sender respects that capacity.
  • The receiving application indirectly controls future transmission by draining its socket buffer.

This mechanism protects an endpoint from a sender that is faster than its application. It does not indicate whether routers along the path are overloaded, and it does not guarantee that the application is processing data quickly.

Premium Content

Subscribe to unlock full access to this content and more premium articles.