Blame man/man8/tc-drr.8

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