Skip to contentSkip to conversation

I thought it was right... please take a look...

LARTC Jeremy Nelson 2 participants 2 messages Jun 19, 2002

lore
Share & tools
lore
#0 lore raw

Hi

I dont think my script is quite right but I just cant see why. If you could have a look at it and let me know if anything is wrong or suggest any better ways of making this happen. I have a 256kbit link, I want to give half of that (approx 124kbit) to a web site we run and let it burst to the full link if the bandwidth is not used (classid 1:10). The other half of the link is divided into 4 parts that each have 31kbit. I want these classes to be able to burst to half the link (124kbit) if the bandwidth is not used (classid 1:20 -> 1:50).

What is happening is that no traffic ever gets over 124kbit/sec even traffic that should be in 1:10. My script is below.

Thanks in advance

Jeremy

# Root
tc qdisc add dev eth0 root handle 1: htb default 50

# Parent to allow sharing
tc class add dev eth0 parent 1: classid 1:1 htb rate 248kbit burst 15k

# Main classes
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 124kbit ceil 248kbit burst 15k tc class add dev eth0 parent 1:1 classid 1:20 htb rate 31kbit ceil 124kbit burst 15k tc class add dev eth0 parent 1:1 classid 1:30 htb rate 31kbit ceil 124kbit burst 15k tc class add dev eth0 parent 1:1 classid 1:40 htb rate 31kbit ceil 124kbit burst 15k tc class add dev eth0 parent 1:1 classid 1:50 htb rate 31kbit ceil 124kbit burst 15k

# Add SFQ Classes under
tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10 tc qdisc add dev eth0 parent 1:20 handle 20: sfq perturb 10 tc qdisc add dev eth0 parent 1:30 handle 30: sfq perturb 10 tc qdisc add dev eth0 parent 1:40 handle 40: sfq perturb 10 tc qdisc add dev eth0 parent 1:50 handle 50: sfq perturb 10

# Add filters
U32="tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32" $U32 match ip sport 80 0xffff flowid 1:10
$U32 match ip sport 25 0xffff flowid 1:20
$U32 match ip sport 1723 0xffff flowid 1:30
$U32 match ip sport 53 0xffff flowid 1:30
$U32 match ip dport 80 0xffff flowid 1:40

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

#1 lore raw
Quoted 11 lines · Jeremy Nelson

Hi

I dont think my script is quite right but I just cant see why. If you could have a look at it and let me know if anything is wrong or suggest any better ways of making this happen. I have a 256kbit link, I want to give half of that (approx 124kbit) to a web site we run and let it burst to the full link if the bandwidth is not used (classid 1:10). The other half of the link is divided into 4 parts that each have 31kbit. I want these classes to be able to burst to half the link (124kbit) if the bandwidth is not used (classid 1:20 -> 1:50).

Quoted 2 lines

What is happening is that no traffic ever gets over 124kbit/sec even traffic that should be in 1:10. My script is below.

The scripts looks ok to me.
Are you sure the filters are working ? You can check with tc -s -d class show dev eth0
and hopely the counters of bytes/packets are incrementing.

And what if you make 1:10 the default class and remove all the filters so packets must end in 1:10?

Stef

Signature · 7 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.openprojects.net
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/