Package: wondershaper
Version: 1.1a-4
Severity: normal

Splitting based on packet size reduces the need for manual port
specification for my purposes of improving SIP phone response.

Also as soon as contention happens with child classes with a cumulative rate
greater than their parent, the parent becomes the queue.  I have solved that
problem.

I haven't tested with allot 1500 and 1600 as in the original script with my
other changes.  allot 3000 worked well in my testing, and allot 1500
shouldn't make much difference.

Comments please.

Thanks,

Mike


--- wondershaper.orig   2006-01-18 00:43:03.000000000 -0800
+++ wondershaper        2006-01-18 06:47:55.199586912 -0800
@@ -11,7 +11,9 @@
 fi
 
 if [ $# == 1 ]; then
+  echo "Qdiscs:"
   tc -s qdisc ls dev $1
+  echo "Classes:"
   tc -s class ls dev $1
   exit
 fi
@@ -78,34 +80,54 @@
 
 # install root CBQ
 
-tc qdisc add dev $DEV root handle 1: cbq avpkt 1000 bandwidth 10mbit 
+tc qdisc add dev $DEV root handle 1: cbq avpkt 1000 bandwidth 10mbit
 
 # shape everything at $UPLINK speed - this prevents huge queues in your
 # DSL modem which destroy latency:
 # main class
 
 tc class add dev $DEV parent 1: classid 1:1 cbq rate ${UPLINK}kbit \
-allot 1500 prio 5 bounded isolated 
+allot 3000 prio 5 bounded isolated
 
 # high prio class 1:10:
 
-tc class add dev $DEV parent 1:1 classid 1:10 cbq rate ${UPLINK}kbit \
-   allot 1600 prio 1 avpkt 1000
+tc class add dev $DEV parent 1:1 classid 1:10 cbq rate $(($UPLINK/8))kbit \
+   allot 3000 prio 1 avpkt 1000
 
-# bulk and default class 1:20 - gets slightly less traffic, 
+# bulk and default class 1:20 to 1:25 split by packet size - gets slightly 
less traffic,
 #  and a lower priority:
 
-tc class add dev $DEV parent 1:1 classid 1:20 cbq rate $((9*$UPLINK/10))kbit \
-   allot 1600 prio 2 avpkt 1000
+tc class add dev $DEV parent 1:1 classid 1:20 cbq rate $(($UPLINK/8))kbit \
+   allot 3000 prio 2 avpkt 16
+
+tc class add dev $DEV parent 1:1 classid 1:21 cbq rate $(($UPLINK/8))kbit \
+   allot 3000 prio 3 avpkt 96
+
+tc class add dev $DEV parent 1:1 classid 1:22 cbq rate $(($UPLINK/8))kbit \
+   allot 3000 prio 4 avpkt 192
+
+tc class add dev $DEV parent 1:1 classid 1:23 cbq rate $(($UPLINK/8))kbit \
+   allot 3000 prio 5 avpkt 384
+
+tc class add dev $DEV parent 1:1 classid 1:24 cbq rate $(($UPLINK/8))kbit \
+   allot 3000 prio 6 avpkt 512
+
+tc class add dev $DEV parent 1:1 classid 1:25 cbq rate $(($UPLINK/8))kbit \
+   allot 3000 prio 7 avpkt 768
 
 # 'traffic we hate'
 
-tc class add dev $DEV parent 1:1 classid 1:30 cbq rate $((8*$UPLINK/10))kbit \
-   allot 1600 prio 2 avpkt 1000
+tc class add dev $DEV parent 1:1 classid 1:30 cbq rate $(($UPLINK/8))kbit \
+   allot 3000 prio 8 avpkt 1000
 
 # all get Stochastic Fairness:
 tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
 tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
+tc qdisc add dev $DEV parent 1:21 handle 21: sfq perturb 10
+tc qdisc add dev $DEV parent 1:22 handle 22: sfq perturb 10
+tc qdisc add dev $DEV parent 1:23 handle 23: sfq perturb 10
+tc qdisc add dev $DEV parent 1:24 handle 24: sfq perturb 10
+tc qdisc add dev $DEV parent 1:25 handle 25: sfq perturb 10
 tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10
 
 # start filters
@@ -128,12 +150,35 @@
 
 # prioritize small packets (<64 bytes)
 
-tc filter add dev $DEV parent 1: protocol ip prio 12 u32 \
-   match ip protocol 6 0xff \
-   match u8 0x05 0x0f at 0 \
+# length 0 - 31 bytes
+tc filter add dev $DEV parent 1: protocol ip prio 20 u32 \
+   match u16 0x0000 0xffe0 at 2 \
+   flowid 1:20
+
+# length 64 - 127 bytes
+tc filter add dev $DEV parent 1: protocol ip prio 20 u32 \
    match u16 0x0000 0xffc0 at 2 \
-   flowid 1:10
+   flowid 1:21
 
+# length 128 - 255 bytes
+tc filter add dev $DEV parent 1: protocol ip prio 20 u32 \
+   match u16 0x0000 0xff00 at 2 \
+   flowid 1:22
+
+# length 256 - 511 bytes
+tc filter add dev $DEV parent 1: protocol ip prio 20 u32 \
+   match u16 0x0000 0xfe00 at 2 \
+   flowid 1:23
+
+# length 512 - 1023 bytes
+tc filter add dev $DEV parent 1: protocol ip prio 20 u32 \
+   match u16 0x0000 0xfc00 at 2 \
+   flowid 1:24
+
+# length 1024 or more bytes
+tc filter add dev $DEV parent 1: protocol ip prio 20 u32 \
+   match u16 0x0000 0xf800 at 2 \
+   flowid 1:25
 
 # some traffic however suffers a worse fate
 for a in $NOPRIOPORTDST
@@ -160,10 +205,6 @@
           match ip dst $a flowid 1:30
 done
 
-# rest is 'non-interactive' ie 'bulk' and ends up in 1:20
-
-tc filter add dev $DEV parent 1: protocol ip prio 18 u32 \
-   match ip dst 0.0.0.0/0 flowid 1:20
 
 
 ########## downlink #############


-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.8-2-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages wondershaper depends on:
ii  iproute                       20041019-3 Professional tools to control the 

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to