Traffic Managers: Active Queue Management Algorithms

Download Report

Transcript Traffic Managers: Active Queue Management Algorithms

Traffic Managers:
Active Queue
Management
Algorithms
COMP680E by M. Hamdi
1
Queuing Disciplines
• Each router must implement some queuing
discipline
• Queuing allocates both bandwidth and buffer space:
– Bandwidth: which packet to serve (transmit) next - This
is scheduling
– Buffer space: which packet to drop next (when required)
– this buffer management
• Queuing affects the delay of a packet (QoS)
COMP680E by M. Hamdi
2
Queuing Disciplines
Traffic
Sources
Traffic
Classes
Class A
Class B
Class C
Drop
Scheduling
Buffer Management
COMP680E by M. Hamdi
3
Active Queue Management
TCP
AQM
TCP
Advantages
• Reduce packet losses
(due to queue overflow)
• Reduce queuing delay
ACK…
Drop!!!
ACK…
Congestion
Queue
Inbound Link
Router
Sink
Outbound Link
ACK…
Congestion
Notification…
COMP680E by M. Hamdi
Sink
4
QoS Router
Queue management
Policer
Per-flow Queue
Scheduler
Classifier
Policer
Per-flow Queue
Policer
Per-flow Queue
Scheduler
Classifier
Policer
shaper
shaper
Per-flow Queue
COMP680E by M. Hamdi
5
Packet Drop Dimensions
Aggregation
Single class
Per-connection state
Class-based queuing
Drop position
Head
Tail
Random location
Overflow drop
Early drop
COMP680E by M. Hamdi
6
Typical Internet Queuing
• FIFO + drop-tail
– Simplest choice
– Used widely in the Internet
• FIFO (first-in-first-out)
– Implies single class of traffic
• Drop-tail
– Arriving packets get dropped when queue is full
regardless of flow or importance
• Important distinction:
– FIFO: scheduling discipline
– Drop-tail: drop policy (buffer management)
COMP680E by M. Hamdi
7
FIFO + Drop-tail Problems
• FIFO Issues: (irrespective of the aggregation level)
– No isolation between flows: full burden on e2e control
(e..g., TCP)
– No policing: send more packets  get more service
• Drop-tail issues:
– Routers are forced to have have large queues to maintain
high utilizations
– Larger buffers => larger steady state queues/delays
– Synchronization: end hosts react to the same events because
packets tend to be lost in bursts
– Lock-out: a side effect of burstiness and synchronization is
that a few flows can monopolize queue space
COMP680E by M. Hamdi
8
Synchronization Problem
• Because of Congestion Avoidance in TCP
cwnd
Slow Start
W*
Congestion Avoidance
W
4
W+1
W*/2
2
1
RTT
RTT
COMP680E by M. Hamdi
Time
9
Synchronization Problem
All TCP connections
reduce their transmission
rate on crossing over the
maximum queue size.
The TCP connections
increase their tx rate
using the slow start and
congestion avoidance.
The TCP connections
reduce their tx rate again.
It makes the network
traffic fluctuate.
Total Queue
Queue Size
Time
COMP680E by M. Hamdi
10
Global Synchronization Problem
Max Queue Length
Can result in very low throughput during periods of
congestion
COMP680E by M. Hamdi
11
Global Synchronization Problem
 TCP Congestion control
 Synchronization: leads to bandwidth under-utilization
 Persistently full queues: leads to large queueing delays
 Cannot provide (weighted) fairness to traffic flows – inherently
proposed for responsive flows
Rate
bottleneck
rate
Aggregate
load
Flow 1
Flow 2
Time
COMP680E by M. Hamdi
12
Lock-out Problem
Max Queue Length
• Lock-Out: In some situations tail drop allows a single
connection or a few flows (misbehaving flows: UDP) to monopolize
queue space, preventing other connections from getting room in
the queue. This "lock-out" phenomenon is often the result of
synchronization.
COMP680E by M. Hamdi
13
Bias Against Bursty Traffic
Max Queue Length
During dropping, bursty traffic will be dropped in benchs – which is
not fair for bursty connections
COMP680E by M. Hamdi
14
Active Queue Management
Goals
• Solve lock-out and full-queue 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
COMP680E by M. Hamdi
15
RED (Random Early Detection)
• FIFO scheduling
• Buffer management:
– Probabilistically discard packets
– Probability is computed as a function of average
queue length
Discard Probability
1
0
min_th
max_th queue_len Average
Queue Length
COMP680E by M. Hamdi
16
Random Early Detection
(RED)
COMP680E by M. Hamdi
17
RED operation
Min thresh
Max thresh
Average queue
length
P(drop)
1.0
MaxP
Avg length
minthresh
maxthresh
COMP680E by M. Hamdi
18
RED (Random Early Detection)
• FIFO scheduling
Min thresh
Max thresh
Average queue
length
Case 1:
Make
Define
Use
Admit
of
Two
Average
the
Threshold
New Queue
Packet
Values
Length
Average Queue Length < Min. Thresh Value
COMP680E by M. Hamdi
19
RED (Cont’d)
Min thresh
Max thresh
p p
1-p1-p
Average queue
length
Case 2: Average Queue Length between
Admit
Or
Dropthe
theNew
NewPacket
PacketWith
WithProbability
Probabilityp…
1-p
Min. and Max. Threshold Value
COMP680E by M. Hamdi
20
Random Early Detection
Algorithm
for each packet arrival:
calculate the average queue size ave
if ave ≤ minth
do nothing
else if minth ≤ ave ≤ maxth
calculate drop probability p
drop arriving packet with probability p
else if maxth ≤ ave
drop the arriving packet
• ave = (1 – wq)ave + wqq
• P = max_P*(avg_len – min_th)/(max_th – min_th)
COMP680E by M. Hamdi
21
Random early detection (RED) packet drop
Average queue length
Max
queue length
Drop probability
Forced drop
Max
threshold
Probabilistic
early drop
Min
threshold
No drop
Time
Active Queue Management
Random Early Detection (RED)
Drop probability
Max Queue Size
Average queue length
Forced drop
Max Threshold
Probabilistic drops
Min Threshold
No drops
Time
• Weighted average accommodates bursty traffic
l
Probabilistic drops
» avoid consecutive drops
» drops proportional to bandwidth utilization
– (drop rate equal for all flows)
COMP680E by M. Hamdi
23
RED Vulnerable to
Misbehaving Flows
1,400
UDP blast
TCP Throughput
(Kbytes/Sec)
1,200
1,000
FIFO
RED
800
600
400
200
0
0
10
20
30
40
50
60
Time (seconds)
70
COMP680E by M. Hamdi
80
90
100
24
Effectiveness of RED
- Lock-Out & Global Synchronization
• Packets are randomly dropped
• Each flow has the same probability of being
discarded
COMP680E by M. Hamdi
25
Effectiveness of RED
- Full-Queue & Bias against bursty traffic
• Drop packets probabilistically in anticipation of
congestion
– Not when queue is full
• Use qavg to decide packet dropping probability :
allow instantaneous bursts
COMP680E by M. Hamdi
26
What QoS does RED Provide?
• Lower buffer delay: good interactive service
– qavg is controlled to be small
• Given responsive flows: packet dropping is
reduced
– Early congestion indication allows traffic to throttle
back before congestion
• RED provide small delay, small packet loss, and
high throughput (when it has responsive flows).
COMP680E by M. Hamdi
27
Weighted RED (WRED)
• WRED provides separate thresholds and weights for
different IP precedences, allowing us to provide different
quality of service to different traffic
• Lower priority class traffic may be dropped more
frequently than higher priority traffic during periods of
congestion
COMP680E by M. Hamdi
28
WRED (Cont..)
High Priority
traffic
Medium
Priority traffic
Low Priority
traffic
Random
Dropping
COMP680E by M. Hamdi
29
Congestion Avoidance: Weighted Random Early
Detection (WRED)
Adds Per-Class
Queue Thresholds
for Differential
Treatment
Probability
of Packet
Discard
Two Classes are
Shown; Any
number of classes
Can Be Defined
Average
Queue
Depth
Standard
Minimum
Threshold
Premium
Minimum
Threshold
Std and Pre
Maximum
Threshold
COMP680E by M. Hamdi
30
Problems with (W)RED – unresponsive
flows
COMP680E by M. Hamdi
31
Vulnerability to Misbehaving Flows
• TCP performance on a 10 Mbps link under RED in the face
of a “UDP” blast
COMP680E by M. Hamdi
32
Vulnerability to Misbehaving Flows
• Try to look at the following example:
• Assume there is a network which is set up as:
S(1)
S(1)
100Mbps
100Mbps
TCP
sources
TCP
sources
S(m)
R1
10Mbps
R2
S(m+1)
S(m)
S(m+1)
UDP
sources
UDP
sources
S(m+n)
S(m+n)
COMP680E by M. Hamdi
33
Vulnerability to Misbehaving Flows
Throughput Analysis
1.2
Ideal
RED
Throughput (Mbps)
1
0.8
0.6
0.4
0.2
0
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Flow number
COMP680E by M. Hamdi
34
20
Vulnerability to Misbehaving Flows
• Queue Size versus Time
CHOKe: Queue Size
250
Average Queue Size
Current Queue Size
RED: Queue Size
Size of Queue (No. of Packets)
200
150
Delay is
bounded
100
50
0
0
5
10
15
20
25
30
35
40
45
50
Global
Synchronization
solved
Time (Seconds)
COMP680E by M. Hamdi
35
Unfairness of RED
RED's Throughput
1000
Idea Fair Share
RED's Throughput
Unresponsive
Flow (such as
UDP)
900
800
Throughput (Kbps)
An unresponsive
700
flow occupies over
600
95% of bandwidth
500
400
300
32 TCP Flows
1 UDP Flow
200
100
0
0
5
10
15
20
25
30
35
Flow Number
COMP680E by M. Hamdi
36
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., WFQ, WRR
– Queue management algorithms:
e.g., RED, FRED, SRED
COMP680E by M. Hamdi
37
The setup and problems
l
In a congested network with many users
l
QoS requirements are different
l
Problem:
q
Allocate bandwidth fairly
COMP680E by M. Hamdi
38
Approach 1: Network-Centric
l
Network node: Fair Queueing (FQ)
l
User traffic: any type
Problem: complex implementation
lots of work per flow
COMP680E by M. Hamdi
39
Approach 2: User-Centric
l
l
Network node:
n
simple FIFO buffer;
n
active queue management (AQM): RED
User traffic: congestion-aware (e.g. TCP)
Problem: requires user cooperation
COMP680E by M. Hamdi
40
Current Trend
l
Network node:
n
n
l
simple FIFO buffer
AQM schemes with enhancement to provide fairness:
preferential dropping packets
User traffic: any type
COMP680E by M. Hamdi
41
Packet Dropping Schemes
Size-based Schemes
l
drop decision based on the size of FIFO queue
e.g. RED
n
n
l
Content-based Schemes
n
n
l
drop decision based on the current content of the FIFO
queue
e.g. CHOKe
History-based Schemes
n
n
keep a history of packet arrivals/drops to guide drop
decision
e.g. SRED, RED with penalty box, AFD
COMP680E by M. Hamdi
42
CHOKe (no state information)
COMP680E by M. Hamdi
43
Random Sampling from Queue
• A randomly chosen packet more likely from the
unresponsive flow
• Unresponsive flows can’t fool the system
COMP680E by M. Hamdi
44
Comparison of Flow ID
• Compare the flow id with the incoming packet
– More accurate
– Reduce the chance of dropping packets from a TCPfriendly flows
COMP680E by M. Hamdi
45
Dropping Mechanism
• Drop packets (both incoming and matching
samples)
– More arrival  More Drop
– Give users a disincentive to send more
COMP680E by M. Hamdi
46
CHOKe (Cont’d)
Min thresh
Max thresh
Average queue
length
Case 1:
Admit the New Packet
Average Queue Length < Min. Thresh Value
COMP680E by M. Hamdi
47
CHOKe (Cont’d)
Min thresh
Max thresh
p
1-p
Average queue
length
A If
packet
Case
they
If 2:
they
are
is Avg.
randomly
from
are
Queue
from
different
chosen
Length
the same
flows,
from
is between
flow,
the
the same
queue
to compare
Min.
both
and
logic
packets
with
Max.
inthe
RED
Threshold
will
new
applies
be arrival
dropped
Values
packet
COMP680E by M. Hamdi
48
CHOKe (Cont’d)
Min thresh
Max thresh
Average queue
length
AIf
If
random
they
they are
are
packet
from
from
Case
will
different
the
3: be
same
chosen
flows,
flow,for
Avg. Queue
the
both
new
Length
packets
packet
comparison
>will
Max.
willbe
be
Threshold
dropped
dropped Value
COMP680E by M. Hamdi
49
Simulation Setup
COMP680E by M. Hamdi
50
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 = 1KByte
RED: (minth, maxth) = (100,200) packets
COMP680E by M. Hamdi
51
32 TCP, 1 UDP (one sample)
COMP680E by M. Hamdi
52
32 TCP, 5 UDP (5 samples)
COMP680E by M. Hamdi
53
How Many Samples to Take?
• Different samples for different Qlenavg
– # samples decrease when Qlenavg close to minth
– # samples increase when Qlenavg close to maxth
COMP680E by M. Hamdi
54
32 TCP, 5 UDP (self-adjusting)
COMP680E by M. Hamdi
55
Two Problems of CHOKe
• Problem I:
– Unfairness among UDP flows of different rates
• Problem II:
– Difficulty in choosing automatically how many to drop
COMP680E by M. Hamdi
56
SAC (Self Adjustable
CHOKe
Tries to Solve the previously
mentioned two problems
COMP680E by M. Hamdi
57
SAC
Problem 1: Unfairness among UDP flows of different rates (e.g., when k
=1, the UDP flow 31 (6 Mbps) has 1/3 throughput of UDP flow 32 (1
Mbps), and when k =10 , throughput of UDP flow 31 is almost 0).
Throughput per flow (30 tcp flows and 2 udp misbehaving flows)
400
CHOKe 1
CHOKe 10
Ideal Fair Share
350
300
Tthroughput(Kbps)
•
250
200
150
100
50
0
0
5
10
15
20
Flow number
COMP680E by M. Hamdi
25
30
35
58
SAC
• Problem 2: Difficulty in choosing automatically how many to drop (when k =
4, UDPs occupy most of the BW. When k =10, relatively good fair sharing,
and when k = 20, TCPs get most of the BW).
Throughput per flow (30 tcp flows and 4 udp misbehaving flows)
180
CHOKe 4
CHOKe 10
CHOKe 20
160
Throughput(Kbps)
140
120
100
80
60
40
20
0
0
5
10
15
20
Flow number
COMP680E by M. Hamdi
25
30
35
59
SAC
•
Solutions:
1. Search from the tail of the queue for a packet
with the same flow number and drop this
packet instead of random dropping – because
the higher a flow rate is, the more likely its
packets will gather at the rear of the queue.
The queue occupancy will be more evenly
distributed among the flows.
2. Automate the process of determining k
according to traffic status (number of active
flows and number of UDP flows)
COMP680E by M. Hamdi
60
SAC
•
•
•
•
•
•
Once an incoming UDP is compared with a randomly
selected packet, if they are of the same flow, P is updated in
this way:
P  (1-wp) P + wp.
If they are of different flows, P is updated as follows:
P  (1-wp) P .
If P is small, then there are more competing flows, and we
should increase the value of k.
Once there is an incoming packet, if it is a UDP packet, R is
updated in this way:
R  (1-wr) R+ wr..
If it is a TCP packet, R is updated as follows:
R  (1-wr) R.
If R is large, then we have a large amount of UDP traffic,
and we should increase k to drop more UDP packets.
COMP680E by M. Hamdi
61
SAC simulation
• Throughput per flow (30 TCP flows and 2 UDP flows of different rate)
COMP680E by M. Hamdi
62
SAC simulation
• Throughput per flow (30 TCP flows and 4 UDP flows of the same rate).
COMP680E by M. Hamdi
63
SAC simulation
• Throughput per flow (20 TCP flows and 4 UDP flows of different rates)
COMP680E by M. Hamdi
64
AQM Using
“Partial” state
information
COMP680E by M. Hamdi
65
Congestion Management and
Avoidance: Goal
 Provide fair bandwidth allocation similar to WFQ
 Be simple to implement like RED
WFQ
Fairness
Ideal
RED
Simplicity
COMP680E by M. Hamdi
66
AQM Based on Capture Recapture
•
Objective: achieve fairness close to that of
max-min fairness
1. If W(f) < C/N, then set R(f) = W(f).
2. If W(f) > C/N, then set R(f) = C/N.
•
Formulation:
–
Ri: the sending rate of flow i
–
Di: the drop probability of flow i
–
Ideally, we want
»
Ri (1 – Di) = Rfair (equal share)
»
Di = (1 – Rfair/Ri)+ (That is, drop the excess)
COMP680E by M. Hamdi
67
AQM Based on Capture-Recapture:
The key question is: how to estimate the
sending rate (Ri) and the fair share (Rfair) !!!
Active Queue Management
Incoming
packets
The estimation of
the sending rate
Fair
allocation
of BW
The adjustment
mechanism
The estimation of
the fair share
COMP680E by M. Hamdi
68
Capture-Recapture Models
• The CR models were originally developed for estimating demographic
parameters of animal populations (e.g., population size, number of
species, etc.).
– It is an extremely useful method where inspecting the whole state space is
infeasible or very costly
– Numerous models have been developed to various situtations
• The CR models are being used in many diverse fields ranging from
software inspection to epidemiology.
• It is based on several key ideas: animals are captured randomly,
marked, released and then recaptured randomly from the population.
COMP680E by M. Hamdi
69
Capture-Recapture Models
• Simple model: estimate a homegeneous population of animals (N):
– n1 animals are captured (marked)
– n2 animals were recaptured, and
– m2 of these appeared to be marked.
• Under this simple capture recapture model (M0):
m2/n2 = n1/N
N
n1
m2
n2
COMP680E by M. Hamdi
70
Capture-Recapture Models
• The capture probability refers to the chance that an
individual animal get caught.
• M0 implies that the capture probability for all animals are
the same.
– ‘0’ refers to constant capture probability
• Using the Mh model, the capture probabilities vary by
animal, sometimes for reasons like difference in species,
sex, or age, etc..
– ‘h’ refers to heterogeneity.
COMP680E by M. Hamdi
71
Capture-Recapture Models
• Estimation of N under the Mh Model is based on the capture frequency
data f1, f2…, and ft (t captures)
– f1 is the number of animals that were caught only once,
– f2 is the number of animals that were caught only twice, … etc.
• The jackknife estimator of N is computed as a linear combination of
these capture frequencies, s.t.:
N = a 1 f 1 + a 2 f 2 + … + a tf t
where ai are coefficients which are a function of t.
COMP680E by M. Hamdi
72
AQM Based on Capture-Recapture
•
The key question is: how to estimate the sending rate (Ri)
and the fair share (Rfair) !!!
•
We use an arrival buffer to store the recently arrived packet
headers (we can have control over how large the buffer is,
and is a better representation of the nature of the flows
when compared to the sending buffer):
1. We estimate Ri using the M0 capture-recapture model
2. We estimate Rfair using the Mh capture-recapture model (by
estimating the number of active flows).
COMP680E by M. Hamdi
73
AQM Based on Capture-Recapture

Ri is estimated for every arriving packet (we can increase the accuracy
by having multiple captures, or decrease it by capturing packets
periodically)


Rfair may not change every single time slot (as a result, the capturing
and the calculation of the number of active flows could be done
independently of the arrival of each incoming packet)



If the arrival buffer is of size B, and the number of captured packets is Ci,
then Ri = R Ci/B where R is the aggregate arrival rate
Rfair = R/(number of active flows)
The capture-recapture model gives us a lot of flexibility in terms of
accuracy vs. complexity
The same capture-recapture can be used for calculating both Ri and
Rfair
COMP680E by M. Hamdi
74
AQM Based on CaptureRecapture
Active Queue Management
(Capture-Recapture)
Incoming
packets
The estimation of
Ri by the M0
model
Di = (1 –
Rfair/Ri)+
Fair
allocation
of BW
The estimation of
Rfair by the Mh
C R
m o d e l
COMP680E by M. Hamdi
75
Performance evaluation
• This is a classical setup that researchers use to evaluate AQM
schemes (we can vary many parameters, responsive vs. nonresponsive connections, the nature of responsiveness, link delays,
etc.)
S(1)
S(1)
100Mbps
100Mbps
TCP
sources
TCP
sources
S(m)
10Mbps
R1
R2
S(m+1)
S(m)
S(m+1)
UDP
sources
UDP
sources
S(m+n)
S(m+n)
COMP680E by M. Hamdi
76
Performance evaluation
• Estimation of the number of flows
Estimation of numnber of flows (varying number of flows)
SRED
CAP
Ideal
50
40
30
20
10
57
0
54
0
51
0
48
0
45
0
42
0
39
0
36
0
33
0
30
0
27
0
24
0
21
0
90
12
0
15
0
18
0
60
30
0
0
Estimated number of flows
60
Time
COMP680E by M. Hamdi
77
Performance evaluation
• Bandwidth allocation comparison between CAP and RED
Ideal RED CAP
1.2
Throughput (Mbits/s)
1
0.8
0.6
0.4
0.2
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Flow number
COMP680E by M. Hamdi
78
Performance evaluation
• Bandwidth allocation comparison between CAP and SRED
Ideal
SRED
CAP
1
0.9
Throughput (Mbits/s)
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7 8 9 10 Flow
11 12number
13 14 15 16 17 18 19 20 21 22 23 24 25
COMP680E by M. Hamdi
79
Performance evaluation
• Bandwidth allocation comparison between CAP and RED-PD
Ideal
RED
RED-PD
CAP
1.2
Throughput (Mbits/s)
1
0.8
0.6
0.4
0.2
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Flow number
COMP680E by M. Hamdi
80
Performance evaluation
• Bandwidth allocation comparison between CAP and SFB
Ideal SFB CAP
0.7
Throughput (Mbits/s)
0.6
0.5
0.4
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Flow number
COMP680E by M. Hamdi
81
Normalized Measure of Performance
• A single comparison of the fairness using a normalized
value, where norm is defined as:
where bi is ideal fair share, bj is the bandwidth received
by each flow
• Thus, ||BW|| = 0 for the ideal fair sharing
COMP680E by M. Hamdi
82
Normalized Measure of
Performance
Ideal
RED
SRED
SFB
RED-PD
CAP
1200
1000
||BW||
800
600
400
200
0
25
30
25
40
45
50
55
number of flows
COMP680E by M. Hamdi
60
65
70
83
Performance Evaluation: Variable
amount of unresponsiveness
Ideal
RED
RED-PD
SFB
SRED
CAP
3000
2500
||BW||
2000
1500
1000
500
0
1
5
10
15
20
UDP load (% of bottleneck link)
COMP680E by M. Hamdi
25
30
84