Skip to contentSkip to conversation

iptables and TOS 15

DISCUSSION [email protected] 4 participants 5 messages Nov 12, 2004

lore
Share & tools
lore
#0 lore raw

    hi,

my ISP mark packets from some internet traffic with TOS 15 and i musst
filter this traffic. how and where i must odified iptables to can do some filtering using this marks, TOS 15.

thanks.

#1 lore raw

tos
This module matches the 8 bits of Type of Service field in the
IP header (ie.
including the precedence bits).

--tos tos
The argument is either a standard name, (use
iptables -m tos -h
to see the list), or a numeric value to match.

iptables -m tos -h
TOS match v1.2.6a options:
[!] --tos value Match Type of Service field from one of
the

                                following numeric or descriptive values:
                                     Minimize-Delay 16 (0x10)
                                     Maximize-Throughput 8 (0x08)
                                     Maximize-Reliability 4 (0x04)
                                     Minimize-Cost 2 (0x02)
                                     Normal-Service 0 (0x00)

INPUT and FORWARD

#2 lore raw
In reply to [email protected]
Quoted 5 lines · On Fri, 2004-11-12 at 03:40, [email protected] wrote:
    hi,

my ISP mark packets from some internet traffic with TOS 15 and i musst
filter this traffic. how and where i must odified iptables to can do some filtering using this marks, TOS 15.

as far as i'm aware, "15" is not a valid TOS value. as a result of the way the TOS bits are set in the packet header, there are only 5 possible TOS settings (from RFC 1349):

  1000   --   minimize delay
  0100   --   maximize throughput
  0010   --   maximize reliability
  0001   --   minimize monetary cost
  0000   --   normal service

some products configure these simply as values 1 - 5 (i.e. cisco boxes). iptables allows you to use two different notations, decimal and hex:

Minimize-Delay 16 (0x10)
Maximize-Throughput 8 (0x08)
Maximize-Reliability 4 (0x04)
Minimize-Cost 2 (0x02)
Normal-Service 0 (0x00)

so for the "minimize delay" TOS value, you could write your rule as:

  iptables -t mangle -A PREROUTING -m tos --tos 16 [ ... ]

or

  iptables -t mangle -A PREROUTING -m tos --tos 0x10 [ ... ]

but before you do anything--talk with your ISP and figure out what TOS setting they are actually using (i.e. "15" is not the right answer).

-j

--
"I hope I didn't brain my damage."
--The Simpsons

#3 lore raw
Quoted 13 lines · Jason Opperisano
Quoted 5 lines · On Fri, 2004-11-12 at 03:40, [email protected] wrote:
   hi,

my ISP mark packets from some internet traffic with TOS 15 and i musst filter this traffic. how and where i must odified iptables to can do some filtering using this marks, TOS 15.

as far as i'm aware, "15" is not a valid TOS value. as a result of the way the TOS bits are set in the packet header, there are only 5 possible TOS settings (from RFC 1349):

Quoted 6 lines
  1000   --   minimize delay
  0100   --   maximize throughput
  0010   --   maximize reliability
  0001   --   minimize monetary cost
  0000   --   normal service

Concerning to http://www.lartc.org/howto/lartc.qdisc.classless.html#AEN659 the value 15 is a combination of all possible TOS values. What would be logical because with a 4bit field you are able to get the max decimal value of 15. In my opinion marking with 15 or not marking have the same effect. Also using the TOS values only makes sense when using for example the pfifo_fast queueing discipline to schedule pakets.

#4 lore raw
Quoted 7 lines · Lopsch

Concerning to
http://www.lartc.org/howto/lartc.qdisc.classless.html#AEN659 the value 15 is a combination of all possible TOS values. What would be logical because with a 4bit field you are able to get the max decimal value of
15. In my opinion marking with 15 or not marking have the same effect. Also using the TOS values only makes sense when using for example the pfifo_fast queueing discipline to schedule pakets.

ah...thanks for the clarification.

-j

Signature · 1 line
Jason Opperisano <[email protected]>