Analytical Model of TCP Send Rate
In questa pagina 5
In questa pagina 3
The model answers: given packet loss probability and round-trip time RTT, how many segments per second does a TCP flow send on average at steady state? The result is a closed formula used to compute path throughput. It models TCP Reno (TCP Congestion ControlCongestion arises when fast links feed a slow one, router queues fill and packets are lost or delayed, possibly up to network collapse; TCP controls its congestion window cwnd using loss feedback (timeout or three duplicate ACKs): slow start doubles cwnd every RTT up to the threshold ssthresh, then congestion avoidance adds 1 MSS per RTT, and on a loss ssthresh becomes W/2; variants differ in reaction to three dupACKs: Tahoe restarts from cwnd=1, Reno uses fast recovery (ssthresh=cwnd/2, cwnd=ssthresh+3, +1 per further dupACK), NewReno handles partial ACKs and recovers several losses in one window, SACK acknowledges received blocks and resends only what is missing.TCP Congestion Control →); symbols as in TCP - Connection, Reliability and Flow ControlTCP is the connection-oriented, reliable transport protocol that turns IP's unreliable service into an ordered byte stream without errors or duplicates; the connection opens with a three-way handshake (SYN, SYN+ACK, ACK) and closes with FIN segments, bytes are numbered (sequence number = first byte of the segment, cumulative ACK = next byte expected), the sender may transmit min(rwnd, cwnd) unacknowledged bytes (rwnd, the receiver window in a 16-bit field, is flow control), errors are handled with checksum, ACKs, retransmission timeout and fast retransmit after three duplicate ACKs, and to fill the pipe the window must reach the bandwidth-delay product, with maximum throughput MSS times Wmax over RTT.TCP - Connection, Reliability and Flow Control →.
Assumptions
- Rounds. Time is divided into rounds of duration RTT; in each round the sender transmits packets (the congestion window, which varies). RTT is constant and independent of .
- Delayed ACKs. One ACK every packets (usually ): packets in a round give ACKs, each growing the window by in congestion avoidance, so the window grows by 1 every rounds.
- Congestion avoidance only (slow start ignored: long flows).
- Losses. Each packet is lost with probability ; losses in different rounds are independent, but within a round they are correlated: if a packet is lost, all later packets of that round are lost too.
- All packets have the same size (count packets, not bytes). Heavy traffic: the sender always has data. At first is infinite.
Two steps: (1) losses signalled only by duplicate ACKs; (2) losses signalled by three dupACKs and timeouts.
Definition (send rate). With the number of packets sent in , the long-term send rate is [packets/s]. It is the send rate (lost packets counted); goodput is .
Step 1: only triple-duplicate losses
TDP cycles
The window is halved at each triple-dupACK event, producing a sawtooth. A TDP (triple duplicate period) is the period between two consecutive halvings. In the -th TDP: is the duration, the window at the end, the number of packets sent. The sequence is a renewal reward process, so
Formula.
Because after cycles packets were sent in time , and by the law of large numbers the sample means converge to and .
Geometry of a TDP
is the position of the first lost packet in the TDP (counting from 1). is the round where the loss occurs (the second-to-last round); the next round is the last, in which packets are sent. After the loss the sender does not yet know and sends more packets.
Window relation. The window grows by 1 every rounds for rounds starting from : Example: , , : window values and .
Packets sent. The lost packet is number ; more packets leave before the loss is detected (if the lost packet is the -th of the second-to-last round, follow it there and are sent in the last round):
First computation of . With independent losses the position of the first loss is geometric: , and with , From (2):
Second computation of (from the shape of the TDP). The window takes values , each for rounds, ; then packets in the last round: Using (1), , so Example (, , ): packets plus (directly: ). Assuming and independent and stationary, and uniform on so : From (1) with stationarity, :
Equation for
Equate (3) and (5) with , (6) and : The positive root is the mean window:
Formula (mean window).
Example. , : packets (the approximation gives ). For , .
Duration and square-root formula
Formula (mean duration). .
With TD only: For the numerator is dominated by and , giving the square-root formula:
Formula (square root).
For the coefficient is : ; for it is .
Example. , ms, : segments/s. Halving RTT doubles ; reducing by a factor 100 multiplies by 10. For formula (7) gives seg/s while the exact gives : for larger the square root overestimates.
Step 2: timeouts as well
With a small window there are not enough packets after the lost one to generate three dupACKs, and a timeout occurs. At timeout and the first unacknowledged packet is resent; if a timeout follows immediately the timer doubles (up to ), being the first timeout duration.
A cycle consists of a sequence of TDPs and a timeout sub-cycle: packets (with packets in the timeout sub-cycle) and seconds. So ; with :
Formula (general form).
is the probability that a loss indication at the end of a TDP is a timeout ( is geometric with parameter ).
Probability
Let be the window in the second-to-last round. The first packets arrive, the -th is lost (and the rest of the round). The ACKs allow packets in the last round, each generating a dupACK if it arrives: TD if at least 3 dupACKs, timeout otherwise. Define (first correct, given the round has an error) and the probability that the first of packets in the last round are correct: for and for . A timeout occurs if or if but fewer than 3 of the last-round packets arrive: Summing the geometric series:
Formula.
(The limit follows from .) Example: , : (versus ); for , . Use .
Timeout sub-cycle
. Each timeout resends one packet; if lost (probability ) another timeout follows: and . consecutive timeouts last for and for (values times ). Averaging: (The -th timeout happens with probability and lasts ; the tail is the geometric series .)
Full and approximate models
Formula (full model).
For small , with , , numerator , and :
Formula (approximate model).
The factor is the one used in the course; the original work has (similar results: versus seg/s in the example below). If the window cannot exceed :
Formula (window cap).
For throughput in bit/s multiply by the payload size in bits.
Accuracy
For , ms, s (seg/s):
| square root (7) | TD only | full (9) | approximate (10) | |
|---|---|---|---|---|
| 866.0 | 858.6 | 856.6 | 864.1 | |
| 273.9 | 266.5 | 260.6 | 267.8 | |
| 86.6 | 79.4 | 64.8 | 70.4 | |
| 50.0 | 42.8 | 25.9 | 29.1 | |
| 27.4 | 20.2 | 7.1 | 7.2 |
For the formulas agree within about 5%. For the square root overestimates heavily because it ignores timeouts.
Complete example
Path with ms, , s (: TCP Retransmission Timeout EstimationTCP retransmits a segment when its ACK does not arrive within the retransmission timeout RTO, which must track the round-trip time: too short causes spurious retransmissions, too long slows recovery; the RTT is measured with one timer per connection, smoothed with an exponential moving average SRTT = (1-alpha) SRTT + alpha rtt with alpha = 1/8, the mean deviation MAD = (1-rho) MAD + rho |rtt - SRTT| with rho = 1/4 is added four times, RTO = SRTT + 4 MAD with a minimum of 1 s, Karn's algorithm ignores samples of retransmitted segments and doubles the RTO at each consecutive timeout up to 64 times, and for a Gaussian RTT the mean deviation equals sigma times the square root of 2 over pi, about 0.797 sigma.TCP Retransmission Timeout Estimation →), segments, TCP payload bytes, path loss probability (from over the links crossed).
- Cap. seg/s: not the limit.
- First denominator term. , square root ; s.
- Timeout term. , root , triple : (about 63% of losses end in timeout); ; product with : s.
- Rate. seg/s, below the cap.
- Throughput. kbit/s ( bytes bits per segment).
For comparison, the square root (7) would give seg/s (hugely overestimated, no timeouts); the full model (9) gives , , seg/s.
Limits
Valid for steady-state long flows in congestion avoidance (slow start not modelled); RTT assumed constant; losses with fixed probability , independent across rounds and correlated within a round (drop-tail); some approximations hold for small ( and independent, uniform); variants such as SACK recover better and exceed the Reno prediction.
Versione ripasso
Setup
- TCP Reno (TCP Congestion ControlCongestion arises when fast links feed a slow one, router queues fill and packets are lost or delayed, possibly up to network collapse; TCP controls its congestion window cwnd using loss feedback (timeout or three duplicate ACKs): slow start doubles cwnd every RTT up to the threshold ssthresh, then congestion avoidance adds 1 MSS per RTT, and on a loss ssthresh becomes W/2; variants differ in reaction to three dupACKs: Tahoe restarts from cwnd=1, Reno uses fast recovery (ssthresh=cwnd/2, cwnd=ssthresh+3, +1 per further dupACK), NewReno handles partial ACKs and recovers several losses in one window, SACK acknowledges received blocks and resends only what is missing.TCP Congestion Control →), rounds of one RTT, congestion avoidance only, loss probability per packet (independent across rounds, correlated within a round), delayed-ACK parameter (window every rounds), heavy traffic.
- Send rate (packets/s); goodput .
Triple-duplicate cycles (TDP)
(renewal reward). ; ; (geometric).
- Two counts of : and , with .
- Quadratic :
; .
Square root: ( for ; for ). , RTT ms, : seg/s. Overestimates for .
With timeouts
; ; , ; .
- Timeout durations ( for ). Full model (9) with .
Approximate model: . Cap: . Throughput in bit/s payload in bits.
- Example ms, , s, , payload bytes: terms and , seg/s, kbit/s (TCP Retransmission Timeout EstimationTCP retransmits a segment when its ACK does not arrive within the retransmission timeout RTO, which must track the round-trip time: too short causes spurious retransmissions, too long slows recovery; the RTT is measured with one timer per connection, smoothed with an exponential moving average SRTT = (1-alpha) SRTT + alpha rtt with alpha = 1/8, the mean deviation MAD = (1-rho) MAD + rho |rtt - SRTT| with rho = 1/4 is added four times, RTO = SRTT + 4 MAD with a minimum of 1 s, Karn's algorithm ignores samples of retransmitted segments and doubles the RTO at each consecutive timeout up to 64 times, and for a Gaussian RTT the mean deviation equals sigma times the square root of 2 over pi, about 0.797 sigma.TCP Retransmission Timeout Estimation → for ).
- Typical errors: using the square root at large ; forgetting to convert payload to bits; ignoring the cap.