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
Flow control prevents a sender from overrunning the receiving endpoint's capacity to buffer and consume data. Congestion control prevents the aggregate traffic from overloading the intervening computer network, especially shared links and router queues. A fast receiver can still sit beyond a congested path; an uncongested path can still lead to a slow receiver. Consequently
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.
For two competing TCP connections, each sender's congestion control aims to obtain useful throughput while adapting to shared capacity and avoiding persistent overload. For two comparable, continuously backlogged connections at one bottleneck, the usual fairness objective is approximately half the available capacity each, while keeping the bottleneck productively used. The goal is not for both senders independently to seize the whole link. Unequal delays, implementations, application demands and other bottlenecks mean that equal throughput is not guaranteed.
For two UDP exchanges, there is no corresponding built-in transport congestion control objective: UDP sends datagrams without specifying a congestion response. The applications might implement well-behaved congestion control, rate limiting or no adaptation at all. Consequently two UDP labels alone do not determine either a target share or the resulting allocation. Applications should still manage overload; that responsibility is outside the base UDP service.
For a competing TCP connection and an unresponsive high-rate UDP application sharing an ordinary queue, losses cause the TCP sender to reduce its offered load while the UDP sender continues. The UDP traffic can take much of the bottleneck capacity and severely reduce TCP throughput. If the UDP rate exceeds capacity, it too loses packets; sending more does not guarantee useful delivery. A modest-rate or adaptive UDP application, or a router enforcing fair queueing, gives a different outcome. Thus
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
The decisive difficulty is that a TCP receive window update is not itself delivered by a reliable notification channel. The receiver can advertise a newly nonzero receive window, but the packet carrying that advertisement can be lost. With the sender stopped and the receiver expecting more data, neither side need send anything else. The sender can then wait forever despite available receiver space.
A TCP acknowledgement containing only an updated receive window does not occupy new sequence space that would make its loss trigger normal data retransmission. Requiring an acknowledgement of every such notification would introduce a separate reliability rule; that new acknowledgement can itself be lost. Some participant still needs a timer and retry rule. Reordering can also deliver stale advertisements, so transport sequence number and acknowledgement checks are needed in addition to merely sending a notification.
The persist timer assigns the repeated enquiry to the side that has data waiting: the sender periodically sends a zero-window probe, eliciting an acknowledgement with the receiver's current receive window. If one enquiry or response is lost, a later attempt can succeed. Receiver window updates remain useful for prompt resumption; probes provide recovery when those updates disappear.[ref]
One could instead specify repeated receiver notifications, a response and suitable timers, but that replaces the recovery mechanism rather than eliminating its purpose. Therefore

Articles by others on the same topic (0)

There are currently no matching articles.