$linuxjunkies
>

HTB

also: Hierarchical Token Bucket

HTB (Hierarchical Token Bucket) is a Linux kernel queueing discipline that shapes network traffic by organizing classes into a hierarchy and allocating bandwidth fairly among them.

HTB is a traffic control (qdisc) mechanism in the Linux kernel that allows you to limit and prioritize network bandwidth. It works by organizing traffic classes in a tree structure, where each class has a guaranteed minimum bandwidth and can borrow unused bandwidth from parent classes.

HTB divides bandwidth into branches and leaves. A parent class guarantees bandwidth to its children, and if a child isn't using its full allocation, other children can borrow the surplus. This makes it ideal for scenarios like ensuring important traffic gets priority while allowing best-effort traffic to use remaining capacity.

Example: You could limit your eth0 interface to 100Mbps total, allocate 60Mbps to web traffic and 40Mbps to downloads. If downloads aren't using their 40Mbps, web traffic can borrow it. Configure HTB using tc qdisc and tc class commands.

Related terms