1#!/usr/bin/perl 2# 3$TC = "/root/DS-6-beta/iproute2-990530-dsing/tc/tc"; 4$DEV = "dev eth1"; 5print "$TC qdisc add $DEV handle 1:0 root dsmark indices 64 set_tc_index\n"; 6print "$TC filter add $DEV parent 1:0 protocol ip prio 1 tcindex ". 7 "mask 0xfc shift 2\n"; 8print "$TC qdisc add $DEV parent 1:0 handle 2:0 cbq bandwidth ". 9 "10Mbit cell 8 avpkt 1000 mpu 64\n"; 10# 11# EF class 12# 13print "$TC class add $DEV parent 2:0 classid 2:1 cbq bandwidth ". 14 "10Mbit rate 1500Kbit avpkt 1000 prio 1 bounded isolated ". 15 "allot 1514 weight 1 maxburst 10 \n"; 16# packet fifo for EF? 17print "$TC qdisc add $DEV parent 2:1 pfifo limit 5\n"; 18print "$TC filter add $DEV parent 2:0 protocol ip prio 1 ". 19 "handle 0x2e tcindex classid 2:1 pass_on\n"; 20# 21# BE class 22# 23print "#BE class(2:2) \n"; 24print "$TC class add $DEV parent 2:0 classid 2:2 cbq bandwidth ". 25 "10Mbit rate 5Mbit avpkt 1000 prio 7 allot 1514 weight 1 ". 26 "maxburst 21 borrow split 2:0 defmap 0xffff \n"; 27print "$TC qdisc add $DEV parent 2:2 red limit 60KB ". 28 "min 15KB max 45KB burst 20 avpkt 1000 bandwidth 10Mbit ". 29 "probability 0.4\n"; 30print "$TC filter add $DEV parent 2:0 protocol ip prio 2 ". 31 "handle 0 tcindex mask 0 classid 2:2 pass_on\n"; 32