172 lines
4.2 KiB
HTML
172 lines
4.2 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of TC</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>TC</H1>
|
|
Section: Linux (8)<BR>Updated: January 2010<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
drr - deficit round robin scheduler
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>tc qdisc ... add drr</B>
|
|
|
|
<B>[ quantum</B>
|
|
|
|
bytes
|
|
<B>]</B>
|
|
|
|
<P>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
The Deficit Round Robin Scheduler is a classful queuing discipline as
|
|
a more flexible replacement for Stochastic Fairness Queuing.
|
|
<P>
|
|
Unlike SFQ, there are no built-in queues -- you need to add classes
|
|
and then set up filters to classify packets accordingly.
|
|
This can be useful e.g. for using RED qdiscs with different settings for particular
|
|
traffic. There is no default class -- if a packet cannot be classified,
|
|
it is dropped.
|
|
<P>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>ALGORITHM</H2>
|
|
|
|
Each class is assigned a deficit counter, initialized to
|
|
<B>quantum.</B>
|
|
|
|
<P>
|
|
DRR maintains an (internal) ''active'' list of classes whose qdiscs are
|
|
non-empty. This list is used for dequeuing. A packet is dequeued from
|
|
the class at the head of the list if the packet size is smaller or equal
|
|
to the deficit counter. If the counter is too small, it is increased by
|
|
<B>quantum</B>
|
|
|
|
and the scheduler moves on to the next class in the active list.
|
|
<P>
|
|
<P>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>PARAMETERS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">quantum<DD>
|
|
Amount of bytes a flow is allowed to dequeue before the scheduler moves to
|
|
the next class. Defaults to the MTU of the interface. The minimum value is 1.
|
|
<P>
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>EXAMPLE & USAGE</H2>
|
|
|
|
<P>
|
|
To attach to device eth0, using the interface MTU as its quantum:
|
|
<P>
|
|
|
|
# tc qdisc add dev eth0 handle 1 root drr
|
|
<P>
|
|
|
|
Adding two classes:
|
|
<P>
|
|
|
|
# tc class add dev eth0 parent 1: classid 1:1 drr
|
|
<BR>
|
|
|
|
# tc class add dev eth0 parent 1: classid 1:2 drr
|
|
<P>
|
|
|
|
You also need to add at least one filter to classify packets.
|
|
<P>
|
|
|
|
# tc filter add dev eth0 protocol .. classid 1:1
|
|
<P>
|
|
|
|
<P>
|
|
Like SFQ, DRR is only useful when it owns the queue -- it is a pure scheduler and does
|
|
not delay packets. Attaching non-work-conserving qdiscs like tbf to it does not make
|
|
sense -- other qdiscs in the active list will also become inactive until the dequeue
|
|
operation succeeds. Embed DRR within another qdisc like HTB or HFSC to ensure it owns the queue.
|
|
<P>
|
|
|
|
You can mimic SFQ behavior by assigning packets to the attached classes using the
|
|
flow filter:
|
|
<P>
|
|
<B>tc qdisc add dev .. drr</B>
|
|
|
|
<P>
|
|
<B>for i in .. 1024;do</B>
|
|
|
|
<BR>
|
|
|
|
<B> tc class add dev .. classid $handle:$(print %x $i)</B>
|
|
|
|
<BR>
|
|
|
|
<B> tc qdisc add dev .. fifo limit 16</B>
|
|
|
|
<BR>
|
|
|
|
<B>done</B>
|
|
|
|
<P>
|
|
<B>tc filter add .. protocol ip .. $handle flow hash keys src,dst,proto,proto-src,proto-dst divisor 1024 perturb 10</B>
|
|
|
|
<P>
|
|
<P>
|
|
<A NAME="lbAH"> </A>
|
|
<H2>SOURCE</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="2">o<DD>
|
|
M. Shreedhar and George Varghese "Efficient Fair
|
|
Queuing using Deficit Round Robin", Proc. SIGCOMM 95.
|
|
<P>
|
|
</DL>
|
|
<A NAME="lbAI"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
<P>
|
|
This implementation does not drop packets from the longest queue on overrun,
|
|
as limits are handled by the individual child qdiscs.
|
|
<P>
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc">tc</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc-htb">tc-htb</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc-sfq">tc-sfq</A></B>(8)
|
|
|
|
<P>
|
|
<A NAME="lbAK"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
sched_drr was written by Patrick McHardy.
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="3"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="4"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="5"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="6"><A HREF="#lbAE">ALGORITHM</A><DD>
|
|
<DT id="7"><A HREF="#lbAF">PARAMETERS</A><DD>
|
|
<DT id="8"><A HREF="#lbAG">EXAMPLE & USAGE</A><DD>
|
|
<DT id="9"><A HREF="#lbAH">SOURCE</A><DD>
|
|
<DT id="10"><A HREF="#lbAI">NOTES</A><DD>
|
|
<DT id="11"><A HREF="#lbAJ">SEE ALSO</A><DD>
|
|
<DT id="12"><A HREF="#lbAK">AUTHOR</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:17 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|