RE: Unexpected results using HTB qdisc

Linux Advanced Routing and Traffic Control

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

 



Hi John,
 
Thanks for the reply.  I removed the ceil parameters as a troubleshooting process to ensure that they weren't what was causing the excess of the configured rate.  From what I can see if the ceil parameter is not specified it defaults to the same figure as the rate parameter.  I have verified this by running "tc -s -d class list dev eth0".  The output from this command also shows that the rate limited classes have not borrowed at all (see below).   I have tried what you suggested anyway and it is still exceeding the configured rate.  The output below was generated on the server immediately after the completion of the iperf tests.  Another thing that doesn't make sense to me is that all but one of the classes are reported to have been lending but which class are they lending to?  None of the classes have been recorded as borrowing.

# tc -s -d class list dev eth0
class htb 1:10 parent 1:1 prio 0 quantum 200000 rate 30000Kbit ceil 100000Kbit burst 39093b/8 mpu 0b overhead 0b cburst 126587b/8 mpu 0b overhead 0b level 0
 Sent 574506 bytes 1223 pkts (dropped 0, overlimits 0)
 rate 63888bit 18pps
 lended: 1223 borrowed: 0 giants: 0
 tokens: 10155 ctokens: 9883
class htb 1:1 root rate 100000Kbit ceil 100000Kbit burst 1487b/8 mpu 0b overhead 0b cburst 126587b/8 mpu 0b overhead 0b level 7
 Sent 1006166 bytes 7723 pkts (dropped 0, overlimits 0)
 rate 181840bit 240pps
 lended: 0 borrowed: 0 giants: 0
 tokens: 110 ctokens: 9883
class htb 1:40 parent 1:4 leaf 40: prio 0 quantum 1000 rate 50000bit ceil 50000bit burst 1661b/8 mpu 0b overhead 0b cburst 1661b/8 mpu 0b overhead 0b level 0
 Sent 81010 bytes 1225 pkts (dropped 341, overlimits 0)
 rate 21272bit 40pps
 lended: 1225 borrowed: 0 giants: 0
 tokens: -239487 ctokens: -239487
class htb 1:4 parent 1:1 rate 300000bit ceil 300000bit burst 1974b/8 mpu 0b overhead 0b cburst 1974b/8 mpu 0b overhead 0b level 6
 Sent 431660 bytes 6500 pkts (dropped 0, overlimits 0)
 rate 117952bit 222pps
 lended: 0 borrowed: 0 giants: 0
 tokens: 39055 ctokens: 39055
class htb 1:41 parent 1:4 leaf 41: prio 0 quantum 1000 rate 50000bit ceil 50000bit burst 1661b/8 mpu 0b overhead 0b cburst 1661b/8 mpu 0b overhead 0b level 0
 Sent 78502 bytes 1189 pkts (dropped 294, overlimits 0)
 rate 20376bit 39pps
 lended: 1189 borrowed: 0 giants: 0
 tokens: -176795 ctokens: -176795
class htb 1:42 parent 1:4 leaf 42: prio 0 quantum 2500 rate 200000bit ceil 200000bit burst 1849b/8 mpu 0b overhead 0b cburst 1849b/8 mpu 0b overhead 0b level 0
 Sent 272120 bytes 4086 pkts (dropped 809, overlimits 0)
 rate 71768bit 135pps
 lended: 4086 borrowed: 0 giants: 0
 tokens: 4616 ctokens: 4616

 

> Date: Mon, 19 Nov 2007 22:49:03 +0100
> From: default@xxxxxxxxxxxxxxxxx
> Subject: Re: Unexpected results using HTB qdisc
> To: lartc@xxxxxxxxxxxxxxx
>
> Hi
>
> Stuart Clouston wrote:
> > Hi All,
> >
> > I am using the script below to limit download rates and manage traffic for a certain IP address and testing the results using iperf. The rate that iperf reports is much higher than the rate I have configured for the HTB qdisc. It's probably just some newbie trap that's messing things up but I'm buggered if I can see it.
> >
> > The following script is run on the server (192.168.10.30): (I have simplified it and removed all of the ceil parameters during my troubleshooting process)
> >
> it think you should have not removed ceiling parameters : )
> > # Remove any existing qdisc
> > tc qdisc del dev eth0 root handle 1:
> >
> > # Root queueing discipline
> > tc qdisc add dev eth0 root handle 1: htb default 10
> >
> > # Root class
> > tc class add dev eth0 parent 1: classid 1:1 htb rate 100mbit burst 1500 ceil 100mbit
> >
> > # Default class
> > tc class add dev eth0 parent 1:1 classid 1:10 htb rate 30mbit ceil 100mbit burst 1500
> >
> > # Rate limited classes
> > tc class add dev eth0 parent 1:1 classid 1:4 htb rate 300kbit
> >
> > tc class add dev eth0 parent 1:4 classid 1:40 htb rate 50kbit
> >
> You should use ceil here right after rate, otherwise the class can
> borrow from its parent class and therefore your overall traffic will be
> shaped in correct proportion but not absolutely (i.e to proper bandwidth)
> Once you set ceil value, the class will not get any more throughput even
> if the link is free...
>
> > tc class add dev eth0 parent 1:4 classid 1:41 htb rate 50kbit
> > tc class add dev eth0 parent 1:4 classid 1:42 htb rate 200kbit
> >
> > tc qdisc add dev eth0 parent 1:40 handle 40: sfq perturb 10
> > tc qdisc add dev eth0 parent 1:41 handle 41: sfq perturb 10
> > tc qdisc add dev eth0 parent 1:42 handle 42: sfq perturb 10
> >
> > # Filters to direct traffic to the right classes:
> >
> > U32="tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32"
> > $U32 match ip dst 192.168.10.85 match ip sport 3389 0xffff flowid 1:42
> > $U32 match ip dst 192.168.10.85 match ip sport 1352 0xffff flowid 1:41
> > $U32 match ip dst 192.168.10.85 flowid 1:40
> >
> >
> >
> > The client (192.168.10.85) then runs iperf to test the results:
> >
> > iperf -c 192.168.10.30 -p 1352 -P 5 -f k
> > [SUM] 0.0-11.4 sec 3016 KBytes 2163 Kbits/sec
> >
> > iperf -c 192.168.10.30 -p 23 -P 5 -f k
> > [SUM] 0.0-11.4 sec 2856 KBytes 2053 Kbits/sec
> >
> > iperf -c 192.168.10.30 -p 3389 -P 5 -f k
> > [SUM] 0.0-10.3 sec 11264 KBytes 8956 Kbits/sec
> >
> >
> > The traffic is being shaped proportionally as I'd hoped but each class is well in excess of its configured limit.
> >
> > I am getting similar results on two separate units:
> > 1: Debian (testing), Kernel v2.6.16.19, iproute2 ss070313
> > 2: Ubuntu (dapper), Kernel v2.6.23.1, iproute2 ss041019
> >
> > I'd be very grateful for any information that could help me out.
> > Thanks,
> > Stu (newbie to HTB)
> > _________________________________________________________________
> >
> >
> I am newbie too, so if i am wrong please someone correct me.
>
> --
> ___________________________________
> S pozdravom / Best regards
>
> John Default
>
>
> _______________________________________________
> LARTC mailing list
> LARTC@xxxxxxxxxxxxxxx
> http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc



Listen now! New music from the Rogue Traders.
_______________________________________________
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