Congestion PDF
Congestion PDF
Mark Handley
Outline
Purpose of congestion control TCPs congestion control algorithm (AIMD) Suitability of AIMD for multimedia TCP-friendly congestion control for multimedia TCP modelling Applications and Congestion Control Datagram Congestion Control Protocol (DCCP)
Congestion Control
End-to-end congestion control serves several purposes: Divides bandwidth between network flows in a "reasonably fair" manner without requiring per-flow scheduling by routers. Prevents congestion collapse of the network by matching demand to supply to ensure overall goodput remains reasonably high.
Congestion Collapse
Congestion collapse occurs when the network is increasingly busy, but little useful work is getting done. Problem: Classical congestion collapse: Paths clogged with unnecessarily-retransmitted packets [Nagle 84]. Fix: Modern TCP retransmit timer and congestion control algorithms [Jacobson 88].
Congestion Control
Since 1988, the Internet has remained functional despite exponential growth, routers that are sometimes buggy or misconfigured, rapidly changing applications and usage patterns, and flash crowds. This is largely because most applications use TCP, and TCP implements end-to-end congestion control.
Outline
Purpose of congestion control TCPs congestion control algorithm (AIMD) Suitability of AIMD for multimedia TCP-friendly congestion control for multimedia TCP modelling Applications and Congestion Control Datagram Congestion Control Protocol (DCCP)
TCPs window is all the packets TCP has sent for which it has not yet seen the acknowlegment.
Data packets
TCPs congestion control adapts the window to fit the capacity available in the network.
Each round-trip time, increase window by one packet. If a packet is lost, halve the window.
TCPs Window
Time (RTTs)
Flow x
TCP Fairness
Flow ys window Flow y Queue
x = y (fairness)
Flow 1
Flow 2
Window of flow 2
Flow 1
Flow 2
Window of flow 1
TCP (Details)
TCP congestion control uses AIMD: Increase the congestion window by one packet every round-trip time (RTT) that no packet is lost. Decrease the congestion window by half every RTT that a packet loss occurs. In heavy congestion, when a retransmitted packet is itself dropped or when there aren't enough packets to run an ACK-clock, use a retransmit timer, which is exponential backed off if repeated losses occur. Slow-start: start by doubling the congestion window every roundtrip time.
The Future
TCP continues to serve us well as the basis of most transport protocols, but some important applications are not well suited to TCP: Telephony and Video-telephony. Streaming Media. Multicast Applications. TCP is a reliable protocol. To achieve reliability while performing congestion control means trading delay for reliability. Telephony and streaming media have limited delay budgets - they don't want total reliability.
receiver buffering (Eg: Rejaie et al, Sigcomm 1999), but it would be better to have a congestion control scheme that was less variable in the first place.
10
Outline
Purpose of congestion control TCPs congestion control algorithm (AIMD) Suitability of AIMD for multimedia TCP-friendly congestion control for multimedia TCP modelling Applications and Congestion Control Multicast congestion control. Datagram Congestion Control Protocol (DCCP)
TCP-Friendly
Any alternative congestion control scheme needs to coexist with TCP in FIFO queues in the best-effort Internet, or be protected from TCP in some manner. To co-exist with TCP, it must impose the same long-term load on the network: No greater long-term throughput as a function of packet loss and delay so TCP doesn't suffer Not significantly less long-term throughput or it's not too useful
11
AIMD with different constants Eg: increase window by 3/7 packets each RTT, decrease multiplicatively by 3/4 when a loss occurs. Equation-based congestion control. Try to design a protocol to achieve the throughput as TCP does on medium timescales.
2.
12
The maximum sending rate in packets per roundtrip time: W The maximum sending rate in bytes/sec: W B / R The average sending rate T: T = (3/4)W B / R The packet drop rate p: The result:
13
TFRC Details
The devil's in the details. How to measure the loss rate? How to use RTT and prevent oscillatory behavior? Not as simple as we first thought. For the details, see: Sally Floyd, Mark Handley, Jitendra Padhye, and Joerg Widmer, Equation-Based Congestion Control for Unicast Applications, Proc ACM SIGCOMM 2000.
14
15
Outline
Purpose of congestion control TCPs congestion control algorithm (AIMD) Suitability of AIMD for multimedia TCP-friendly congestion control for multimedia TCP modelling Applications and Congestion Control Datagram Congestion Control Protocol (DCCP)
Whats in it for me? Why would an multimedia application writer choose to add congestion control? Disadvantages: Extra Complexity. Get to go slower. Variable quality may annoy users. I can just add all this redundancy and FEC you told me about to protect my flows from packet loss. If I dont adapt my rate, all those adaptive TCP flows will just be nice and get out of my way!
16
17
Application-level Adaptation
Streaming media options: Switch between different quality stored encodings. Use a layered codec, and add/drop layers as required. Store high quality, and transcode as required. Video telephony options (easy): Change quantization, frame-rate, image size. Audio telephony options (hard): Codec switching (not ideal - audible artifacts). A few codecs support adjustable bitrates (but not many)
Usually very hard to track the exact rate given by the congestion control algorithm. This area is still research. My current recommendation: Use the congestion controlled rate as the reference rate. Aim to stay within a factor of two of the reference rate. Track correlation between loss rate and transmit rate in case youre the only flow on the bottleneck link!
18
Future Research
Audio congestion control. TFRC, TCP, and RAP all assume you change the packet rate (leaving the packet size constant). What if you need to change the packet size (compression ratio) and leave the packet rate constant?
Outline
Purpose of congestion control TCPs congestion control algorithm (AIMD) Suitability of AIMD for multimedia TCP-friendly congestion control for multimedia TCP modelling Applications and Congestion Control Datagram Congestion Control Protocol (DCCP)
19
Implementing congestion control correctly is hard. Its not usually the area of expertise of the application writer, and certainly doesnt get their product to market faster. TCP is a non-starter. UDP has problems getting though firewalls and NATs because its connectionless.
How about providing a protocol to help out the application writers, and give them some incentive to do the right thing? Result: DCCP.
DCCP Features
DCCP provides the following features: An unreliable flow of datagrams, with acknowledgements. A reliable handshake for connection setup and teardown. Reliable negotiation of options, including negotiation of a suitable congestion control mechanism. Mechanisms allowing a server to avoid holding any state for unacknowledged connection attempts or already-finished connections. An optional mechanism that allows the sender to know, with high reliability, which packets reached the receiver. Congestion control incorporating Explicit Congestion Notification (ECN) and the ECN Nonce. Path MTU discovery, as per [RFC 1191].
20
CLOSEREQ
CLOSING
CLOSED TIME-WAIT CLOSED The client and server's typical progress through states.
21
DCCP status
RFC 4340. Currently a few implementations, but none ready for primetime. Linux probably the best; partly written by Andrea Bittau (UCL) Operating system APIs still a work-in-progress. Expect a few years before it is commonplace enough for application writers, firewalls and NATs to assume its existence.
22
References
J. Nagle, Congestion Control in IP/TCP Internetworks, RFC896, 1984. C. A. Kent, J. C. Mogul, Fragmentation Considered Harmful, WRL Technical Report 87/3, DEC Western Research Laboratory, Palo Alto, CA, 1987. V. Jacobson, Congestion Avoidance and Control, Proc. ACM SIGCOMM 1988 J.C. Mogul, S.E. Deering Path MTU discovery, RFC1191, 1990. Padhye, J., Firoiu, V., Towsley, D. and J. Kurose, Modeling TCP Throughput: A Simple Model and its Empirical Validation, Proc. ACM SIGCOMM 1998. Sally Floyd, Mark Handley, Jitendra Padhye, and Joerg Widmer, Equation-Based Congestion Control for Unicast Applications, Proc ACM SIGCOMM 2000. M. Handley, S. Floyd, J. Padhye, J. Widmer, TCP Friendly Rate Control (TFRC): Protocol Specification, RFC3448, January 2003. E. Kohler, M.Handley, S. Floyd, Datagram Congestion Control Protocol (DCCP), RFC 4340, March 2006.
23