| lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | #!/usr/bin/perl | 
 | 2 | $TC = "/root/DS-6-beta/iproute2-990530-dsing/tc/tc"; | 
 | 3 | $DEV = "dev eth1"; | 
 | 4 | $efrate="1.5Mbit"; | 
 | 5 | $MTU="1.5kB"; | 
 | 6 | print "$TC qdisc add $DEV handle 1:0 root dsmark indices 64 set_tc_index\n"; | 
 | 7 | print "$TC filter add $DEV parent 1:0 protocol ip prio 1 tcindex ". | 
 | 8 |   "mask 0xfc shift 2\n"; | 
 | 9 | print "$TC qdisc add $DEV parent 1:0 handle 2:0 prio\n"; | 
 | 10 | # | 
 | 11 | # EF class: Maximum about one MTU sized packet allowed on the queue | 
 | 12 | # | 
 | 13 | print "$TC qdisc add $DEV parent 2:1 tbf rate $efrate burst $MTU limit 1.6kB\n"; | 
 | 14 | print "$TC filter add $DEV parent 2:0 protocol ip prio 1 ". | 
 | 15 | 	  "handle 0x2e tcindex classid 2:1 pass_on\n"; | 
 | 16 | # | 
 | 17 | # BE class | 
 | 18 | # | 
 | 19 | print "#BE class(2:2) \n"; | 
 | 20 | print "$TC qdisc add $DEV parent 2:2 red limit 60KB ". | 
 | 21 | 	  "min 15KB max 45KB burst 20 avpkt 1000 bandwidth 10Mbit ". | 
 | 22 | 	  "probability 0.4\n"; | 
 | 23 | # | 
 | 24 | print "$TC filter add $DEV parent 2:0 protocol ip prio 2 ". | 
 | 25 | 	  "handle 0 tcindex mask 0 classid 2:2 pass_on\n"; |