Title: TCPIP Computer Networks Congestion Control
1TCP/IP Computer NetworksCongestion Control
- José Legatheaux Martins
- Departamento de Informática da
- FCT/UNL
2Congestion Control
3Chapter Outline
- Congestion in IP networks
- Unavoidable due to best-effort service model
- Congestion control methods
- Approaches to congestion control
- Mechanisms allowing its implementation
4Required and Alternative Readings
- Larry L. Peterson and Bruce S. Davie, Computer
Networks A Systems Approach 4th Edition,
Morgan Kaufman, 2007 - Chapter 6 sections 6.1 and 6.4
- James F. Kurose and Keith W. Ross, Computer
Networking - A Top-Down Approach Featuring the
Internet, 4th Edition, Addison Wesley Longman,
Inc., 2007 - Chapter 3 sections 3.6
- William Stallings, "Data Computer
Communications, 7th Edition, Prentice-Hall
Pearson, 2004 - Chapter 13 and Chapter 20 section 20.3
- A. S.Tanenbaum, Computer Networks - 4th
Edition, Prentice-Hall, 2003 - Chapter 5 Sections 5.3 and Chapter 6
subsection 6.5.9
5The Problem of Congestion
- What is congestion?
- Load is higher than capacity
- What do IP routers do?
- Drop the excess packets
- Why is this bad?
- Wasted bandwidth for retransmissions
congestion collapse
Increase in load that results in a decrease in
useful work done.
Goodput
Load
6No Problem Under Circuit Switching
- Source establishes connection to destination
- Nodes reserve resources for the connection
- Circuit rejected if the resources arent
available - Cannot have more than the network can handle
7IP Best-Effort Design Philosophy
- Best-effort delivery
- Let everybody send
- Try to deliver what you can
- and just drop the rest
source
destination
IP network
8Queues inside a router
9Congestion is Unavoidable
- Two packets arrive at the same time
- The node can only transmit one
- and either buffer or drop the other
- If many packets arrive in short period of time
- The node cannot keep up with the arriving traffic
- and the buffer may eventually overflow
10Why does it implies bad performance ?
- Theoretical scenario
- Two senders and two receivers
- One router
- Infinite buffers
- No retransmissions
C link capacity
11Ideal behaviour with infinite buffers
- Capacity grows up to a theoretical maximum
- When buffers become full, there are no losses but
delay grows to infinity - Power is the ratio of capacity (bit rate) and
delay. Power easily highlights the network
behaviour
12Real world behaviour
13A more realistic scenario
- Router with finite buffers
- Senders retransmit packets
C link capacity
14Finite buffers and retransmissions
- (a) Theoretical ideal
- (b) Only dropped packets are retransmitted
- (c) Add retransmission of late packets
(duplicates) - Extra cost of congestion all retransmissions
15A more complete scenario
- Fours senders, finite buffers, retransmissions,
multi-hop paths
16Final Result
Extra cost of congestion dropped packets also
consumed resources
17Symptoms of Congestion
- Throughput quickly decreases
- Huge queues in routers
- Many lost packets
- High delays
- Very high jitter
18Ways to Deal With Congestion
- Ignore the problem
- Many dropped (and retransmitted) packets
- Can cause congestion collapse
- Reservations, like in circuit switching
(congestion management and congestion avoidance) - Pre-arrange bandwidth allocations
- Requires negotiation before sending packets
- Or take measures whenever congestion is
approaching - Pricing (differentiate users)
- Dont drop packets for the high-bidders
- Requires a payment model
- Dynamic self-adjustment by users (TCP)
- Every sender infers the level of congestion
- And adapts its sending rate, for the greater good
19Congestion Control Mechanisms
20Network Internal Mechanisms
- These are router to router or router to host
signalling mechanisms. - For example, backpressure packets from a
congested router to the next router, source
router of congestion, iteratively up to the
source host - Example choke packets
- Concrete example in the IP word ICMP source
quench packets - These mechanisms, unfortunately, are part of the
problem, not of the solution.
21Network External Congestion Mechanisms
- Network-assisted
- The router signals to the source host that the
network is congested (DEC-bit, SNA, ATM, ...) - The router signals the available bandwidth to the
end host - These mechanisms are mostly available in
(virtual) circuit oriented networks
- End-to-end
- Network says nothing when it is congested
- End hosts realize that the network is congested
and react accordingly
22ATM Network Example
- ABR available bit rate
- Elastic Service
- If the sender path is lightly loaded, the sender
can increase the bit rate - If this path is congested, the sender must
decrease its rate - Resource management cells
- These cells are spread among the data cells by
the sender - ATM switches position bits in the RM cells
- NI bit rate should not be increased (light
congestion) - CI bit explicit congestion
- RM cells are sent from the sender to the
receiver bits are positioned by the intermediate
switches the receiver must return RM cells to
the sender
23Continued
- RM cells have an ER (explicit rate) two byte
field - A saturated switch can lower the rate value
- If the data cell header bit EFCI (Explicit
Forward Congestion Indication) is set to 1 by a
switch - The receiver must return RM cells to the sender
with the CI (Congestion indication) bit set
24Cell Flow
25End-to-end Congestion Control
- By measuring delay and packet loss, end-hosts can
realize that the network is congested - In face of this event, it is expected that they
lower their emitting rate - If senders do not cooperate, the mechanism is
ineffective - The most know protocol using this behaviour is
TCP
26Many Important Questions
- How does the sender know there is congestion?
- Explicit feedback from the network?
- Inference based on network performance?
- How should the sender adapt?
- Explicit sending rate computed by the network?
- End host coordinates with other hosts?
- End host thinks globally but acts locally?
- What is the performance objective?
- Maximizing goodput, even if some users suffer
more? - Fairness? (Whatever the heck that means!)
- How fast should new TCP senders send?
27Inferring From Implicit Feedback
?
- What does the end host see?
- What can the end host change?
28Where Congestion Happens Links
- Simple resource allocation FIFO queue
drop-tail - Link bandwidth first-in first-out queue
- Packets transmitted in the order they arrive
- Buffer space drop-tail queuing
- If the queue is full, drop the incoming packet
29How it Looks to the End Host
- Packet delay
- Packet experiences high delay
- Packet loss
- Packet gets dropped along the way
- How does TCP sender learn this?
- Delay
- Round-trip time estimate
- Loss
- Timeout
- Triple-duplicate acknowledgment
30What Can the End Host Do?
- Upon detecting congestion
- Decrease the sending rate (e.g., divide in half)
- End host does its part to alleviate the
congestion - But, what if conditions change?
- Suppose there is more bandwidth available
- Would be a shame to stay at a low sending rate
- Upon not detecting congestion
- Increase the sending rate, a little at a time
- And see if the packets are successfully delivered
31Queuing Mechanisms
- Random Early Detection (RED)
- Explicit Congestion Notification (ECN)
32Bursty Loss From Drop-Tail Queuing
- TCP depends on packet loss
- Packet loss is the indication of congestion
- In fact, TCP drives the network into packet loss
- by continuing to increase the sending rate
- Drop-tail queuing leads to bursty loss
- When a link becomes congested
- many arriving packets encounter a full queue
- And, as a result, many flows divide sending rate
in half - and, many individual flows lose multiple packets
33Slow Feedback from Drop Tail
- Feedback comes when buffer is completely full
- even though the buffer has been filling for a
while - Plus, the filling buffer is increasing RTT
- and the variance in the RTT
- Might be better to give early feedback
- Get one or two connections to slow down, not all
of them - Get these connections to slow down before it is
too late
34Random Early Detection (RED)
- Basic idea of RED
- Router notices that the queue is getting
backlogged - and randomly drops packets to signal congestion
- Packet drop probability
- Drop probability increases as queue length
increases - If buffer is below some level, dont drop
anything - otherwise, set drop probability as function of
queue
Probability
Average Queue Length
35RED Management
- If the size of the queue is below T1, do not drop
packets, i.e., drop packets with probability 0 - If the size of the queue is above T2 always drop,
i.e., drop packets with probability 100 - Otherwise drop packets with probability P
- A variant known as WRED (Weigthed RED) adapts the
dropping probability to the flows priority. Low
priority flows get higher probabilities.
36Properties of RED
- Drops packets before queue is full
- In the hope of reducing the rates of some flows
- Drops packet in proportion to each flows rate
- High-rate flows have more packets
- and, hence, a higher chance of being selected
- Drops are spaced out in time
- Which should help desynchronize the TCP senders
- Tolerant of burstiness in the traffic
- By basing the decisions on average queue length
37Problems With RED
- Hard to get the tunable parameters just right
- How early to start dropping packets?
- What slope for the increase in drop probability?
- What time scale for averaging the queue length?
- Sometimes RED helps but sometimes not
- If the parameters arent set right, RED doesnt
help - And it is hard to know how to set the parameters
- RED is implemented in practice
- But, often not used due to the challenges of
tuning right - Many variations in the research community
- With cute names like Blue and FRED ?
38Explicit Congestion Notification
- Early dropping of packets
- Good gives early feedback
- Bad has to drop the packet to give the feedback
- Explicit Congestion Notification
- Router marks the packet with an ECN bit
- and sending host interprets as a sign of
congestion - Surmounting the challenges
- Must be supported by the end hosts and the
routers - Requires two bits in the IP header (one for the
ECN mark, and one to indicate the ECN capability) - Solution borrow two of the Type-Of-Service bits
in the IPv4 packet header
39Conclusions
Congestion must be avoided in order to optimally
use the network Backpressure and choke packets
are mostly, part of the problem, not of the
solution Network assisted mechanisms are well
suited for circuit switched networks with usage
contracts (SLAs) Connection-less networks
mostly use end-to-end feedback to infer network
congestion. These mechanisms depend of hosts
being well behaved and must be provided in a
protocol by protocol basis
40Acknowledgements
- These slides have several sources
- Textbooks companion web sites
- Computer Networks A Systems Approach (4th
edition), by Peterson and Davie, 2007 - Computer Networking A Top-Down Approach
Featuring the Internet (4th edition), by Kurose
and Ross, 2007 - Data Computer Communications, William
Stallings, 7th Edition, 2004 - Slides of the course
- Computer Networks, COS461, Jennifer Rexford,
Princeton University, 2007