[LARTC] tc filter oddities
Catalin BOIE
util@deuroconsult.ro
Fri, 31 Oct 2003 10:38:30 +0200 (EET)
Hi!
> //root limited to 120kbits (on 128kbit link)
> tc qdisc add root dev eth1 handle 1: htb
> tc class add dev eth1 parent 1: classid 1:1 htb rate 120kbit ceil
> 120kbit burst 2k
>
> //first one is voip, second one is everything else
> //this is a change from how i was doing it before and is untested
> tc class add dev eth1 parent 1:1 classid 1:10 htb rate 100kbit ceil
> 120kbit burst 2k prio 1
> tc class add dev eth1 parent 1:1 classid 1:20 htb rate 20kbit ceil
> 120kbit burst 2k prio 2
>
> //3 prio classes for the 'everything else' traffic
> tc class add dev eth1 parent 1:20 classid 1:21 htb rate 40kbit burst 2k
> prio 1
> tc class add dev eth1 parent 1:20 classid 1:22 htb rate 40kbit burst 2k
> prio 2
> tc class add dev eth1 parent 1:20 classid 1:23 htb rate 40kbit burst 2k
> prio 3
>
> //sfq's for the prio classes
> tc qdisc add dev eth1 parent 1:21 handle 121: sfq
> tc qdisc add dev eth1 parent 1:22 handle 122: sfq
> tc qdisc add dev eth1 parent 1:23 handle 123: sfq
>
> //filters - first and second for voip and other
> tc filter add dev eth1 parent 1:0 prio 1 protocol ip u32 match ip src
> 192.168.0.14 flowid 110:
^^^^
I think here is 1:10, right?
> tc filter add dev eth1 parent 1:0 prio 1 protocol ip u32 match ip dst
> 0/0 flowid 1:20
OK, till here.
> //and others are for qos min-delay, empty-ack, and everything else
> tc filter add dev eth1 parent 1:20 pref 2 protocol ip u32 match ip tos
> 0x10 0xff flowid 121:
Here must be 1:21.
> tc filter add dev eth1 parent 1:20 pref 3 protocol ip u32 match ip
> protocol 6 0xff match u8 0x10 0xff at nexthd r+13 match u16 0x0000
> 0xffc0 at 2 flowid 122:
Here must be 1:22.
> tc filter add dev eth1 parent 1:20 pref 4 protocol ip route flowid 123:
Here must be 1:23.
Try this and come back.
>
> ---
> tc -s -d qdisc ls:
>
> qdisc sfq 123: dev eth1 quantum 1514b limit 128p flows 128/1024
> Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
>
> qdisc sfq 122: dev eth1 quantum 1514b limit 128p flows 128/1024
> Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
>
> qdisc sfq 121: dev eth1 quantum 1514b limit 128p flows 128/1024
> Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
>
> qdisc htb 1: dev eth1 r2q 10 default 0 direct_packets_stat 166 ver 3.10
> Sent 27491 bytes 166 pkts (dropped 0, overlimits 0)
>
> --
> and perhaps more interesting is tc filter show dev eth1 (eth1=upstream)
>
> filter parent 1: protocol ip pref 1 u32
> filter parent 1: protocol ip pref 1 u32 fh 802: ht divisor 1
> filter parent 1: protocol ip pref 1 u32 fh 802::800 order 2048 key ht
> 802 bkt 0 flowid 122:
> match 00060000/00ff0000 at 8
> match 00100000/00ff0000 at nexthdr+12
> match 00000000/0000ffc0 at 0
> filter parent 1: protocol ip pref 1 u32 fh 801: ht divisor 1
> filter parent 1: protocol ip pref 1 u32 fh 801::800 order 2048 key ht
> 801 bkt 0 flowid 121:
> match 00100000/00ff0000 at 0
> filter parent 1: protocol ip pref 1 u32 fh 800: ht divisor 1
> filter parent 1: protocol ip pref 1 u32 fh 800::800 order 2048 key ht
> 800 bkt 0 flowid 110:
> match c0a8000e/ffffffff at 12
> filter parent 1: protocol ip pref 1 u32 fh 800::801 order 2049 key ht
> 800 bkt 0 flowid 1:20
> match 00000000/00000000 at 16
>
> (parents == 1: ??!)
>
> Thanks in advance all for your comments on this.
>
> --Justin Whitney
>
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>
---
Catalin(ux) BOIE
catab@deuroconsult.ro