[LARTC] probleme with cbq share

Linux Advanced Routing and Traffic Control

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

 



Hi everybody sorry for my poor english.
 
My script doesn't work very well
 
I want to share bandwidth between 3 subnet (64k, 128k, 256k)
if i put the flag bounded on the class root that's doesn't work bandwidth is not limited
if i put the flag bounded on each class, all the subnet is limited by each rule:
 
subnet 64 can't use more than a total of 64k as it was 1 single user
...
 
so i don't know how to share 64k by user on subnet 64, 128k by user on subnet 128, 256k by user on subnet 254.
 
What's wrong with my script?
 
thx a lot.
Michael
 
 
tc qdisc add dev eth0 root handle 1: cbq bandwidth 100Mbit avpkt 1000 cell 8 mpu 64
 
tc class add dev eth0 parent 1:0 classid 1:1 cbq bandwidth 100Mbit \
rate 100Mbit prio 1 allot 1514 weight 10Mbit cell 8 maxburst 20 avpkt 1000
 
tc class add dev eth0 parent 1:1 classid 1:2 cbq bandwidth 100Mbit \
rate 4Mbit prio 1 allot 1514 weight 400kbit cell 8 maxburst 20 avpkt 1000 bounded
 
tc class add dev eth0 parent 1:2 classid 1:11 cbq bandwidth 100Mbit \
rate 64kbit prio 1  allot 1514 weight 6kbit cell 8 maxburst 20      \
avpkt 1000
 
tc class add dev eth0 parent 1:2 classid 1:12 cbq bandwidth 100Mbit \
rate 128kbit prio 1  allot 1514 weight 13kbit cell 8 maxburst 20      \
avpkt 1000
 
tc class add dev eth0 parent 1:2 classid 1:13 cbq bandwidth 100Mbit  \
rate 256kbit prio 1  allot 1514 weight 26kbit cell 8 maxburst 20      \
avpkt 1000
 
tc filter add dev eth0 parent 1:0 prio 1 protocol ip u32
tc filter add dev eth0 parent 1:0 prio 1 handle 2: u32 divisor 256
 

j=0;
while [ $j -le 255 ]; do
hex=`echo "obase=16; $j" |bc`
echo $hex;
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 ht 2:$hex: \
match ip src 172.16.64.$j flowid 1:11
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 ht 2:$hex: \
match ip src 172.16.128.$j flowid 1:12
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 ht 2:$hex: \
match ip src 172.16.254.$j flowid 1:13
j=$((j+1))
done
 
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 ht 800:: \
match ip src 172.16.0.0/16 \
hashkey mask 0x000000ff at 12 \
link 2:

 

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