Qos - HTB - Question - Networking

This is a discussion on Qos - HTB - Question - Networking ; Hi, I try to set a overall rate limit for our microwave uplink with htb: tc qdisc add dev $INIF root handle 1: htb default 3 tc class add dev $INIF parent 1: classid 1:1 htb rate 34MBit ceil 34MBit ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Qos - HTB - Question

  1. Qos - HTB - Question

    Hi,

    I try to set a overall rate limit for our microwave uplink with htb:

    tc qdisc add dev $INIF root handle 1: htb default 3

    tc class add dev $INIF parent 1: classid 1:1 htb rate 34MBit ceil 34MBit
    prio 1
    tc class add dev $INIF parent 1:1 classid 1:2 htb rate 32MBit ceil 32MBit
    prio 1
    tc class add dev $INIF parent 1:1 classid 1:3 htb rate 200KBit ceil 200KBit
    prio 3
    tc class add dev $INIF parent 1:1 classid 1:4 htb rate 500KBit ceil 500KBit
    prio 3
    tc class add dev $INIF parent 1:1 classid 1:5 htb rate 200KBit ceil 200KBit
    prio 3
    tc class add dev $INIF parent 1:1 classid 1:6 htb rate 200KBit ceil 200KBit
    prio 3
    tc class add dev $INIF parent 1:1 classid 1:7 htb rate 600KBit ceil 600KBit
    prio 2

    tc qdisc add dev $INIF parent 1:2 sfq quantum 1514b perturb 15
    tc qdisc add dev $INIF parent 1:3 sfq quantum 1514b perturb 15
    tc qdisc add dev $INIF parent 1:4 sfq quantum 1514b perturb 15
    tc qdisc add dev $INIF parent 1:5 sfq quantum 1514b perturb 15
    tc qdisc add dev $INIF parent 1:6 sfq quantum 1514b perturb 15
    tc qdisc add dev $INIF parent 1:7 sfq quantum 1514b perturb 15

    tc filter add dev $INIF protocol ip prio 4 handle 1 fw classid 1:2
    tc filter add dev $INIF protocol ip prio 5 handle 2 fw classid 1:3
    tc filter add dev $INIF protocol ip prio 5 handle 3 fw classid 1:4
    tc filter add dev $INIF protocol ip prio 5 handle 7 fw classid 1:5
    tc filter add dev $INIF protocol ip prio 5 handle 9 fw classid 1:6
    tc filter add dev $INIF protocol ip prio 5 handle 10 fw classid 1:7

    The shaping in my sibling classes 1:2-7 works, the marking is done with
    iptables. The only thing which is not working is my overall limit in
    classid 1:1, which is the parent class of my siblings 1:2-7. If I change
    the Line to:

    tc class add dev $INIF parent 1: classid 1:1 htb rate 1MBit ceil 1MBit prio
    1

    and measure the outgoing traffic on INIF with iptraf I got still for example
    5-6 Mbit outgoing Traffic. Shouldn't it shape the traffic down to 1 Mbit
    although my sibling class 1:2 has a rate of 32MBit? I thought the max rate
    is always the parent rate and in case of higher sibling rates it is
    distributed depending on their ratio?

    Thanks!

    Oli




  2. Re: Qos - HTB - Question

    Oli wrote:
    I thought the max rate
    > is always the parent rate and in case of higher sibling rates it is
    > distributed depending on their ratio?


    No, child rates are guarenteed regardless of parent.

    The ratio equal prio classes share excess is loosely related to rate,
    but only because by default htb calculates quantum from rates.

    You can specify quantum and override this. To see what quantums are
    being used do -

    tc -s -d class ls dev ....

    Andy.

+ Reply to Thread