You are on page 1of 2

Congestion Control Example of Slow Start

• The congestion window cwnd =


• TCP implements congestion control at the sender 1xMSS
segment 1
size grows very rapidly ent 1
– This control is intended to reduce congestion in the – For every ACK, we cwnd =
ACK for segm

network. increase cwnd by 1 2xMSS


segment 2
segment 3
irrespective of the
• The sender has two parameters for congestion control: number of segments
ents 2 + 3
ACK’ed cwnd =
ACK for segm

– Congestion Window (cwnd; Initial value is MSS bytes) – with byte-counting, the 3xMSS segment 4
cwnd would increase by segment 5
– Threshhold Value (ssthresh; Initial value is 65536 bytes) the bytes acknowledged segment 6
in an ACK, which means
in the example cwnd
would become 4MSS ents 4+5+6
ACK for segm
• The window size at the sender is set as follows: when the ACK for
cwnd =
4xMSS
segments 2+3 is
Allowed Window = MIN (advertised window, congestion window) received
advertised window: flow-control window at the receiver • TCP slows down the
increase of cwnd when
MSS: Maximum Segment Size (set with option field in TCP header) cwnd > ssthresh

Malathi Veeraraghavan Malathi Veeraraghavan


Originals by Jörg Liebeherr 1 Originals by Jörg Liebeherr 3

Normal operation of Slow Start / Congestion


Slow Start Avoidance
• Whenever starting traffic on a new connection, or whenever If cwnd <= ssthresh then
increasing traffic after congestion was experienced: /* Slow Start Phase */
• Set cwnd =MSS bytes (cwnd is stored in bytes) Each time an ACK is received:
• Each time an ACK is received, the congestion window cwnd = cwnd + segsize
is increased by 1 segment (= MSS bytes). else /* cwnd > ssthresh */
• If an ACK acknowledges two segments, cwnd is still /* Congestion Avoidance Phase */
increased by only 1 segment (without byte counting)
Each time an ACK is received:
• Even if ACK acknowledges a segment that is smaller
cwnd = cwnd + segsize * segsize / cwnd + segsize / 8
than MSS bytes long, cwnd is increased by MSS bytes.
• If cwnd is 3 but there is still one outstanding ACK, the endif
sender can only send two segments
segsize = MSS
• Does Slow Start increment slowly? Not really. In fact, the
increase of cwnd is exponential
Malathi Veeraraghavan Malathi Veeraraghavan
Originals by Jörg Liebeherr 2 Originals by Jörg Liebeherr 4

1
Slow Start/Congestion Avoidance Example Computation of cwnd on previous slide

• Assume that ssthresh = 8 • Upto and including ack 2561, this TCP connection is in slow
start, and cwnd is increased by 1 MSS bytes each time an
14 ACK is received.
12 • Note that when cwnd = ssthresh, slow start is still applied.
10 Hence when ack 2561 is received, cwnd = 2560+512 = 3072.
Cwnd (in segments)

8 • When the last ack shown on the previous slide is received,


ssthresh
6 the TCP connection is in congestion avoidance since cwnd is
4
> ssthresh. Therefore, cwnd = cwnd + MSS × MSS / cwnd +
MSS / 8 = 3072 + 512 × 512/3072+512/8=3222
2

0
t= 0 t= 1 t= 2 t=3 t= 4 t=5 t= 6 t=7

Roundtrip times

Malathi Veeraraghavan Malathi Veeraraghavan


Originals by Jörg Liebeherr 5 Originals by Jörg Liebeherr 7

Example of slow start and congestion When congestion occurs: Congestion Avoidance
avoidance Algorithm
• Assume MSS=512 bytes; advertised window = 5120 bytes • When congestion occurs (indicated by timeout),
PSH 1:513 (512) ack 10
cwnd=512; ssthresh=2560 – ssthresh is set to half the current window size (the
cwnd=1024 ack 513 minimum of the advertised window (AW) and cwnd):
ssthresh = min(cwnd,AW) / 2 but at least 2 segments
– cwnd is changed according to:
cwnd = 1 segsize = 1 MSS bytes (in case of timeout only)
• When new data is acknowledged,cwnd is increased according
PSH 1537:2049 (512) ack 10
PSH 2049:2561(512) ack 10
to whether it is in slow start or CA
ack 2049
cwnd=2560; ssthresh=2560 ack 2561
cwnd=3072; ssthresh=2560 PSH 2561:3073(512) ack 10
Enter congestion avoidance

cwnd=3222; ssthresh=2560 ack 3073


Malathi Veeraraghavan Malathi Veeraraghavan
Originals by Jörg Liebeherr 6 Originals by Jörg Liebeherr 8

You might also like