I decided to revamp the testing using netcat. The details of the kernels are unchanged and 'linux-2.6.0-test2.tar.bz2' is used as the test file for transfer across the network. I run 'Netcat Loop' on the remote host and 'Test Script' on the machine with the 2.6 kernels. The 'Test Script' sets up the traffic shaping rate and sends the test file to the remote host. The variable 'RATELIST' holds the values that the script will loop with. The results are printed out in the form; Rate=XXX AAA BBB CCC DDD XXX is the requested rate for the traffic shaping in mbit/s AAA - BBB |_ Measured rates in mbit/s CCC | (four runs at each rate) DDD - Cheers, Chris Smale The results; Vanilla ======= Script started on Mon 04 Aug 2003 17:45:55 BST [root@laetitia traffic]# ./shaper-tester 175.176.65.173 3000 Rate=90 93.89 93.29 93.42 93.89 Rate=76 93.77 93.00 93.88 93.90 Rate=48 93.00 93.65 93.74 93.36 Rate=34 93.51 90.84 86.74 93.53 Rate=22 93.91 93.98 93.98 92.97 Rate=10 11.58 11.58 11.59 11.58 Rate=5 5.77 5.73 5.77 5.79 Rate=1 1.02 1.01 1.01 1.02 [root@laetitia traffic]# exit exit Script done on Tue 05 Aug 2003 08:46:34 BST Patched ======= Script started on Tue 05 Aug 2003 08:53:04 BST [root@laetitia traffic]# ./shaper-tester 175.176.65.173 3000 Rate=90 90.59 88.07 90.64 90.74 Rate=76 77.25 76.84 76.98 77.25 Rate=48 48.51 47.86 48.33 48.51 Rate=34 34.24 34.19 34.15 34.27 Rate=22 21.46 22.17 21.92 21.08 Rate=10 10.05 10.06 10.05 10.06 Rate=5 4.97 4.99 4.97 4.98 Rate=1 .96 .97 .96 .96 [root@laetitia traffic]# exit Script done on Tue 05 Aug 2003 09:19:28 BST Program Versions ================ [root@laetitia traffic]# nc -h [v1.10] [root@laetitia traffic]# tc -V tc utility, iproute2-ss010824 [root@laetitia traffic]# bc -v bc 1.06 Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc. Netcat Loop =========== Usage; ./nc_loop port --------------------- 8< ------------------------------------------ #!/bin/bash NC=`which nc` LOCALPORT=$1 while [ 1 ] ; do $NC -l -p $LOCALPORT > /dev/null done --------------------- 8< ------------------------------------------ Test Script =========== Usage; ./shaper-testing ipaddress port --------------------- 8< ------------------------------------------ #!/bin/bash DATE=`which date` CAT=`which cat` ECHO=`which echo` NC=`which nc` LS=`which ls` BC=`which bc` SLEEP=`which sleep` #Allow the remote instance of 'nc' to respawn. DELAY=1 TRAFSHAP="./traffic-shaper" TESTFILENAME="linux-2.6.0-test2.tar.bz2" TESTFILESIZE=`$LS -s --block-size=1 ./$TESTFILENAME` TESTFILESIZE=$($ECHO $TESTFILESIZE | sed 's/ .*//' -) RATELIST="90 76 48 34 22 10 5 1" #"95 90 85 80 75 70 65 60 55 50 45 40 35 30 25 20 15 10 8 6 4 3 2 1" REMOTEIP=$1 REMOTEPORT=$2 if [ "$REMOTEIP" == "" ] ; then $ECHO "ipaddress and port needed" exit 1 fi if [ "$REMOTEPORT" == "" ] ; then $ECHO "ipaddress and port needed" exit 1 fi for RATE in $RATELIST ; do $ECHO Rate=$RATE for i in 1 2 3 4; do $TRAFSHAP $RATE $RATE START=`$DATE +%s.%N` $CAT $TESTFILENAME | $NC $REMOTEIP $REMOTEPORT END=`$DATE +%s.%N` TIMETAKEN=$($ECHO "$END-$START" | $BC -l) CALC=$($ECHO "scale=2; $TESTFILESIZE*8/$TIMETAKEN/1000000" | $BC -l) $ECHO -n "$CALC " $SLEEP $DELAY done $ECHO done --------------------- 8< ------------------------------------------ Traffic Shaping Script ====================== Usage; ./traffic-shaper XX YY Where XX represent the rate and YY the ceiling, both are in mbit/s. No input checking is done on these values and the default r2q value of 1000 will almost certainly be incorrect for smaller values of the rate and ceiling. --------------------- 8< ------------------------------------------ #!/bin/bash DEV=eth0 ECHO=`which echo` TC=`which tc` $TC qdisc del dev $DEV root 2> /dev/null > /dev/null #see http://luxik.cdi.cz/~devik/qos/htb/manual/userg.htm #r2q will probably need adjusting for smaller values of the rate $TC qdisc add dev $DEV root handle 1:0 htb default 10 r2q 1000 #Add a class to hold all rules and filters $TC class add dev $DEV parent 1: classid 1:1 htb rate 100mbit $TC class add dev $DEV parent 1:1 classid 1:10 htb rate "$1"mbit ceil "$2"mbit #Add an SFQ $TC qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10 --------------------- 8< ------------------------------------------ - : send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html