[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Q: mask and value





Niklas Höglund wrote:
> 
> Hi!

	Hi Niklas!

> Im a newbie in the diffserv area so... =)

	There is a good paper documentating DS on Linux. You should check:

ftp://lrcftp.epfl.ch/pub/people/almesber/pub/tcio-current.ps

 
> One of the example scripts I found looked like:
> tc class change dev eth0 class 1:1 dsmark mask 0x3 value 0xb8
> 
> I'm curious about the 'mask' & 'value' options, according to a howto:
> mask: mask on DSCP (0xff)
> value: value to or with (0)
> 
> I know that DSCP is the first 6 bits in TOS-field, could someone explain
> the mask/value field some more?

	These fields work this way:

	Outgoing DSCP = (Incoming DSCP AND mask) OR value

	Where Incoming DSCP is the DSCP value of the original incoming packet,
and Outgoing DSCP is the DSCP that the packet will be assigned as it
leaves the queue.

	Or, maybe, the right formula is:

	Outgoing TOS = (Incoming TOS AND mask) OR value

	Can anybody please tell? (in any case, there is just a difference of a
two-bit shift).

	Cheers,

		Mariano Korman