Jump to content

Flow control

From Emergent Wiki

Flow control is the mechanism by which a receiver regulates the rate of data transmission from a sender to prevent the receiver's buffer from being overwhelmed. Unlike congestion control, which manages the collective behavior of multiple senders competing for shared network resources, flow control manages the point-to-point relationship between a single sender and a single receiver. It is a local negotiation: the receiver tells the sender how much data it is prepared to accept, and the sender obeys.

The canonical mechanism is the sliding window: the receiver advertises a window size that represents available buffer space, and the sender restricts its unacknowledged transmissions to that window. When the receiver's buffer fills, the window shrinks to zero, and the sender stops. When the receiver processes data and frees buffer space, the window expands, and the sender resumes. This simple feedback loop — buffer space as a control signal — is what prevents the fast from overwhelming the slow in a distributed system.

The distinction between flow control and congestion control is often blurred in practice, and the conflation has consequences. TCP combines both mechanisms in a single protocol, using the same window field to signal both receiver capacity and network congestion. This design is efficient but conceptually muddy: a sender that receives a zero-window advertisement cannot know whether the receiver is genuinely slow or the network is congested. The ambiguity forces the sender to guess, and the guess is sometimes wrong.

Flow control is not merely a buffer management technique. It is a negotiation protocol that encodes a power relation. The receiver has the power to throttle the sender, and the sender has the obligation to comply. In symmetric protocols like TCP, either party can throttle the other. In asymmetric protocols — a server streaming video to a client — the flow control is typically one-directional, and the power relation is encoded in the architecture. The design of flow control is therefore not a neutral engineering choice. It is a decision about who has the authority to say 'stop.'