Study guides · Intermediate

Read TCP congestion control through windows and flight

Trace a Reno-style teaching model while distinguishing receive windows, outstanding data, RTT and unperformed real packet measurements.

Ask Logeia about this articleTry the three questionsReview your answers

Updated

On this page
  1. Separate receiver space from path congestion
  2. Subtract outstanding data from the effective limit
  3. Trace an idealized growth phase
  4. Distinguish a timeout response from threshold state
  5. Execute the window-state model
  6. Calculate bandwidth-delay quantities with units
  7. Do not explain every application delay with cwnd
  8. Compare short and long transfers separately
  9. Exercise: answer with units and model scope
  10. Ask Logeia about this articleCheck your understanding

Separate receiver space from path congestion

TCP sending is not limited only by the receiver's buffer. Advertised rwnd supplies flow control, while sender-maintained cwnd controls congestion exposure on the path. Those decisions address different resources. Building on TCP and congestion-control definitions, this guide traces how an illustrative window changes with acknowledgments and loss.

The model measures one segment as a unit. Actual specifications use byte quantities, MSS and detailed acknowledgment behavior, so the resulting integer sequence is not a claim about every current operating-system implementation. Application-limited sending or a small receive window can keep actual flight below cwnd. Separate the window limit, outstanding unacknowledged data and newly sendable amount. Those quantities are related but not interchangeable, even before selecting a particular congestion-control algorithm.

Subtract outstanding data from the effective limit

With cwnd six, rwnd four and three outstanding units, the simple effective-limit calculation permits one new unit: minimum of six and four minus three. Treating cwnd as wholly new sending allowance counts existing flight twice. Newly acknowledged data can open space, while duplicate acknowledgments require their own interpretation.

A larger cwnd also does not observe an equal amount delivered to the receiver. Transmission, queueing, reception and ACK return take time. Put flight and RTT on a timeline so a newly sent unit is not treated as instantly confirmed. Changing the congestion window after inferred loss does not make every earlier outstanding byte disappear. Track the controller's limits and actual data-accounting state separately throughout the trace.

StateTeaching value
cwnd6 units
rwnd4 units
Unacknowledged3 units
Additional allowancemin(6,4)−3 = 1 unit

Trace an idealized growth phase

Start the teaching model at cwnd one and threshold four. If a full window is acknowledged each RTT, an idealized initial phase doubles through one, two and four. After reaching the threshold, the simplified avoidance phase increases by about one per RTT, yielding four, five and six. Slow start is not a statement that only one fixed unit is added on every round.

This trace omits per-ACK details, delayed acknowledgments and ACK aggregation. Initial window one is deliberately chosen for the example, not asserted as every current TCP implementation's default. Different algorithms and versions require their own rules. Learn which state is limited and which events update it, then compare the selected implementation with the documented model rather than treating this small integer trace as the protocol in full.

Distinguish a timeout response from threshold state

With flight six units, a simplified timeout response sets threshold to max of half flight and two, giving three, and resets cwnd to one. Window and threshold are different state variables; do not say that both merely halve. Actual Reno-family rules additionally involve MSS, timer and retransmission conditions. The model keeps units aligned while omitting those implementation details.

Fast retransmit and recovery following duplicate acknowledgments are not identical to the timeout path, and are not implemented here. Loss is not necessarily proof of congestion alone, nor does a missing ACK prove an application operation failed. Separate transport-control response from business outcome. TCP retransmission and a new application-level retry are different events and must not be combined into one ambiguous retry count.

Execute the window-state model

The code asserts five RTT windows of one, two, four, five and six, then timeout state cwnd one and threshold three. It is a deterministic controller model. It does not inject packet loss, measure kernel cwnd or benchmark a real link. Repeating its output reproduces the model, not every operating system's congestion-control implementation.

A real network exercise would record isolated endpoints, selected algorithm, MSS, RTT, observation point and controlled loss mechanism. If permissions prevent that injection, record it as unperformed. Do not generate load against public sites and label any delay a verified congestion experiment. The learning outcome here is reading units and controller state from a declared history. Actual OS loss-injection work remains explicitly outside this run's evidence.

python
cwnd=1.0;ssthresh=4.0;history=[]
for rtt in range(5):
    history.append(cwnd)
    cwnd=min(2*cwnd,ssthresh) if cwnd<ssthresh else cwnd+1
assert history==[1,2,4,5,6]
flight=6;ssthresh=max(flight/2,2);cwnd=1
assert ssthresh==3 and cwnd==1
print('teaching RTT windows=',history,'after timeout cwnd=',cwnd,'ssthresh=',ssthresh)
print('segment-unit round model; not a complete TCP implementation or packet measurement')

Calculate bandwidth-delay quantities with units

For an illustrative ten MiB per second path and0.1second RTT, the bandwidth-delay product is one MiB. That indicates an amount of outstanding data associated with keeping the path busy, not a guarantee that every application reaches that throughput. Windows, available application data, receiver behavior, loss and processing still matter. Convert rate and time into consistent byte/second units before multiplying.

A one-MiB window divided by0.1second gives a simplified ten-MiB-per-second window bound, excluding overhead and retransmission. It is not a recommendation to enlarge every window. Keep assumed bandwidth, derived bounds and measured throughput in separate columns. As in the earlier Roofline lesson, a calculated upper limit and a performance level actually attained by hardware or a network are different kinds of evidence.

Do not explain every application delay with cwnd

Short HTTP requests also include DNS, connection setup, TLS, server work and pool waiting. Fixed round trips may dominate a small response before sustained window growth matters. Larger transfers can justify studying window, RTT and loss separately. Define the request and measurement interval before attributing all latency to one part of the TCP model.

Distinguish new from reused connections. Adding parallel connections changes total resource use and interaction with per-connection control, so an apparent application speedup must be interpreted at that broader boundary. This lesson does not rank real networks or recommend products from model window sizes. Its practical goal is choosing the next observation using the application trace and network measurement point, not explaining an unseen service with a single controller parameter.

Compare short and long transfers separately

A long file transfer may make steady-state sending rate the central concern. A small response can finish while connection establishment and the first few round trips still dominate elapsed time. The teaching model starts at one segment to make arithmetic visible; that is not a claim about every operating system's initial window or current congestion algorithm.

Connection reuse can amortize setup, but idle periods, path changes and disconnects add conditions. Do not infer short-request latency from only the mean rate of a long transfer. Hold response size, RTT, loss conditions and concurrent connection count explicit, and retain TLS and application processing time separately.

Bandwidth-delay product estimates how much in-flight data would fill a path under its assumptions. Sending that amount does not guarantee a faster user-visible response. Inspect the send-window limit, receiver headroom, queueing and the application's ability to produce bytes. Explain the boundary that currently stops progress. This makes a changed-condition exercise useful even when the simple Reno-shaped model is insufficient to predict a real connection's complete behavior.

Exercise: answer with units and model scope

With cwnd six, rwnd four and three outstanding, the simplified additional allowance is one unit. With flight six followed by a modeled timeout, cwnd becomes one and threshold three. Do not interpret the new window as a claim that earlier outstanding data vanished. State which ACK and retransmission details the model omits.

For twenty MiB per second and0.05second RTT, bandwidth-delay product is again one MiB. Equal products do not make the individual round-trip delays equal. Finally, a passing controller script does not establish measured TCP behavior under injected loss. It verifies declared model transitions. Explain state variables, byte or segment units, observations and guarantee boundaries together; that is the transferable skill beyond reproducing this particular integer sequence.

Reading and practice are recorded separately in this browser, for each language.

Learn this in order

Understand the systems behind the web · STEP 10

Choose a learning path