[LARTC] bandwith limiting limits to twice the expected speed

Linux Advanced Routing and Traffic Control

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

 



The following is a working experimental sample. It works, in respect that it more or less does what I expect it to do, but not
completely correctly.

First a little explanation about my configuration. The following is configured on my home firewall, running 2.4.20 and which is
connected to the Internet via Ethernet cable modem connection (about 4000Mbit down/128Kbit up). $DEV is the interface on the
internal side (FastEthernet).

The idea is, for experimental reasons only (I'm not nuts), to limit the downlink speed to 128kbit, separated in 64kbit for
http-proxy, and 64kbit for everything else. Proxy service is running at tcp/8080 at my provider's.



$TC qdisc del dev $DEV root 2>/dev/null
$TC qdisc del dev $DEV ingress 2>/dev/null

$TC qdisc add dev $DEV root handle 1: htb r2q 10
$TC class add dev $DEV parent 1: classid 1:1 htb rate 128Kbit ceil 128Kbit
$TC qdisc add dev $DEV parent 1:1 handle 11: cbq bandwidth 128Kbit avpkt 1500
$TC class add dev $DEV parent 11: classid 11:1 cbq bandwidth 128Kbit rate 64Kbit allot 1500 prio 1 avpkt 1500 bounded
$TC qdisc add dev $DEV parent 11:1 handle 111: prio
$TC qdisc add dev $DEV parent 111:1 handle 1111: sfq perturb 10
$TC qdisc add dev $DEV parent 111:2 handle 1112: sfq perturb 10
$TC qdisc add dev $DEV parent 111:3 handle 1113: sfq perturb 10
$TC class add dev $DEV parent 11: classid 11:2 cbq bandwidth 128Kbit rate 64Kbit allot 1500 prio 1 avpkt 1500 bounded
$TC qdisc add dev $DEV parent 11:2 handle 112: prio
$TC qdisc add dev $DEV parent 112:1 handle 1121: sfq perturb 10
$TC qdisc add dev $DEV parent 112:2 handle 1122: sfq perturb 10
$TC qdisc add dev $DEV parent 112:3 handle 1123: sfq perturb 10
# the first following line could be omitted when using "default 1" on the htb qdisc
$TC filter add dev $DEV parent 1: protocol ip prio 2 route flowid 1:1
$TC filter add dev $DEV parent 11: protocol ip prio 2 route flowid 11:1
$TC filter add dev $DEV parent 11: protocol ip prio 1\
        u32 match ip protocol 6 0xff match ip sport 8080 0xffff flowid 11:2



Everything ends up in a qdisc where I expect it to be. However, the download speed should be limited to about 8kByte per second.
But, it is not. If I download a 20MByte file using IE6, the download speed first sets of at about 40kByte and a few seconds later
drops to a steady 17kByte per second; about twice as fast as it should.

This is a cbq qdisc attached to a htb class. A cbq qdisc attached to a cbq qdisc with the same limiting properties gives the same
result.
I have been playing with maxburst settings of 1, all to no avail...

Maybe someone has an idea about what is going on and/or how to solve it...

Many thanks,

--
Vik



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