Skip to contentSkip to conversation

borrowing only from parent]

Fwd: Re: Anton Yurchenko 3 participants 12 messages Apr 26, 2002 – May 15, 2002

lore
Share & tools
lore
#0 lore raw

If you read the manual, the algorithm will not work correctly with {,c}burst < MTU ...
devik

Quoted 9 lines · Anton Yurchenko

Hello,

for example I have a parent class 1:1 defined as:

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

# shape at 15 kbit almost no borrowing and no bursts
tc class add dev eth0 parent 1: classid 1:1 htb rate 15kbit ceil 1kbit burst 1b cburst 1b

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

#1 lore raw
Quoted 19 lines · Stef Coene
Quoted 10 lines · Anton Yurchenko

Hello,

for example I have a parent class 1:1 defined as:

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

# shape at 15 kbit almost no borrowing and no bursts
tc class add dev eth0 parent 1: classid 1:1 htb rate 15kbit ceil 1kbit
burst 1b cburst 1b
Quoted 7 lines
# and sibling classes
# shape at 5kbit and borrow up to 5 kbit no burst
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 5kbit ceil 5kbit
burst 1b cburst 1b # shape at 10kbit and borrow up to 10 kbit no burst
tc class add dev eth0 parent 1:1 classid 1:11 htb rate 10kbit ceil 10kbps
burst 1b cburst 1b
Quoted 5 lines

Try ceil 15kbit for the class 1:10 and 1:11.

And 15kbit is a very low speed to shape at. Why are you doing so ? And you also typed kbps, but kbps = kilobyte/s = 8 kilobit/s = 8 kbit.

That was just a mistype i typed in actualy your test config for htb, modified for my expalme purposes :)) this is the actual config:

tc -s -d class show dev eth0:
-----------
class htb 1:101 parent 1:1 prio 0 rate 40Kbit ceil 100Kbit burst 0b/8 mpu 0b cburst 0b/8 mpu 0b quantum 512 level 0 Sent 279738 bytes 4197 pkts (dropped 0, overlimits 9703) lended: 4197 borrowed: 0 giants: 0 injects: 0
tokens: -95938 ctokens: -191877

class htb 1:1 root prio 0 rate 100Kbit ceil 1Kbit burst 0b/8 mpu 0b cburst 0b/8 mpu 0b quantum 1280 level 3 Sent 605011 bytes 9017 pkts (dropped 0, overlimits 0) rate 233bps 3pps lended: 566 borrowed: 0 giants: 0 injects: 0
tokens: -9594 ctokens: -59999999

class htb 1:100 parent 1:1 prio 0 rate 60Kbit ceil 100Kbit burst 0b/8 mpu 0b cburst 0b/8 mpu 0b quantum 768 level 0 Sent 325273 bytes 4820 pkts (dropped 0, overlimits 12652) rate 233bps 3pps lended: 4254 borrowed: 566 giants: 0 injects: 0
tokens: -15989 ctokens: -9594

-----------
tc qdisc show dev eth0
-----------
qdisc htb 1: dev eth0 r2q 10 default 400 dcache 0
deq_util 1/250000 deq_rate 1 trials_per_deq 0
dcache_hits 0 direct_packets 71955
Chain PREROUTING (policy ACCEPT)
target prot opt source destination -----------

tc filter show dev eth0
-----------
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination filter parent 1: protocol ip pref 3 fw filter parent 1: protocol ip pref 3 fw handle 0x1 classid 1:100 filter parent 1: protocol ip pref 3 fw handle 0x2 classid 1:101

-----------

iptables -t mangle -L:
-----------

Chain INPUT (policy ACCEPT)
target prot opt source destination MARK all -- srchost1 anywhere MARK set 0x1 MARK all -- srchost2 anywhere MARK set 0x2

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination MARK all -- anywhere srchost1 MARK set 0x1 MARK all -- anywhere srchost2 MARK set 0x2

-----------

Also: whe I mark pakets for example only on OUTPUT chain, it will apply only to packets from me? so I should do it for in and out right?

Anyway with this config when I download from srchost1 (I use wget to measure) via ftp wget shows from 140 to 240 KB/s and for srchost2 via http I get from 70 to 100 KB/s. nothing like I expected :)

Thanks
Anton

#2 lore raw
In reply to Anton Yurchenko
Quoted 4 lines · Martin Devera

If you read the manual, the algorithm will not work correctly with {,c}burst < MTU ...
devik

I just tried to change {,c}burst to 1600, or leaving them by default but no visible result. here is the latest tc -s -d class show dev eth0

class htb 1:101 parent 1:1 prio 0 rate 40Kbit ceil 40Kbit burst 1599b/8 mpu 0b cburst 1599b/8 mpu 0b quantum 512 level 0 Sent 392526 bytes 5898 pkts (dropped 0, overlimits 15394) lended: 5898 borrowed: 0 giants: 0 injects: 0
tokens: -11905 ctokens: -11905

class htb 1:1 root prio 0 rate 100Kbit ceil 1Kbit burst 1599b/8 mpu 0b cburst 1599b/8 mpu 0b quantum 1280 level 3 Sent 956111 bytes 14168 pkts (dropped 0, overlimits 0) rate 12bps lended: 566 borrowed: 0 giants: 0 injects: 0
tokens: 224179 ctokens: -59999999

class htb 1:100 parent 1:1 prio 0 rate 60Kbit ceil 60Kbit burst 1599b/8 mpu 0b cburst 1599b/8 mpu 0b quantum 768 level 0 Sent 563585 bytes 8270 pkts (dropped 0, overlimits 20093) rate 11bps lended: 7704 borrowed: 566 giants: 0 injects: 0
tokens: -14100 ctokens: -14100

thanks,

Anton

Quoted 4 lines · Martin Devera

If you read the manual, the algorithm will not work correctly with {,c}burst < MTU ...
devik

I just tried to change {,c}burst to 1600, or leaving them by default but no visible result. here is the latest tc -s -d class show dev eth0

class htb 1:101 parent 1:1 prio 0 rate 40Kbit ceil 40Kbit burst 1599b/8 mpu 0b cburst 1599b/8 mpu 0b quantum 512 level 0 Sent 392526 bytes 5898 pkts (dropped 0, overlimits 15394) lended: 5898 borrowed: 0 giants: 0 injects: 0
tokens: -11905 ctokens: -11905

class htb 1:1 root prio 0 rate 100Kbit ceil 1Kbit burst 1599b/8 mpu 0b cburst 1599b/8 mpu 0b quantum 1280 level 3 Sent 956111 bytes 14168 pkts (dropped 0, overlimits 0) rate 12bps lended: 566 borrowed: 0 giants: 0 injects: 0
tokens: 224179 ctokens: -59999999

class htb 1:100 parent 1:1 prio 0 rate 60Kbit ceil 60Kbit burst 1599b/8 mpu 0b cburst 1599b/8 mpu 0b quantum 768 level 0 Sent 563585 bytes 8270 pkts (dropped 0, overlimits 20093) rate 11bps lended: 7704 borrowed: 566 giants: 0 injects: 0
tokens: -14100 ctokens: -14100

thanks,

Anton

#3 lore raw
In reply to Anton Yurchenko
Quoted 10 lines

I just tried to change {,c}burst to 1600, or leaving them by default but no visible result.
here is the latest tc -s -d class show dev eth0

class htb 1:101 parent 1:1 prio 0 rate 40Kbit ceil 40Kbit burst 1599b/8 mpu 0b cburst 1599b/8 mpu 0b quantum 512 level 0 Sent 392526 bytes 5898 pkts (dropped 0, overlimits 15394) lended: 5898 borrowed: 0 giants: 0
injects: 0
tokens: -11905 ctokens: -11905

Quoted 5 lines

class htb 1:1 root prio 0 rate 100Kbit ceil 1Kbit burst 1599b/8 mpu 0b cburst 1599b/8 mpu 0b quantum 1280 level 3 Sent 956111 bytes 14168 pkts (dropped 0, overlimits 0) rate 12bps lended: 566 borrowed: 0 giants: 0
injects: 0
tokens: 224179 ctokens: -59999999

ceil 1kbit !!??

devik

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

#4 lore raw
In reply to Anton Yurchenko
Quoted 10 lines · Martin Devera
Quoted 10 lines

I just tried to change {,c}burst to 1600, or leaving them by default but no visible result.
here is the latest tc -s -d class show dev eth0

class htb 1:101 parent 1:1 prio 0 rate 40Kbit ceil 40Kbit burst 1599b/8 mpu 0b cburst 1599b/8 mpu 0b quantum 512 level 0 Sent 392526 bytes 5898 pkts (dropped 0, overlimits 15394) lended: 5898 borrowed: 0 giants: 0
injects: 0
tokens: -11905 ctokens: -11905

Quoted 9 lines
Quoted 6 lines

class htb 1:1 root prio 0 rate 100Kbit ceil 1Kbit burst 1599b/8 mpu 0b cburst 1599b/8 mpu 0b quantum 1280 level 3 Sent 956111 bytes 14168 pkts (dropped 0, overlimits 0) rate 12bps lended: 566 borrowed: 0 giants: 0
injects: 0
tokens: 224179 ctokens: -59999999

ceil 1kbit !!??

Wouldnt it prevent 1:1 from borrowing from 1: ? I think Im missunderstanding the ceil. As I see it it is if I fe. have rate 100kbit and ceil 100kbit then 1:1 would go at at least 100kbit and can borrow 100kbit from 1: . Which is in my case unwanted. I want to limit 1:1 to 100kbit without abilyti to borrow. 1:100 and 1:101 could borrow from one another up to the max rate of 1:1 ( 100 kbit) that is what I want ot achieve.

thanks,

Anton

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

#5 lore raw
In reply to Anton Yurchenko
Quoted 3 lines
Quoted 2 lines

ceil 1kbit !!??

Wouldnt it prevent 1:1 from borrowing from 1: ? I think Im

it will but also it will prevent 1:1 to lend anything.

Quoted 3 lines

missunderstanding the ceil. As I see it it is if I fe. have rate 100kbit and ceil 100kbit then 1:1 would go at at least 100kbit and can borrow 100kbit from 1: . Which is in my case unwanted. I want to limit 1:1 to

no 100/100 is it can do 100 and 100 is also it;s maximal rate. Cail should be greater or the same in respec to rate. devik

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

#6 lore raw
In reply to Anton Yurchenko

Hello,

After your explaining now I think I get the meaning of htb options and here is my config , which still sadly doesnt work. Downloads from srchost1 and srchost2 go at full speed, and are not shaped. Though counters for respective classes increase.

tc -s -d show class dev eth0
-------------------------------------

class htb 1:101 parent 1:1 prio 0 rate 40Kbit ceil 100Kbit burst 1650b/8 mpu 0b cburst 1727b/8 mpu 0b quantum 512 level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0 injects: 0
tokens: 628545 ctokens: 263144

class htb 1:1 root prio 0 rate 100Kbit ceil 100Kbit burst 1599b/8 mpu 0b cburst 1599b/8 mpu 0b quantum 1280 level 3
Sent 3131025 bytes 23836 pkts (dropped 0, overlimits 0)
rate 281bps 3pps
lended: 751 borrowed: 0 giants: 0 injects: 0
tokens: -8719 ctokens: -8719

class htb 1:100 parent 1:1 prio 0 rate 60Kbit ceil 100Kbit burst 1675b/8 mpu 0b cburst 1727b/8 mpu 0b quantum 768 level 0
Sent 36068 bytes 504 pkts (dropped 0, overlimits 538)
rate 281bps 3pps
lended: 319 borrowed: 185 giants: 0 injects: 0
tokens: -12135 ctokens: 10773

-------------------------------------
tc qdisc show dev eth0
-------------------------------------
qdisc htb 1: r2q 10 default 400 dcache 0
deq_util 1/83333 deq_rate 4 trials_per_deq 0
dcache_hits 0 direct_packets 94066

-------------------------------------

tc filter show dev eth0
-------------------------------------

filter parent 1: protocol ip pref 3 fw
filter parent 1: protocol ip pref 3 fw handle 0x1 classid 1:100 filter parent 1: protocol ip pref 3 fw handle 0x2 classid 1:101

-------------------------------------

iptables -t mangle -L
-------------------------------------

Chain PREROUTING (policy ACCEPT)
target prot opt source destination

Chain INPUT (policy ACCEPT)

target     prot opt source               destination         
MARK       all  -- sourcehost1           anywhere           MARK set 0x1 
MARK       all  -- sourcehost2  anywhere           MARK set 0x2 

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)

target     prot opt source               destination         
MARK       all  --  anywhere 		sourcehost1         MARK set 0x1 
MARK       all  --  anywhere 		sourcehost2 		MARK set 0x2 

Chain POSTROUTING (policy ACCEPT)
target prot opt source destination

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

#7 lore raw
In reply to Anton Yurchenko

You are trying to shape downloads !? It will not work of course in this setup. You can shape output only. Or what do you want to shape ? devik

Quoted 6 lines · Anton Yurchenko

Hello,

After your explaining now I think I get the meaning of htb options and here is my config , which still sadly doesnt work. Downloads from srchost1 and srchost2 go at full speed, and are not shaped. Though counters for respective classes increase.

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

#8 lore raw
In reply to Anton Yurchenko
Quoted 4 lines · Martin Devera

You are trying to shape downloads !? It will not work of course in this setup. You can shape output only. Or what do you want to shape ? devik

ok I got it :)) that is what I suspected :)) finaly. that is common logic, I`m sorry, after reading some of the docs you go mad. my bad, thank you and Stef Coene very much for you help.

Anton

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

#9 lore raw
In reply to Anton Yurchenko

;) Try Patrick's IMQ version it should be able to do it.

Quoted 3 lines · Anton Yurchenko

ok I got it :)) that is what I suspected :)) finaly. that is common logic, I`m sorry, after reading some of the docs you go mad. my bad, thank you and Stef Coene very much for you help.

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

#10 lore raw
In reply to Anton Yurchenko

Question :

Quoted 2 lines
Quoted 2 lines

Has anyone ever managed to compile iproute2 from source, running a 2.4.x kernel ?

I have also managed to solve it in another way..
Here is how ...

Solution 1:

Well I have managed to fix the compile error on a kernel 2.4.x

If we have a look at the file, /usr/src/linux/include/linux/if_ether.h that you get from the different kernels, we notice a change.

On 2.2.x kernel...
#define ETH_P_ECHO 0x0200 /* Ethernet Echo packet */

On 2.4.x kernel...
#define ETH_P_PUP 0x0200 /* Xerox PUP packet */

Q: How to fix it ?
In the directory /lib of the source from the iproute2 tarball,
is a file called, 'll_proto.c'
In the file, there is an entry '__PF(ECHO,echo)' on line 36.

A: Remove this line, and try to compile it again.

Solution 2:

Quoted 12 lines

Using SGL :)

hvisage@meklon:~$ tar -zxf 
download/iproute2-2.4.7-now-ss020116-try.tar.gz 
hvisage@meklon:~$ cd iproute2/
hvisage@meklon:~/iproute2$ sed -e "s/UTILS_H/IPROUTE2_UTILS_H/g" 
< include/utils.h > include/iproute2_utils.h
hvisage@meklon:~/iproute2$ for i in `find . -type f | xargs grep 
utils.h|grep :|cut -f 1 -d :`; do sed -e 
's/"utils.h"/"iproute2_utils.h"/' <$i > $i.new;mv $i.new $i;done
hvisage@meklon:~/iproute2$ make 
Quoted 5 lines

QED ;^)

The reason:
there are a /usr/include/utils.h that get's included before
the iproute2/include/utils.h :(

----
To unsubscribe from this list: send the line "unsubscribe glug" in the subject of a message to [email protected]. If you have a problem unsubscribing, please mail [email protected]

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