Debian Codegraph @

upstream/debian-unstable/man8/tc-htb.8

raw
1 .TH HTB 8 "10 January 2002" "iproute2" "Linux"
2 .SH NAME
3 HTB \- Hierarchy Token Bucket
4 .SH SYNOPSIS
5 .B tc qdisc ... dev
6 dev
7 .B ( parent
8 classid
9 .B | root) [ handle
10 major:
11 .B ] htb [ default
12 minor-id
13 .B ] [ r2q
14 divisor
15 .B ] [ offload ]
16
17 .B tc class ... dev
18 dev
19 .B parent
20 major:[minor]
21 .B [ classid
22 major:minor
23 .B ] htb rate
24 rate
25 .B [ ceil
26 rate
27 .B ] burst
28 bytes
29 .B [ cburst
30 bytes
31 .B ] [ prio
32 priority
33 .B ] [ quantum
34 bytes
35 .B ]
36
37 .SH DESCRIPTION
38 HTB allows control of the outbound bandwidth on a given link.
39 It allows simulating several slower links and to send different
40 kinds of traffic on different simulated links. In both cases, you have
41 to specify how to divide the physical link into simulated links and
42 how to decide which simulated link to use for a given packet to be sent.
43
44 HTB shapes traffic based on the Token Bucket Filter algorithm
45 which does not depend on interface characteristics and so does not need to
46 know the underlying bandwidth of the outgoing interface.
47
48 .SH SHAPING ALGORITHM
49 Shaping works as documented in
50 .B tc-tbf (8).
51
52 .SH CLASSIFICATION
53 Within the one HTB instance many classes may exist. Each of these classes
54 contains another qdisc, by default
55 .BR tc-pfifo (8).
56
57 When enqueueing a packet, HTB starts at the root and uses various methods to
58 determine which class should receive the data.
59
60 In the absence of uncommon configuration options, the process is rather easy.
61 At each node we look for an instruction, and then go to the class the
62 instruction refers us to. If the class found is a barren leaf-node (without
63 children), we enqueue the packet there. If it is not yet a leaf node, we do
64 the whole thing over again starting from that node.
65
66 The following actions are performed, in order at each node we visit, until one
67 sends us to another node, or terminates the process.
68 .TP
69 (i)
70 Consult filters attached to the class. If sent to a leafnode, we are done.
71 Otherwise, restart.
72 .TP
73 (ii)
74 If none of the above returned with an instruction, enqueue at this node.
75 .P
76 This algorithm makes sure that a packet always ends up somewhere, even while
77 you are busy building your configuration.
78
79 .SH LINK SHARING ALGORITHM
80 FIXME
81
82 .SH QDISC
83 The root of a HTB qdisc class tree has the following parameters:
84
85 .TP
86 parent major:minor | root
87 This mandatory parameter determines the place of the HTB instance, either at the
88 .B root
89 of an interface or within an existing class.
90 .TP
91 handle major:
92 Like all other qdiscs, the HTB can be assigned a handle. Should consist only
93 of a major number, followed by a colon. Optional, but very useful if classes
94 will be generated within this qdisc.
95 .TP
96 default minor-id
97 Unclassified traffic gets sent to the class with this minor-id.
98 .TP
99 r2q divisor
100 Divisor used to calculate
101 .B quantum
102 values for classes. Classes divide
103 .B rate
104 by this number. Default value is 10.
105 .TP
106 offload
107 Offload the HTB algorithm to hardware (requires driver and device support).
108
109 .SH CLASSES
110 Classes have a host of parameters to configure their operation.
111
112 .TP
113 parent major:minor
114 Place of this class within the hierarchy. If attached directly to a qdisc
115 and not to another class, minor can be omitted. Mandatory.
116 .TP
117 classid major:minor
118 Like qdiscs, classes can be named. The major number must be equal to the
119 major number of the qdisc to which it belongs. Optional, but needed if this
120 class is going to have children.
121 .TP
122 prio priority
123 In the round-robin process, classes with the lowest priority field are tried
124 for packets first.
125
126 .TP
127 rate rate
128 Maximum rate this class and all its children are guaranteed. Mandatory.
129
130 .TP
131 ceil rate
132 Maximum rate at which a class can send, if its parent has bandwidth to spare.
133 Defaults to the configured rate, which implies no borrowing
134
135 .TP
136 burst bytes
137 Amount of bytes that can be burst at
138 .B ceil
139 speed, in excess of the configured
140 .B rate.
141 Should be at least as high as the highest burst of all children.
142
143 .TP
144 cburst bytes
145 Amount of bytes that can be burst at 'infinite' speed, in other words, as fast
146 as the interface can transmit them. For perfect evening out, should be equal to at most one average
147 packet. Should be at least as high as the highest cburst of all children.
148
149 .TP
150 quantum bytes
151 Number of bytes to serve from this class before the scheduler moves to the next class.
152 Default value is
153 .B rate
154 divided by the qdisc
155 .B r2q
156 parameter. If specified,
157 .B r2q
158 is ignored.
159
160 .SH NOTES
161 Due to Unix timing constraints, the maximum ceil rate is not infinite and may in fact be quite low. On Intel,
162 there are 100 timer events per second, the maximum rate is that rate at which 'burst' bytes are sent each timer tick.
163 From this, the minimum burst size for a specified rate can be calculated. For i386, a 10mbit rate requires a 12 kilobyte
164 burst as 100*12kb*8 equals 10mbit.
165
166 .SH SEE ALSO
167 .BR tc (8)
168 .P
169 HTB website: http://luxik.cdi.cz/~devik/qos/htb/
170 .SH AUTHOR
171 Martin Devera <[email protected]>. This manpage maintained by bert hubert <[email protected]>