Traffic Shaping?

Jared Watkins jared at watkins.net
Fri Jan 28 13:31:01 EST 2005


Is anyone on the list familiar with the use of the tc command for
traffic shaping?

I'm trying to set up a two tiered set of queues...  and it's giving me
'Invalid argument' errors when I'm almost certain the syntax is
right...   Here is what I'm trying to do...

UPLINK is set to my cable speed of 340
# 1:1 is the root.. set at max upload
# 1:2 is for VoIP, pfifo qdisc
# 1:3 is for interactive and TCP SYN/ACK, sfq qdisc
# 1:4 is for bulk traffic, htb leaves use sfq

# 1:4 is further split
# 4:1 high priority (gaming, open vpn traffic)
# 4:2 medium (most other stuff http, smtp, imap etc)
# 4:3 Low Priority (bit torrent, nntp etc)

tc qdisc add dev $DEV root handle 1: htb default 4
tc class add dev $DEV parent 1:   classid 1:1 htb rate ${UPLINK}kbit
ceil ${UPLINK}kbit

tc class add dev $DEV parent 1:1  classid 1:2 htb rate 64kbit  ceil
$[9*$UPLINK/10]kbit burst 6k prio 0
tc class add dev $DEV parent 1:1  classid 1:3 htb rate 64kbit  ceil
$[8*$UPLINK/10]kbit burst 6k prio 1
tc class add dev $DEV parent 1:1  classid 1:4 htb rate 192kbit ceil
$[8*$UPLINK/10]kbit burst 6k
tc class add dev $DEV parent 1:4  classid 4:1 htb rate 64kbit  ceil
$[8*$UPLINK/10]kbit burst 6k prio 2
tc class add dev $DEV parent 1:4  classid 4:2 htb rate 64kbit  ceil
$[8*$UPLINK/10]kbit burst 6k prio 3
tc class add dev $DEV parent 1:4  classid 4:3 htb rate 64kbit  ceil
$[6*$UPLINK/10]kbit burst 6k prio 4

tc qdisc add dev $DEV parent 1: handle 2: pfifo
tc qdisc add dev $DEV parent 4: handle 1: sfq perturb 10
tc qdisc add dev $DEV parent 4: handle 2: sfq perturb 10
tc qdisc add dev $DEV parent 4: handle 3: sfq perturb 10



I start getting errors when I try to setup 4:1...   but I believe the
syntax is right...  based on several web references.. namely

http://luxik.cdi.cz/~devik/qos/htb/manual/userg.htm

Can anyone help me?

Thanks,
Jared




More information about the gnhlug-discuss mailing list