[LARTC] PRIO not working?

Andy Furniss andy.furniss@dsl.pipex.com
Fri, 08 Oct 2004 14:28:13 +0100


Phill wrote:
> Hello,
> 	I am using a simple script, which is based on prio. The point is,
> that it is not possible to use htb on wifi networks, so I thought that prio
> will work fine, but it does almost nothing.
> 
> All I wanted was to make the important packets like icmp, games, VoIP,... to
> go first, and to slow the things like FTP data transfer, etc.
> 
> When I use $TC -s qdisc show dev ${IFACE}, I see, that the packets go to
> correct qdiscs.
> But when I start FTP data transfer, then the ping time is same with and
> without this shaping.
> 
> I should also mention, that I am testing it on WiFi with hostap drivers,
> where the ping times are about 2-3ms when idle and 100-150ms durring high
> traffic.
> 
> Is the first/fastest prio class really 1:1, and the last/slowest is 1:4?
> 
> Or did I miss something else?
> 
> A part of the code follows:
> 
> $TC qdisc add dev ${IFACE} root handle 1:0 prio bands 4 priomap 2 2 2 2 2 2
> 0 0 1 2 2 2 2 2 2 2 2>/dev/null
> 
>     $TC qdisc add dev ${IFACE} parent 1:1 handle 10 sfq quantum 1514b
> perturb 10
>     $TC qdisc add dev ${IFACE} parent 1:2 handle 20 sfq quantum 1514b
> perturb 10
>     $TC qdisc add dev ${IFACE} parent 1:3 handle 30 sfq quantum 1514b
> perturb 10
>     $TC qdisc add dev ${IFACE} parent 1:4 handle 40 sfq quantum 1514b
> perturb 10
> 
>     $TC filter add dev ${IFACE} parent 1:0 protocol ip handle 1 fw flowid
> 1:1
>     $TC filter add dev ${IFACE} parent 1:0 protocol ip handle 2 fw flowid
> 1:2
>     $TC filter add dev ${IFACE} parent 1:0 protocol ip handle 3 fw flowid
> 1:3
>     $TC filter add dev ${IFACE} parent 1:0 protocol ip handle 4 fw flowid
> 1:4
> 
> 
> $IPT -t mangle -A POSTROUTING -o ${IFACE} -j MARK --set-mark 1
> .......
> $IPT -t mangle -A POSTROUTING -o ${IFACE} -p tcp --dport 20 -j MARK
> --set-mark 2
> $IPT -t mangle -A POSTROUTING -o ${IFACE} -p tcp --sport 20 -j MARK
> --set-mark 2
> .......

You need to limit the rate to less than link speed by making the prio a 
child of an htb class.

Andy.