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