1

The parent class in my TC rules script doesn't work as it garanteed! Can somebody tell me what is wrong with my script? Here are some details about my question:

From the chapter "9.5.4.4. Sample configuration" of Linux Advanced Routing & Traffic Control HOWTO, we see we can limit the total rate of child classes by specifying a parent class, even the sum rates of child classes is bigger than that of parent class.

But I tried it on my machine, only to find it doesn't work as expected. Below is my script, the port 22 is used by SecureCRT. The parent class limits the 80 and 22 ports to a total rate of 100KB, and the child classes limits them to 60KB and 80KB respectively.

    # tc qdisc add dev eth0 root handle 1:0 cbq bandwidth 10Mbit         \
         avpkt 1000 cell 8
    # tc class add dev eth0 parent 1:0 classid 1:1 cbq bandwidth 10Mbit  \
         rate 800kbit weight 80kbit prio 8 allot 1514 cell 8 maxburst 20      \
         avpkt 1000 bounded

    # tc class add dev eth0 parent 1:1 classid 1:3 cbq bandwidth 10Mbit  \
         rate 480kbit weight 48kbit prio 5 allot 1514 cell 8 maxburst 20      \
         avpkt 1000                       
    # tc class add dev eth0 parent 1:1 classid 1:4 cbq bandwidth 10Mbit  \
         rate 640kbit weight 64kbit prio 5 allot 1514 cell 8 maxburst 20      \
         avpkt 1000

    # tc qdisc add dev eth0 parent 1:3 handle 30: sfq 
    # tc qdisc add dev eth0 parent 1:4 handle 40: sfq

    # tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip \
         sport 80 0xffff flowid 1:3
    # tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip \
         sport 22 0xffff flowid 1:4

0

You must log in to answer this question.

Browse other questions tagged .