Find the answer to your Linux question:
Results 1 to 3 of 3
I am building a Linux router to manage bandwidth to specific IP addresses. Everything is working fine, but I am a little confused about the classes and how the hierarchy ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2007
    Posts
    3

    TC Class confusion


    I am building a Linux router to manage bandwidth to specific IP addresses.

    Everything is working fine, but I am a little confused about the classes and how the hierarchy is working.

    Example:

    Code:
    tc qdisc add dev eth0 root handle 1: htb default 12
    tc class add dev eth0 parent 1: classid 1:1 htb rate 3mbit ceil 3mbit
    tc class add dev eth0 parent 1:1 classid 1:10 htb rate 1mbit ceil 2mbit
    tc class add dev eth0 parent 1:1 classid 1:11 htb rate 1mbit ceil 2mbit
    tc class add dev eth0 parent 1:1 classid 1:12 htb rate 1mbit ceil 2mbit
    tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 \
       match ip dst 0.0.0.0 flowid 1:12
    tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 \
       match ip dst x.x.x.x flowid 1:11
    tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 \
       match ip dst x.x.x.x flowid 1:10
    tc qdisc add dev eth0 parent 1:10 handle 20: sfq
    tc qdisc add dev eth0 parent 1:11 handle 30: sfq
    tc qdisc add dev eth0 parent 1:12 handle 40: sfq
    The only why the sfq commands would work is with the 20:, 30:, 40:, etc. What happens when I reach 90: ? Also, am I doing this efficiently? Any help is appreciated.

  2. #2
    Linux User cyberinstru's Avatar
    Join Date
    Jan 2007
    Location
    India
    Posts
    362
    Hi,

    AFAIK, you can imagine these HTB Qs and classes as a tree.
    1. Queue being the ROOT node
    2. Classes are INTERIORS
    3. SFQs (in your case) are LEAFs or EXTERIORS

    I have a few questions on your Q hierarchy:

    =>> Your max pipe size is 3Mbps. Then why is the CEIL values for its child classes configured as 2 mbit? Is it done intentionally?

    =>> For further improving, classes can be prioritized.

    20: 30: 40: are just HANDLE IDs. It can be any value. But the only condition is all the childs need to be properly attached to its parents.

    HTH
    ---------------------------------
    Registered Linux User #440311
    HI2ARUN _AT_ GMAIL _DOT_ COM
    ---------------------------------

  3. #3
    Just Joined!
    Join Date
    Nov 2007
    Posts
    3
    The ceil is done intentionally, I was trying to make it 2mbit if it was available.

    I would guess I would use prio X for prioritization?

    And just to clear up the handle IDs on the sfqs, I can use any number except 1: ?

    That was too simple, sorry for the waste of time...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •