0

I am using Linux HTB to shape traffic, I am able to achieve the bellow diagram. The problem arise when I want to change the allocation for the excess bandwidth, instead of giving each class its proportion from the excess bandwidth, I'd like to be able to give first application 10% of excess bandwidth instead of 50%

          - Root - 200kbps
         /   |    \
        /    |     \
       /     |      \
      /      |       \
     /       |        \
    /        |         \
100kbps    60kbps     40kbps
app1       app2       app3

It appears HTB already does it:

When more classes want to borrow bandwidth they are each given some number of bytes before serving other competing class. This number is called quantum. If several classes are competing for parent's bandwidth then they get it in proportion of their quantums.

If I understood correctly, when 2 classes compete for parent bandwidth, each one is served a number of bytes according to his quantum, then the rest is distributed proportionally to their original allocation. (Correct me if I am wrong).


I thought I could give each class percentage of the excess bandwidth by changing its Quantum (i.e. chaning r2q global)

HTB chooses precomputed quantum values. It computes classe's quantum (when added or changed) as its rate divided by r2q global parameter.

But unfortunately, when I add a new class I am unable to change the r2q, it seems it can only be overrun for the root.

How can overrun the quantum for each inner class ? (if possible) ?

Tony Tannous
  • 103
  • 9

1 Answers1

1

You cannot override the r2q for different classes, because this is a global value for every HTB qdisc, but you can specify the quantum value for every class in bytes. In this case the specified quantum value will be used, not calculated from rate and r2q values.

Anton Danilov
  • 5,082
  • 2
  • 13
  • 23