Professional Documents
Culture Documents
25 Congestion Control Part2 March 14
25 Congestion Control Part2 March 14
Gaurav S. Kasbekar
Dept. of Electrical Engineering
IIT Bombay
1-1
References
Slides by Kurose and Ross available at:
http://ctas.poly.asu.edu/millard/CET459/lectno/K%
20-%20R%20stuff/index.html
1-2
Congestion Control Problem
Multiple flows (e.g., file transfers) across a
network
set of active flows varies with time
Each sender must dynamically adapt
transmission rate to available bandwidth
3-3
Approaches towards congestion control
Two broad approaches towards congestion control:
3-4
Modes of Feedback in N/w Assisted CC
3-8
TCP Congestion Control
Sender does not know amount of free bandwidth at
routers along path
When sender sends a data pkt, either ACK received
or pkt loss detected
Need to infer congestion level using just this info.
Idea:
Pkt loss indicates high congestion ⟹ reduce rate
ACK received for previously unACKed pkt ⟹
increase rate
Adaptive algorithm
Achieving a Desired Send Rate r
Suppose sender wants to send at avg. rate
r pkts/sec
One way: send one pkt every 1/r sec
Want to achieve same send rate using a
window
3-10
Achieving a Desired Send Rate r
Assume constant RTT, no corrupted or lost pkts or ACKs
Pkt transmission times negligible compared to RTT and
window size N is used
Avg rate r:
N / RTT
Summary
We can adjust the send rate by adjusting
window size N
When pkt loss detected, decrease N
When new ACK received, increase N
Notation: henceforth, denote window size
by Cong_Win
Operation
States:
Slow Start: Cong_Win increased exponentially
Congestion Avoidance: Cong_Win increased linearly
Fast Recovery: a transit state; duration ≤1 RTT (approx.)
Slow Start
When sender starts data transfer, has no
idea how congested network is
So starts cautiously: Cong_Win = 1
But corresponding rate may be much lower
than available bandwidth
E.g., if pkt size = 500 bytes, RTT = 200 ms,
then rate = only 20 kbps
Need a way to rapidly increase Cong_Win
when new ACKs received
3-14
Slow Start
3-16
Slow Start
Cong_Win increases very rapidly in slow start
When should slow start end?
Should certainly end when pkt loss detected
Recall: pkt loss inferred from:
i. timeout and
ii. 3 duplicate ACKs
Both indicate congestion, but more severe in (i)
If timeout occurs, sstresh = Cong_Win/2, Cong_Win =1, lost
pkt resent and sender stays in Slow Start
Half the Cong_Win value at which congestion was detected
is stored (in sstresh)
When sender crosses sstresh again, not safe to keep
increasing Cong_Win exponentially
switch to Congestion Avoidance state 3-17
Slow Start
Suppose pkt loss detected via 3 dup. ACKs
Sender sets sstresh = Cong_Win/2,
Cong_Win = sstresh + 3, resends lost pkt
and goes to Fast Recovery
3-18
Congestion Avoidance
Recall: switch to CA when Cong_Win
exceeds sstresh
Not safe to increase Cong_Win
exponentially in CA
Cong_Win increased by 1 every RTT
Update rule:
Cong_Win increased by 1/Cong_Win each time a
new ACK is received
When should CA end?
Ends when pkt loss occurs; same actions as
in Slow Start taken
Fast Recovery
Recall: when pkt loss detected via 3 dup. ACKs, sender
retransmits pkt and switches to fast recovery
Transit state sender stays in before switching to SS or CA
duration at most 1 RTT (approx.)
Three possible events in Fast Recovery:
1) Timeout occurs
o set sstresh = Cong_Win/2, Cong_Win = 1, retransmit lost pkt and
go to Slow Start
2) New ACK received
o set Cong_Win = sstresh and go to Congestion Avoidance (fast
recovery)
3) More dup. ACKs received: increase Cong_Win by 1 each
time, transmit new pkts as allowed, stay in Fast
Recovery
Queuing Delays
When congestion in network increases,
queuing delays increase
Does TCP’s rate adaptation algorithm take
queuing delays into account?
Yes, since RTT increases in queuing delay
Rate (window size) increased slowly if queuing
delays large and vice-versa
3-21
FSM
Flow Control in TCP
Flow control: making sure that receiver
always has enough memory in buffer to
store data pkts sent by sender
To add flow control to TCP:
Receiver sends an integer “Flow_Win” to
sender during initial handshake and
includes it in every ACK
equal to amt of free space in receiver buffer
Sender uses window size = min(Flow_Win,
Cong_Win)