Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Feb 2012 01:51:15 +0900
From:      rozhuk.im@gmail.com
To:        <freebsd-net@freebsd.org>
Subject:   ipfw and DSCP / ECN
Message-ID:  <4f466e89.6560b40a.499a.ffffe838@mx.google.com>

next in thread | raw e-mail | index | archive | help
Hi!


"ip_tos" (ipv4) and "Traffic Class" (ipv6) field in the header of ip packet
may contain a DSCP and ECN.
"iptos" and "ipprecedence" options in ipfw does not allow to use these
fields in the header of packets.

May want to add two additional options for working with them in the ipv4 and
ipv6 packets:
 - ipecn: values IPTOS_ECN_NOTECT, IPTOS_ECN_ECT1, IPTOS_ECN_ECT0,
IPTOS_ECN_CE (defined in ip.h)
 - ipdscp: number from 0 to 0x3f

I want to hear your opinions about this.


Also, the header ipv6 may be more convenient as:

struct ip6_hdr {
	union {
		struct ip6_hdrctl {
			u_int32_t ip6_un1_flow;	/* 20 bits of flow-ID */
			u_int16_t ip6_un1_plen;	/* payload length */
			u_int8_t  ip6_un1_nxt;	/* next header */
			u_int8_t  ip6_un1_hlim;	/* hop limit */
		} ip6_un1;
		u_int8_t ip6_un2_vfc;	/* 4 bits version, top 4 bits class
*/
		struct ip6_hdrctl2 {
			u_int32_t ip6_un3_vers:4; /* 4 bits version */
			u_int32_t ip6_un3_class:8;/* 8 bits class */
			u_int32_t ip6_un3_flow:20;/* 20 bits of flow-ID */
			u_int16_t ip6_un3_plen;	/* payload length */
			u_int8_t  ip6_un3_nxt;	/* next header */
			u_int8_t  ip6_un3_hlim;	/* hop limit */
		} ip6_un3;
	} ip6_ctlun;
	struct in6_addr ip6_src;	/* source address */
	struct in6_addr ip6_dst;	/* destination address */
} __packed;



PS:
http://tools.ietf.org/html/rfc2474#section-3
"A replacement header field, called the DS field, is defined, which is
intended to supersede the existing definitions of the IPv4 TOS octet
[RFC791] and the IPv6 Traffic Class octet [IPv6]."

For a full history of the TOS field, see:
http://tools.ietf.org/html/rfc3168#section-22

   0     1     2     3     4     5     6     7
+-----+-----+-----+-----+-----+-----+-----+-----+
|               DSCP                |    ECN    |  RFCs 2474,
+-----+-----+-----+-----+-----+-----+-----+-----+    2780







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4f466e89.6560b40a.499a.ffffe838>