Congestion Avoidance Richard T. B. Ma School of Computing National University of Singapore CS 5229: Advanced Compute Networks
References K. K. Ramakrishnan, Raj Jain, A Binary Feedback Scheme for Congestion Avoidance in Computer Networks with a Connectionless Network Layer, ACM Computer Communication Review, Vol. 18, No. 4, August 1988, pp. 303-313.
Congestion Collapse When: October 1986 Where: Lawrence Berkeley Laboratory (LBL) to UC Berkeley site, 400 yards and 3 hops away What: Throughput dropped from 32 Kbps to 40bps
Network Congestion Congestion in a packet-switched network Source Router 1.5-Mbps T1 link Dest Source
Flow Control VS Congestion Control End-to-end flow control looks at selfish control function Make sure sufficient buffer at destination RcvWindow = RcvBuffer (LastByteRcvd LastByteRead) Congestion control solves a social problem Logical links of network cooperate to avoid/recover from congestion of the intermediate nodes they share
Congestion Avoidance/Control Congestion control: Detect and reduce load from the Cliff Congestion avoidance: Operate network at the Knee
Connectionless Flows Multiple flows passing through a set of routers Source Router Router Dest1 Source Source Router Dest2
DECbit Scheme: 1-bit Feedback 0 1 Congestion Avoidance Bit 1 Minimum feedback information One congestion avoidance bit Set by the router if congested Destination send it back in ACK When does the router set avoidance bit? What does an end-host respond?
Optimization Criteria (Metrics) Efficiency Maximize Power Power Trougput α Response Time, 0 < α < 1. Operate at Knee when maximizing for α = 1 Resource Efficiency Resource Power Resource Power at Knee Less than 100% efficiency can happen when Underutilize capacity (low throughput) Overutilize capacity (high response time)
Optimization Criteria (Metrics) Fairness Maximize Jain s index J x = n i=1 x i n i=1 2 n x i 2 x i denotes i s resource share, absolute or % J x 0,1 Independent of scale Continuous J x = k/n if only k users are allocated equally
Optimization Criteria (Metrics) Distributedness Only depends congestion avoidance bit End-hosts control independently Convergence Responsiveness Smoothness
Congestion Detection at Router Assumption: single server FIFO type Metrics: 1) utilization ρ, 2) # of users L Packet size distribution determine service time distribution When packet size varies a lot, utilization ρ is not a good measure of congestion L is used instead to measure congestion
Hysteresis algorithm Two thresholds 0 < T 1 < T 2 Set congestion signal when L > T 2 Unset congestion signal when L < T 1 Equivalently, the algorithm maintains a center C and width K such that T 1 = C K and T 2 = C + K Power is maximized (in experiment) with C = 1 and K = 0 (or T 1 = T 2 = 1) Set congestion avoidance bit when L 1
Feedback Filter at Router Do not use instantaneous value of L(t) Average over time interval T Using last (busy + idle) cycle time plus the busy period of the current cycle
User Policy: Decision Frequency Update after each acknowledgement Update after receiving W p + W c packets W p and W c are the previous & current window sizes
User Policy: Signal Filtering Use of Received Information Only the most recent W c packets are examined Drop old information (W p packets) after update Signal Filtering Reduce W c if more than 50% of the bits are set Increase W c otherwise Why do we use 50% as a cutting point?
User Policy: Signal Filtering For M/M/1, power = Throughput RTT Max power is attained at ρ = 0.5 1/μ E D = 1 ρ ρ At the optimum, π 0 = 1 ρ = 0.5 and π i = π 0 ρ i = 0.5 i+1 If use a threshold C to set congestion bit At the optimum operating point P bit set = 1 π 0 π 1 π C 1 If more than P bit set W c packets are set, system is overutilized; otherwise, it is underutilized.
User Policy: Signal Filtering Use of Received Information Only the most recent W c packets are examined Drop old information (W p packets) after update Signal Filtering Reduce W c if more than 50% of the bits are set Increase W c otherwise Decision Function How much to increase/decrease?
Decision Function Requirements Achieve efficiency (high resource power) Achieve fairness (high Jain s index) Minimize oscillations Minimize convergence time
Decision Function Choices 1. Additive increase additive decrease (AIAD) : W c i = W p i + b; : W c i = W p i d 2. Additive increase multiplicative decrease (AIMD) : W c i = W p i + b; : W c i = dw p i 3. Multiplicative increase additive decrease (MIAD) : W c i = bw p i ; : W c i = W p i d 4. Multiplicative increase and decrease (MIMD) : W c i = bw p i ; : W c i = dw p i
References Dah Ming Chiu and Raj Jain, Analysis of the Increase and Decrease Algorithms for Congestion Avoidance in Computer Networks, Computer Networks and ISDN Systems, 1989, Vol. 17, pp. 1-14.
Synchronous Feedback Model Feedback control loop is synchronous Congestion state is determined by the number of packets in the system Single bottleneck Binary feedback
Distributed Linear Control Each user i adjust the window size x i as a function of feedback x i t + 1 = a I + b I x i (t) if y t = 0 a D + b D x i (t) if y t = 1 Decision on the values of a I, a D, b I and b D. AIAD: a I > 0 > a D ; b I = b D = 1. AIMD: a I > 0; 0 < b D < b I = 1. MIAD: a D < 0; b D = 1 < b I. MIMD: 0 < b D < 1 < b I.
Pictorial Explanation/Intuition Additive Movement Multiplicative Movement
AIMD Works
AIAD Not Fair (so as MIMD)
Efficiency Convergence
Fairness Convergence Conclusion: Decrease must be multiplicative in order to achieve fairness and efficiency.
Increase Fairness & Efficiency Conclusion: Optimal increase is additive in order to achieve fairness and efficiency.
Decision Function Choices 1. Additive increase additive decrease (AIAD) : W c i = W p i + b; : W c i = W p i d 2. Additive increase multiplicative decrease (AIMD) : W c i = W p i + b; : W c i = dw p i 3. Multiplicative increase additive decrease (MIAD) : W c i = bw p i ; : W c i = W p i d 4. Multiplicative increase and decrease (MIMD) : W c i = bw p i ; : W c i = dw p i
Optimal Convergence To Efficiency t e : time to convergence Responsiveness improved with large increase/decreases parameters s e : oscillation size Smoothness improved with small increase/decreases parameters Fairness AIMD is the optimal mechanism that convergences to fairness
Buffer Management Source Router 1.5-Mbps T1 link Dest Source Buffer over-flow under congestion When to drop packets? Which packets to drop?
References Sally Floyd and Van Jacobson, Random Early Detection Gateway for Congestion Avoidance, IEEE/ACM Transactions on Networking, Vol. 1 No. 4, August 1993.
Congestion Avoidance Default mechanism: FIFO, droptail Congestion can be detected after packet drop Induce long queues and queueing delays Main Goal and desirable objectives Provide congestion avoidance by controlling the average queue length High throughput and low delay Routers can detect congestion better Distinguish propagation and queueing delay
Random Early Detection (RED) Does not assume cooperative end hosts, and provide probabilistic fairness to flows General buffer management scheme that can be used with other congestion control mechanisms, e.g. TCP, scheduling mechanisms, e.g. FIFO, priority queueing. Does not require all routers in the Internet to implement in order for RED to work (incremental deployment is possible) Avoid global synchronization
RED VS DECbit Computing average queue size DECbit: last (busy+idle) cycle + current busy cycle for averaging queue size RED: time-based exponential decay Notifying congestion DECbit: no separation of detection and marking, biased against bursty traffic RED: randomized marking, avoid global synchronization
RED Algorithm (high-level) For each packet arrival calculate the average queue size avg if t min avg < t max calculate probability p a mark the arriving packet with probability p a else if t max avg mark the arriving packet
RED Active Queue Management p x = 0, 0 x < t min x t min t max t min pmax, t min x t max 1, t max < x 1 p max 0 t min t max
RED Algorithm (part 1) Initialization: for each packet arrival avg = 0; count = 1; calculate the average queue size avg: if queue is nonempty: avg = 1 w q avg + w q q else: m = f time q_time ; avg = 1 w q m avg
RED Algorithm (part2) if t min avg < t max count = count + 1; calculate probability p a : p b = p max (avg t min )/(t max t min ); p a = p b /(1 count p b ); with probability p a : mark the arriving packet; count = 0; else if t max avg mark the arriving packet; count = 0; else count = 1; When queue becomes empty: q_time = time
Relationship between p a and p b p a = p b /(1 count p b ) p a increases slowly with count Ensure that the router does not wait too long before marking a packet Make inter-dropping time uniform
Relationship between p a and p b Use p b as the final dropping probability Inter-dropping time T b is geometric Prob T b = n = 1 p b n 1 p b ; E T b = 1/p b More desirable to have uniform distribution Use p a as the final dropping probability Prob T a = n = p b n 2 1 p b 1 n 1 p b i=0 1 ip b = p b 1 n 1/p b 0 n > 1/p b E T a = 1 2p b + 1 2
How About TCP? How to control congestion window sizes? How to infer congestion? Why and how to estimate and smooth RTT? What is Slow Start? Why do we need it? Retransmit timer back-off policy Acknowledgement sending policy
References Van Jacobson, Congestion Avoidance and Control, ACM Computer Communication Review Vol. 18, No. 4, August 1988, pp. 314-329.