31 TCP Congestion
31 TCP Congestion
is Congestion?
What gives rise to congestion?
Computer Networks
Resource contention: offered load is
greater than system capacity
• too much data for the network to handle
• how is it different from flow control?
Lectures 31:
TCP Congestion Control
four segm
2. congestion avoidance: linear increase
ents
pipe full
Stevens
ndex is [6]:
4. Smoothness: little oscillation
l users do not get exactly equal allocations, the
larger change-step increases
ystem is less fair and • we need an index or a
unction that quantifies responsiveness but decreases
the fairness. One such
smoothness
Goal ~ oothness
• decrease upon congestion: w’ = bdw +ad
between nodes
network ai > 0, bi = 1, ad = 0, 0 < bd < 1
his index has the following properties: 3. Multiplicative increase, additive decrease:
(a) The fairness is bounded between 0 and 1 (or Time Chiu & Jain
Fig. 3. Responsiveness and smoothness. ai = 0, bi > 1, ad < 0, bd = 1
Guideline for congestion control (as in routing):
0% and 100%). A totally fair allocation (with
all xi's equal) has a fairness of 1 and a 4. Multiplicative increase, multiplicative decrease:
be skeptical of good news, react fast to bad news
totally unfair allocation (with all resources
(4) Convergence: Finally we require the control bi > 1, 0 < bd < 1, ai = ad = 0
given to only one user) has a fairness of 1 / n scheme to converge. Convergence is generally
which is 0 in the limit as n tends to oo. measured by the speed with which (or time taken
(b) The fairness is independent of scale, i.e., till) the system approaches the goal state from any
unit of measurement does not matter. starting state. However, due to the binary nature
(c) The fairness is a continuous function. Any of the feedback, the system does not generally
slight change in allocation shows up in the converge to a single steady state. Rather, the sys-
location {Xl(t), x 2 ( t ) } Can be represented as a location {Xl(t), x 2 ( t ) } Can be represented as a
point (x 1, x2) in a 2-dimensional space. In this Notice that multiplying both allocations by a fac- point (x 1, x2) in a 2-dimensional space. In this Notice
figure, the horizontal axis represents allocations to tor b does not change the fairness. That is, figure, the horizontal axis represents allocations to tor b
user 1, and the vertical axis represents allocations (bx 1, bx2) has the same fairness as (x 1, x2) for all user 1, and the vertical axis represents allocations (bx 1, bx
to user 2. All allocations for which x I + x 2 = Xgoal values of b. Thus, all points on the line joining a to user 2. All allocations for which x I + x 2 = Xgoal values o
are efficient allocations. This corresponds to the point to origin have the same fairness. We, there- are efficient allocations. This corresponds to the point to
n-dimensional vector space, one dimension per user users’ allocation moves an allocation along a 45º line
additive increase/multiplicative decrease control
policy. The point x 0 is below the efficiency line
additive
policy.
and so both users are asked to increase. They do
so additively by moving along at an angle of 45 o.
and so
so addit
l Equi- l Equi-
A 2-user allocation trajectory: Fairness Fairness Multiplicative factor:
This brings them to x~ which happens to be above
Fairness Fairness
This bri
the efficiency line. The users are asked to decrease the effic
• x1, x2: the two users’ allocations UserR ~ L m ~ Line multiplying both users’
and they do so multiplicatively. This correspondsUserR ~ L m ~ Line and the
to moving towards the origin on the line joining to movi
• Efficiency Line: x1 + x2 = xi = R 2's ~ ~ // allocation by the same factor 2's
x 1 and the origin. This brings them to point x 2,
~ ~ //
x 1 and
• below this line, system is under-loaded Alloc- ] ~ //Overload
moves an allocation on a line
which happens to be below the efficiency line andAlloc-
the cycle repeats. Notice that x 2 has higher fair-
] ~ //Overload which h
the cycl
• above, overloaded
through the origin (the
ness than x 0. Thus, with every cycle, the fairness ness tha
• Fairness Line: x1 = x2 increases slightly, and eventually, the system con- increase
“equi-fairness,” or rather,
verges to the optimal state in the sense that it verges t
• Optimal Point: efficient and fair keeps oscillating around the goal. keeps os
“equi-unfairness” line)
Similar trajectories can be drawn for other con- Simil
• Goal of congestion control: trol policies. Although not all control policies con- trol poli
User l's Allocation xt R • the slope of this line, not any
verge. For example, Fig. 6 shows the trajectory for User l's Allocation xt R verge. F
to operate at optimal point Fig. 4. Vectorrepresentationof a two-usercase. the additive increase/additive decrease control Fig. 4. Vectorrepresentationof a two-usercase. the add
Chiu & Jain
position on it, determines fairness Chiu & Jain
Fairness
Line
xl /"
/
/
//
, ~5~' \ E f f i c i e n c y Line
• by how much should sender decrease cwnd?
I i//
/¢, Ii//~
, ~5~'
I i// \ E f f i c i e n c y Line / ~fficteney Line
/¢,
Ii//~
f
ID-
policy starting from the position x 0. The system converge to efficiency, but not to fairness. The
keeps moving back and forth along a 45 ° line conditions for convergence to efficiency and fair-
through x 0. With such a policy, the system can ness are derived algebraically in the next section.
Fast Retransmit Fast Retransmit Example
Motivation: waiting for RTO is too slow
TCP Tahoe also does fast retransmit:
• with cumulative ACK, receipt of packets following a lost
packet causes duplicate ACKs to be returned
• interpret 3 duplicate ACKs as an implicit NAK
• retransmit upon receiving 3 dupACKs, i.e., on receipt of the
rwnd
4th ACK with the same seq#, retransmit segment
• why 3 dupACKs? why not 2 or 4?
time (secs)
[Hoe]
1 RTT
[Hoe]
Fast Recovery
1. on congestion, retransmit lost
Summary: TCP Congestion Control
segment, set ssthresh = cwnd/2
2. remember highest seq# sent, • When cwnd is below ssthresh, sender in slow-
snd_high; and remember snd_high start phase, window grows exponentially
current cwnd, let’s call it pipe
3. decrease cwnd by half • When cwnd is above ssthresh, sender is in
4. increment cwnd for every congestion-avoidance phase, window grows linearly
returning dupACK, incl. the 3
used for fast retransmit • When a 3 dupACKs received, ssthresh set to
5. send new packets (above
pipe
cwnd/2 and cwnd set to new ssthresh
snd_high) only when
cwnd > pipe • If more dupACKs return, do fast recovery
6. exit fast-recovery when a sshthresh+1