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

Newbie: CBQ u32 help needed please!



Hi all,
I am new to linux-diffserv and was trying the CBQ u32 example from the website http://qos.ittc.ukans.edu/howto but am having trouble getting it to work. I tried the routing table based example and that works fine. I modified the CBQ u32 script for a simple example where traffic to be routed to a specific  IP destination addr is assigned to a class with a bounded bandwidth.
 
I run the script and it appears to execute fine, but when I test it by running a ftp session and transferring data to the specified dest addr machine, it appears that the rate of the traffic is running at the maximum possible rate (~1Mbyte/s) instead of the setup rate of ~50 Kbit/s.(or whatever I specify)
 
When I do a tc -s -d qdisc dev eth0, it appears that everything is sent by thre root qdisc instead of the required CBQ qdisc 2: why?
 
Can someone please help ?
Thanks in advance.
The script used and result is shown below. I am using redhat 6.2 with kernel 2.3.99-pre3 with iproute-991023
----------------------------------------------------------------------------------------
tc qdisc add dev eth0 root handle 1: cbq bandwidth 10Mbit allot 1514 cell 8 avpkt 1000 mpu 64
tc class add dev eth0 parent 1:0 classid 1:1 cbq bandwidth 10Mbit rate 10Mbit allot 1514 cell 8 weight 10Mbit prio 8 maxburst 20 avpkt 1000
 
# Traffic to testbed1. The priority is 3 and the allocation is 50Kbit.
tc class add dev eth0 parent 1:1 classid 1:2 cbq bandwidth 10Mbit rate 50Kbit allot 1514 cell 8 weight 50Kbit prio 3 maxburst 20 avpkt 1000 bounded
# Attaching another CBQ
tc qdisc add dev eth0 parent 1:2 handle 2: cbq bandwidth 50Kbit allot 1514 cell 8 avpkt 1000 mpu 64
# Setting up the classes for the traffic
tc class add dev eth0 parent 2:0 classid 2:1 cbq bandwidth 50Kbit rate 50Kbit allot 1514 cell 8 weight 5Kbit prio 3 maxburst 20 avpkt 1000 bounded
tc class add dev eth0 parent 2:1 classid 2:2 cbq bandwidth 50Kbit rate 10Kbit allot 1514 cell 8 weight 1Kbit prio 1 maxburst 20 avpkt 1000 bounded
tc class add dev eth0 parent 2:1 classid 2:3 cbq bandwidth 50Kbit rate 40Kbit allot 1514 cell 8 weight 4Kbit prio 2 maxburst 20 avpkt 1000 bounded
 
# Installing a route classifier on device eth0.
tc filter add dev eth0 parent 1:0 protocol ip prio 100 route
ip route add 192.168.10.2 via 192.168.10.10 realm 2
 
# Installing a u32 classifier for the traffic to testbed1
tc filter add dev eth0 parent 2:0 prio 3 protocol ip u32
# Creating hash tables for classification of the packets to testbed1
tc filter add dev eth0 parent 2:0 prio 3 handle 1: u32 divisor 256
tc filter add dev eth0 parent 2:0 prio 3 handle 2: u32 divisor 256
# Configuring the 6th slot of the hash table 1 to select packets with destination set to testbed1 
tc filter add dev eth0 parent 2:0 prio 3 u32 ht 1:6: match ip dst 192.168.10.2 flowid 2:2
# Configuring the 6th slot of the hash table 2 to select packets with destination set to testbed2 
tc filter add dev eth0 parent 2:0 prio 3 u32 ht 2:6: match ip dst 192.168.10.1 flowid 2:3
# Lookup hash table and it it is not fragmented, use the protocol as the hash key.
tc filter add dev eth0 parent 2:0 prio 3 handle ::1 u32 ht 800:: match ip nofrag offset mask 0x0F00 shift 6 hashkey mask 0x00ff0000 at 8 link 1:
tc filter add dev eth0 parent 2:0 prio 3 handle ::1 u32 ht 800:: match ip nofrag offset mask 0x0F00 shift 6 hashkey mask 0x00ff0000 at 8 link 2:
 
The following is the result of the setup
---------------------------------------------------------------------
[root@mint /root]# tc -s -d qdisc
qdisc cbq 2: dev eth0 rate 50Kbit cell 8b mpu 64b (bounded,isolated) prio no-transmit/8 weight 50Kbit allot 1514b
level 2 ewma 5 avpkt 1000b maxidle 4882us
    Sent 0 bytes 0 pkts (dropped 0,overlimits 0) borrowed 0 overactions 0 avgidle 128000 undertime 0
qdisc cbq 1: dev eth0 rate 10Mbit cell 8b mpu 64b (bounded,isolated) prio no-transmit/8 weight 10Mbit allot 1514b
level 2 ewma 5 avpkt 1000b maxidle 23us
    Sent 9595436 bytes 9250 pkts (dropped 0, overlimits 0) borrowed 0 overactions 0 avgidle 624 undertime 0
 
[root@mint /root]# tc filter ls dev eth0 parent 2:0
filter protocol ip pref 3 u32
filter protocol ip pref 3 u32 fh 2: ht divisor 256
filter protocol ip pref 3 u32 fh 2:6:800 order 2048 key ht 2 bkt 6 flowid 2:3
    match c0a80a01/ffffffff at 16
filter protocol ip pref 3 u32 fh 1: ht divisor 256
filter protocol ip pref 3 u32 fh 1:6:800 order 2048 key ht 1 bkt 6 flowid 2:2
    match c0a80a02/ffffffff at 16
filter protocol ip pref 3 u32 fh 800: ht divisor 1
filter protocol ip pref 3 u32 fh 800::1 order 1 key ht 800 bkt 0 link 1:
    match 00000000/00003fff at 4
    offset 0f00>>6 at 0
    hash mask 00ff0000 at 8
filter protocol ip pref 3 u32 fh 800::1 order 1 key ht 800 bkt 0 link 2:
    match 00000000/00003fff at 4
    offset 0f00>>6 at 0
    hash mask 00ff0000 at 8
 
 

Brandon Lai

Centre for Telecommunications Access and Service

Department of Electrical Engineering

University of the Witwatersrand

e-mail: b.lai@ee.wits.ac.za