Re: HTB: Problem with excess bandwidth distribution

Linux Advanced Routing and Traffic Control

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

 



Leslie Patrick Polzer wrote:
Still problems :(

I upgraded to kernel 2.6.9 now, configured IMQ to hook itself up after NAT, called it
from prerouting, used u32 (matching works), set the root class to a rate of 800kBit
(which is 200 less than my link speed) - and the behavior gets even worse :(


Unfortunately, I cannot shape on the outgoing interfaces either, because there are two.

I really don't know what to do now... I haven't dug deep into CBQ yet - should I try it?

Hmm - this should work. I just cobbled together a test - It's not very elegant because it's based on a slightly different setup, but it works for me. I use default as my local traffic has a dynamic IP - you don't need to . Note the U32 filters are attached to 1:0 if I attached them to 1:1 than I would need a rule to send traffic to 1:1.


I wouldn't trust the output of apps for bandwidth tests - their averaging can be confusing - also if it weren't just a test I would add queues to the classes. Saying that I did notice that HTB was dropping - maybe the default queue length is shorter now? It does seem a bit strange though, I see drops where I expect the queue to be long enough for my rwin and a class with two tcps on the go had less drops than one with one - strange.

It did work though use tc -s class ls dev imq0 to see rates (which for me using the new TC seem to be shown in the wrong units).

You may need to unwrap the lines if you copy n paste this:

set -x
IPTABLES=/usr/local/sbin/iptables
MODPROBE=/sbin/modprobe
IP=/sbin/ip
TC=/sbin/tc


$IPTABLES -t mangle -D PREROUTING -i ppp0 -j IMQ --todev 0 &> /dev/null $IP link set imq0 down &> /dev/null $MODPROBE -r imq &> /dev/null

if [ "$1" = "stop" ]
then
        echo "stopping"
        exit
fi

$MODPROBE imq numdevs=1
$IPTABLES -t mangle -I PREROUTING -i ppp0 -j IMQ --todev 0
$IP link set imq0 up

$TC qdisc add dev imq0 root handle 1:0 htb default 34

$TC class add dev imq0 parent 1:0 classid 1:1 htb rate 400kbit ceil 400kbit burst 6k

#### 1 ####
$TC class add dev imq0 parent 1:1 classid 1:32 htb rate 133kbit ceil 400kbit prio 1


$TC filter add dev imq0 protocol ip parent 1:0 prio 1 u32 match ip dst 192.168.0.2 flowid 1:32

#### 2 ####
$TC class add dev imq0 parent 1:1 classid 1:33 htb rate 133kbit ceil 400kbit

$TC filter add dev imq0 protocol ip parent 1:0 prio 1 u32 match ip dst 192.168.0.3 flowid 1:33

#### Default = traffic for local process ####

$TC class add dev imq0 parent 1:1 classid 1:34 htb rate 133kbit ceil 400kbit



Andy.



_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

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