Blame man/man8/tc-drr.8

Packit Service 3880ab
.TH TC 8 "January 2010" "iproute2" "Linux"
Packit Service 3880ab
.SH NAME
Packit Service 3880ab
drr \- deficit round robin scheduler
Packit Service 3880ab
.SH SYNOPSIS
Packit Service 3880ab
.B tc qdisc ... add drr
Packit Service 3880ab
.B [ quantum
Packit Service 3880ab
bytes
Packit Service 3880ab
.B ]
Packit Service 3880ab
Packit Service 3880ab
.SH DESCRIPTION
Packit Service 3880ab
Packit Service 3880ab
The Deficit Round Robin Scheduler is a classful queuing discipline as
Packit Service 3880ab
a more flexible replacement for Stochastic Fairness Queuing.
Packit Service 3880ab
Packit Service 3880ab
Unlike SFQ, there are no built-in queues \-\- you need to add classes
Packit Service 3880ab
and then set up filters to classify packets accordingly.
Packit Service 3880ab
This can be useful e.g. for using RED qdiscs with different settings for particular
Packit Service 3880ab
traffic. There is no default class \-\- if a packet cannot be classified,
Packit Service 3880ab
it is dropped.
Packit Service 3880ab
Packit Service 3880ab
.SH ALGORITHM
Packit Service 3880ab
Each class is assigned a deficit counter, initialized to
Packit Service 3880ab
.B quantum.
Packit Service 3880ab
Packit Service 3880ab
DRR maintains an (internal) ''active'' list of classes whose qdiscs are
Packit Service 3880ab
non-empty. This list is used for dequeuing. A packet is dequeued from
Packit Service 3880ab
the class at the head of the list if the packet size is smaller or equal
Packit Service 3880ab
to the deficit counter. If the counter is too small, it is increased by
Packit Service 3880ab
.B quantum
Packit Service 3880ab
and the scheduler moves on to the next class in the active list.
Packit Service 3880ab
Packit Service 3880ab
Packit Service 3880ab
.SH PARAMETERS
Packit Service 3880ab
.TP
Packit Service 3880ab
quantum
Packit Service 3880ab
Amount of bytes a flow is allowed to dequeue before the scheduler moves to
Packit Service 3880ab
the next class. Defaults to the MTU of the interface. The minimum value is 1.
Packit Service 3880ab
Packit Service 3880ab
.SH EXAMPLE & USAGE
Packit Service 3880ab
Packit Service 3880ab
To attach to device eth0, using the interface MTU as its quantum:
Packit Service 3880ab
.P
Packit Service 3880ab
# tc qdisc add dev eth0 handle 1 root drr
Packit Service 3880ab
.P
Packit Service 3880ab
Adding two classes:
Packit Service 3880ab
.P
Packit Service 3880ab
# tc class add dev eth0 parent 1: classid 1:1 drr
Packit Service 3880ab
.br
Packit Service 3880ab
# tc class add dev eth0 parent 1: classid 1:2 drr
Packit Service 3880ab
.P
Packit Service 3880ab
You also need to add at least one filter to classify packets.
Packit Service 3880ab
.P
Packit Service 3880ab
# tc filter add dev eth0 protocol .. classid 1:1
Packit Service 3880ab
.P
Packit Service 3880ab
Packit Service 3880ab
Like SFQ, DRR is only useful when it owns the queue \-\- it is a pure scheduler and does
Packit Service 3880ab
not delay packets. Attaching non-work-conserving qdiscs like tbf to it does not make
Packit Service 3880ab
sense \-\- other qdiscs in the active list will also become inactive until the dequeue
Packit Service 3880ab
operation succeeds. Embed DRR within another qdisc like HTB or HFSC to ensure it owns the queue.
Packit Service 3880ab
.P
Packit Service 3880ab
You can mimic SFQ behavior by assigning packets to the attached classes using the
Packit Service 3880ab
flow filter:
Packit Service 3880ab
Packit Service 3880ab
.B tc qdisc add dev .. drr
Packit Service 3880ab
Packit Service 3880ab
.B for i in .. 1024;do
Packit Service 3880ab
.br
Packit Service 3880ab
.B "\ttc class add dev .. classid $handle:$(print %x $i)"
Packit Service 3880ab
.br
Packit Service 3880ab
.B "\ttc qdisc add dev .. fifo limit 16"
Packit Service 3880ab
.br
Packit Service 3880ab
.B done
Packit Service 3880ab
Packit Service 3880ab
.B tc filter add .. protocol ip .. $handle flow hash keys src,dst,proto,proto-src,proto-dst divisor 1024 perturb 10
Packit Service 3880ab
Packit Service 3880ab
Packit Service 3880ab
.SH SOURCE
Packit Service 3880ab
.TP
Packit Service 3880ab
o
Packit Service 3880ab
M. Shreedhar and George Varghese "Efficient Fair
Packit Service 3880ab
Queuing using Deficit Round Robin", Proc. SIGCOMM 95.
Packit Service 3880ab
Packit Service 3880ab
.SH NOTES
Packit Service 3880ab
Packit Service 3880ab
This implementation does not drop packets from the longest queue on overrun,
Packit Service 3880ab
as limits are handled by the individual child qdiscs.
Packit Service 3880ab
Packit Service 3880ab
.SH SEE ALSO
Packit Service 3880ab
.BR tc (8),
Packit Service 3880ab
.BR tc-htb (8),
Packit Service 3880ab
.BR tc-sfq (8)
Packit Service 3880ab
Packit Service 3880ab
.SH AUTHOR
Packit Service 3880ab
sched_drr was written by Patrick McHardy.