Subject: a tiny comment on the ip6_hdr structure (rfc2292bis)

From: JINMEI Tatuya / 神明達哉<[email-masked]>
Date: Sun, 27 Feb 2000 01:42:56 +0900

Hi,

I'd like to comment on the definition of the ip6_hdr structure in
rfc2292bis-01. The definition is as follows.

       struct ip6_hdr {
         union {
           struct ip6_hdrctl {
             uint32_t ip6_un1_flow; /* 4 bits version, 8 bits TC, 24 bits flow-ID */
             uint16_t ip6_un1_plen; /* payload length */
             uint8_t  ip6_un1_nxt;  /* next header */
             uint8_t  ip6_un1_hlim; /* hop limit */
           } ip6_un1;
           uint8_t ip6_un2_vfc;     /* 4 bits version, top 4 bits tclass */
         } ip6_ctlun;
         struct in6_addr ip6_src;   /* source address */
         struct in6_addr ip6_dst;   /* destination address */
       };

But the length of the flow label field is now 20 bits, so the comment
on the ip6_un1_flow member should be

	 /* 4 bits version, 8 bits TC, 20 bits flow-ID */

Also, it might be useful to define an additional member to access the
lower 4 bits of the traffic class field.

					JINMEI, Tatuya
					Communication Platform Lab.
					Corporate R&D Center, Toshiba Corp.
					[email-masked]
--------------------------------------------------------------------
IETF IPng Working Group Mailing List
IPng Home Page:                      http://playground.sun.com/ipng
FTP archive:                      ftp://playground.sun.com/pub/ipng
Direct all administrative requests to [email-masked]
--------------------------------------------------------------------

---

From: Erik Nordmark <[email-masked]>
Date: Mon, 28 Feb 2000 14:37:53 -0800 (PST)

> 	 /* 4 bits version, 8 bits TC, 20 bits flow-ID */

I'll fix it.

> lower 4 bits of the traffic class field.

Wouldn't it make more sense to define macros to access the flow id and TC
out of a uint32_t?
We had such macros in a previous version dealing with flow id
and priority (I don't recall if it was in the basic or the advanced API).

The problem with 4 bit wide fields is that they are not very portable.

  Erik

---

From: JINMEI Tatuya / 神明達哉<[email-masked]>
Date: Tue, 29 Feb 2000 13:35:55 +0900

>>>>> On Mon, 28 Feb 2000 14:37:53 -0800 (PST), 
>>>>> Erik Nordmark <[email-masked]> said:

> Wouldn't it make more sense to define macros to access the flow id and TC

It might be. The macros could be
IP6_GET_TC(ip6, class)
IP6_SET_TC(ip6, class)
for example?

> and priority (I don't recall if it was in the basic or the advanced API).

I think it was in the advanced API, but the oldest version that I have
is draft-stevens-advanced-api-04, in which I can't find such
definitions.

> The problem with 4 bit wide fields is that they are not very portable.

Indeed, so it would be a good idea to define generic macros to access
such fields.

					JINMEI, Tatuya

---

From: Ignatios Souvatzis <[email-masked]>
Date: Tue, 29 Feb 2000 10:17:15 +0100

> Wouldn't it make more sense to define macros to access the flow id and TC

Yes, please. Much better than bitfields.

	-is
-- 
 * Progress (n.): The process through which Usenet has evolved from
   smart people in front of dumb terminals to dumb people in front of
   smart terminals.  -- [email-masked] (obscurity)
--------------------------------------------------------------------
IETF IPng Working Group Mailing List
IPng Home Page:                      http://playground.sun.com/ipng
FTP archive:                      ftp://playground.sun.com/pub/ipng
Direct all administrative requests to [email-masked]
--------------------------------------------------------------------