ACCSE CSC2B10-Chapter 3 5
ACCSE CSC2B10-Chapter 3 5
Data Communications
Chapter 3.5
Chapter 3 outline
2
Principles of Congestion Control
Congestion:
• informally: “too many sources sending too much data
too fast for network to handle”
• different from flow control!
• manifestations:
• lost packets (buffer overflow at routers)
• long delays (queueing in router buffers)
• a top-10 problem!
3
Causes/costs of congestion: scenario 1
Host A λout
λin : original data
• two senders, two
receivers Host B unlimited shared
output link buffers
• one router, infinite
buffers
• no retransmission
Host A
5
Congestion scenario 2a: ideal case
R/2
λout
available
R/2
λin
λin : original data
copy λout
λ'in: original data, plus
retransmitted data
Host B
no buffer space!
Host A
7
Congestion scenario 2b: known loss
• packets may get dropped at
R/2
router due to full buffers
• sometimes not lost when sending at
R/2, some packets
λout
• sender only resends if are retransmissions
but asymptotic
packet known to be lost goodput is still R/2
R/2
(why?)
(admittedly idealized) λin
8
Congestion scenario 2c: duplicates
• packets may get dropped at
R/2
router due to full buffers
when sending at
• sender times out R/2, some packets
λout
prematurely, sending two are retransmissions
including duplicated
copies, both of which are that are delivered!
delivered λin
R/2
λin
copy
timeout
λ'in λout
Host B
9
Congestion scenario 2c: duplicates
• packets may get dropped at
R/2
router due to full buffers
when sending at
• sender times out R/2, some packets
λout
prematurely, sending two are retransmissions
including duplicated
copies, both of which are that are delivered!
delivered λin
R/2
“costs” of congestion:
more work (retrans) for given “goodput”
unneeded retransmissions: link carries multiple copies of pkt
decreasing goodput
10
Causes/costs of congestion: scenario 3
• four senders Q: what happens as λ
in
• multihop paths and λ increase ?
in
• timeout/retransmit
Host A λout
λin : original data
λ'in : original data, plus
retransmitted data
Host B
11
Causes/costs of congestion: scenario 3
H λ
o
o
s
u
t
A t
H
o
s
t
B
12
Approaches towards congestion control
13
Case study: ATM ABR congestion control
ABR: available bit rate: RM (resource management)
• “elastic service” cells:
• if sender’s path • sent by sender, interspersed with
“underloaded”: data cells
• sender should use available • bits in RM cell set by switches
bandwidth (“network-assisted”)
• if sender’s path congested: • NI bit: no increase in rate (mild
• sender throttled to minimum congestion)
guaranteed rate • CI bit: congestion indication
• RM cells returned to sender by
receiver, with bits intact
14
Case study: ATM ABR congestion control
15
Chapter 3 outline
16
TCP Congestion Control: details
17
TCP congestion control: additive increase, multiplicative
decrease
approach: increase transmission rate (window size),
probing for usable bandwidth, until loss occurs
additive increase: increase cwnd by 1 MSS every
RTT until loss detected
multiplicative decrease: cut cwnd in half after
congestion
window loss
cwnd: congestion window size
24 Kbytes
16 Kbytes
8 Kbytes
saw tooth time
behavior: probing
for bandwidth
time
18
TCP Slow Start
RTT
• initially cwnd = 1 MSS
• double cwnd every RTT
• done by incrementing cwnd for every
ACK received
• summary: initial rate is slow but
ramps up exponentially fast
time
19
Refinement: inferring loss
20
Summary: TCP Congestion Control
New
New ACK!
duplicate ACK
dupACKcount++
ACK!
new ACK
new ACK
.
cwnd = cwnd + MSS (MSS/cwnd)
dupACKcount = 0
cwnd = cwnd+MSS transmit new segment(s), as allowed
dupACKcount = 0
Λ transmit new segment(s), as allowed
cwnd = 1 MSS
ssthresh = 64 KB cwnd > ssthresh
dupACKcount = 0 slow Λ congestion
start timeout avoidance
ssthresh = cwnd/2
cwnd = 1 MSS duplicate ACK
timeout dupACKcount = 0 dupACKcount++
ssthresh = cwnd/2 retransmit missing segment
cwnd = 1 MSS
dupACKcount = 0
retransmit missing segment New
timeout
ACK!
ssthresh = cwnd/2
cwnd = 1 New ACK
dupACKcount = 0
cwnd = ssthresh dupACKcount == 3
dupACKcount == 3 retransmit missing segment dupACKcount = 0
ssthresh= cwnd/2 ssthresh= cwnd/2
cwnd = ssthresh + 3 cwnd = ssthresh + 3
retransmit missing segment retransmit missing segment
fast
recovery
duplicate ACK
cwnd = cwnd + MSS
transmit new segment(s), as allowed
21
Refinement
Q: when should the
exponential increase
switch to linear?
A: when cwnd gets to
1/2 of its value before
timeout.
Implementation:
• variable ssthresh
• on loss event, ssthresh is set
to 1/2 of cwnd just before loss
event
22
TCP throughput
23
TCP Fairness
fairness goal: if K TCP sessions share same bottleneck
link of bandwidth R, each should have average rate of
R/K
TCP connection 1
bottleneck
TCP
router
connection 2
capacity R
25
Why is TCP fair?
two competing sessions:
• additive increase gives slope of 1, as throughout increases
• multiplicative decrease decreases throughput proportionally
Connection 1 throughputR
26
Fairness (more)
Fairness and UDP Fairness and parallel TCP
• multimedia apps often do connections
not use TCP • nothing prevents app from
• do not want rate throttled by opening parallel connections
congestion control between 2 hosts.
• instead use UDP: • web browsers do this
• pump audio/video at constant • example: link of rate R
rate, tolerate packet loss supporting 9 connections;
• new app asks for 1 TCP, gets rate
R/10
• new app asks for 11 TCPs, gets
R/2 !
27
Chapter 3: Summary