[netmod] js review of draft-ietf-core-yang-cbor-12

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Tue, 31 March 2020 11:02 UTC

Return-Path: <J.Schoenwaelder@jacobs-university.de>
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 69BDB3A2012; Tue, 31 Mar 2020 04:02:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.001
X-Spam-Level:
X-Spam-Status: No, score=0.001 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, MSGID_FROM_MTA_HEADER=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=jacobsuniversity.onmicrosoft.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 OFNMAynaQSeP; Tue, 31 Mar 2020 04:02:40 -0700 (PDT)
Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2044.outbound.protection.outlook.com [40.107.21.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7BB753A2011; Tue, 31 Mar 2020 04:02:40 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W/0wocmOLK0u9s2cnWOe4e+hKF1LgzDrP2gGTAUME2X2CMI30vbJwCppDbv9kyzHlvf0jjHwWky0/A8DjQy8ULi65QJlQQLZnoig7GerXlz72nGalbjb0iKZGqP91Y2JUVdsPfQQnuevQlXNrfgq4bFPMAYgxCwY9rL7JX0tqthqvmeRJ+YU6CrhChT2tc4f3+aL36l0bEkV05E1cj0V1qtunv8hNT4XJ5nW6oei+UNQyv/thpL7cp7PcGGO9h7akYssl3LhUe1SXeO4ummF6tMn6oTyswAlmJhOFra0eXrfYHiORk+4hFT9unZjOCAENhIYnssYO30Iduzf4/7HPw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uDYBDx51QwheD57vNfz+YUiigJ3FDWn45OcGqQyWedU=; b=YwmIKvVa7HqzfiaMXqu69sVxKY8HccAm6Jc/p/jUXSHbQeQBxVybf03peIKi9Z1A+qditTHnXIpbuYCvjcEQNMTEGN85KjvNldDyJFfh4zhy62IUw1zCld67LiVgzx5fF3nPcv6XFEhwdrBJc5pnGYRxp0B4UB2cJldpZb6KSk2lXxZdSw8aKrWV1pAUR69108j0VDnRQ810/2PrAkrWSu/V2hNPKIjHjy/R6mK6OWVMVoqlE+FpB7+vZEHKYsOt2COKuhSADy5ZW9M5ZbVXxxR4rK+kUr6ZufO479nasKK1X9Al5zFOxrA6lX4+grFXikDBQ8WDcrDnd1ClHosBLA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=jacobs-university.de; dmarc=pass action=none header.from=jacobs-university.de; dkim=pass header.d=jacobs-university.de; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jacobsuniversity.onmicrosoft.com; s=selector2-jacobsuniversity-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uDYBDx51QwheD57vNfz+YUiigJ3FDWn45OcGqQyWedU=; b=CntMo3IirjUZJgX9Q9FupC4mLb72ZH1uSoksiZG/rtMzMD8Lm46HgvfxV0WuZb3T8+x7O8zNGh0TI8imBZ1i7vzej1d/ehyqa8lP4tNI/IvLzW5bCr5cc1u0kt2Wnxczlwxc/3T3OCfaAwXCf2j1jJO/tVzrn/XdbVy60DiNmA0=
Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=J.Schoenwaelder@jacobs-university.de;
Received: from DB6P190MB0310.EURP190.PROD.OUTLOOK.COM (10.165.186.141) by DB6P190MB0375.EURP190.PROD.OUTLOOK.COM (10.165.140.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Tue, 31 Mar 2020 11:02:38 +0000
Received: from DB6P190MB0310.EURP190.PROD.OUTLOOK.COM ([fe80::b999:3826:8a06:8653]) by DB6P190MB0310.EURP190.PROD.OUTLOOK.COM ([fe80::b999:3826:8a06:8653%6]) with mapi id 15.20.2856.019; Tue, 31 Mar 2020 11:02:38 +0000
Date: Tue, 31 Mar 2020 13:02:37 +0200
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: core@ietf.org
Cc: netmod@ietf.org
Message-ID: <20200331110237.zbo3zw74xlccur3w@anna.jacobs.jacobs-university.de>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: core@ietf.org, netmod@ietf.org
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
X-ClientProxiedBy: AM4PR0902CA0012.eurprd09.prod.outlook.com (2603:10a6:200:9b::22) To DB6P190MB0310.EURP190.PROD.OUTLOOK.COM (2603:10a6:6:3e::13)
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
Received: from localhost (2001:638:709:5::7) by AM4PR0902CA0012.eurprd09.prod.outlook.com (2603:10a6:200:9b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20 via Frontend Transport; Tue, 31 Mar 2020 11:02:37 +0000
X-Originating-IP: [2001:638:709:5::7]
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: c91f80eb-0046-4a4f-a230-08d7d5630639
X-MS-TrafficTypeDiagnostic: DB6P190MB0375:
X-MS-Exchange-Transport-Forked: True
X-Microsoft-Antispam-PRVS: <DB6P190MB037587582139FD312BC22D9FDEC80@DB6P190MB0375.EURP190.PROD.OUTLOOK.COM>
X-MS-Oob-TLC-OOBClassifiers: OLM:741;
X-Forefront-PRVS: 0359162B6D
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6P190MB0310.EURP190.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(346002)(376002)(396003)(136003)(39850400004)(366004)(52116002)(6916009)(8676002)(81156014)(81166006)(478600001)(786003)(450100002)(66556008)(316002)(6486002)(66476007)(2906002)(16526019)(1076003)(6496006)(5660300002)(3450700001)(8936002)(4326008)(66946007)(186003)(86362001); DIR:OUT; SFP:1101;
Received-SPF: None (protection.outlook.com: jacobs-university.de does not designate permitted sender hosts)
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: 0azGkJeszCUEip4QRubWFUfD/h7EMAS1JwKoQitOvsF+K/+GZAqIy1NWImDAaGpqE8n5mNtHwamEI8pMOOOqmlzhNRKZA0Y/UaQ0+NRnNHmBUIfRJZQSDKc9eSnKDfjWO46VM/z5x6hyfRfSe6J679O4xQztz5OMLD+IFJPavLcRehiHL6AU/az2mGlu8u7cD1NzJSJqedquXLvOBvKESvloKHTjnovkKFAyc8D91saL7ArEgF21NKzP3mkvHyhx3rNj4LvqA4VWd0xFUYmrXUOMOqrsNGzuwjWy1yVLqA67s8F5e6xU1mpOokXdrP1uUwXUbG31EXqNvSO/WowEr0M+oGRd2QtayJZuTtMX/RcuraelCdmJDVrNLLP5JNeSOZeFL3KDHbaeP0fbIVZ/mQSgUN2Kxc23POiK/tEKuk3DHng/JttnH1RvXXMysOhgyRaMDFzDWQai+wKPMmc5KEgqrcWwiVyszQ4Xj0nmR+bbC9ysgRTplbnHOFygkWvOd3ArvXkBy+FFf2jhTDoMEQ==
X-MS-Exchange-AntiSpam-MessageData: DDFJ4PnrwvEfzhgOPGsPIUHiZhyCJhjbf3kKnZ/JA23ByuHIgCIb5axZsnctGU/y/6nL/Ppf8SpEswmiThbQyt+pXkO1ggiSo3m++407toAbYOQg2Zdjn43h4nI7I8jxA4/06lJ9P5ba35OcKoydeKUuXPBA60uTGe7XV+hBBPk=
X-OriginatorOrg: jacobs-university.de
X-MS-Exchange-CrossTenant-Network-Message-Id: c91f80eb-0046-4a4f-a230-08d7d5630639
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2020 11:02:38.1682 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f78e973e-5c0b-4ab8-bbd7-9887c95a8ebd
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 3zp9dTYhhE3ESM+xBOVKYtV1aJGdDhiweU+CPFE47ftfkXK5YyA/IzAxctAvv9IZDqr4aoQ99rUKikyXaXDkA9F70mwnPwWUCcki2/3yMTA=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6P190MB0375
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/ls3iMlnJYtRg6NMIAZLGMcSMNpA>
Subject: [netmod] js review of draft-ietf-core-yang-cbor-12
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
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: Tue, 31 Mar 2020 11:02:43 -0000

Hi,

here is my review of draft-ietf-core-yang-cbor-12. I have not checked
the examples in detail, I assume (hope?) the authors have used tools
to generate them or to validate them.

- Nit: There is no need to capitalize Action in the abstract (and
  elsewhere).

- You should perhaps write 'yang-data extension' instead of 'yang data
  template' since this is more concrete and less confusing. The use of
  'template' is a bit unfortunate in RFC 8040 since templates have
  been used with different meanings elsewhere and I believe people
  more commonly refer to the yang-data extension. I also checked
  draft-ietf-netmod-yang-data-ext-05.txt and it does not use the word
  "template" anymore.

  I see that you use 'YANG data template' later on in several places.
  This is not strictly incorrect but I find it unfortunate. I would
  prefer to talk specifically about the yang-data extensions. You
  actually import both terms, I believe only one is needed (and I
  prefer yang-data (extension) over YANG data template.

- If this work gets approved, will other specifications like
  draft-ietf-netmod-yang-data-ext-05.txt be expected to cover CBOR
  encoding in addition to XML and JSON? This is more a procedural
  question.

- Wording:

     A new set of encoding rules has been defined to allow the use of the
     same data models in environments based on the JavaScript Object
     Notation (JSON) Data Interchange Format [RFC8259].  This is
     accomplished in the JSON Encoding of Data Modeled with YANG
     specification [RFC7951].

  What is "environments based on the JavaScript Object Notation (JSON)
  Data Interchange Format". Perhaps do not even try to speculate about
  reasons. What about this?

     An additional set of encoding rules has been defined based on the
     JavaScript Object Notation (JSON) Data Interchange Format
     [RFC8259].

- Is there a reason why SID terminology is not imported from the SID
  specification? Is the reason to avoid a dependency? But then, can
  this dependency really be avoided? I reviewed the SID document first
  because I thought knowing what SIDs are is essential to understand
  this document...

- I am not sure I would call a notification or a container a
  collection. Note that RFC 7950 uses the phrase child node quite a
  bit in definitions, so this may do the same without using the
  (overloaded) word collection:

   o  child: A schema node defined as a child node of a
      container, a list, a case, a notification, an RPC input, an RPC
      output, an action input, an action output.

   I searched the text and 'child' only shows up once and I am not
   sure this deserves to define a term at all.

- Is 'parent' the same as an 'interior node' defined in RFC 7950? If
  so, why not use 'interior node'? Looking at the uses or parent, I am
  not even convinced this term needs to be defined at all, the context
  seems to be rather clear of what is meant. RFC 7950 does not define
  'parent' as term either but the meaning is clear in the contexts
  where the word is being used.

- To summarize the last few comments, I propose to import 'item' and
  'SID' from the SID document, to not define 'child' and 'parent'
  (following RFC 7950), and so the only term to defined here is
  'delta'. But see above concerning the relationship to the SID
  document; it is not clear to me what the goals and intentions are in
  terms of intended document dependencies.

- schema trees vs data trees

   This document defines CBOR encoding rules for YANG schema trees and
   their subtrees.

  You are not encoding schema trees, you are encoding data trees. See
  also the JSON document, which says:

   This document defines JSON encoding for YANG data trees and their
   subtrees.

  Why did you change this from data trees to schema trees?

- avoid 'collection'?

  s/A collection such as/A data node such as/

- If I were to use CBOR with RESTCONF, can I request (e.g. via a
  specific media-type) how I like the keys to be encoded? Or would
  such a mechanism have to be specified elsewhere, i.e., we would need
  another using CBOR with RESTCONF document that defines suitable
  media types?

- I do not understand this statement:

   Application payloads carrying a value serialized using the rules
   defined by this specification (e.g.  CoAP Content-Format) SHOULD
   include the identifier (e.g.  SID, namespace qualified name,
   instance-identifier) of this value.

  What is "the identifier of this value"? I am not getting what
  is being conveyed here.

- s/section Section 4/Section 4/

- SIDs other than [I-D.ietf-core-sid]?

     [...] If SIDs are to be used, the present specification is
     used in conjunction with a specification defining this management.
     One example for such a specification is [I-D.ietf-core-sid].

  This seems to indicate that there can be other kinds of SIDs or SIDs
  managed differently. Why is this? The SID I-D claims the entire
  number space, so how would a different 'specification defining the
  management of SIDs' ever work? Why not be specific that the usage of
  SIDs depends on [I-D.ietf-core-sid]? See my earlier comments about
  the unclear dependency relationship between this specification and
  the SID specification.

- Avoid 'collections'?

    4.2.  The 'container' and other collections

    Collections such as containers, list instances, notification

  Rewrite to:

    4.2.  The 'container' and other interior data nodes

    Interior data nodes such as containers, list instances, notification

  There are more uses of collections following that likely can be
  replaced with 'interior data nodes'. The phrase 'interior data node'
  is used in RFC 7950 (although not formally defined).

- Should

       77 : {                    / event (SID 60200) /

  be

       77 : {                    / example-port-fault (SID 60200) /

  Similarly

       47(60200) : {             / event (SID 60123) /

  be

       47(60200) : {             / example-port-fault (SID 60200) /

- Replace

  5.  Encoding of YANG data templates

   YANG data templates are data structures defined in YANG but not
   intended to be implemented as part of a datastore.  YANG data
   templates are defined using the 'yang-data' extension as described by
   [RFC8040].

   YANG data templates MUST be encoded using the encoding rules of a
   collection as defined in Section 4.2.

  with

  5.  Encoding of the 'yang-data' extension

   The yang-data extension [RFC8040] is used to define data structures
   in YANG that are not intended to be implemented as part of a
   datastore.

   The yang-data extension MUST be encoded using the encoding rules of
   interior nodes as defined in Section 4.2.

  to avoid the use of 'templates' and 'collections'. In the following
  text, there are a few more places where 'YANG template' should be
  replaced by the 'yang-data extension'.

- Unexpected ietf-comi module name showing up in an example

     "ietf-comi:error" : {

  The module prefix pops up out of the blue. You may want the put the
  yang-data definition into an example module, give it an example
  name, and then replace ietf-comi with that example name. Perhaps
  even simplify the yang-data schema to just 1-2 leafs.

- typo

  s/section defined the CBOR encoding/section defines the CBOR encoding/

- Improve wording

   To avoid overlap of 'value' defined in different 'enumeration'
   statements, 'enumeration' defined in a Leafs of type 'union' MUST be
   encoded using a CBOR text string data item (major type 3) and MUST
   contain one of the names assigned by 'enum' statements in YANG.

  This does not read well. Perhaps:

   Values of 'enumeration' types defined in a 'union' type MUST be
   encoded using a CBOR text string data item (major type 3) and MUST
   contain one of the names assigned by 'enum' statements in YANG.

  There is similar text on page 31 in the context of bits encoding
  that will also benefit from a rewrite.

- Third example Bob vs Jack

  Should the third example use

   "/ietf-system:system/authentication/user[name='jack']"

  instead of

   "/ietf-system:system/authentication/user[name='bob']"

  to line up with the third example using SIDs?

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>