Re: [netmod] Changes to IPv6 zone definition in draft-ietf-netmod-rfc6991-bis-15

Brian E Carpenter <brian.e.carpenter@gmail.com> Fri, 31 March 2023 22:43 UTC

Return-Path: <brian.e.carpenter@gmail.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C7261C14CF18; Fri, 31 Mar 2023 15:43:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.096
X-Spam-Level:
X-Spam-Status: No, score=-7.096 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, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hmq2oL1S3Xi6; Fri, 31 Mar 2023 15:43:43 -0700 (PDT)
Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id DE22DC151549; Fri, 31 Mar 2023 15:43:43 -0700 (PDT)
Received: by mail-pj1-x1030.google.com with SMTP id j13so21982969pjd.1; Fri, 31 Mar 2023 15:43:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680302623; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=4VPPT8qokEapMk8OyYhvXEeFeOlifgm1K85wlpN8Ir8=; b=nCJNBz10zIyRQLrgDWMXhvfO6tXN2VNLspjHV4MBjI4xqrJKJImKXgBswmbsYs0Dnh jehhrYKBsIe+DaQ7p87wpsdr/TXa+9g41W+rhmZcuvWEbsYeb4A8j5RYUYayXMW+21l6 H33FnUfV71l9aBbJUZZvdtIuVSccdQUH0h3a59S6MbcoVywFzJKFmzDPU4YpWmWC2890 mT8/NeYXZt1u/iydErs/GiPeW/D0xZJE6aVf/+tCW7EJimKiqgz3v+GL6j5FiTT0pG10 2Ic5rnSIdNjexKoySo+OSVcO4Yq5kNyhE5SwxIRxXWy4ZCA2DckGEArFYdILxuao697O 0vDA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680302623; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4VPPT8qokEapMk8OyYhvXEeFeOlifgm1K85wlpN8Ir8=; b=aHOXvOCuDhi1eFwmQsQ4rmLCWmhng2/6Ji47ZHt9z0ND+X/tP4VIPdVXuWIWuoeuf0 G2ruW10P35gw6tkkjgKx8b/dL4GgCSELVr1XiLgtKy1j1/XotoDZYOhIiRo083ndL4Gi PJRY1ll0linwL4LhFSZw8SKF9AKDNiErufCcbQ/s9SQWj/DMCm8pZ8Z6xXc9sbg0Ju8o RUGtnFg7SbFLs6//tYBx0Syp7ZuwgDkTnmjC3w07mbVtqHMuLb5nqYQ+mrXnAMJx3LGg zqo309tqjpdMMVUsuFxn0gK9QNknyI111U0/r2Hisiy8AI+VP5l0ywxZB+xlCyqjzKgz 8EZA==
X-Gm-Message-State: AAQBX9cS0krCdejOl9IdfJsRsO/25jomwS7+f506qKrilr5zvVX0S25s Ki58lEX30STIh8n3vfeAkHR+4swoOP/XZg==
X-Google-Smtp-Source: AKy350YjOOh6Jss8v4EdRNcDCQRrP+Gs200LgfpRl4/TBg7JW/7ZsUvmxPord5d1kefzcTKqEbTMEw==
X-Received: by 2002:a17:90a:e7d0:b0:237:461c:b31a with SMTP id kb16-20020a17090ae7d000b00237461cb31amr31131016pjb.32.1680302623174; Fri, 31 Mar 2023 15:43:43 -0700 (PDT)
Received: from ?IPV6:2406:e003:1184:f001:9991:d1ad:8c20:42bd? ([2406:e003:1184:f001:9991:d1ad:8c20:42bd]) by smtp.gmail.com with ESMTPSA id jf19-20020a170903269300b001a065d3ea3bsm2018322plb.295.2023.03.31.15.43.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 31 Mar 2023 15:43:42 -0700 (PDT)
Message-ID: <8d491135-c720-228c-efad-f1f3fa113545@gmail.com>
Date: Sat, 01 Apr 2023 11:43:37 +1300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0
Content-Language: en-US
From: Brian E Carpenter <brian.e.carpenter@gmail.com>
To: "Rob Wilton (rwilton)" <rwilton@cisco.com>, "netmod@ietf.org" <netmod@ietf.org>, "draft-ietf-netmod-rfc6991-bis.all@ietf.org" <draft-ietf-netmod-rfc6991-bis.all@ietf.org>, "draft-ietf-6man-rfc6874bis.all@ietf.org" <draft-ietf-6man-rfc6874bis.all@ietf.org>
References: <BY5PR11MB41966FD2ECEFB84708C5A325B5869@BY5PR11MB4196.namprd11.prod.outlook.com> <16d6f918-ea40-3596-9292-d2656eec8ad4@gmail.com>
In-Reply-To: <16d6f918-ea40-3596-9292-d2656eec8ad4@gmail.com>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: base64
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/Q1dPBdlr7qufAxJIyEoJtzIBBhU>
Subject: Re: [netmod] Changes to IPv6 zone definition in draft-ietf-netmod-rfc6991-bis-15
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 31 Mar 2023 22:43:47 -0000

I just put two and two together and got five. There are so many threads that I can't remember who brought this point up, but the editor's copy of draft-ietf-6man-rfc6874bis now includes this:

"The mapping
between the human-readable zone identifier string and the numeric value is a host-specific
function that varies between operating systems. The present document is concerned only
with the human-readable string. However, in some operating systems it is possible
to use the underlying interface number, represented as a decimal integer, as an alternative
to the human-readable string. For example, on Linux, a user can determine interface
numbers simply by issuing the command "ip link show" and then, for example,
use "fe80::1%5" instead of "fe80::1%Ethernet1/0/1", if the interface number
happens to be 5."

I don't know whether this work-around will apply in every type of device, but I certainly can't see any other solution, since the URI syntax is very insistent on lowercase normalization and special characters.

Comments?

Regards
    Brian Carpenter

On 23-Mar-23 14:48, Brian E Carpenter wrote:
> Hi Rob,
> 
> On 23-Mar-23 02:32, Rob Wilton (rwilton) wrote:
>> Hi Jürgen, Netmod, & rfc6874bis interested parties,
>>
>> In my AD review of draft-ietf-netmod-rfc6991-bis-15, Jurgen has proposed a change to definition of the zone-id in the ip-address, ipv4-address, and ipv6-address types.  These changes move the definition somewhat closer to what is in rfc6874bis, but they are still different enough that we don't have wide compatibility.
>>
>> I think that it may be useful to have a discussion to see if we can find a technical solution that works both for YANG models and that is compatible with being used in URIs.  Hence, I've separated my AD review comments for these two specific issues into this separate thread to try and ensure that interested parties can be involved in the discussion:
>>
>> (2) In RFC 6991:
>>        typedef ipv6-address {
>>          type string {
>>            pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
>>                  + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
>>                  + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}'
>>                  + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))'
>>                  + '(%[\p{N}\p{L}]+)?';
>>
>> In draft-ietf-netmod-rfc6991-bis-15, p 27, sec 4.  Internet Protocol Suite Types
>>        typedef ipv6-address {
>>          type string {
>>            pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
>>                  + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
>>                  + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}'
>>                  + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))'
>>                  + '(%[A-Za-z0-9][A-Za-z0-9\-\._~/]*)?';
>>
>> I'm not saying that this change is wrong, but this technically looks to be a non-backwards-compatible change (depending on whether interface names could ever use non-ASCII characters).  Where is the set of allowed characters for zone-ids defined?  I couldn't find them in an RFC, RFC 4007 section 11.2 seems to indicate that there is no restriction.
> 
> RFC 4007 is woefully vague, but it does limit the character set to ASCII. The failings I have noted so far include:
> 1) No length limit - i.e. exposed to buffer overrun bugs and exploits;
> 2) NULL is not disallowed - i.e. exposed to NULL-terminated string bugs and exploits;
> 3) In fact, no statement about non-alphanumeric characters at all;
> 4) No statement about case sensitivity or case folding;
> 
> [It's clear to me that RFC 4007 needs to be revisited after we have settled the current issues.]
> 
> All of these are problematic in the URI context, not to mention the poor choice of "%" as a delimiter.
> 
> The above doesn't tell me what is intended about case sensitivity, and it does include "/" which is troublesome in URIs.
> 
> Maybe you could consider an even more complex definition that distinguishes general zone identifiers from URI-friendly zone identifiers? The latter would be something like
> '(%[a-z0-9][a-z0-9\-\._~]*)?'
> 
> Then there could be a general recommendation to use the restricted character set if, and only if, there is an operational requirement to generate URIs for a given interface.
> 
>>   draft-ietf-6man-rfc6874bis, which I'm currently holding a 'discuss' ballot position on, effectively limits the usable character set of zone-ids to the unreserved set in URIs, which seems to match those above except for '/' that is allowed above (and used in many interface names), but not in the URI's unreserved character set.  A further difference is that upper case characters are allowed in this typedef but are not allowed when used in the host part of URIs.
> 
> Well, more precisely they will almost certainly be normalized to lower case by the URI parser.
>    
>> Update - I've now seen the thread 'ipv6-address in RFC 6991 (and bis)', and Jürgen has put together a useful blog post, thanks!
>>
>> Given that "interface-name" in RFC 8343, and the text in RFC 4007 section 11.2, then arguably the safest thing here would be to allow the zone-id to be unrestricted, i.e., "(%.*)?"  However, this would leave draft-ietf-6man-rfc6874bis as only being able to support a small fraction of interface names as zone-ids in URLs.  The authors of draft-ietf-6man-rfc6874bis seem to indicate that it works for all interface names that currently matter for their use case.
> 
> That appears to be correct, as noted in the newly proposed text at
> https://www.cs.auckland.ac.nz/~brian/draft-ietf-6man-rfc6874bis-06X.html#section-1-5
> 
>>
>> An alternative solution could be to somewhere define the zone-ids in YANG to match the restrictive set in draft-ietf-6man-rfc6874bis (i.e., lower case only, and disallow '/').  I think that this would then require that we recommend a conversion of interface names into draft-ietf-6man-rfc6874bis compatible zone-ids interface-names.  E.g., such a conversion could take the interface name, and change any uppercase characters to lower case, and replace any symbol that isn't in the allowed character set with '_'.  This conversion is effectively one way, and there is a theoretical risk that the converted interface names could collide, but this may be unlikely in practice.  Obviously, this conversation doesn't handle non-ASCII interface names, but I'm not sure how realistic it is that they would be used anyway.
> 
> Remember there is a browser between the URI and the operating system, and the browser communicates with the operating system via a socket interface. So such a conversion is useless unless the socket interface in the device concerned is fully aware of the mapping. So even if there is a use case, there are a lot of moving parts here.
> 
> Personally I think allowing non-ASCII would be disastrously complex and would have no real advantage for netops staff. Езернет1/0/1 instead of Ethernet1/0/1 doesn't seem worth all the resultant hassle.
> 
>>
>> This general comment also applies for the same change for 'ipv4-address'.
> 
> Fortunately this is 100% out of scope for the 6man draft.
> 
>>
>> (3) draft-ietf-netmod-rfc6991-bis-15, p 28, sec 4.  Internet Protocol Suite Types
>>
>>            The canonical format of IPv6 addresses uses the textual
>>            representation defined in Section 4 of RFC 5952.  The
>>            canonical format for the zone index is the numerical
>>            format as described in Section 11.2 of RFC 4007.";
>>
>> Would it make sense to also change the canonical format for the zone index to be interface name (or converted interface name) rather than numeric id (when used in YANG models)?
> 
> Please not. In a completely different context (RFC 8990) I've written code handling link local addresses and multiple interfaces, and driving it by interface index rather than by name is definitely the way to go. Humans may like the names, but the numbers are much better for programs.
> 
> Regard
>      Brian
> 
>>
>> This comment also applies for the same change for 'ipv4-address'.
>>
>>
>> Thoughts and comments on these two issues are welcome.
>>
>> Regards,
>> Rob