| 1 |
.TH TC 8 "January 2010" "iproute2" "Linux" |
| 2 |
.SH NAME |
| 3 |
drr \- deficit round robin scheduler |
| 4 |
.SH SYNOPSIS |
| 5 |
.B tc qdisc ... add drr |
| 6 |
.B [ quantum |
| 7 |
bytes |
| 8 |
.B ] |
| 9 |
|
| 10 |
.SH DESCRIPTION |
| 11 |
|
| 12 |
The Deficit Round Robin Scheduler is a classful queuing discipline as |
| 13 |
a more flexible replacement for Stochastic Fairness Queuing. |
| 14 |
|
| 15 |
Unlike SFQ, there are no built-in queues \-\- you need to add classes |
| 16 |
and then set up filters to classify packets accordingly. |
| 17 |
This can be useful e.g. for using RED qdiscs with different settings for particular |
| 18 |
traffic. There is no default class \-\- if a packet cannot be classified, |
| 19 |
it is dropped. |
| 20 |
|
| 21 |
.SH ALGORITHM |
| 22 |
Each class is assigned a deficit counter, initialized to |
| 23 |
.B quantum. |
| 24 |
|
| 25 |
DRR maintains an (internal) ''active'' list of classes whose qdiscs are |
| 26 |
non-empty. This list is used for dequeuing. A packet is dequeued from |
| 27 |
the class at the head of the list if the packet size is smaller or equal |
| 28 |
to the deficit counter. If the counter is too small, it is increased by |
| 29 |
.B quantum |
| 30 |
and the scheduler moves on to the next class in the active list. |
| 31 |
|
| 32 |
|
| 33 |
.SH PARAMETERS |
| 34 |
.TP |
| 35 |
quantum |
| 36 |
Amount of bytes a flow is allowed to dequeue before the scheduler moves to |
| 37 |
the next class. Defaults to the MTU of the interface. The minimum value is 1. |
| 38 |
|
| 39 |
.SH EXAMPLE & USAGE |
| 40 |
|
| 41 |
To attach to device eth0, using the interface MTU as its quantum: |
| 42 |
.P |
| 43 |
# tc qdisc add dev eth0 handle 1 root drr |
| 44 |
.P |
| 45 |
Adding two classes: |
| 46 |
.P |
| 47 |
# tc class add dev eth0 parent 1: classid 1:1 drr |
| 48 |
.br |
| 49 |
# tc class add dev eth0 parent 1: classid 1:2 drr |
| 50 |
.P |
| 51 |
You also need to add at least one filter to classify packets. |
| 52 |
.P |
| 53 |
# tc filter add dev eth0 protocol .. classid 1:1 |
| 54 |
.P |
| 55 |
|
| 56 |
Like SFQ, DRR is only useful when it owns the queue \-\- it is a pure scheduler and does |
| 57 |
not delay packets. Attaching non-work-conserving qdiscs like tbf to it does not make |
| 58 |
sense \-\- other qdiscs in the active list will also become inactive until the dequeue |
| 59 |
operation succeeds. Embed DRR within another qdisc like HTB or HFSC to ensure it owns the queue. |
| 60 |
.P |
| 61 |
You can mimic SFQ behavior by assigning packets to the attached classes using the |
| 62 |
flow filter: |
| 63 |
|
| 64 |
.B tc qdisc add dev .. drr |
| 65 |
|
| 66 |
.B for i in .. 1024;do |
| 67 |
.br |
| 68 |
.B "\ttc class add dev .. classid $handle:$(print %x $i)" |
| 69 |
.br |
| 70 |
.B "\ttc qdisc add dev .. fifo limit 16" |
| 71 |
.br |
| 72 |
.B done |
| 73 |
|
| 74 |
.B tc filter add .. protocol ip .. $handle flow hash keys src,dst,proto,proto-src,proto-dst divisor 1024 perturb 10 |
| 75 |
|
| 76 |
|
| 77 |
.SH SOURCE |
| 78 |
.TP |
| 79 |
o |
| 80 |
M. Shreedhar and George Varghese "Efficient Fair |
| 81 |
Queuing using Deficit Round Robin", Proc. SIGCOMM 95. |
| 82 |
|
| 83 |
.SH NOTES |
| 84 |
|
| 85 |
This implementation does not drop packets from the longest queue on overrun, |
| 86 |
as limits are handled by the individual child qdiscs. |
| 87 |
|
| 88 |
.SH SEE ALSO |
| 89 |
.BR tc (8), |
| 90 |
.BR tc-htb (8), |
| 91 |
.BR tc-sfq (8) |
| 92 |
|
| 93 |
.SH AUTHOR |
| 94 |
sched_drr was written by Patrick McHardy. |