Transport sequence numbers identify the position of data within an exchange. They let a receiver restore order, recognize duplicates, identify missing data and state precisely what has been received in an acknowledgement. In TCP they count bytes, so one packet can contain several consecutively numbered bytes.
A send window is the range of numbered data the sender is currently allowed to have outstanding. It permits several transmissions before their acknowledgements return, which keeps the path busy despite network latency, while bounding unacknowledged data and the information needed for data retransmission. A receive window specifies the range the receiver is prepared to accept, limiting buffer use and rejecting data outside the current range; an implementation may retain acceptable out-of-order data until earlier data arrive. As acknowledgements and consumption advance, these ranges slide, giving a sliding window protocol. Thus
TCP implements both restrictions at the sending endpoint, using information from different places. For flow control, the receiving TCP advertises its available receive window in TCP headers. The sending TCP tracks that advertised range together with the acknowledgement number, and must not send ordinary new data beyond its right edge. As the receiving application consumes data, the receiver can advertise more space. A zero receive window stops ordinary new data and invokes the separate probing mechanism.
For congestion control, the sender maintains a congestion window representing its permitted amount of outstanding data given the path's condition. Acknowledgements, duplicate acknowledgements and data retransmission timeouts supply feedback; explicit congestion notifications can also contribute when negotiated. Routers supply the underlying evidence through queuing, drops or marks, but ordinary TCP congestion window management takes place at the endpoints, rather than through a per-connection capacity reservation at each router.[ref]
Ignoring exceptional probe behaviour, let be the number of sent but not yet acknowledged bytes. The two controls combine approximately as
The send window is anchored by the acknowledged sequence position, rather than authorizing a fresh windowful on every send. Acknowledgements release room as old data leave flight. A sudden reduction of a limit can leave already transmitted data above it; the sender then waits instead of recalling those bytes. The receive window is explicit receiver feedback, whereas the congestion window is a local sender variable. No details of their parameter-adjustment algorithms are needed for this distinction.
Nagle's algorithm prevents the small-packet problem: an application that writes one or a few bytes at a time could generate a separate TCP TCP segment for each write, with transport/link overhead and router work far larger than the useful data. This is a sender-side cause of the silly window syndrome family of inefficient tiny transmissions.
When no data are outstanding, send the first small TCP segment promptly. While data remain unacknowledged, accumulate further small writes instead of emitting another short TCP segment. Release the accumulated data when either enough are available for a full-sized TCP segment, subject to the allowed send window, or the outstanding data have been acknowledged. This makes the waiting adapt to the round-trip time, rather than imposing one fixed batching interval.[ref]
The penalty is extra network latency for later small writes. A short application message split across writes may have its second piece delayed awaiting the acknowledgement of the first. If the receiver uses a delayed acknowledgement while its application awaits that second piece, progress can wait for the acknowledgement timer. It is a delay interaction, not a permanent deadlock while that timer works. Latency-sensitive applications can request that Nagle's algorithm be disabled, accepting the possible extra packets. The tradeoff is
Send window 2026-10-31
A send window specifies the numbered data a sender may transmit before further progress permits the range to advance.