winter 2003cs244a handout 71 cs492b project #2 tcp tutorial #2 2003. 9.22 jin hyun ju
Post on 19-Jan-2016
214 Views
Preview:
TRANSCRIPT
Winter 2003 CS244a Handout 7 2
CS244a: An Introduction to Computer Networks
Handout 7: Congestion Control
Nick McKeownProfessor of Electrical Engineering and Computer Science, Stanford University
nickm@stanford.eduhttp://www.stanford.edu/~nickm
Winter 2003 CS244a Handout 7 3
Main points Congestion is inevitable TCP sources detect congestion and, co-
operatively, reduce the rate at which they transmit.
The rate is controlled using the TCP window size.
TCP modifies the rate according to “Additive Increase, Multiplicative Decrease (AIMD)”.
To jump start flows, TCP uses a fast restart mechanism (called “slow start”!).
Winter 2003 CS244a Handout 7 4
CongestionH1
H2
R1 H3
A1(t)10Mb/s
D(t)1.5Mb/s
A2(t)100Mb/s
A1(t)
A2(t)X(t)
D(t)
A1(t)
A2(t)
D(t)
X(t)
Cumulativebytes
t
Winter 2003 CS244a Handout 7 5
Congestion is unavoidableArguably it’s good!
We use packet switching because it makes efficient use of the links. Therefore, buffers in the routers are frequently occupied.
If buffers are always empty, delay is low, but our usage of the network is low.
If buffers are always occupied, delay is high, but we are using the network more efficiently.
So how much congestion is too much?
Winter 2003 CS244a Handout 7 6
Detecting Congestion
duplicated ACK time out without congestion control…
Winter 2003 CS244a Handout 7 7
TCP Congestion Control
TCP implements host-based, feedback-based, window-based congestion control.
TCP sources attempts to determine how much capacity is available
TCP sends packets, then reacts to observable events (loss).
Winter 2003 CS244a Handout 7 8
TCP Congestion Control
TCP sources change the sending rate by modifying the window size:Window = min{Advertized window, Congestion Window}
In other words, send at the rate of the slowest component: network or receiver.
“cwnd” follows additive increase/multiplicative decrease On receipt of Ack: cwnd += 1 On packet loss (timeout): cwnd *= 0.5
Receiver Transmitter (“cwnd”)
Winter 2003 CS244a Handout 7 9
Additive Increase
D A D D A A D D A AD A
Src
Dest
When ACK is received:
cwnd += 1/cwnd
Winter 2003 CS244a Handout 7 10
Leads to the TCP “sawtooth”
t
Rate
halved
Timeouts
Could take a long time to get started!
Winter 2003 CS244a Handout 7 11
“Slow Start”Designed to cold-start connection quickly at startup or if
a connection has been halted (e.g. window dropped to zero,or window full, but ACK is lost).
How it works: increase cwnd by 1 for each ACK received.
D A D D A A D D
A A
D
A
Src
Dest
D
A
1 2 4 8
Winter 2003 CS244a Handout 7 12
Fast Recovery
Upon 3 duplicate ACKs, TCP retransmits. Does not enter slow-start: there are
probably ACKs in the pipe that will continue correct AIMD operation.
Winter 2003 CS244a Handout 7 13
TCP Reno Congestion Control
halved
Timeout
Exponential “slow start” t
Rate
Why is it called slow-start? Because TCP originally hadno congestion control mechanism. The source would just
start by sending a whole window’s worth of data.
Slow start in operation until it reaches half of
previous cwnd.
Triple duplicated ACK
top related