In article <[EMAIL PROTECTED]> you wrote:

>  Is there a way to detect packets content type (audio, video, ftp, http...) :
> Is TOS bits using a good idea for that??? (If you could give me good links for
> that...)
> Is there a way in U32 filter to classify packets depending on the TOS bits
> value??

The U32 selectors are simply patterns and masks to match in an IP/TCP/UDP
header. There are two types of selectors - general and specific (kind of
my own classification). Specific ones are those matching specific
protocols and fields in IP header. Examples are: match ip src, match
ip tos, match tcp dst etc. [1] There are only three of general ones - u32,
u16 and u8, each covers different pattern length (in bits, the names
say all for themselves).

All specific selectors are translated to general ones by TC. Eg.: specific
selector "match ip tos 0x10 0xff" is equivalent to general one "match
u8 0x10 0xff at 1", because the TOS field in IP header is one byte long
(u8) and is positioned at offset 1 (in bytes, this is the "at 1").

Also be aware, that there's a trick when using specific selectors - for
example, using "match tcp src 0x1234" doesn't automatically match only
TCP protocol packets. This is because this selector will get translated
to "match u16 0x1234 0xffff nexthdr+0", which means "match 16-bit long
pattern in the encapsulated protocol's header, at offset 0". So, it will
match also UDP packets. To solve this ambiguity, use two selectors
"match tcp src 0x1234 match ip protocol 0x6".

Hope I made no mistake, please correct me if I did - I'm still new to U32
and all the above comes from lurking in the TC sources. There are also
a lot of other options in TC filter command line:

classid | flowid
        Specifies which CBQ class to select for matching selectors.

police
        Sets destination for packets exceeding specific rate.

However, I don't understand very well what the following one are for:

sample
offset
hashkey
divisor
order
link
ht

[1] The full table you can find at http://ceti.pl/~kravietz/NET4_tc.ps.bz2
This is a preliminary version of TC-HOWTO, but only in Polish currently.

-- 
Pawel Krawczyk, CETI internet, Krakow. http://ceti.pl/~kravietz/
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to