* [LARTC] Rules OK (?), no filtering...
@ 2005-05-16 22:11 karcinox
2005-05-17 20:27 ` Andy Furniss
0 siblings, 1 reply; 2+ messages in thread
From: karcinox @ 2005-05-16 22:11 UTC (permalink / raw)
To: lartc
[-- Attachment #1: Type: text/plain, Size: 2540 bytes --]
Hi
I have defined a single HTB qdisc on eth0 with one root class 1:1 further subdivided as below, nothing complicated.
1: (root qdisc)
|
|
1:1 (root class)
/\
/ \
/ \
/ \
/ \
1:10 \ }
/ | \ 1:20 }
/ | \ / \ } <------ subclasses
/ | \ / \ }
1:100 1:200 1:300 1:201 1:202 }
| | | | |
| | | | |
101: 102: 103: 201: 202: <------ sqf qdiscs
I have a filtering rule on 1: directing everything from/to IP_address.xx.yy.zz to class 1:20.
There is a filtering rule on (subclass) 1:20 directing everything to/from ports 25, 80, 110, 119 to (subclass) 1:201.
n
Also, there are further filtering rules on 1:10 towards 1:200 and 1:300, based on src ip addresses.
That's it for filtering rules.
In my definition for htb 1: I included "default 10"
I have enclosed the details (but not the script that generated this configuration) at the end. As you can see, even though the qdiscs and classes are properly defined with (seemingly) proper filters, there is traffic only on subclass 1:201, sqf 201: and on htb 1:, rootclass 1:1. None on the other branches...
But a capture of the traffic confirms that there is indeed activity on those other branches.
I have assumed (wrongly?) that defining two filter rules on 1:10 would send all unmatched traffic on the third branch (same assumption for the filter on 1: and on 1:20). When I tried the following (as mentioned in the documentation):
tc filter add dev eth0 protocol ip parent 1:10 prio 2 flowid 1:100
on the line following my two filter definitions, hoping to send "packets not matched so far" to 1:100, tc complained: "unknown filter "flowid" hence opion "1:100" is unparsable"...
Can one define filtering rules on classes as well as on qdiscs? Does the target have to be a qdisc or can it also be a class? What about default behaviour?
One last thing: I have defined my initial qdisc on eth0 as 1: with default 10. This should send any unfiltered stuff to 1:10, no matter the absence of a default filter. Could the absence of such a default filter on 1:10 prevent this classifying?
What am i missing?
TIA.
P.S. Please let me know if you need other info.
[-- Attachment #2: qdisc.stats --]
[-- Type: text/plain, Size: 747 bytes --]
qdisc sfq 202: quantum 1514b limit 128p flows 128/1024 perturb 10sec
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
qdisc sfq 201: quantum 1514b limit 128p flows 128/1024 perturb 10sec
Sent 38931081 bytes 37478 pkts (dropped 0, overlimits 0)
qdisc sfq 103: quantum 1514b limit 128p flows 128/1024 perturb 10sec
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
qdisc sfq 102: quantum 1514b limit 128p flows 128/1024 perturb 10sec
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
qdisc sfq 101: quantum 1514b limit 128p flows 128/1024 perturb 10sec
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
qdisc htb 1: r2q 10 default 101 direct_packets_stat 566828 ver 3.16
Sent 494717098 bytes 604311 pkts (dropped 0, overlimits 139598)
[-- Attachment #3: filter.stats --]
[-- Type: text/plain, Size: 3945 bytes --]
filter parent 1: protocol ip pref 100 u32
filter parent 1: protocol ip pref 100 u32 fh 804: ht divisor 1
filter parent 1: protocol ip pref 100 u32 fh 804::800 order 2048 key ht 804 bkt 0 flowid 1:201
match 00160000/ffff0000 at 20
filter parent 1: protocol ip pref 100 u32 fh 804::801 order 2049 key ht 804 bkt 0 flowid 1:201
match 00170000/ffff0000 at 20
filter parent 1: protocol ip pref 100 u32 fh 804::802 order 2050 key ht 804 bkt 0 flowid 1:201
match 00190000/ffff0000 at 20
filter parent 1: protocol ip pref 100 u32 fh 804::803 order 2051 key ht 804 bkt 0 flowid 1:201
match 00500000/ffff0000 at 20
filter parent 1: protocol ip pref 100 u32 fh 804::804 order 2052 key ht 804 bkt 0 flowid 1:201
match 006e0000/ffff0000 at 20
filter parent 1: protocol ip pref 100 u32 fh 804::805 order 2053 key ht 804 bkt 0 flowid 1:201
match 00770000/ffff0000 at 20
filter parent 1: protocol ip pref 100 u32 fh 804::806 order 2054 key ht 804 bkt 0 flowid 1:201
match 01bb0000/ffff0000 at 20
filter parent 1: protocol ip pref 100 u32 fh 803: ht divisor 1
filter parent 1: protocol ip pref 100 u32 fh 803::800 order 2048 key ht 803 bkt 0 flowid 1:201
match 00000016/0000ffff at 20
filter parent 1: protocol ip pref 100 u32 fh 803::801 order 2049 key ht 803 bkt 0 flowid 1:201
match 00000017/0000ffff at 20
filter parent 1: protocol ip pref 100 u32 fh 803::802 order 2050 key ht 803 bkt 0 flowid 1:201
match 00000019/0000ffff at 20
filter parent 1: protocol ip pref 100 u32 fh 803::803 order 2051 key ht 803 bkt 0 flowid 1:201
match 00000050/0000ffff at 20
filter parent 1: protocol ip pref 100 u32 fh 803::804 order 2052 key ht 803 bkt 0 flowid 1:201
match 0000006e/0000ffff at 20
filter parent 1: protocol ip pref 100 u32 fh 803::805 order 2053 key ht 803 bkt 0 flowid 1:201
match 00000077/0000ffff at 20
filter parent 1: protocol ip pref 100 u32 fh 803::806 order 2054 key ht 803 bkt 0 flowid 1:201
match 000001bb/0000ffff at 20
filter parent 1: protocol ip pref 100 u32 fh 802: ht divisor 1
filter parent 1: protocol ip pref 100 u32 fh 802::800 order 2048 key ht 802 bkt 0 flowid 1:20
match cea29213/ffffffff at 16
filter parent 1: protocol ip pref 100 u32 fh 802::801 order 2049 key ht 802 bkt 0 flowid 1:20
match cea29213/ffffffff at 12
filter parent 1: protocol ip pref 100 u32 fh 801: ht divisor 1
filter parent 1: protocol ip pref 100 u32 fh 801::800 order 2048 key ht 801 bkt 0 flowid 1:300
match cea29241/ffffffff at 16
filter parent 1: protocol ip pref 100 u32 fh 801::801 order 2049 key ht 801 bkt 0 flowid 1:300
match cea29241/ffffffff at 12
filter parent 1: protocol ip pref 100 u32 fh 801::802 order 2050 key ht 801 bkt 0 flowid 1:300
match cea29281/ffffffff at 16
filter parent 1: protocol ip pref 100 u32 fh 801::803 order 2051 key ht 801 bkt 0 flowid 1:300
match cea29281/ffffffff at 12
filter parent 1: protocol ip pref 100 u32 fh 801::804 order 2052 key ht 801 bkt 0 flowid 1:300
match 8ed9d1c1/ffffffff at 16
filter parent 1: protocol ip pref 100 u32 fh 801::805 order 2053 key ht 801 bkt 0 flowid 1:300
match 8ed9d1c1/ffffffff at 12
filter parent 1: protocol ip pref 100 u32 fh 800: ht divisor 1
filter parent 1: protocol ip pref 100 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:200
match cea2921e/ffffffff at 12
filter parent 1: protocol ip pref 100 u32 fh 800::801 order 2049 key ht 800 bkt 0 flowid 1:200
match cea2921e/ffffffff at 16
filter parent 1: protocol ip pref 100 u32 fh 800::802 order 2050 key ht 800 bkt 0 flowid 1:200
match cea2921f/ffffffff at 12
filter parent 1: protocol ip pref 100 u32 fh 800::803 order 2051 key ht 800 bkt 0 flowid 1:200
match cea2921f/ffffffff at 16
filter parent 1: protocol ip pref 100 u32 fh 800::804 order 2052 key ht 800 bkt 0 flowid 1:200
match cea29217/ffffffff at 12
filter parent 1: protocol ip pref 100 u32 fh 800::805 order 2053 key ht 800 bkt 0 flowid 1:200
match cea29217/ffffffff at 16
[-- Attachment #4: class.stats --]
[-- Type: text/plain, Size: 1983 bytes --]
class htb 1:202 parent 1:20 leaf 202: prio 7 quantum 1638 rate 128Kbit ceil 256Kbit burst 4Kb/8 mpu 0b cburst 1926b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 256000 ctokens: 60218
class htb 1:1 root rate 1581Kbit ceil 1581Kbit burst 4Kb/8 mpu 0b cburst 3622b/8 mpu 0b level 7
Sent 39370141 bytes 38002 pkts (dropped 0, overlimits 0)
rate 5928bps 7pps
lended: 0 borrowed: 0 giants: 0
tokens: 13075 ctokens: 10682
class htb 1:10 parent 1:1 rate 1325Kbit ceil 1581Kbit burst 4Kb/8 mpu 0b cburst 3622b/8 mpu 0b level 6
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 24729 ctokens: 18332
class htb 1:100 parent 1:10 leaf 101: prio 1 quantum 12044 rate 941Kbit ceil 1581Kbit burst 4Kb/8 mpu 0b cburst 3622b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 34822 ctokens: 18332
class htb 1:200 parent 1:10 leaf 102: prio 7 quantum 1638 rate 128Kbit ceil 128Kbit burst 4Kb/8 mpu 0b cburst 1762b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 256000 ctokens: 110186
class htb 1:20 parent 1:1 rate 256Kbit ceil 256Kbit burst 4Kb/8 mpu 0b cburst 1926b/8 mpu 0b level 6
Sent 39371655 bytes 38003 pkts (dropped 0, overlimits 0)
rate 5970bps 7pps
lended: 10145 borrowed: 0 giants: 0
tokens: 41694 ctokens: -26088
class htb 1:300 parent 1:10 leaf 103: prio 7 quantum 3276 rate 256Kbit ceil 1581Kbit burst 4Kb/8 mpu 0b cburst 3622b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 128000 ctokens: 18332
class htb 1:201 parent 1:20 leaf 201: prio 7 quantum 1638 rate 128Kbit ceil 256Kbit burst 4Kb/8 mpu 0b cburst 1926b/8 mpu 0b level 0
Sent 39365817 bytes 37998 pkts (dropped 0, overlimits 0)
rate 6135bps 7pps
lended: 27857 borrowed: 10141 giants: 0
tokens: 75194 ctokens: -26088
[-- Attachment #5: Type: text/plain, Size: 143 bytes --]
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [LARTC] Rules OK (?), no filtering...
2005-05-16 22:11 [LARTC] Rules OK (?), no filtering karcinox
@ 2005-05-17 20:27 ` Andy Furniss
0 siblings, 0 replies; 2+ messages in thread
From: Andy Furniss @ 2005-05-17 20:27 UTC (permalink / raw)
To: lartc
karcinox@globetrotter.net wrote:
> Hi
>
> I have defined a single HTB qdisc on eth0 with one root class 1:1 further subdivided as below, nothing complicated.
>
>
> 1: (root qdisc)
> |
> |
> 1:1 (root class)
> /\
> / \
> / \
> / \
> / \
> 1:10 \ }
> / | \ 1:20 }
> / | \ / \ } <------ subclasses
> / | \ / \ }
> 1:100 1:200 1:300 1:201 1:202 }
> | | | | |
> | | | | |
> 101: 102: 103: 201: 202: <------ sqf qdiscs
>
>
>
> I have a filtering rule on 1: directing everything from/to IP_address.xx.yy.zz to class 1:20.
> There is a filtering rule on (subclass) 1:20
From the filter stats it looks like you have everything on 1:0 some
should have parent 1:20
directing everything to/from ports 25, 80, 110, 119 to (subclass) 1:201.
> n
> Also, there are further filtering rules on 1:10 towards 1:200 and 1:300, based on src ip addresses.
> That's it for filtering rules.
> In my definition for htb 1: I included "default 10"
>
> I have enclosed the details (but not the script that generated this configuration) at the end.
Seeing that would be easier.
As you can see, even though the qdiscs and classes are properly
defined with (seemingly) proper filters, there is traffic only on
subclass 1:201, sqf 201: and on htb 1:, rootclass 1:1. None on the other
branches...
>
> But a capture of the traffic confirms that there is indeed activity on those other branches.
>
> I have assumed (wrongly?) that defining two filter rules on 1:10 would send all unmatched traffic on the third branch (same assumption for the filter on 1: and on 1:20). When I tried the following (as mentioned in the documentation):
>
> tc filter add dev eth0 protocol ip parent 1:10 prio 2 flowid 1:100
tc filter add dev eth0 protocol ip parent 1:10 prio 3 u32 match u32 0 0
flowid 1:100 should do it make the other 2 on 1:10 prio 1 and 2 to be
sure (though it will probably be OK with all at same prio if they get
installed in the right order)
>
> on the line following my two filter definitions, hoping to send "packets not matched so far" to 1:100, tc complained: "unknown filter "flowid" hence opion "1:100" is unparsable"...
>
> Can one define filtering rules on classes as well as on qdiscs?
yes
Does the target have to be a qdisc or can it also be a class?
can be a class.
What about default behaviour?
not sure about htb default I only ever set it to a leaf - remember arp
will go there if you shape eth unless you filter it elsewhere.
Andy.
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-05-17 20:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-16 22:11 [LARTC] Rules OK (?), no filtering karcinox
2005-05-17 20:27 ` Andy Furniss
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox