Active Queue Management Rong Pan Cisco System EE384y Spring Quarter 2006
Outline Queue Management Drop as a way to feedback to TCP sources Part of a closed-loop Traditional Queue Management Drop Tail Problems Active Queue Management RED CHOKe AFD 2
Queue Management: Drops/Marks - A Feedback Mechanism To Regulate End TCP Hosts End hosts send TCP traffic -> Queue size Network elements, switches/routers, generate drops/marks based on their queue sizes Drops/Marks: regulation messages to end hosts TCP sources respond to drops/marks by cutting down their windows, i.e. sending rate 3
TCP+Queue Management - A closed-loop control system W/R C + _ N + _ q 0.5 - + Time Delay p Queue Management 1 4
Drop Tail - problems Lock out Full queue Bias against bursty traffic Global synchronization 5
Tail Drop Queue Management Lock-Out Max Queue Length 6
Tail Drop Queue Management Full-Queue Only drop packets when queue is full long steady-state delay 7
Bias Against Bursty Traffic Max Queue Length 8
Tail Drop Queue Management Global Synchronization Max Queue Length 9
Alternative Queue Management Schemes Drop from front on full queue Drop at random on full queue both solve the lock-out problem both have the full-queues problem 10
Active Queue Management Goals Solve tail-drop problems no lock-out behavior no global synchronization no bias against bursty flow Provide better QoS at a router low steady-state delay lower packet dropping 11
Random Early Detection (RED) Arriving packet Admit the new packet end no AvgQsize > Min th? yes AvgQsize > Max th? no yes Admit packet with a probability p end Drop the new packet end 12
RED Dropping Curve Drop Probability 1 0 max p min th max th Average Queue Size 13
Effectiveness of RED - Lock-Out & Global Synchronization Packets are randomly dropped Each flow has the same probability of being discarded 14
Effectiveness of RED - Full-Queue & Bias against bursty traffic Drop packets probabilistically in anticipation of congestion not when queue is full Use q avg to decide packet dropping probability: allow instantaneous bursts 15
What QoS does RED Provide? Lower buffer delay: good interactive service q avg is controlled to be small Given responsive flows: packet dropping is reduced early congestion indication allows traffic to throttle back before congestion Given responsive flows: fair bandwidth allocation 16
Bad News - unresponsive end hosts udp tcp udp udp tcp tcp The Internet Connectionless; Best-Effort 17
Scheduling & Queue Management What routers want to do? isolate unresponsive flows (e.g. UDP) provide Quality of Service to all users Two ways to do it scheduling algorithms: e.g. FQ, CSFQ, SFQ queue management algorithms: e.g. RED, FRED, SRED 18
FQ vs. RED Isolation from nonadaptive flows FQ Hard/Expensive to implement No isolation from non-adaptive flows RED Easy to implement 19
Active Queue Manament With Enhancement to Fairness FIFO Provide isolation from unresponsive flows Be as simple as RED 20
Admit the new packet end no yes CHOKe RED AvgQsize > Min th? Flow id same as AvgQsize > Max th? the new nopacket id? no Admit packet end with a probability p Arriving packet yes no end Drop the new packet yes Drop both Admit packet with AvgQsize Drop > the Max new packet th? matched packets a probability no p yes end end Draw a packet at random from queue end 21
Random Sampling from Queue UDP flow A randomly chosen packet more likely from the unresponsive flow Adversary can t fool the system 22
Comparison of Flow ID Compare the flow id with the incoming packet more acurate Reduce the chance of dropping packets from a TCPfriendly flows. 23
Dropping Mechanism Drop packets (both incoming and matching samples ) More arrival -> More Drop Give users a disincentive to send more 24
Simulation Setup S(1) D(1) m TCP Sources S(2) 10Mbps 10Mbps D(2) m TCP Sinks S(m) 1Mbps D(m) S(m+1) D(m+1) n UDP Sources n UDP Sinks S(m+n) D(m+n) 25
Network Setup Parameters 32 TCP flows, 1 UDP flow All TCP s maximum window size = 300 All links have a propagation delay of 1ms FIFO buffer size = 300 packets All packets sizes = 1 KByte RED: (min th,max th ) = (100,200) packets 26
32 TCP, 1 UDP (one sample) T hro ug hput (K b ps) 1000 800 600 400 200 23.0% UDP Throughput (RED) UDP Throughput (CHOKe) Avg. TCP Throughput (CHOKe) 74.1% 99.6% 0 100 1000 10000 UDP Arrival Rate (Kbps) 27
32 TCP, 5 UDP (5 samples) Throughput (Kbps) 1500 1200 900 600 300 CHOKe(one sample):total UDP Throughput CHOKe(one sample):total TCP Throughput CHOKe with 5 samples: Total UDP Throughput CHOKe with 5 samples: Total TCP Throughput 0 100 1000 10000 Total UDP Arrival Rate (Kbps) 28
How Many Samples to Take? R k R 2 R 1 Max th avg min th Different samples for different Qlen avg # samples when Qlen avg close to min th # samples when Qlen avg close to max th 29
32 TCP, 5 UDP (selfadjusting) Throughput (Kbps) 1200 900 600 300 0 Total UDP Throughput Total TCP Throughput 61.1% 38.3% 89.7% 6.6% 99.3% 100 1000 10000 Total UDP Arrival Rate (Kbps) 30
Analytical Model discards from the queue permeable tube with leakage 31
Fluid Analysis N: the total number of packets in the buffer L i (t): the survial rate for flow i packets L i (t)δt - L i (t +δt)δt = λ i δt L i (t)δt /N - dl i (t)/dt = λ i L i (t) N L i (0) = λ i (1-p i ) L i (D) = λ i (1-2p i ) 32
Model vs Simulation - multiple TCPs and one UDP Throughput 350 300 250 200 150 100 50 0 fluid model CHOKe ns simulation 1/(1+e) 0.1 1 10 Arrival Rate 33
Fluid Model - Multiple samples Multiple samples are chosen L i (t)δt - L i (t +δt)δt = Mλ i δt L i (t)δt /N - dl i (t)/dt = Mλ i L i (t) N L i (0) = λ i (1-p i ) M L i (D) = λ i (1-p i ) M - Mλ i p i 34
Two Samples - multiple TCPs and one UDP UDP Throughput(Kbps) 140 120 100 80 60 40 20 0 NS Simulation Fluid Model 0 0.5 1 1.5 2 UDP Arrival Rate(Mbps) 35
Two Samples - multiple TCPs and two UDP UDP Throughput(Kbps) 200 160 120 80 40 0 NS Simulation Fluid Model 0 0.5 1 1.5 2 UDP Arrival Rate(Mbps) 36
What If We Use a Small Amount of State? 37
AFD: Goal Approximate equal bandwidth allocation Not only AQM, approximate DRR scheduling Provide soft queues in addition to physical queues Keep the state requirement small Be simple to implement 38
AFD Algorithm: Details (Basic Case: Equal Share) Arriving Packets Di = Drop Probability for Class i Qlen Class i M i = Arrival estimate for Class i (Bytes over interval T s ) D i 1-D i Qref Mfair = Mfair - a (Qlen - Qref) + b (Qlen_old - Qref) Fair Share If M i Mfair : No Drop (D i = 0) If M i > Mfair : D i > 0 such that M i (1-D i ) = Mfair 39
AFD Algorithm: Details (General Case) Arriving Packets Di = Drop Probability for Class i Qlen Class i M i = Arrival estimate for Class i (Bytes over interval T s ) D i 1-D i Qref Mfair = Mfair - a (Qlen - Qref) + b (Qlen_old - Qref) Fair Share If M i F(Mfair,Min i,max i,w i, ): No Drop (D i = 0) If M i > Mfair : D i > 0 such that M i (1-D i ) = F(Mfair,Min i,max i,w i, ) 40
Not Per-Flow State Fraction of flows State requirement on the order of # of unresponsive flows 41
AFD Solution: Details Based on 3 simple mechanisms estimate per class arrival rate counting per class bytes over fixed intervals ( T s ) potential averaging over multiple intervals estimate deserved departure rate (so as to achieve the proper bandwidth allocation for the class) Observation and averaging of queue length as measure of congestion Functional definition of fair share based on fairness criterion perform probabilistic dropping (pre-enqueue) to drive arrival rate to equal desired departure rate 42
Mixed Traffic with Different Levels of Unresponsiveness 500 Throughput (kbps) 400 300 200 100 0 RED CHOKe AFD 43
Drop Probabilities (note differential dropping) 0.3 Drop Probability 0.25 0.2 0.15 0.1 0.05 0 RED CHOKe AFD 44
Different Number of TCP Flows in Each Class Class 1 5 TCP Flows Class 2 10 TCP Flows 0 50 100 150 200 time 0 50 100 150 200 time 15 TCP Flows 20 TCP Flows Class 3 Class 4 0 50 100 150 200 time 0 50 100 150 200 time 45
Different Class Throughput Comparison 46
Queue Length 47
Mfair 48
AFD Implementation Issues Monitor Arrival Rate Determine Drop Probability Maximize Link Utilization 49
Arrival Monitoring Keep a counter for each class Count the data arrivals (in bytes) of each class in 10ms interval: arv i Arrival rate of each class is updated every 10ms m i = m i (1-1/2 c )+arv i c determines the average window 50
Implementing the Drop Function If M i Mfair then D i = 0 Otherwise, rewrite the drop function as Suppose we have predetermined drop levels, find the one such that D i * M i = (M i Mfair) 51
Implementing the Drop Function "###$ Di! 0.0 0.375 0.406 1.0 52
AFD - Summary Fairness FQ AFD Ideal CHOKe RED Simplicity Equal share is approximated in a wide variety of settings The state requirement is limited 53
Summary Traditional Queue Management Drop Tail, Drop Front, Drop Random Problems: lock-out, full queue, global synchronization, bias against bursty traffic Active Queue Management RED: can t handle unresponsive flows CHOKe: penalize unresponsive flows AFD: provides approximate fairness with limited states 54