# info > tc-drr

---
type: CommandReference
command: drr
mode: man
section: 8
source: man-pages
---

## Quick Reference
- `tc qdisc add dev eth0 handle 1 root drr` — attach DRR with interface MTU as quantum
- `tc class add dev eth0 parent 1: classid 1:1 drr` — add a DRR class
- `tc filter add dev eth0 protocol ip ... classid 1:1` — classify packets to a class
- `tc qdisc add dev ... drr; for i in $(seq 1024); do tc class add ... classid ... drr; done` — mimic SFQ with flow filter
- `tc filter add ... protocol ip ... flow hash keys src,dst,proto,proto-src,proto-dst divisor 1024 perturb 10` — flow hash filter for SFQ-like behavior

## Name
drr — deficit round robin scheduler (classful queuing discipline)

## Synopsis
shell
tc qdisc ... add drr [ quantum BYTES ]
tc class ... add ... drr
## Options
- `quantum` — bytes a flow is allowed to dequeue before the scheduler moves to the next class. Defaults to the interface MTU; minimum value is 1.

## Description
DRR is a classful replacement for Stochastic Fairness Queuing (SFQ). It has no built‑in queues; you must add classes via `tc class add` and classify packets with filters. If a packet cannot be classified, it is dropped.

Each class maintains a deficit counter, initialized to `quantum`. DRR keeps an internal “active” list of classes whose child qdiscs are non‑empty. During dequeue, the class at the head of the list is allowed to send a packet if the packet size is ≤ the counter. If the counter is too small, it is increased by `quantum` and the next active class is tried.

DRR must own the queue — it is a pure scheduler and does not delay packets. Attach non‑work‑conserving qdiscs (e.g., tbf) below it is not meaningful. Embed DRR inside HTB or HFSC to ensure it possesses the queue.

## Examples
Attach DRR to eth0:
shell
# tc qdisc add dev eth0 handle 1 root drr
Add two classes:
shell
# tc class add dev eth0 parent 1: classid 1:1 drr
# tc class add dev eth0 parent 1: classid 1:2 drr
Attach a filter (classify packets to class 1:1):
shell
# tc filter add dev eth0 protocol ip ... classid 1:1
Mimic SFQ using a flow filter:
shell
# tc qdisc add dev eth0 handle 1 root drr
for i in $(seq 1024); do
    tc class add dev eth0 parent 1: classid 1:$(printf %x $i) drr
    tc qdisc add dev eth0 parent 1:$(printf %x $i) fifo limit 16
done
# tc filter add dev eth0 protocol ip parent 1: handle 1 flow hash keys src,dst,proto,proto-src,proto-dst divisor 1024 perturb 10
## See Also
- [tc(8)](http://localhost/phpMan.php/man/tc/8/markdown)
- [tc-htb(8)](http://localhost/phpMan.php/man/tc-htb/8/markdown)
- [tc-sfq(8)](http://localhost/phpMan.php/man/tc-sfq/8/markdown)
- M. Shreedhar and George Varghese, “Efficient Fair Queuing using Deficit Round Robin”, Proc. SIGCOMM ’95.