Manual:HTB: Difference between revisions
No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
===Dual Limitation=== | ===Dual Limitation=== | ||
Each queue in HTB have two rate limits: | Each queue in HTB have two rate limits: | ||
* '''CIR''' (Committed Information Rate) – ('''limit-at''' in RouterOS)in worst case scenario flow will get this amount of traffic no matter what (assuming we can actually send so much data) | * '''CIR''' (Committed Information Rate) – ('''limit-at''' in RouterOS) in worst case scenario flow will get this amount of traffic no matter what (assuming we can actually send so much data) | ||
* '''MIR''' (Maximal Information Rate) – in best case scenario a flow can get up to | * '''MIR''' (Maximal Information Rate) – ('''max-limit''' in RouterOS) in best case scenario a flow can get up to if there is spare bandwidth | ||
In another words, at first HTB will try to satisfy every child queue's '''limit-at''' ('''CIR''') only then it will try to reach '''max-limit''' ('''MIR''') | In another words, at first HTB will try to satisfy every child queue's '''limit-at''' ('''CIR''') only then it will try to reach '''max-limit''' ('''MIR''') | ||
To ensure optimal (as designed) usage of dual limitation feature we suggest to stick to these rules: | To ensure optimal (as designed) usage of dual limitation feature we suggest to stick to these rules: | ||
Line 22: | Line 24: | ||
Make a note that priority only works: | Make a note that priority only works: | ||
* for child queues - as soon as you assign at least one child to the queue priority option will | * for child queues - as soon as you assign at least one child to the queue, priority option will have no meaning in this queue | ||
* if '''limit-at''' and/or '''max-limit''' is specified (not 0) | * if '''limit-at''' and/or '''max-limit''' is specified (not 0) | ||
== Example== | |||
= | === Stage 1 - Structure and requirements === | ||
== | |||
[[Image:Stage1_1.jpg]] | [[Image:Stage1_1.jpg]] | ||
== | === Stage 2 - Reaching Limit-at=== | ||
[[Image:Stage1_2.jpg]] | [[Image:Stage1_2.jpg]] | ||
== | === Stage 3 - Max-limit=== | ||
[[Image:Stage1_3.jpg]] | [[Image:Stage1_3.jpg]] | ||
[[Category:Manual]] | |||
[[Category:Finished]] |
Revision as of 11:57, 2 October 2008
Theory
Structure
Hierarchical Token Bucket (HTB) allows to create hierarchical queue structure and determine relations between parent and child queues and relation between child queues. As soon as queue have at least one child it become a parent queue. All child queues (don't matter how many levels of parents they have) are treated as they were on the same (bottom) level of HTB. Child queues make actual traffic consumption, parent queues are responsible only for traffic distribution. Child queues are not able to get more traffic than parent has.
In RouterOS it is necessary to specify parent option to assign queue as a child to other queue
Dual Limitation
Each queue in HTB have two rate limits:
- CIR (Committed Information Rate) – (limit-at in RouterOS) in worst case scenario flow will get this amount of traffic no matter what (assuming we can actually send so much data)
- MIR (Maximal Information Rate) – (max-limit in RouterOS) in best case scenario a flow can get up to if there is spare bandwidth
In another words, at first HTB will try to satisfy every child queue's limit-at (CIR) only then it will try to reach max-limit (MIR)
To ensure optimal (as designed) usage of dual limitation feature we suggest to stick to these rules:
- Maximal rate of the parent must be equal or bigger than sum of committed rates of the children
- MIR (parent) ≥ CIR(child1) +...+ CIR(childN)
- Maximal rate of any child must be less or equal to maximal rate of the parent
- MIR (parent) ≥ MIR(child1) & MIR (parent) ≥ MIR(child2) & MIR (parent) ≥ MIR(childN)
Priority
Priority is used for creation of the strict order - who will get traffic first. Queue with higher priority will reach its limit-at before the queue with lower priority and after all limit-ats are satisfied queue with higher priority will reach its MIR before the queue with lower priority. 8 is the lowest priority, 1 is the highest.
Make a note that priority only works:
- for child queues - as soon as you assign at least one child to the queue, priority option will have no meaning in this queue
- if limit-at and/or max-limit is specified (not 0)
Example
Stage 1 - Structure and requirements
Stage 2 - Reaching Limit-at