congestion control
DESCRIPTION
Congestion Control. Class 18 Resource Allocation Considerations. Issues and Principles Causes of Congestion Approaches to Congestion Control. Congestion Control. Resource Allocation Process by which NEs try to meet competing demands from the same network resources: - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/1.jpg)
SMU CSE 5344/7344 1
Congestion Control
Class 18Resource Allocation
Considerations
![Page 2: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/2.jpg)
SMU CSE 5344/7344 2
Congestion Control
• Issues and Principles• Causes of Congestion• Approaches to Congestion
Control
![Page 3: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/3.jpg)
SMU CSE 5344/7344 3
Terminology
• Resource Allocation– Process by which NEs try to meet
competing demands from the same network resources:
• Bandwidth + buffer space
• Congestion Control– Efforts made by NEs to prevent or
respond to overload conditions in the NW
– Could demand certain NEs to stopTXing– Prefer a notion of fairness
![Page 4: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/4.jpg)
SMU CSE 5344/7344 4
Issues – Congestion on Switched NWs
• Two sides of the same coin– pre-allocate resources so at to avoid congestion– control congestion if (and when) is occurs
• Two points of implementation– hosts at the edges of the network (transport
protocol)– routers inside the network (queuing discipline)
• Underlying service model– best-effort (assume for now)– multiple qualities of service (later)– soft-state versus hard-state flow information
Destination1.5-Mbps T1 link
Router
Source2
Source1
100-Mbps FDDI
10-Mbps Ethernet
Lots of capacity on immediate links
Reduced capacity on NW links
“Default Router” – the bottleneck
![Page 5: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/5.jpg)
SMU CSE 5344/7344 5
Framework
• Taxonomy– router-centric versus host-centric– reservation-based versus feedback-based
• Implicit (behavioral) vs. explicit feedback– window-based versus rate-based
Router
Source2
Source1
Source3
Router
Router
Destination2
Destination1
Data “flows” – visible to routers inside the network
Channels – process-to-process
![Page 6: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/6.jpg)
SMU CSE 5344/7344 6
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)
![Page 7: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/7.jpg)
SMU CSE 5344/7344 7
Congestion: A Close-up View
• knee – point after which – throughput increases
very slowly– delay increases fast
• cliff – point after which– throughput starts to
decrease very fast to zero (congestion collapse)
– delay approaches infinity
Load
De
lay
cliff
congestioncollapse
Load
Th
rou
ghp
ut knee packet
loss
![Page 8: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/8.jpg)
SMU CSE 5344/7344 8
Congestion Control vs. Congestion Avoidance
• Congestion control goal– stay left of cliff
• Congestion avoidance goal– stay left of knee
• Right of cliff: – Congestion collapse
Load
Th
rou
ghp
ut knee cliff
congestioncollapse
![Page 9: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/9.jpg)
SMU CSE 5344/7344 9
Congestion Collapse: How Bad is It?
• Definition: Increase in network load that results in a decrease of useful work done
• Many possible causes– Spurious retransmissions of packets still in flight– Undelivered packets
• Packets consume resources and are dropped elsewhere in network
– Fragments• Mismatch of transmission and retransmission units
– Control traffic• Large percentage of traffic is for control
– Stale or unwanted packets• Packets that are delayed on long queues
![Page 10: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/10.jpg)
SMU CSE 5344/7344 10
Evaluation Criteria for Resource Allocation Scheme Effectiveness
• Fairness• Power (ratio of throughput to
delay)
Optimalload Load
Th
rou
ghp
ut/d
elay
Th
rou
gh
pu
t
Dela
y
![Page 11: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/11.jpg)
SMU CSE 5344/7344 11
Causes of Congestion
![Page 12: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/12.jpg)
SMU CSE 5344/7344 12
Causes/costs of congestion: scenario 1
• two senders, two receivers
• one router, infinite buffers
• no retransmission
• large delays when congested
• maximum achievable throughput
unlimited shared output link buffers
Host A
in : original
data
Host B
out
Per-connection throughput
C= Router Capacity
Aggregate throughput = C is bad for delay
![Page 13: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/13.jpg)
SMU CSE 5344/7344 13
Causes/costs of congestion: scenario 2 • one router, finite buffers • sender retransmission of lost packet• Rate of sending original data +
retransmissions offered load
finite shared output link buffers
Host A in : original data
Host B
out
'in : original data, plus retransmitted data
'in
![Page 14: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/14.jpg)
SMU CSE 5344/7344 14
Causes/costs of congestion: scenario 2
• always: (goodput)
• “perfect” retransmission only when loss:
• retransmission of delayed (not lost) packet makes
larger (than perfect case) for same
in
out
=
in
out
>
in
out
“costs” of congestion: • more work (retrans) for given “goodput”• unneeded retransmissions: link carries multiple copies of pkt
No Loss case
Retransmissions due to loss
Retransmissions due to queue
delayC/4
![Page 15: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/15.jpg)
SMU CSE 5344/7344 15
finite shared output link buffers
Host A in : original data
Host D
out
'in : original data, plus retransmitted data
R1
R2
R3
R4
Host B
Host C
Causes/costs of congestion scenario 3
• four senders• multihop paths• timeout/retransmit
Q: what happens as and increase ?
in
Max R2 Capacity = C
If 'in is very large, arrival rate at R2 can overwhelm R2
As offered load infinity, B-D traffic supersedes A-C traffic to zero
in
![Page 16: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/16.jpg)
SMU CSE 5344/7344 16
Causes/costs of congestion: scenario 3
Another “cost” of congestion:
• when packet dropped, any “upstream transmission capacity” used for that packet is wasted
NW is better off if R1 discarded packets NW is better off if R2 preferentially transmitted packets
that already crossed the network
Host A
Host B
o
u
t
Offered Load
Th
rou
gh
pu
t
Multi-hop flows vs. single-hop flows fair?
![Page 17: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/17.jpg)
SMU CSE 5344/7344 17
Resource Allocation Schemes
![Page 18: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/18.jpg)
SMU CSE 5344/7344 18
Queuing Discipline
• First-In-First-Out (FIFO)– does not discriminate between traffic sources (flows)
– Tail-drop – is a drop policy (not a scheduling method)
– Pushes congestion control / resource allocation responsibility out to the hosts
![Page 19: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/19.jpg)
SMU CSE 5344/7344 19
Queuing Discipline• FIFO with Priority Queuing (FIFO-PQ)
– Multiple FIFO queues at each router
– Differential (TOS-based) drops
• Lets VIP jump to head of the line
• Problem?– Can “starve-out” lower-priority packets
– Needs a means to force those packets out as well
![Page 20: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/20.jpg)
SMU CSE 5344/7344 20
Queuing Discipline• Fair Queuing (FQ)
– explicitly segregates traffic based on flows– ensures no flow captures more than its share of
capacity• punishes non-conforming flows
– variation: weighted fair queuing (WFQ)– still needs an end-to-end congestion control
mechanism
• Problem?Flow 1
Flow 2
Flow 3
Flow 4
Round-robinservice
Different Packet lengths
Algorithm “views transmission” as bit-by-bit
![Page 21: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/21.jpg)
SMU CSE 5344/7344 21
FQ Algorithm – single flow
• Suppose clock ticks each time a bit is transmitted
• Let Pi denote the length of packet i
• Let Si denote the time when start to transmit packet i
• Let Fi denote the time when finish transmitting packet i
• Fi = Si + Pi
• When does router start transmitting packet i?– if before router finished tx packet i - 1 from this flow,
then tx immediately after last bit of i - 1 (Fi-1)
– if no current packets for this flow, then start transmitting when arrives (call this Ai)
• Thus: Fi = MAX (Fi - 1, Ai) + Pi
![Page 22: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/22.jpg)
SMU CSE 5344/7344 22
FQ Algorithm – multiple flows• For multiple flows
– calculate Fi for each packet that arrives on each flow
– treat all Fi’s as timestamps
– next packet to transmit is one with lowest timestamp• The one that should finish before the others based on
time
• Not perfect: can’t preempt current packet– So not a perfect case of bit-by-bit round robin
• ExampleFlow 1 Flow 2
(a) (b)
Output Output
F = 8 F = 10F = 5
F = 10
F = 2
Flow 1(arriving)
Flow 2(transmitting)
Select F5,F8 before F10 F2 is smaller and finished before F10, if true bit-by-bit round robin
![Page 23: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/23.jpg)
SMU CSE 5344/7344 23
FQ Algorithm – multiple flows• Link is never left idle – work conserving
– Active NE can use full link capacity
• One flow cannot use more than 1/n capactiy if have n flows– Provides a guaranteed minimum shared bandwidth is
provided each flow
• Weighted Fair Queuing– Specifies (weighs) how much bandwidth any flow
receives– FQ, weight = 1 for each flow– Mechanism can provide TOS
General system concept separate Mechanism from Policy
![Page 24: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/24.jpg)
SMU CSE 5344/7344 24
Approaches to Congestion Control
![Page 25: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/25.jpg)
SMU CSE 5344/7344 25
Approaches towards congestion control
End-end congestion control:
• no explicit feedback from network– To Transport Layer
• congestion inferred from end-system observed loss, delay
• approach taken by TCP– Since IP does not
provide any feedback
Network-assisted congestion control:
• routers (network-layer components) provide feedback to end systems
• Feedback may be:– single bit indicating
congestion (SNA, DECnet, ATM-ABR)
a router tells the sender the explicit rate to transmit on a link
Two broad approaches towards congestion control:
![Page 26: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/26.jpg)
SMU CSE 5344/7344 26
Network-assisted Congestion Control:ATM ABR
ABR: available bit rate:
• “elastic service” if sender’s path “under-loaded”: – sender should use
available bandwidth• if sender’s path
congested: – sender throttled to
minimum guaranteed rate
RM (resource management) cells:
• sent by sender, interspersed with data cells
• bits in RM cell set by switches (“network-assisted”)
• RM cells returned to sender by receiver, with bits intact
![Page 27: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/27.jpg)
SMU CSE 5344/7344 27
ATM ABR Congestion Control
ABR Congestion Control is a rate-based approach:
• Sender computes a maximum rate at which it can send• Sender regulates transmissions accordingly
Three mechanisms to signal congestion-related info:
1. bits in RM cell set by switches (“network-assisted”) – RM cells are interspersed with data cells (1:32
default)– NI bit: no increase in rate (mild congestion) – bit = 1– CI bit: congestion indication – bit = 1– Switches set these bits as RM cells arrive
![Page 28: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/28.jpg)
SMU CSE 5344/7344 28
ATM ABR Congestion ControlThree mechanisms to signal congestion-related
info:
• ER Setting – Explicit Rate– Each RM cell also contains a two-byte ER field– Congested switch lowers the value contained in the ER
field of a passing RM cell– This sets the minimum rate is across all src<>dst
switches
• EFCI bit – Explicit Forward Congestion Indication– Each data cell contains an EFCI bit– Switch sets EFCI bit = 1 to inform destination host– Destination sets CI bit = 1 in RM cell to source host
ATM ABR source adjusts sending rate as a function of CI, NI, ER values
![Page 29: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/29.jpg)
SMU CSE 5344/7344 29
End-to-End Congestion Control
![Page 30: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/30.jpg)
SMU CSE 5344/7344 30
TCP Congestion Control• Idea
– assumes best-effort network (FIFO or FQ routers) each source determines network capacity for itself
– uses implicit feedback– the ACKs pace transmission (self-clocking)
• Challenge– determining the available capacity in the
first place– adjusting to changes in the available
capacity
![Page 31: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/31.jpg)
SMU CSE 5344/7344 31
Additive Increase/Multiplicative Decrease (AIMD)
Objective: adjust to changes in the available capacity
• New state variable per connection: CongestionWindow– limits how much data source has in transit– NW congestion counterpart of flow-control
AdvertisedWindow
MaxWin = MIN(CongestionWindow,AdvertisedWindow) EffWin = MaxWin - (LastByteSent - LastByteAcked)
• Idea:– increase CongestionWindow when congestion goes down– decrease CongestionWindow when congestion goes up
![Page 32: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/32.jpg)
SMU CSE 5344/7344 32
TCP Congestion ControlHow does sender perceive congestion?• loss event = timeout or 3 duplicate ACKs• TCP sender reduces rate (CongWin) after loss
event
three mechanisms to adjust:– AIMD– slow start– conservative after timeout events
![Page 33: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/33.jpg)
SMU CSE 5344/7344 33
AIMD (cont’d)
Question: how does the source determine whether or not the network is congested?
• Answer: a timeout occurs– timeout signals that a packet was lost– packets are seldom lost due to transmission error– lost packet implies congestion
• Behaviorally based
![Page 34: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/34.jpg)
SMU CSE 5344/7344 34
AIMD (cont)
• In practice: increment a little for each ACKIncrement = MSS * (MSS/CongestionWindow)
CongestionWindow += Increment
Source Destination
…
• Algorithm– increment CongestionWindow by one
packet per RTT (linear increase)– divide CongestionWindow by two
whenever a timeout occurs (multiplicative decrease)
![Page 35: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/35.jpg)
SMU CSE 5344/7344 35
TCP AIMDmultiplicative decrease:
cut CongWin in half after loss event
additive increase: increase CongWin by 1 MSS every RTT in the absence of loss events: probing
8 Kbytes
16 Kbytes
24 Kbytes
time
congestionwindow
Long-lived TCP connection
AIMD is necessary for a stability
Decrease aggressively / increase conservatively consequences are less for a smaller window than a larger window
![Page 36: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/36.jpg)
SMU CSE 5344/7344 36
TCP Slow Start
• When connection begins, CongWin = 1 MSS– Example: MSS = 500
bytes & RTT = 200 msec– initial rate = 20 kbps
• available bandwidth may be >> MSS/RTT– desirable to quickly ramp
up to respectable rate
• When connection begins, increase rate exponentially fast until first loss event
![Page 37: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/37.jpg)
SMU CSE 5344/7344 37
TCP Slow Start (more)• When connection
begins, increase rate exponentially until first loss event:– double CongWin every
RTT– done by incrementing CongWin for every ACK received
• Summary: initial rate is slow but ramps up exponentially fast
Host A
one segment
RTT
Host B
time
two segments
four segments
![Page 38: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/38.jpg)
SMU CSE 5344/7344 38
Slow Start (cont’d)
• Exponential growth, but slower than all at once
• Used…– when first starting connection– when connection goes dead waiting for
timeout
![Page 39: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/39.jpg)
SMU CSE 5344/7344 39
Summary: TCP Congestion Control
• When CongWin is below Threshold, sender in slow-start phase, window grows exponentially
• When CongWin is above Threshold, sender is in congestion-avoidance phase, window grows linearly
• When a triple duplicate ACK occurs, Threshold set to CongWin/2 and CongWin set to Threshold
• When timeout occurs, Threshold set to CongWin/2 and CongWin is set to 1 MSS.
![Page 40: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/40.jpg)
SMU CSE 5344/7344 40
TCP sender congestion control
Event State TCP Sender Action Commentary
ACK receipt for previously unACKed data
Slow Start (SS)
CongWin = CongWin + MSS, If (CongWin > Threshold) set state to “Congestion Avoidance”
Resulting in a doubling of CongWin every RTT
ACK receipt for previously unacked data
CongestionAvoidance (CA)
CongWin = CongWin+MSS * (MSS/CongWin)
Additive increase, resulting in increase of CongWin by 1 MSS every RTT
Loss event detected by triple duplicate ACK
SS or CA Threshold = CongWin/2, CongWin = Threshold,Set state to “Congestion Avoidance”
Fast recovery, implementing multiplicative decrease. CongWin will not drop below 1 MSS.
Timeout SS or CA Threshold = CongWin/2, CongWin = 1 MSS,Set state to “Slow Start”
Enter slow start
Duplicate ACK SS or CA Increment duplicate ACK count for segment being ACKed
CongWin and Threshold not changed
![Page 41: Congestion Control](https://reader035.vdocuments.net/reader035/viewer/2022062519/5681539b550346895dc19f49/html5/thumbnails/41.jpg)
SMU CSE 5344/7344 41
End of Class 18