HTB Rate and Prio

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 

Hi,

 

I wanted to implement some QOS on my Linux Box with HTB, but after some time spend

on the configuration and tests, I still don’t manage to have some correct results. Here are the details :

 

 

 

-ROOT 2000 kbits

            -HIGHPRIO SUBCLASS 50 kbits prio 0

            -SUBCLASS1 750 kbits prio 1

                        -SERVICE1 250 kbits prio 1

                        -SERVICE2 250 kbits prio 1

                        -SERVICE3 250 kbits prio 1

            -SUBCLASS2 750 kbits prio 1

                        -SERVICE1 250 kbits prio 1

                        -SERVICE2 250 kbits prio 1

                        -SERVICE3 250 kbits prio 1

            -SUBCLASS3   400 kbits prio 1

                        -SERVICE1 200 kbits prio 1

                        -SERVICE2 200 kbits prio 1

            -LOWPRIO SUBCLASS 50 kbits prio 5

 

Here is the details of the implementation, I only wrote 1 on the subclass

Cause they are all on the same template.

 

 

tc qdisc add dev $QOSIN root handle 1:0 htb default 1000

tc class add dev $QOSIN parent 1:0 classid 1:1 htb rate 2000kbit

 

### SUBCLASS1

tc class add dev $QOSIN parent 1:1 classid 1:10 htb rate 750kbit ceil 2000kbit prio 1

tc class add dev $QOSIN parent 1:10 classid 1:101 htb rate 250kbit ceil 2000kbit prio 1

tc qdisc add dev $QOSIN parent 1:101 handle 101: pfifo limit 10

tc class add dev $QOSIN parent 1:10 classid 1:102 htb rate 250kbit ceil 2000kbit prio 1

tc qdisc add dev $QOSIN parent 1:102 handle 102: pfifo limit 10

tc class add dev $QOSIN parent 1:10 classid 1:103 htb rate 250kbit ceil 2000kbit prio 1

tc qdisc add dev $QOSIN parent 1:103 handle 103: pfifo limit 10

 

tc filter add dev $QOSIN parent 1:0 protocol ip handle $OUTPROD$MAIL fw flowid 1:101

tc filter add dev $QOSIN parent 1:0 protocol ip handle $OUTPROD$HTTP fw flowid 1:102

tc filter add dev $QOSIN parent 1:0 protocol ip handle $OUTPROD$FTP fw flowid 1:103

 

etc…

 

 

### HIGH PRIO ###

tc class add dev $QOSIN parent 1:1 classid 1:50 htb rate 50kbit ceil 2000kbit prio 0 quantum 1500

tc qdisc add dev $QOSIN parent 1:50 handle 50: pfifo limit 10

tc filter add dev $QOSIN parent 1:0 protocol ip handle $OUTPROD$HIGHPRIO fw flowid 1:50

tc filter add dev $QOSIN parent 1:0 protocol ip handle $OUTPOSTPROD$HIGHPRIO fw flowid 1:50

tc filter add dev $QOSIN parent 1:0 protocol ip handle $OUTDMZ$HIGHPRIO fw flowid 1:50

 

### LOW PRIO ###

tc class add dev $QOSIN parent 1:1 classid 1:60 htb rate 50kbit ceil 2000kbit prio 5 quantum 1500

tc qdisc add dev $QOSIN parent 1:60 handle 60: pfifo limit 10

tc filter add dev $QOSIN parent 1:0 protocol ip handle $OUTPROD$LOWPRIO fw flowid 1:60

tc filter add dev $QOSIN parent 1:0 protocol ip handle $OUTPOSTPROD$LOWPRIO fw flowid 1:60

tc filter add dev $QOSIN parent 1:0 protocol ip handle $OUTDMZ$LOWPRIO fw flowid 1:60

 

 

Every traffic seems to go in the class it must go, the stats are good and if I change any of the ceil rate

the associated traffic is caped to the right ceil I enter.

 

Now with this configuration I expected that when one of the SUBCLASS class or SERVICE want more bandwith than its

rate, she can borrow it from root and she had it before LOW PRIO and after HIGH PRIO.

 

But it don’t work at all, for exemple I tried only with 2 flow, I have 500 Kbits of LOW PRIO traffic that is currently

going on, then I fire some SERVICE1 traffic from SUBCLASS1 that can theorically take 2000 kbits, and instead

of taking it from LOW PRIO, it just take what is left…

 

I surely miss something…

 

Thanks for your help and don’t hesitate to ask more infos J

 

Gael.

 

 

_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux