Re: [netmod] [Technical Errata Reported] RFC7950 (5157)

Vladimir Vassilev <vladimir@transpacket.com> Sun, 22 October 2017 00:25 UTC

Return-Path: <vladimir@transpacket.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 AF7251344DC for <netmod@ietfa.amsl.com>; Sat, 21 Oct 2017 17:25:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0
X-Spam-Level:
X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 yJpCzEag482R for <netmod@ietfa.amsl.com>; Sat, 21 Oct 2017 17:25:30 -0700 (PDT)
Received: from mail.transpacket.com (s91205186171.blix.com [91.205.186.171]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D615B1344D6 for <netmod@ietf.org>; Sat, 21 Oct 2017 17:25:29 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by mail.transpacket.com (Postfix) with ESMTP id B76281404004; Sun, 22 Oct 2017 02:25:27 +0200 (CEST)
Received: from mail.transpacket.com ([127.0.0.1]) by localhost (mail.transpacket.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id JnJxse_D1gSq; Sun, 22 Oct 2017 02:25:27 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1]) by mail.transpacket.com (Postfix) with ESMTP id 8DA44140396D; Sun, 22 Oct 2017 02:25:27 +0200 (CEST)
Received: from mail.transpacket.com ([127.0.0.1]) by localhost (mail.transpacket.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id uCR9y29yzmCl; Sun, 22 Oct 2017 02:25:27 +0200 (CEST)
Received: from [192.168.2.191] (cm-84.211.71.154.getinternet.no [84.211.71.154]) by mail.transpacket.com (Postfix) with ESMTPSA id 631D51403896; Sun, 22 Oct 2017 02:25:27 +0200 (CEST)
To: Andy Bierman <andy@yumaworks.com>
References: <20171016190431.5FA26B80E0F@rfc-editor.org> <67172aec-686f-90ba-0fc8-1ce2bc3dcdb4@cisco.com> <CABCOCHRP2ooSG1BGWehD8BsCDF-pX97Q++=WftOxGvf=S57GAQ@mail.gmail.com>
Cc: "netmod@ietf.org" <netmod@ietf.org>
From: Vladimir Vassilev <vladimir@transpacket.com>
Message-ID: <6d43c6fb-ae11-df39-0dd4-766f7b25ac82@transpacket.com>
Date: Sun, 22 Oct 2017 02:25:27 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0
MIME-Version: 1.0
In-Reply-To: <CABCOCHRP2ooSG1BGWehD8BsCDF-pX97Q++=WftOxGvf=S57GAQ@mail.gmail.com>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/qxR_XT3idOUY2nOv32qExRVNWqU>
Subject: Re: [netmod] [Technical Errata Reported] RFC7950 (5157)
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
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: Sun, 22 Oct 2017 00:25:33 -0000

Hello,

I would like to use the occasion of this Errata report to point out some 
additional issues with the instance-identifier type definition.

IMO the instance-identifier built-in type has 2 additional problems that 
can be addressed with alternative and significantly more radical errata 
or fixed in a new version of YANG.:

Problem 1: The obvious limitation inherited from Xpath 1.0 - inability 
to escape single or double quote characters. In Xpath world this 
limitation is worked around by use of concat() which is not available in 
the YANG 1.1 instance-identifier definition. 2 examples of this limitation:

1. It is impossible to create value of type instance-identifier 
referencing nodes in lists with key string values containing both a 
single and a double quote characters e.g. ...<interface><name>"It's 
valid string!"</name></interface>.

2. Another example of the same problem would be a leaf of type 
instance-identifier referencing another leaf of type 
instance-identifier. With 2 references it works provided one is encoded 
with single quotes and the other with double but it is impossible to 
create third e.g.

YANG:

     list id-list {
       key "id";

       leaf id {
           type instance-identifier;
       }
     }

Data:

* /top/id-list[id="/top/list[idx='4']"]

* /top/id-list[id="/top/id-list[idx='/top/list[idx=4]'"] <assuming the 
proposed errata is also in effect>

* <next reference not possible with YANG 1.1>

Problem 2: The instance-identifier type lacks canonical form (which 
makes it the only data type with implementation dependent representation 
at the data level ... think of the integer types allowing optional 
spaces between the digits). This is in fact the only built-in data type 
that allows the server implementation to change the configuration data 
replacing double quotes with single or the other way around. Inserting 
white spaces where you did not have them when the configuration was 
submitted. You can not simply read a configuration and use fast data 
comparison without schema support just because of this type. This is 
useless flexibility for simple data type.

And this can be fixed if:

1. white spaces in instance-identifiers are prohibited

2. list key predicates are required in alphabetical order

3. strict quotation convention with escape option is added. (only 3. 
contradicts the sec. 9.13 ".. instance-identifier is a subset of the 
XPath ..")

Vladimir

On 10/21/2017 08:16 PM, Andy Bierman wrote:
>
>
> On Sat, Oct 21, 2017 at 12:28 AM, Benoit Claise <bclaise@cisco.com 
> <mailto:bclaise@cisco.com>> wrote:
>
>     Dear all,
>
>     Shall I validate this one?
>
>
>
> To add more context, this relates to the the RESTCONF JSON vs. XML
> discussions in the NETCONF WG.
>
>   leaf broken {
>       type union {
>         type int32;
>         type string;
>      }
>   }
>
> If all values of key leaf "broken" are sent as strings in an 
> instance-identifier,
> then the int32 value may not match in all implementations, instead of 
> the string.
> Allowing numbers as literals in addition to quoted strings allows the 
> sender
> to be specific, and all implementations to be consistent.
>
>
>     Regards, Benoit
>
>
>
> Andy
>
>         The following errata report has been submitted for RFC7950,
>         "The YANG 1.1 Data Modeling Language".
>
>         --------------------------------------
>         You may review the report below and at:
>         http://www.rfc-editor.org/errata/eid5157
>         <http://www.rfc-editor.org/errata/eid5157>
>
>         --------------------------------------
>         Type: Technical
>         Reported by: Andy Bierman <andy@yumaworks.com
>         <mailto:andy@yumaworks.com>>
>
>         Section: 14
>
>         Original Text
>         -------------
>            key-predicate-expr  = node-identifier *WSP "=" *WSP
>         quoted-string
>
>         Corrected Text
>         --------------
>            key-predicate-expr  = node-identifier *WSP "=" *WSP
>                  (quoted-string / integer-value / decimal-value)
>
>         Notes
>         -----
>         An instance identifier is forced to specify every key value to
>         be a string
>         even though the YANG key leaf type could be a numeric type.
>         XPath does not require a quoted string here, just YANG.
>
>         Old:  /top/list[idx="4"]
>         New: /top/list[idx=4]
>
>         Instructions:
>         -------------
>         This erratum is currently posted as "Reported". If necessary,
>         please
>         use "Reply All" to discuss whether it should be verified or
>         rejected. When a decision is reached, the verifying party
>         can log in to change the status and edit the report, if necessary.
>
>         --------------------------------------
>         RFC7950 (draft-ietf-netmod-rfc6020bis-14)
>         --------------------------------------
>         Title               : The YANG 1.1 Data Modeling Language
>         Publication Date    : August 2016
>         Author(s)           : M. Bjorklund, Ed.
>         Category            : PROPOSED STANDARD
>         Source              : NETCONF Data Modeling Language
>         Area                : Operations and Management
>         Stream              : IETF
>         Verifying Party     : IESG
>         .
>
>
>
>
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod