Congestion Control - Department of Computer Science and

University of Nevada – Reno
Computer Science & Engineering Department
Fall 2011
CPE 400 / 600
Computer Communication Networks
Lecture 14
Transport Layer
(Transmission Control Protocol)
slides are modified from J. Kurose & K. Ross
Introduction
1
Chapter 3 outline
 3.1 Transport-layer
services
 3.2 Multiplexing and
demultiplexing
 3.3 Connectionless
transport: UDP
 3.4 Principles of
reliable data transfer
 3.5 Connection-oriented
transport: TCP




segment structure
reliable data transfer
flow control
connection management
 3.6 Principles of
congestion control
 3.7 TCP congestion
control
Transport Layer
3-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!
Transport Layer
3-3
Causes/costs of congestion: scenario 1
Host A
 two senders, two
receivers
 one router,
infinite buffers
 no retransmission
Host B
lout
lin : original data
unlimited shared
output link buffers
 large delays
when congested
 maximum
achievable
throughput
Transport Layer
3-4
Causes/costs of congestion: scenario 2
 one router, finite buffers
 sender retransmission of lost packet
Host A
Host B
lin : original
data
l'in : original data, plus
retransmitted data
lout
finite shared output
link buffers
Transport Layer
3-5
Causes/costs of congestion: scenario 2
(goodput)
= l
out
in
 “perfect” retransmission only when loss:
 always:
l
l > lout
in
 retransmission of delayed (not lost) packet makes
(than perfect case) for same
lout
l
in
larger
“costs” of congestion:
 more work (retrans) for given “goodput”
 unneeded retransmissions: link carries multiple copies of pkt
Transport Layer
3-6
Causes/costs of congestion: scenario 3
 four senders
Q: what happens as l
in
and l increase ?
 multihop paths
 timeout/retransmit
in
Host A
lin : original data
lout
l'in : original data, plus
retransmitted data
finite shared output
link buffers
Host B
Transport Layer
3-7
Causes/costs of congestion: scenario 3
H
o
s
t
A
l
o
u
t
H
o
s
t
B
another “cost” of congestion:
 when packet dropped, any “upstream transmission
capacity used for that packet was wasted!
Transport Layer
3-8
Approaches towards congestion control
two broad approaches towards congestion control:
end-end congestion
control:
 no explicit feedback from
network
 congestion inferred from
end-system observed loss,
delay
 approach taken by TCP
network-assisted
congestion control:
 routers provide feedback to
end systems
 single bit indicating
congestion (SNA, DECbit,
TCP/IP ECN, ATM)
 explicit rate sender
should send at
Transport Layer
3-9
Case study: ATM ABR congestion control
ABR: available bit rate:
 “elastic service”
RM (resource management)
cells:
 if sender’s path
 sent by sender, interspersed
“underloaded”:
 sender should use
available bandwidth
 if sender’s path
congested:
 sender throttled to
minimum guaranteed
rate
with data cells
 bits in RM cell set by switches
(“network-assisted”)
 NI bit: no increase in rate
(mild congestion)
 CI bit: congestion indication
 RM cells returned to sender by
receiver, with bits intact
Transport Layer 3-10
Case study: ATM ABR congestion control
 two-byte ER (explicit rate) field in RM cell
 congested switch may lower ER value in cell
 sender’ send rate thus maximum supportable rate on path
 EFCI bit in data cells: set to 1 in congested switch
 if data cell preceding RM cell has EFCI set, sender sets CI
bit in returned RM cell
Transport Layer
3-11
Chapter 3 outline
 3.1 Transport-layer
services
 3.2 Multiplexing and
demultiplexing
 3.3 Connectionless
transport: UDP
 3.4 Principles of
reliable data transfer
 3.5 Connection-oriented
transport: TCP




segment structure
reliable data transfer
flow control
connection management
 3.6 Principles of
congestion control
 3.7 TCP congestion
control
Transport Layer 3-12
TCP congestion control:
 goal: TCP sender should transmit as fast as possible,
but without congesting network

Q: how to find rate just below congestion level
 decentralized: each TCP sender sets its own rate,
based on implicit feedback:
 ACK: segment received (a good thing!), network not
congested, so increase sending rate
 lost segment: assume loss due to congested
network, so decrease sending rate
Transport Layer 3-13
TCP congestion control: bandwidth probing
 “probing for bandwidth”: increase transmission rate
on receipt of ACK, until eventually loss occurs, then
decrease transmission rate

continue to increase on ACK, decrease on loss (since available
bandwidth is changing, depending on other connections in
network)
sending rate
ACKs being received,
so increase rate
X
X loss, so decrease rate
X
X
TCP’s
“sawtooth”
behavior
X
time
 Q: how fast to increase/decrease?
 details to follow
Transport Layer 3-14
TCP Congestion Control: details
 sender limits rate by limiting number
of unACKed bytes “in pipeline”:
LastByteSent-LastByteAcked  cwnd
 cwnd: differs from rwnd (how, why?)
 sender limited by min(cwnd,rwnd)
 roughly,
rate =
cwnd
RTT
cwnd
bytes
bytes/sec
 cwnd is dynamic, function of
perceived network congestion
RTT
ACK(s)
Transport Layer 3-15
TCP Congestion Control: more details
segment loss event:
reducing cwnd
 timeout: no response
from receiver

cut cwnd to 1
 3 duplicate ACKs: at
least some segments
getting through


recall fast retransmit
cut cwnd in half, less
aggressively than on
timeout
ACK received: increase
cwnd
 slowstart phase:
 increase exponentially
fast (despite name) at
connection start, or
following timeout
 congestion avoidance:
 increase linearly
Transport Layer 3-16
TCP Slow Start
 when connection begins, cwnd = 1 MSS

example: MSS = 500 bytes &
RTT = 200 msec
initial rate = 20 kbps
Host A
Host B
RTT

 available bandwidth may be >>
MSS/RTT
 desirable to quickly ramp up to
respectable rate
 increase rate exponentially until first
loss event or when threshold reached
 double cwnd every RTT
 done by incrementing cwnd by 1
for every ACK received
time
Transport Layer 3-17
Transitioning into/out of slowstart
ssthresh: cwnd threshold maintained by TCP
 on loss event: set ssthresh to cwnd/2
 remember (half of) TCP rate when congestion last occurred
 when cwnd >= ssthresh: transition from slowstart to congestion
avoidance phase
duplicate ACK
dupACKcount++
L
cwnd = 1 MSS
ssthresh = 64 KB
dupACKcount = 0
slow
start
timeout
ssthresh = cwnd/2
cwnd = 1 MSS
dupACKcount = 0
retransmit missing segment
new ACK
cwnd = cwnd+MSS
dupACKcount = 0
transmit new segment(s),as allowed
cwnd > ssthresh
L
timeout
ssthresh = cwnd/2
cwnd = 1 MSS
dupACKcount = 0
retransmit missing segment
congestion
avoidance
Transport Layer 3-18