Blame man/man8/tc-htb.8

Packit Service 3880ab
.TH HTB 8 "10 January 2002" "iproute2" "Linux"
Packit Service 3880ab
.SH NAME
Packit Service 3880ab
HTB \- Hierarchy Token Bucket
Packit Service 3880ab
.SH SYNOPSIS
Packit Service 3880ab
.B tc qdisc ... dev
Packit Service 3880ab
dev
Packit Service 3880ab
.B  ( parent
Packit Service 3880ab
classid
Packit Service 3880ab
.B | root) [ handle
Packit Service 3880ab
major:
Packit Service 3880ab
.B ] htb [ default
Packit Service 3880ab
minor-id
Packit Service 3880ab
.B ] [ r2q
Packit Service 3880ab
divisor
Packit Service 3880ab
.B ]
Packit Service 3880ab
Packit Service 3880ab
.B tc class ... dev
Packit Service 3880ab
dev
Packit Service 3880ab
.B parent
Packit Service 3880ab
major:[minor]
Packit Service 3880ab
.B [ classid
Packit Service 3880ab
major:minor
Packit Service 3880ab
.B ] htb rate
Packit Service 3880ab
rate
Packit Service 3880ab
.B [ ceil
Packit Service 3880ab
rate
Packit Service 3880ab
.B ] burst
Packit Service 3880ab
bytes
Packit Service 3880ab
.B [ cburst
Packit Service 3880ab
bytes
Packit Service 3880ab
.B ] [ prio
Packit Service 3880ab
priority
Packit Service 3880ab
.B ] [ quantum
Packit Service 3880ab
bytes
Packit Service 3880ab
.B ]
Packit Service 3880ab
Packit Service 3880ab
.SH DESCRIPTION
Packit Service 3880ab
HTB is meant as a more understandable and intuitive replacement for
Packit Service 3880ab
the CBQ qdisc in Linux. Both CBQ and HTB help you to control the use
Packit Service 3880ab
of the outbound bandwidth on a given link. Both allow you to use one
Packit Service 3880ab
physical link to simulate several slower links and to send different
Packit Service 3880ab
kinds of traffic on different simulated links. In both cases, you have
Packit Service 3880ab
to specify how to divide the physical link into simulated links and
Packit Service 3880ab
how to decide which simulated link to use for a given packet to be sent.
Packit Service 3880ab
Packit Service 3880ab
Unlike CBQ, HTB shapes traffic based on the Token Bucket Filter algorithm
Packit Service 3880ab
which does not depend on interface characteristics and so does not need to
Packit Service 3880ab
know the underlying bandwidth of the outgoing interface.
Packit Service 3880ab
Packit Service 3880ab
.SH SHAPING ALGORITHM
Packit Service 3880ab
Shaping works as documented in
Packit Service 3880ab
.B tc-tbf (8).
Packit Service 3880ab
Packit Service 3880ab
.SH CLASSIFICATION
Packit Service 3880ab
Within the one HTB instance many classes may exist. Each of these classes
Packit Service 3880ab
contains another qdisc, by default
Packit Service 3880ab
.BR tc-pfifo (8).
Packit Service 3880ab
Packit Service 3880ab
When enqueueing a packet, HTB starts at the root and uses various methods to
Packit Service 3880ab
determine which class should receive the data.
Packit Service 3880ab
Packit Service 3880ab
In the absence of uncommon configuration options, the process is rather easy.
Packit Service 3880ab
At each node we look for an instruction, and then go to the class the
Packit Service 3880ab
instruction refers us to. If the class found is a barren leaf-node (without
Packit Service 3880ab
children), we enqueue the packet there. If it is not yet a leaf node, we do
Packit Service 3880ab
the whole thing over again starting from that node.
Packit Service 3880ab
Packit Service 3880ab
The following actions are performed, in order at each node we visit, until one
Packit Service 3880ab
sends us to another node, or terminates the process.
Packit Service 3880ab
.TP
Packit Service 3880ab
(i)
Packit Service 3880ab
Consult filters attached to the class. If sent to a leafnode, we are done.
Packit Service 3880ab
Otherwise, restart.
Packit Service 3880ab
.TP
Packit Service 3880ab
(ii)
Packit Service 3880ab
If none of the above returned with an instruction, enqueue at this node.
Packit Service 3880ab
.P
Packit Service 3880ab
This algorithm makes sure that a packet always ends up somewhere, even while
Packit Service 3880ab
you are busy building your configuration.
Packit Service 3880ab
Packit Service 3880ab
.SH LINK SHARING ALGORITHM
Packit Service 3880ab
FIXME
Packit Service 3880ab
Packit Service 3880ab
.SH QDISC
Packit Service 3880ab
The root of a HTB qdisc class tree has the following parameters:
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
parent major:minor | root
Packit Service 3880ab
This mandatory parameter determines the place of the HTB instance, either at the
Packit Service 3880ab
.B root
Packit Service 3880ab
of an interface or within an existing class.
Packit Service 3880ab
.TP
Packit Service 3880ab
handle major:
Packit Service 3880ab
Like all other qdiscs, the HTB can be assigned a handle. Should consist only
Packit Service 3880ab
of a major number, followed by a colon. Optional, but very useful if classes
Packit Service 3880ab
will be generated within this qdisc.
Packit Service 3880ab
.TP
Packit Service 3880ab
default minor-id
Packit Service 3880ab
Unclassified traffic gets sent to the class with this minor-id.
Packit Service 3880ab
.TP
Packit Service 3880ab
r2q divisor
Packit Service 3880ab
Divisor used to calculate
Packit Service 3880ab
.B quantum
Packit Service 3880ab
values for classes.  Classes divide
Packit Service 3880ab
.B rate
Packit Service 3880ab
by this number.  Default value is 10.
Packit Service 3880ab
Packit Service 3880ab
.SH CLASSES
Packit Service 3880ab
Classes have a host of parameters to configure their operation.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
parent major:minor
Packit Service 3880ab
Place of this class within the hierarchy. If attached directly to a qdisc
Packit Service 3880ab
and not to another class, minor can be omitted. Mandatory.
Packit Service 3880ab
.TP
Packit Service 3880ab
classid major:minor
Packit Service 3880ab
Like qdiscs, classes can be named. The major number must be equal to the
Packit Service 3880ab
major number of the qdisc to which it belongs. Optional, but needed if this
Packit Service 3880ab
class is going to have children.
Packit Service 3880ab
.TP
Packit Service 3880ab
prio priority
Packit Service 3880ab
In the round-robin process, classes with the lowest priority field are tried
Packit Service 3880ab
for packets first.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
rate rate
Packit Service 3880ab
Maximum rate this class and all its children are guaranteed. Mandatory.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
ceil rate
Packit Service 3880ab
Maximum rate at which a class can send, if its parent has bandwidth to spare.
Packit Service 3880ab
Defaults to the configured rate, which implies no borrowing
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
burst bytes
Packit Service 3880ab
Amount of bytes that can be burst at
Packit Service 3880ab
.B ceil
Packit Service 3880ab
speed, in excess of the configured
Packit Service 3880ab
.B rate.
Packit Service 3880ab
Should be at least as high as the highest burst of all children.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
cburst bytes
Packit Service 3880ab
Amount of bytes that can be burst at 'infinite' speed, in other words, as fast
Packit Service 3880ab
as the interface can transmit them. For perfect evening out, should be equal to at most one average
Packit Service 3880ab
packet. Should be at least as high as the highest cburst of all children.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
quantum bytes
Packit Service 3880ab
Number of bytes to serve from this class before the scheduler moves to the next class.
Packit Service 3880ab
Default value is
Packit Service 3880ab
.B rate
Packit Service 3880ab
divided by the qdisc
Packit Service 3880ab
.B r2q
Packit Service 3880ab
parameter.  If specified,
Packit Service 3880ab
.B r2q
Packit Service 3880ab
is ignored.
Packit Service 3880ab
Packit Service 3880ab
.SH NOTES
Packit Service 3880ab
Due to Unix timing constraints, the maximum ceil rate is not infinite and may in fact be quite low. On Intel,
Packit Service 3880ab
there are 100 timer events per second, the maximum rate is that rate at which 'burst' bytes are sent each timer tick.
Packit Service 3880ab
From this, the minimum burst size for a specified rate can be calculated. For i386, a 10mbit rate requires a 12 kilobyte
Packit Service 3880ab
burst as 100*12kb*8 equals 10mbit.
Packit Service 3880ab
Packit Service 3880ab
.SH SEE ALSO
Packit Service 3880ab
.BR tc (8)
Packit Service 3880ab
.P
Packit Service 3880ab
HTB website: http://luxik.cdi.cz/~devik/qos/htb/
Packit Service 3880ab
.SH AUTHOR
Packit Service 3880ab
Martin Devera <devik@cdi.cz>. This manpage maintained by bert hubert <ahu@ds9a.nl>