Re: [dhcwg] Follow on I-D to RFC7227 (Guidelines for Creating New DHCPv6 Options)

mohamed.boucadair@orange.com Fri, 30 April 2021 16:40 UTC

Return-Path: <mohamed.boucadair@orange.com>
X-Original-To: dhcwg@ietfa.amsl.com
Delivered-To: dhcwg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B70493A1F12 for <dhcwg@ietfa.amsl.com>; Fri, 30 Apr 2021 09:40:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 2.183
X-Spam-Level: **
X-Spam-Status: No, score=2.183 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, GB_SUMOF=5, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=orange.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JWQUms4aSodk for <dhcwg@ietfa.amsl.com>; Fri, 30 Apr 2021 09:40:16 -0700 (PDT)
Received: from relais-inet.orange.com (relais-inet.orange.com [80.12.70.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id BADD43A1F0F for <dhcwg@ietf.org>; Fri, 30 Apr 2021 09:40:15 -0700 (PDT)
Received: from opfednr04.francetelecom.fr (unknown [xx.xx.xx.68]) by opfednr26.francetelecom.fr (ESMTP service) with ESMTP id 4FWylc0zVPz1121; Fri, 30 Apr 2021 18:40:12 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=orange.com; s=ORANGE001; t=1619800812; bh=ZY/AGbKmQPGfDgRPSL+8XuWiVzfntzDcIHK3TT8uTLk=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=elxVXJId9pRqexprszEkh5oso7EruswyxcmtmidMwyRW+HjBwzOsK6+tjwdRdvTnu VrRHvv/amo/3d0cbhEDPE0OY3MQBvQ6G/uEapd/bGn2G+/eywuP3P/NmMg83Ezo+fL TUvqkqPLjYyAJaBvQrcQOo3iPB5+1YTwmoPzehwWEbt5TTP8U4d/a0mx1FholH/7kQ Z/5M66KeXQWFXVq/bs+8noIsu+38FoLVR3kINliFE6eGCDez788zmmvwgs+2jALSed tKwcsSR1ow/05ur8I4ega6OpG4olZdJdAjv5tHbXURF/PW9o6wZcoRUzZ2OcW3z92m LGItJ1OecfGDg==
Received: from Exchangemail-eme6.itn.ftgroup (unknown [xx.xx.13.48]) by opfednr04.francetelecom.fr (ESMTP service) with ESMTP id 4FWylc0748z1xpp; Fri, 30 Apr 2021 18:40:12 +0200 (CEST)
From: <mohamed.boucadair@orange.com>
To: "Bernie Volz (volz)" <volz=40cisco.com@dmarc.ietf.org>, "dhcwg@ietf.org" <dhcwg@ietf.org>
Thread-Topic: Follow on I-D to RFC7227 (Guidelines for Creating New DHCPv6 Options)
Thread-Index: Adc9zfuwpqQyQYxmR/SMqJXqvWmjvgAD2Maw
Date: Fri, 30 Apr 2021 16:40:11 +0000
Message-ID: <8387_1619800812_608C32EC_8387_375_1_787AE7BB302AE849A7480A190F8B9330353753E0@OPEXCAUBMA2.corporate.adroot.infra.ftgroup>
References: <BN7PR11MB2547577287FE80D6A7CE762ACF5E9@BN7PR11MB2547.namprd11.prod.outlook.com>
In-Reply-To: <BN7PR11MB2547577287FE80D6A7CE762ACF5E9@BN7PR11MB2547.namprd11.prod.outlook.com>
Accept-Language: fr-FR, en-US
Content-Language: fr-FR
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [10.114.13.245]
Content-Type: multipart/alternative; boundary="_000_787AE7BB302AE849A7480A190F8B9330353753E0OPEXCAUBMA2corp_"
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/dhcwg/baHgUt99kHmqSB5pmhPm6YyN4O4>
Subject: Re: [dhcwg] Follow on I-D to RFC7227 (Guidelines for Creating New DHCPv6 Options)
X-BeenThere: dhcwg@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <dhcwg.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dhcwg>, <mailto:dhcwg-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dhcwg/>
List-Post: <mailto:dhcwg@ietf.org>
List-Help: <mailto:dhcwg-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dhcwg>, <mailto:dhcwg-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 30 Apr 2021 16:40:21 -0000

Hi Bernie, all,

Thank you for bring this to the list.

I do think that it is good to have some guidelines for these options to ensure consist option designs.

In one of the documents I'm editing, our initial approach was to consider the length fields themselves as fixed data and then place them first, then followed by the actual variable data. However, I do think Bernie made some good points in favor of 3.A.

Initial design

0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|       OPTION_V6_DNR           |         Option-length         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         ADN Length            |     Addresses Length          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~                   authentication-domain-name                  ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~                        ipv6-address(es)                       ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
~                 Service Parameters (SvcParams)                ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Updated if we proceed with 3.A

0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|       OPTION_V6_DNR           |         Option-length         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         ADN Length            |                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
~                   authentication-domain-name                  ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Addresses Length          |                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               |
~                        ipv6-address(es)                       ~
|                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               |
~                 Service Parameters (SvcParams)                ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

I don't think there is much cost between count and length for fixed length data.

Cheers,
Med

De : dhcwg [mailto:dhcwg-bounces@ietf.org] De la part de Bernie Volz (volz)
Envoyé : vendredi 30 avril 2021 17:26
À : dhcwg@ietf.org
Objet : [dhcwg] Follow on I-D to RFC7227 (Guidelines for Creating New DHCPv6 Options)

Hi:

This is with WG co-chair Hat OFF.

RFC7227 did not cover structured options, i.e., those that carry a number of data items (fragment types as per RFC7227) and especially where more than one data item is variable in length (or an array/list of a fixed length type).

Therefore, I'm wondering if perhaps an additional I-D (or a 7227-bis) that would provide guidance on how these options should be constructed? I have wondered about this for a while, but a (off list) request from another WG about a potential new option caused me to initiate this query.

This advice might be:
1)      When an option consists of multiple "fragment types" where all fragment types are fixed in size, these can simple be constructed by concatenating the fixed length types.
2)      When an option consists of multiple "fragment types" where all but one are fixed in size, the variable sized item should be placed last as then the option-length - the fixed sizes determined its length (examples of this include the IA_NA and IA_PD, IAADDR and IAPREFIX, options - where the variable part is the encapsulated options).
3)      When an option consists of multiple "fragment types" where more than one is variable in size, is thus the real open question as to how best to format that. This would be the main focus of the document.

For (3), there are two basic formats to consider:
A)     For all variable length "fragment types" (except potentially the last), use a length + data encoding. Thus, if you had a string followed by a list of (v6) addresses followed by some "binary" data, this might be:
a.       Length of string in octets (assume 2-octets length)
b.      <length> octets of the string
c.       Length of list of addresses (for v6 addresses, this must be a multiple of 16) (assume 2-octets length)
d.      <length> octets of the addresses
e.      <length> octets of binary data -- length here is option-length - 2 + (length of string) + 2 + (length of list of addresses).
B)      Use some kind of structure that provides the "fixed" fields followed by the data. In the example in (A), this would be:
a.       Length of string in octets (assume 2-octets length)
b.      Length of list of addresses
c.       <length> octets of the string
d.      <length> octets of the list of addresses
e.      <length> octets of the binary data (length here is same for (A) case).

There's also a question as to whether for an array (list) of fixed length values, whether a length or count is better (of course, one can easily be converted to the other). I prefer a length as that is more consistent; but this is something to discuss too.

I personally prefer 3.A. is it makes creating a parser (text to binary; or vice versa) for option data much easier and definitions (to the parser) simpler. But often people prefer format (B) to make it (somewhat) quicker to find any particular data in an option. Case 3.A. requires a bit more processing to find (e) as the field (c) is not at a fixed offset (and also requires validating that (a) does not exceed the option length before accessing (c)). But I think that cost is minimal these days.

Note that while some may say that 3.B. has the data "better" aligned, but that is not true as DHCPv6 options inside the packet are byte aligned and thus one can never assume that the length fields are indeed aligned on a 16-bit boundary.

The guidance for 3.A. is easy to document in terms of rules and for parsers to handle with really no specialized code (as long as the parser knows the order of the fragment types, the fragment type, and if fixed length fragment type if it is an array):
1)      When all data items each fit into a single instance of fixed length fragment types, the option should just be these fragment types concatenated.
2)      When all but one of the data items is variable length or is an array (list) of fixed length fragment types, place the variable item at the end (and the option length minus the fixed length items determine its length).
3)      When multiple data items are variable length and/or arrays, prefix each of these (except the last in the option) with a length field; the length of the last variable length data item in the option can be determined by subtracting the sum of the size of the fixed length items, the lengths, plus 2 times the number of length fields.

Anyway, I'm raising this to the WG to see:
-          What thoughts people may have on which format we should promote (if any)
-          Whether people feel that a document that provides this guidance is useful for future option definitions (we obviously cannot change what already exists)
-          And if so, whether a new document or a 7227-bis are best way forward

So if you have thoughts, please post them to the list.

Depending of feedback, I may start an individual submission draft.

-          Bernie Volz


_________________________________________________________________________________________________________________________

Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.