218 lines
6.3 KiB
HTML
218 lines
6.3 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of HTB</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>HTB</H1>
|
|
Section: Linux (8)<BR>Updated: 10 January 2002<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>
|
|
|
|
HTB - Hierarchy Token Bucket
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>tc qdisc ... dev</B>
|
|
|
|
dev
|
|
<B>( parent</B>
|
|
|
|
classid
|
|
<B>| root) [ handle</B>
|
|
|
|
major:
|
|
<B>] htb [ default</B>
|
|
|
|
minor-id
|
|
<B>]</B>
|
|
|
|
<P>
|
|
<B>tc class ... dev</B>
|
|
|
|
dev
|
|
<B>parent</B>
|
|
|
|
major:[minor]
|
|
<B>[ classid</B>
|
|
|
|
major:minor
|
|
<B>] htb rate</B>
|
|
|
|
rate
|
|
<B>[ ceil</B>
|
|
|
|
rate
|
|
<B>] burst</B>
|
|
|
|
bytes
|
|
<B>[ cburst</B>
|
|
|
|
bytes
|
|
<B>] [ prio</B>
|
|
|
|
priority
|
|
<B>]</B>
|
|
|
|
<P>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
HTB is meant as a more understandable and intuitive replacement for
|
|
the CBQ qdisc in Linux. Both CBQ and HTB help you to control the use
|
|
of the outbound bandwidth on a given link. Both allow you to use one
|
|
physical link to simulate several slower links and to send different
|
|
kinds of traffic on different simulated links. In both cases, you have
|
|
to specify how to divide the physical link into simulated links and
|
|
how to decide which simulated link to use for a given packet to be sent.
|
|
<P>
|
|
Unlike CBQ, HTB shapes traffic based on the Token Bucket Filter algorithm
|
|
which does not depend on interface characteristics and so does not need to
|
|
know the underlying bandwidth of the outgoing interface.
|
|
<P>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>SHAPING ALGORITHM</H2>
|
|
|
|
Shaping works as documented in
|
|
<B>tc-tbf (8).</B>
|
|
|
|
<P>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>CLASSIFICATION</H2>
|
|
|
|
Within the one HTB instance many classes may exist. Each of these classes
|
|
contains another qdisc, by default
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc-pfifo">tc-pfifo</A></B>(8).
|
|
|
|
<P>
|
|
When enqueueing a packet, HTB starts at the root and uses various methods to
|
|
determine which class should receive the data.
|
|
<P>
|
|
In the absence of uncommon configuration options, the process is rather easy.
|
|
At each node we look for an instruction, and then go to the class the
|
|
instruction refers us to. If the class found is a barren leaf-node (without
|
|
children), we enqueue the packet there. If it is not yet a leaf node, we do
|
|
the whole thing over again starting from that node.
|
|
<P>
|
|
The following actions are performed, in order at each node we visit, until one
|
|
sends us to another node, or terminates the process.
|
|
<DL COMPACT>
|
|
<DT id="1">(i)<DD>
|
|
Consult filters attached to the class. If sent to a leafnode, we are done.
|
|
Otherwise, restart.
|
|
<DT id="2">(ii)<DD>
|
|
If none of the above returned with an instruction, enqueue at this node.
|
|
</DL>
|
|
<P>
|
|
|
|
This algorithm makes sure that a packet always ends up somewhere, even while
|
|
you are busy building your configuration.
|
|
<P>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>LINK SHARING ALGORITHM</H2>
|
|
|
|
FIXME
|
|
<P>
|
|
<A NAME="lbAH"> </A>
|
|
<H2>QDISC</H2>
|
|
|
|
The root of a HTB qdisc class tree has the following parameters:
|
|
<P>
|
|
<DL COMPACT>
|
|
<DT id="3">parent major:minor | root<DD>
|
|
This mandatory parameter determines the place of the HTB instance, either at the
|
|
<B>root</B>
|
|
|
|
of an interface or within an existing class.
|
|
<DT id="4">handle major:<DD>
|
|
Like all other qdiscs, the HTB can be assigned a handle. Should consist only
|
|
of a major number, followed by a colon. Optional, but very useful if classes
|
|
will be generated within this qdisc.
|
|
<DT id="5">default minor-id<DD>
|
|
Unclassified traffic gets sent to the class with this minor-id.
|
|
<P>
|
|
</DL>
|
|
<A NAME="lbAI"> </A>
|
|
<H2>CLASSES</H2>
|
|
|
|
Classes have a host of parameters to configure their operation.
|
|
<P>
|
|
<DL COMPACT>
|
|
<DT id="6">parent major:minor<DD>
|
|
Place of this class within the hierarchy. If attached directly to a qdisc
|
|
and not to another class, minor can be omitted. Mandatory.
|
|
<DT id="7">classid major:minor<DD>
|
|
Like qdiscs, classes can be named. The major number must be equal to the
|
|
major number of the qdisc to which it belongs. Optional, but needed if this
|
|
class is going to have children.
|
|
<DT id="8">prio priority<DD>
|
|
In the round-robin process, classes with the lowest priority field are tried
|
|
for packets first. Mandatory.
|
|
<P>
|
|
<DT id="9">rate rate<DD>
|
|
Maximum rate this class and all its children are guaranteed. Mandatory.
|
|
<P>
|
|
<DT id="10">ceil rate<DD>
|
|
Maximum rate at which a class can send, if its parent has bandwidth to spare.
|
|
Defaults to the configured rate, which implies no borrowing
|
|
<P>
|
|
<DT id="11">burst bytes<DD>
|
|
Amount of bytes that can be burst at
|
|
<B>ceil</B>
|
|
|
|
speed, in excess of the configured
|
|
<B>rate.</B>
|
|
|
|
Should be at least as high as the highest burst of all children.
|
|
<P>
|
|
<DT id="12">cburst bytes<DD>
|
|
Amount of bytes that can be burst at 'infinite' speed, in other words, as fast
|
|
as the interface can transmit them. For perfect evening out, should be equal to at most one average
|
|
packet. Should be at least as high as the highest cburst of all children.
|
|
<P>
|
|
</DL>
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
Due to Unix timing constraints, the maximum ceil rate is not infinite and may in fact be quite low. On Intel,
|
|
there are 100 timer events per second, the maximum rate is that rate at which 'burst' bytes are sent each timer tick.
|
|
From this, the minimum burst size for a specified rate can be calculated. For i386, a 10mbit rate requires a 12 kilobyte
|
|
burst as 100*12kb*8 equals 10mbit.
|
|
<P>
|
|
<A NAME="lbAK"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc">tc</A></B>(8)
|
|
|
|
<P>
|
|
|
|
HTB website: <A HREF="http://luxik.cdi.cz/~devik/qos/htb/">http://luxik.cdi.cz/~devik/qos/htb/</A>
|
|
<A NAME="lbAL"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
Martin Devera <<A HREF="mailto:devik@cdi.cz">devik@cdi.cz</A>>. This manpage maintained by bert hubert <<A HREF="mailto:ahu@ds9a.nl">ahu@ds9a.nl</A>>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="13"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="14"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="15"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="16"><A HREF="#lbAE">SHAPING ALGORITHM</A><DD>
|
|
<DT id="17"><A HREF="#lbAF">CLASSIFICATION</A><DD>
|
|
<DT id="18"><A HREF="#lbAG">LINK SHARING ALGORITHM</A><DD>
|
|
<DT id="19"><A HREF="#lbAH">QDISC</A><DD>
|
|
<DT id="20"><A HREF="#lbAI">CLASSES</A><DD>
|
|
<DT id="21"><A HREF="#lbAJ">NOTES</A><DD>
|
|
<DT id="22"><A HREF="#lbAK">SEE ALSO</A><DD>
|
|
<DT id="23"><A HREF="#lbAL">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>
|