Re: [core] YANG to CBOR mapping version 1

Michel Veillette <Michel.Veillette@trilliantinc.com> Fri, 08 July 2016 23:00 UTC

Return-Path: <Michel.Veillette@trilliantinc.com>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 54E6E12B028 for <core@ietfa.amsl.com>; Fri, 8 Jul 2016 16:00:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.922
X-Spam-Level:
X-Spam-Status: No, score=-1.922 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=trilliant.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 6Ohsj7l8a8pn for <core@ietfa.amsl.com>; Fri, 8 Jul 2016 16:00:21 -0700 (PDT)
Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0135.outbound.protection.outlook.com [104.47.37.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A6FFD12D580 for <core@ietf.org>; Fri, 8 Jul 2016 16:00:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Trilliant.onmicrosoft.com; s=selector1-trilliantinc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=gdasLEzIf1k9mf8V/PgvI35u5NghHhNMWqxLfrM/aFM=; b=XOmbZUJHYDdwrBdW0PuatY0wthK44hzYRGzC0yqVj1s4KcatP9MJQpmv2rwHLJYBsC0o6SHesm3EvtHE2nJAUrdhGFmGE/N30ceCuDHzuYjYdaO6UTcyc8kQ0t+Ftuf8NcxEOEDSztFx6ECohTPAnjYlQEKO4ZmcXIguUYr4KlM=
Received: from BLUPR06MB1763.namprd06.prod.outlook.com (10.162.224.149) by BLUPR06MB1761.namprd06.prod.outlook.com (10.162.224.147) with Microsoft SMTP Server (TLS) id 15.1.528.16; Fri, 8 Jul 2016 23:00:17 +0000
Received: from BLUPR06MB1763.namprd06.prod.outlook.com ([10.162.224.149]) by BLUPR06MB1763.namprd06.prod.outlook.com ([10.162.224.149]) with mapi id 15.01.0528.024; Fri, 8 Jul 2016 23:00:17 +0000
From: Michel Veillette <Michel.Veillette@trilliantinc.com>
To: "consultancy@vanderstok.org" <consultancy@vanderstok.org>
Thread-Topic: [core] YANG to CBOR mapping version 1
Thread-Index: AQHR1qK2U/a50X7m60OAxt73Sipz+qAOmnXw
Date: Fri, 08 Jul 2016 23:00:16 +0000
Message-ID: <BLUPR06MB17639739570760661AEC32C3FE3C0@BLUPR06MB1763.namprd06.prod.outlook.com>
References: <1ed9a5d16aca7d13412259e94afc1aa2@xs4all.nl>
In-Reply-To: <1ed9a5d16aca7d13412259e94afc1aa2@xs4all.nl>
Accept-Language: fr-CA, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=Michel.Veillette@trilliantinc.com;
x-originating-ip: [207.96.192.122]
x-ms-office365-filtering-correlation-id: c35fd3f4-9d4f-4344-fcc2-08d3a783a0e5
x-microsoft-exchange-diagnostics: 1; BLUPR06MB1761; 6:NvtZsQKPSfzqxf3JguHLKWYkDCBNCseqPC3qKO1yZHkD2NNFdfdFCvuKBeYOB8hhzL0mdqK7V5llG3V4M3gcGmoK8/YiFak+roRGy4eO2lnRW/cY3ztjL+8TPCBTLIfKQuyMNmj/VMDb2iu44C2K7io+qKBUa3KWAVVf2Zz6QBWFU+YxDj8Bq23x5RcdvA9woFxHtdSqzY7lppLBt6vy2HY+4ABa4+R5U+Cb2RnXfZhGp4DHKQZEmApUTVbfntk1izmgMMS2ff8Vfl8TawPBmeTmV91e1+WO+KWwQi6ltMs=; 5:2xugKESW6yqEjwgCmGraG5de3ulie1C1b812ea/oxyGE7QppEaGavlYBlddnHssI33hF8PdKjAMIq9my5egLTf3SdnVRSXPkE1uXHevEDb0CxikMj8sw25p7m2jjiR9H05wIqSxFd3W2dsM+E5dRHQ==; 24:1xNfe8q4Phe/5T5BbPiWqXg8PgMk5IQ487XfbwH2dxs+zQw8zOjaZw6jo/liaPtGyithbdOtJRnqLsxtYfEYNhrWi2A1eTY7zpzlUaeFXkQ=; 7:py9IC2wbwZYmFgKzIlkGGd6R3ZFmxIsqXeqAGplXNuk2+d9zgb0v4KnfspxcaCGB/IL5IGsOl2T4KMKscndsQUOkazm95q2SvxZMMNm0U0dx7TaMx4Nz1hqSUZnDJyCUXXUYz7hYA4e/+l8M3SZSAY3UmWpMuuvqdv0mPn/dgst15ZtSRFLruVHgQxKWAANjvY7HPZYFGcK1sUhHB2R5JBSmPJmmBEbKQecJIoo3jI4CgcVESJChVhUDCKinlI7h
x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR06MB1761;
x-microsoft-antispam-prvs: <BLUPR06MB1761A22B3895CB6001DCC659FE3C0@BLUPR06MB1761.namprd06.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(158342451672863)(166708455590820)(100405760836317)(21532816269658);
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:BLUPR06MB1761; BCL:0; PCL:0; RULEID:; SRVR:BLUPR06MB1761;
x-forefront-prvs: 0997523C40
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(7916002)(199003)(51444003)(13464003)(129404003)(377454003)(189002)(77096005)(2351001)(3280700002)(81166006)(105586002)(10400500002)(87936001)(8676002)(81156014)(101416001)(3846002)(102836003)(4326007)(1720100001)(76176999)(50986999)(6116002)(15975445007)(3660700001)(76576001)(92566002)(68736007)(586003)(2900100001)(1730700003)(110136002)(2906002)(122556002)(189998001)(99286002)(2501003)(7696003)(66066001)(97736004)(2950100001)(106356001)(54356999)(106116001)(11100500001)(8936002)(74316002)(5002640100001)(7736002)(5003600100003)(7846002)(86362001)(33656002)(305945005)(575784001)(19580405001)(9686002)(19580395003)(5640700001)(5890100001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR06MB1761; H:BLUPR06MB1763.namprd06.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en;
received-spf: None (protection.outlook.com: trilliantinc.com does not designate permitted sender hosts)
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: trilliantinc.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2016 23:00:16.6959 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 4f6fbd13-0dfb-4150-85c3-d43260c04309
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR06MB1761
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/KFabLMqgF08x1WjuQaPqJno_sQQ>
Cc: Core <core@ietf.org>
Subject: Re: [core] YANG to CBOR mapping version 1
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 08 Jul 2016 23:00:24 -0000

Hi Peter

See answers inline [MV]

These changes will be submitted later today.

Regards,
Michel

-----Original Message-----
From: core [mailto:core-bounces@ietf.org] On Behalf Of peter van der Stok
Sent: Tuesday, July 5, 2016 5:51 AM
To: Core <core@ietf.org>
Subject: [core] YANG to CBOR mapping version 1

Hi authors,

Attached my review of the document.
I have not looked at the enum, union encoding as this was done by Andy.

______________________________________________________________________________
YANG to CBOR
Section 1 line 2; remove “only”

[MV] “only” removed

Page 5; the table is referenced nowhere

[MV] Adding to the text:
[MV] Table 1 below provides a summary of this notation.
[MV]
[MV] Adding after the table:
[MV] Table 1 : CBOR diagnostic notation summary

End of section 2.1 “Deltas are represented as positive number” is contradicted in section 4.2 “SIDs as keys” second bullet: “Clients and servers MUST support negative deltas.
Suggestion: Deltas are represented as numbers preceded by a + or – sign

[MV] Removing "or +123" in the first line of the table
[MV] Second note bellow the table is updated to:
[MV] •	Deltas are represented as numbers preceded by a + or – sign.
[MV] The use of the + sign for positive deltas represents an extension to
[MV] the CBOR diagnostic notation as defined by [RFC7049] section 6.

End page 5: “value need” -> “value needs”

[MV] Fixed

Section 3: “the specification supports three types of keys.”
I would suggest only 2: character strings and numbers.
The use of deltas is either application (CoOL) specific or YANG to CBOR mapping specific.
If it is YANG to CBOR specific, I would encourage the use of another CBOR type that specifies a delta. As specified here its use is ambiguous; and forces each application to specify explicitly what is meant.
In the case that the delta is CoOL specific, I recommend to remove it completely from this draft, and explain the use of Deltas in the appropriate CoOL draft.
In the latter case: What remains are two key types: number and character string.

[MV] The use of delta to encode integer based keys (SIDs) is an integral part of the YANG to CBOR mapping.
[MV] This optimization is part of the encoding and independent of the application.
[MV] The document is updated to keep only 2 type of keys

Last alinea of section 3: “entities generating” should that not be” 
agents (processes) generating”…

[MV] Updating to "application entities" (for now)
[MV] I can't use "agent" because this encoding is implemented by both the manager (client) and the agent (server).
[MV] I also want to stay generic since this mapping is not necessary restricted network management

“The CoAP content-Format Option …. In the first place.”  I don’t understand this phrase.

[MV] Sentence removed
[MV] I also don’t understand the intent of this sentence within the context of this draft.

Section 4.2 title:  ‘container” Schema Node. Is “CBOR map key” not a better title?

[MV] Titles of this draft are aligned with https://www.ietf.org/id/draft-ietf-netmod-yang-json-10.txt 
[MV] I'm renaming all titles of section 4 to "Data Node" to keep this alignment.

As suggested earlier: Reduce this to string (major type 3) and number (major type 0) keys.

[MV] Done

I think that a large number of the CBOR encoding examples in section 4.2 can be left out.
They can be generated any time by an interested implementer; and now confuse the issues.

[MV] I received many questions about the final encoding and the number of bytes required.
[MV] If I remove these examples, I'm concern that I will receive even more of these questions.
[MV] I agree that these examples are useless for peoples with a good knowledge of CBOR
[MV] but seem very welcome from newcomers. 

Section 4.4; the example is really complex; some explanation what this all illustrates would be welcome.
Why is the use of choice necessary to understand the list encoding?

[MV] I'm trying to use real life examples, the server list is the simplest example of list I found in a RFC.
[MV] If I use an subset of the list, I can probably use the "interface" list from RFC 7223.
[MV] A suggestion will be welcome.

I suggest to first present the names example followed by the number example.

[MV] SIDs should be the prevalent naming used by this mapping.
[MV] For this reason, I prefer to show SIDs first.

Section 5: I need more explanation to relate the instance examples to the type definitions.
For example section 5.1; does the 1280 come from {mtu: 1280} ?
Here we do need the CBOR encoding to see the relation between the type specification and the CBOR encoding.

[MV] Adding is section 5.1:
[MV] The following example shows the encoding of leaf 'mtu' set to 1280 bytes.
[MV] Adding is section 5.2:
[MV] The following example shows the encoding of leaf ' timezone-utc-offset' set to -300 minutes.
[MV] Adding is section 5.3:
[MV] The following example shows the encoding of leaf 'my-decimal' set to 2.57 minutes.
[MV] Adding is section 5.4:
[MV] The following example shows the encoding of leaf 'name' set to "eth0".
[MV] Adding is section 5.5:
[MV] The following example shows the encoding of leaf 'enabled' set to 'true'.
[MV] Adding is section 5.6:
[MV] The following example shows the encoding of leaf 'oper-status' set to 'testing'.
[MV] Adding is section 5.7:
[MV] The following example shows the encoding of leaf 'mybits' with the 'disable-nagle' and '10-Mb-only' set.
[MV] Adding is section 5.8:
[MV] The following example shows the encoding of leaf 'aes128-key' set to the value 0x1f1ce6a3f42660d888d92a4d8030476e.
[MV] Adding is section 5.9:
[MV] The following example shows the encoding of leaf 'interface-state-ref' set to the value "eth1".
[MV] Adding is section 5.10:
[MV] The following following example shows the encoding of leaf 'type' set to the value 'ethernetCsmacd'.
[MV] Adding is section 5.11:
[MV] The following example shows the encoding of leaf 'is-router' when present.
[MV] Adding is section 5.12:
[MV] The following example shows the encoding of leaf 'ip-address' when set to "2001:db8:a0b:12f0::1".
[MV] Adding is section 5.13:
More added, see http://core-wg.github.io/yang-cbor/draft-ietf-core-yang-cbor-latest.html for final result
See https://github.com/core-wg/yang-cbor/commit/28f5dae04c20c13667b5749541f036d3dbdb4b43#diff-083fd5e71ffd63b12d8cd2854c3ad1bf for a diff

Section 5.2 example illustrates major type 1? Not immediately clear unless you decode the CBOR.

[MV] Should I add more text than the note already added. (This example shows the encoding of leaf ' timezone-utc-offset' set to -300 minutes.)
[MV] If so, do you have a sentence to propose?

Section 5.3; Start phrase got lost 3 lines lower.

[MV] Fixed

In the example, where do I find in the CBOR encoding that the fraction is 2 digits?

[MV] The number of digits is not encoded. This information is considered an unnecessary metadata
[MV] similar to "units", text of an enumeration, name of a flag within bits. This was the consensus
[MV] of the group which is aligned with the statement in section 3 (In order to minimize the size of
[MV] the encoded data, the proposed mapping avoid any unnecessary meta-information beyond
[MV] those natively supported by CBOR.)
[MV] It might be worth it to raise this topic within a larger audience. 

Sections 5.4 - 5.8; see comments on section 5.1 Section 5.9 Here more text is needed to connect the complex YANG specification to “eth1” value.

[MV] Done

Section 5.10; what is a name-space qualified form? In YANG-JSON it is defined but may need some repetition here.

[MV] Adding 'namespace-qualified' in the list of terms listed in section 2.
[MV] Adding "Names and namespaces are defined in [I-D.ietf-netmod-yang-json] section 4.".

Why is the subject SIDs as identityref* split in two parts?

[MV] The intent is to keep the name and SID example together.
[MV] Replacing the title in the example section to "Encoding example using name", "Encoding example using SID",

And again I find the CBOR encoding difficult to relate to the definition example.


Section 5.11
CBOR diagnostic is: {isrouter: [null]} ?

[MV] Yes, an empty datatype have no value
[MV] When present, it is set to 'null'.
[MV] draft-ietf-netmod-yang-json-10 implements the same approach.

Section 5.13.
I don’t understand how this section relates to YANG to CBOR mapping. If the section refers to specifying an instance identifier in the request, I think it can be removed. The use of [key=value] as instance identifier is well explained in restconf draft. The use of numeric identifier is currently described in CoMI draft, and differently in CoOL draft. I propose to remove this section as it does not directly relate to CBOR encoding.

[MV] An instance-identifier is a YANG datatype which need to be supported.
[MV] See example leaf 'error-path' in http://www.netconfcentral.org/modulereport/ietf-restconf
[MV] We simply reuse this YANG datatype in the CoAP methods to minimize overhaul complexity.

However, I am missing how to transport a given list instance with its key values in the CBOR encoding. Section 4.4 describes the encoding of a complete list not a subset of its instances.

[MV] A list instance is a collection which is described in section 4.2.
_____________________________________________________________________________________________
Hope this helps,
Peter


--
Peter van der Stok
vanderstok consultancy
mailto: consultancy@vanderstok.org

_______________________________________________
core mailing list
core@ietf.org
https://www.ietf.org/mailman/listinfo/core