Re: [PATCH nft 1/2] src: add dscp support

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

 



On Thu, Nov 26, 2015 at 09:54:45AM +0000, Patrick McHardy wrote:
> On 26.11, Pablo Neira Ayuso wrote:
> > > > ToS breaks useful things like ECN, and the more I keep reading docs on
> > > > the Internet, the more problem I have to see how the user can benefit
> > > > from this.
> > > 
> > > We *match* on ToS, that cannot possibly break anything. Also I'm unsure how
> > > this could break ECN even otherwise, ToS does not even use the ECN bits.
> > 
> > ToS bits overlap with ECN bits, from that original ToS 8 bit-field now
> > we use 6 bit for DSCP and 2 bits for ECN.
> 
> Sure, but our ToS definition is wrong anyway, the ToS-bits are actually
> 3 + 3 + 2 unused bits (ECN).

That's right according to the original ToS definition, but looking a
bit further on the RFCs, someone outthere extended this, so I found
this:

See 22. Historical Definitions for the IPv4 TOS Octet from
https://tools.ietf.org/html/rfc3168.

It refers to https://tools.ietf.org/html/rfc1349 that defines
Minimize Monetary Cost TOS Value and it extends it to one extra bit
(from 3 to 4, scratching one from the unused bits).

Bottom line says "Because of this unstable history, the definition of
the ECN field in this document cannot be guaranteed to be backwards
compatible with all past uses of these two bits."

Anyway, looking at the Linux header definitions, we have the

#define IPTOS_MINCOST           0x02

The mincost thing is there.

#define IPTOS_TOS_MASK          0x1E
#define IPTOS_TOS(tos)          ((tos)&IPTOS_TOS_MASK)

So it seems our headers are considering ToS is 4 bits too.

Cheers,
Pablo
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux