Skip to contentSkip to conversation

why so fast?

LARTC sun reflex4 2 participants 4 messages May 14, 2003

lore
Share & tools
lore
#0 lore raw

Hi,
I am doing some test to control outgoing traffic, and I want to see if everything is working, but when I configure Compuetr A, and make a download in Computer B from A (e.g. in Computer A Apache is installed), the download goes so fast(not as in the ceil or rate!), even when I make the rate & ceil too small, am I doing something wrong??
Example on Computer A:
tc qdisc add dev eth0 root handle 1: htb default 19

tc class add dev eth0 parent 1: classid 1:1 htb rate 10bps ceil 10bps tc class add dev eth0 parent 1: classid 1:19 htb rate 15bps ceil 15bps

tc filter add dev eth0 parent 1: protocol ip handle 1 fw classid 1:1

iptables -t mangle -A OUTPUT -d 192.168.0.11 -j MARK --set-mark 1
#Compter B has ip 192.168.0.11

Thanx

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?pageþatures/junkmail

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#1 lore raw
Quoted 9 lines · On Wednesday 14 May 2003 11:25, sun reflex4 wrote:

Hi,
I am doing some test to control outgoing traffic, and I want to see if everything is working, but when I configure Compuetr A, and make a download in Computer B from A (e.g. in Computer A Apache is installed), the download goes so fast(not as in the ceil or rate!), even when I make the rate & ceil too small, am I doing something wrong??
Example on Computer A:
tc qdisc add dev eth0 root handle 1: htb default 19

Quoted 7 lines

tc class add dev eth0 parent 1: classid 1:1 htb rate 10bps ceil 10bps tc class add dev eth0 parent 1: classid 1:19 htb rate 15bps ceil 15bps

tc filter add dev eth0 parent 1: protocol ip handle 1 fw classid 1:1

iptables -t mangle -A OUTPUT -d 192.168.0.11 -j MARK --set-mark 1
#Compter B has ip 192.168.0.11

Your setup is good, but you put all packets coming from computer A (and marked with 1) in class 1:1. The problem is that this is not a leaf class because it has a child class. And a non-leaf class can not transmit packets itself. So the packets are sended at link speed.
Solution : only leaf classes can shape traffic so make sure all packets ends up in a leaf class. You can do this by removing the filter statement so all packets are placed in the default class. Or change your filter statement so all packets marked with a 1 are redireted to class 1:19.

If you are interested, I did some tests myself. You can find the results on www.docum.org.

Stef

Signature · 8 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#2 lore raw
In reply to sun reflex4

Hi Stef,
is class 1:1 really a non-leaf class? It doesn't have any children. I know your site, and actually it is the place, where I lerned all this stuff :)

Quoted 5 lines

tc qdisc add dev eth0 root handle 1: htb default 19

tc class add dev eth0 parent 1: classid 1:1 htb rate 10bps ceil 10bps tc class add dev eth0 parent 1: classid 1:19 htb rate 15bps ceil 15bps

Quoted 8 lines

tc filter add dev eth0 parent 1: protocol ip handle 1 fw classid 1:1

iptables -t mangle -A OUTPUT -d 192.168.0.11 -j MARK --set-mark 1
#Compter B has ip 192.168.0.11
Your setup is good, but you put all packets coming from computer A (and marked with 1) in class 1:1. The problem is that this is not a leaf class because it has a child class. And a non-leaf class can not transmit packets itself. So the packets are sended at link speed.

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?pageþatures/junkmail

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#3 lore raw
In reply to sun reflex4
Quoted 2 lines · On Wednesday 14 May 2003 12:02, sun reflex4 wrote:

Hi Stef,
is class 1:1 really a non-leaf class? It doesn't have any children.

Oops. Indeed.
But you better create 1 root class and add 1:1 and 1:19 to that root class.

Quoted 2 lines

I know your site, and actually it is the place, where I lerned all this stuff :)

Ok :)

Quoted 9 lines
Quoted 9 lines

tc qdisc add dev eth0 root handle 1: htb default 19

tc class add dev eth0 parent 1: classid 1:1 htb rate 10bps ceil 10bps tc class add dev eth0 parent 1: classid 1:19 htb rate 15bps ceil 15bps

tc filter add dev eth0 parent 1: protocol ip handle 1 fw classid 1:1

iptables -t mangle -A OUTPUT -d 192.168.0.11 -j MARK --set-mark 1
#Compter B has ip 192.168.0.11

Can you check to see the tc counters to make sure the packets are ending in the class you want?

Stef

Signature · 8 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/