Egress%20traffic%20shaping%20on%20Linux%20using%20Hierarchical%20Token%20Bucket%20(HTB) - PowerPoint PPT Presentation

About This Presentation
Title:

Egress%20traffic%20shaping%20on%20Linux%20using%20Hierarchical%20Token%20Bucket%20(HTB)

Description:

Has many applications where desired network use exceeds ... http://www.knowplace.org/shaper/index.html. HTB Linux queuing discipline manual - user guide ... – PowerPoint PPT presentation

Number of Views:533
Avg rating:3.0/5.0
Slides: 13
Provided by: bradb81
Learn more at: http://cs.uccs.edu
Category:

less

Transcript and Presenter's Notes

Title: Egress%20traffic%20shaping%20on%20Linux%20using%20Hierarchical%20Token%20Bucket%20(HTB)


1
Egress traffic shaping on Linux using
Hierarchical Token Bucket (HTB)
  • Brad Baker
  • CS522
  • 12.10.2003

2
Traffic Shaping Overview
  • Manages limited network resources
  • Has many applications where desired network use
    exceeds available resources
  • Can provide control, efficiency, and guaranteed
    quality of service, QoS
  • Limits contention for resources
  • Most useful on outbound (Egress) streams, some
    options for Ingress.

3
Traffic Control
  • Feature included in current Linux distributions
  • Includes classless and classful queuing
    disciplines
  • Need TC function to be bottleneck, not external
    router or other device
  • Several classless techniques available
  • FIFO, SFQ, TBF
  • Several classful techniques available
  • HTB, CBQ, PRIO

4
HTB Hierarchical Token Bucket
  • Classful queuing discipline
  • Similar to Class Based Queuing (CBQ)
  • Hierarchy of classes combined with filters are
    used to control traffic
  • System periodically produces tokens, needed to
    send frames over the interface
  • Classes send data if tokens are available
  • If no tokens, can borrow from parent

5
HTB classes
  • Root classes cannot borrow from one another
  • Traffic can only be classified to leaf classes
  • Inner classes allow borrowing to children
  • Egress packets are classified and placed in
    correct subclass
  • Dequeue request given to root, proceeds down tree
    until it can be fulfilled

6
HTB specifics
  • Bucket based storage of tokens accommodates burst
    traffic, such as web
  • Same concept in classless discipline TBF
  • Can use same feature to smooth bursts
  • Good for situations with fixed bandwidth to
    distribute among competitors
  • Can provide guaranteed min service rate, and
    constrain to max bandwidth use to ceiling rate
  • Supports priority values associated with classes
  • More efficient and fewer parameters than CBQ

7
Some HTB results
8
HTB syntax
  • tc qdisc del dev eth0 root
  • tc qdisc add dev eth0 root handle 2 htb default
    1
  • tc class add dev eth0 parent 2 classid 21 htb
    rate 100kbps ceil 100kbps prio 0
  • tc qdisc add dev eth0 parent 21 handle 1 htb
    default 1
  • tc class add dev eth0 parent 1 classid 11 htb
    rate 70kbps ceil 70kbps prio 0
  • tc class add dev eth0 parent 11 classid 110 htb
    rate 35kbps ceil 70kbps prio 1 burst 10k
  • tc class add dev eth0 parent 11 classid 111 htb
    rate 35kbps ceil 70kbps prio 1 burst 10k
  • tc qdisc add dev eth0 parent 110 handle 10 sfq
    perturb 10
  • tc qdisc add dev eth0 parent 111 handle 11 sfq
    perturb 10
  • tc class add dev eth0 parent 1 classid 12 htb
    rate 30kbps ceil 30kbps prio 0
  • tc class add dev eth0 parent 12 classid 120 htb
    rate 15kbps ceil 30kbps prio 1 burst 10k
  • tc class add dev eth0 parent 12 classid 121 htb
    rate 15kbps ceil 30kbps prio 1 burst 10k
  • tc class add dev eth0 parent 1 classid 13 htb
    rate 100kbps ceil 100kbps prio 1 burst 10k
  • Creates four qdiscs and eight classes
  • One non-root qdisc used to enforce 100K
  • Two non-root qdiscs used for SFQ

9
HTB improvements
  • Problem HTB divides predetermined bandwidth
    values between classes
  • Works well in situations with fixed bandwidth
  • Improvement Process could be enhanced by giving
    classes relative bandwidth values
  • Find potential channel capacity and use as root
    bandwidth

10
HTB improvements
  • Problem Discrepancy between quantum value and
    actual packet size
  • Can cause errors in cases of high bandwidth
    contention
  • Improvement Calculate bandwidth based on actual
    dequequed bytes
  • Instead of bytes specified by the model

11
Conclusion
  • Traffic shaping is useful and important
  • When resources exceed demand
  • When an interface changes from fast connection to
    slow connection
  • HTB provides a well supported TC solution
  • Efficient and accurate shaping traffic among
    predetermined bandwidth values
  • Allows resource control comparable to high-end
    dedicated bandwidth management systems.
  • Included in recent (2.4.20 or later) Linux
    kernels

12
References
  • Linux Advanced Routing Traffic Control HOWTO
    (LARTC)
  • Author Bert Hubert and others
  • http//lartc.org/howto/
  • Traffic Shaping with Linux
  • Author Shane Chen
  • http//www.knowplace.org/shaper/index.html
  • HTB Linux queuing discipline manual - user guide
  • Author Martin Devera
  • http//luxik.cdi.cz/devik/qos/htb/manual/userg.ht
    m
  • Traffic Control HOWTO
  • Author Martin A. Brown
  • http//linux-ip.net/articles/Traffic-Control-HOWTO
    /index.html
Write a Comment
User Comments (0)
About PowerShow.com