HTB Home
Martin Devera aka devik (devik@cdi.cz)
Last updated: 7.12.2003
Back to QoS page
HTB is packet scheduler. It is currently included in
stock Linux kernels from 2.4.20. To read news see
below.
For Czech: Hledam programatora Rad bych do naseho tymu sehnal
spolehliveho PHP programatora. Neni treba virtuos staci solidni
interpret ;-). JS, Perl, C vitano, stejne tak smysl pro korektni
modularni a komentovany kod. Moznosti lecos se priucit v ramci
pracovni doby. Flex. prac. doba ale pouze v sidle firmy (Pha, Jarov).
To same plati pro admina. Napln prace - sprava par desitek serveru,
Exim, Apache, PHP, MySQL, PgSQL, SpamAssassin a dalsi proprietarni sw.
Please general question regarding HTB should be send to LARTC
mailing list. See http://lartc.org.
I accept only bug reports and assume you read FAQ below.
Please assume that HTB related mails to me are not considered
to be private unless you explicitly ask for it. In other words
it means that I can put them into FAQ for example.
Documents
Actual:
User guide (PDF version)
FAQ
Theory and implementation
HTB3 performance analysis
Czech documents from my presentation at SLT 2002 in town Sec.
These are part of ISBN 80-7302-043-2 by Konvoj and you can
download them only for your private use.
STL 2002 HTB description
SLT 2002 Presentation slides
Older docs:
Older theory and ideas
Older performance measurements
Ideas on HTB1->HTB3 way
Links
- LARTC- well known site devoted to
routing and QoS in 2.4 kernels.
- docum.org - site with interesting
QoS informations.
Mailing lists
- Moderated low volume listserv for announcements. You can subscribe
by sending mail with subject "subscribe" to qos-request@lists.cdi.cz.
You will get infor about HTB events. You can't post there !
- LARTC list - there are many people using HTB. It is general purporse
list. See http://lartc.org.
Downloads
To get tc tool for 2.4.20 and newer kernels, download htb3.6-020525.tgz
below. It contains both binary and patch against iproute2. I hope Alexey will
release new iproute2 soon (he claims it contains HTB code already).
HTB3 code (public beta, this is if you want to patch older 2.4 kernels but
I strongly recomment you to use 2.4.20 or more recent one):
htb3.6-020525.tgz is the latest archive
with patches, Changelog and tc binary.
Tested with 2.4.17 and probably other 2.4.x will be ok.
The file contains also rb_tree export patch which is now in 2.4.19pre. You
may get some patch errors on kernels 2.4.19pre and newer.
Note that you have to use new tc tool.
HTB2 code:
diff against 2.2.17 and probably other 2.2.x
diff against 2.4.17 and probably other 2.4.x
diff against iproute2 rel 991023
and tc binary (Warning: this doesn't work with HTB3 !!)
Changes
- 21.6.2004
- Witold Szczerba spent his time evaluating fairness of borrowing. His
troubles inspired me enough to analyze the problem: When a class changes
from yellow to green it disconnects itself from parent's feedlist.
Unfortunately it resets feed pointer to the first child. I created a patch
where the class uses classid to remember its position in the feedlist.
The patch for 2.4.24 and hopefully others is
here. It will
be included in next kernel releases. PLEASE report me any problems
with it !
- 7.12.2003
- Two oopses were found by zhaoyao and Daniel Blueman. Patch against
2.4.23 and 2.6.0-test10 is
here. It will
be included in next kernel releases of course.
- 23.10.2003
- Walter Karshat created patch which implements per packet overhead and
MPU. You can get it here. Overhead
implementation is a bit hack but when you need it you will be satisfied :-)
No tc binary yet.
- 4.8.2003
- Wilfried Weissmann spotted bug in dequeue code and helped with fix.
This patch contains one below thus needs to be applied after patch
from 20.6.2003. It is here. This
one will appear in 2.4.23 because it is too late for 2.4.22.
- 5.7.2003
- I changed Tobias' patch to disable debug dump during tc qdisc show command.
It is cumulative patch against the one below.
- 20.6.2003
- Patch against 2.4.21 release. It fixes dequeue(n) bug hopefully. It will be
included in next kernel but in meanwhile download it
here.
- 12.12.2002
- I lost track of dates so meanwhile 2.4.20 HTB is out and FAQ section was added.
- 15.8.2002
- HTB included in 2.4.20pre1 and next 2.5.x patch.
- Alexey told me that he included HTB into latest iproute2 package.
- Another guy informed me about plans to include backport into 2.2.
- 5.5.2002
- HTB sites totaly redesigned. I hope it is now more readable ...
- Minor changes into HTB3 .. seems to work well.
- Greg Louis had problems with HTB3 and 2.4.19pre7. The reason is that
ANK changed PSCHED_TDIFF_SAFE function in pre5. Send message to netdev.
- 2.5.2002
- New HTB3 finished. Need testers. Look at this for performance
analysis. At bottom of this page are new patches. Major changes:
- Scalable and fast code. Major code cleanup.
- You can set quantum for each class which allows you to control how
bw is distributed under single parent.
- Injecting is gone. Sorry. It was experimental feature and it'd complicate
new design.
- No 2.2 version ! Maybe someone will backport it - it is not hard
but I use rb_tree which is part of 2.4. One could copy the files
and it should work. But now I concentrate on 2.4.
- My special circular lists are gone - now I use standard struct list_head.
As you can see the new HTB is almost the same from user's view. It is
ok. The only goal was speed and clean design.
- 13.1.2002
- Allow to attach a filter to a leaf. It is needed by tc_index filter used in diffserv.
- Updated source to support 2.4.17 (which removed CONFIG_RTNETLINK).
- Here is preliminary of HTB2 theory paper.
- 21.12.2001
- Bug in new beta regarding "default" keyword fixed. Thanks goes to Claudio Neves.
- Binary tc added.
- 19.12.2001
- Beta of new version. See patches htb2_xxx. HTB timer > 5 sec bug fix.
- Added ability to bind classifiers (filters) to inner nodes.
- Added internal fifo queue which allows you to pass unclassified
packets directly thru at full speed. It can be also selected explicitly
as class :0.
- Code prepared for merge into 2.4 mainline.
- In TC you don't have to specify "burst" and "cburst" anymore. The tc tool
will compute it for you (you can still override it).
- 17.12.2001
- Urgent: see comments at download section of this page
- 2.12.2001
- Oops in class delete fixed (thanks to Martin Josefsson)
- Parts of this manual rewriten and my bad English fixed (thanks to Don Cohen)
- 30.11.2001
- Nasty bug with class stalls fixed (thanks to Vladimir Smelhaus).
- New tc qdisc parameter to turn debug tracing of variour subsystems on and off.
HTB now comes with debugging compiled in but turned off to simplify problem
localization by regular users.
- 16.11.2001
- Added #include<linux/version.h> which was not needed in 2.4.12.
- I turned debugging messages off finally.
- 15.11.2001
- Added binary tc tool (many wanted it)
- 9.11.2001
- ondrej kraus reminded me that htb doesn't work as non-module. fixed.
- he also noted that packets going to nonexistent class should not be
dropped as it can fool administrator (cut his ssh connection :-). now
such packets go slowly (!) thru.
- 21.10.2001
- Slots removed. The whole idea was a hack and now
it is replaced by much cleaner approach called Intermediate Queue (IMQ).
See my QOS page for it. A
nice side effect of removal is much cleaner and shorter code. And it is
2.4 SMP safe finally.
- Added idea of injecting but not extensively tested yet.
- Changed DRR to multilevel-DRR (more fair).
- Revision 1.6 of sch_htb.c marked as v1.0 of HTB.
- 19.9.2001