Re: [core] YANG to CBOR mapping

Michel Veillette <Michel.Veillette@trilliantinc.com> Thu, 10 March 2016 15:15 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 773C112D8D1 for <core@ietfa.amsl.com>; Thu, 10 Mar 2016 07:15:24 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.902
X-Spam-Level:
X-Spam-Status: No, score=-1.902 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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 8U9gYtcE82Zu for <core@ietfa.amsl.com>; Thu, 10 Mar 2016 07:15:22 -0800 (PST)
Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0787.outbound.protection.outlook.com [IPv6:2a01:111:f400:fc10::787]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7567E12D99A for <core@ietf.org>; Thu, 10 Mar 2016 07:08:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Trilliant.onmicrosoft.com; s=selector1-trilliantinc-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=BgZYul51MMRAWvaxvIL+Ke33TXX06Tb64AfB5BKLC9U=; b=RPom0l9lyR2ttvkucbs5P67lIO668aqmeWafblAr05LVmMEKu1zUiQCSatTMyuJyb8l7BWxT5+8Zq3ZQa/+YoWpYkkOq9b/urtpBRVjKui5YmFbonwgwBLw1jEJrfYZJG413XPC5nCqiifAy3ThZF3xqP1ea631OE0B/xWv2hYo=
Received: from BLUPR06MB1763.namprd06.prod.outlook.com (10.162.224.149) by BLUPR06MB1762.namprd06.prod.outlook.com (10.162.224.148) with Microsoft SMTP Server (TLS) id 15.1.427.16; Thu, 10 Mar 2016 15:07:46 +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.0427.020; Thu, 10 Mar 2016 15:07:47 +0000
From: Michel Veillette <Michel.Veillette@trilliantinc.com>
To: "consultancy@vanderstok.org" <consultancy@vanderstok.org>
Thread-Topic: YANG to CBOR mapping
Thread-Index: AQHReqwpv4GV3DdT0UCv7zUIvxJWyp9SwChA
Date: Thu, 10 Mar 2016 15:07:46 +0000
Message-ID: <BLUPR06MB1763AC14774F3C21EC21CE79FEB40@BLUPR06MB1763.namprd06.prod.outlook.com>
References: <125ea14670116bd8cbc275a2b1b011f9@xs4all.nl>
In-Reply-To: <125ea14670116bd8cbc275a2b1b011f9@xs4all.nl>
Accept-Language: fr-CA, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: vanderstok.org; dkim=none (message not signed) header.d=none;vanderstok.org; dmarc=none action=none header.from=trilliantinc.com;
x-originating-ip: [24.225.215.88]
x-ms-office365-filtering-correlation-id: 2d74bc76-b1e7-4cf4-bc56-08d348f5bd5b
x-microsoft-exchange-diagnostics: 1; BLUPR06MB1762; 5:Qou92OMDxxMsM1Un+51ImreOjF7AyIVVnkDcJg6ft1QJCRuVbkzdUW0piJxn36S69G4EzMxrsV2uVp58cmxMVtydsFhQKaAvAdpgs7WkAaqQIvVY5ay1EYusQcjphqOVtAVPv7DykjSD8vJP8oa28w==; 24:EEL/ISUz3C2OPfMthKL4YwIT9o2PTe+xWDqxhdMxjAalpohccnCD5Hfead7cfL7ek8vYSjAlppuPJvh1VqAXN3wa8mx2U3UATkpWltvS5Z0=
x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR06MB1762;
x-microsoft-antispam-prvs: <BLUPR06MB1762F48316C041C695DF55EDFEB40@BLUPR06MB1762.namprd06.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:;
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:BLUPR06MB1762; BCL:0; PCL:0; RULEID:; SRVR:BLUPR06MB1762;
x-forefront-prvs: 08770259B4
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(377454003)(13464003)(3480700003)(3660700001)(3280700002)(81166005)(66066001)(10400500002)(2950100001)(15395725005)(2900100001)(102836003)(3846002)(6116002)(106116001)(1096002)(99286002)(1220700001)(586003)(33656002)(5640700001)(87936001)(1730700002)(5004730100002)(74316001)(2501003)(76576001)(4326007)(5008740100001)(2906002)(2351001)(86362001)(92566002)(19580395003)(19580405001)(54356999)(122556002)(15975445007)(5002640100001)(76176999)(77096005)(110136002)(189998001)(50986999); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR06MB1762; H:BLUPR06MB1763.namprd06.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en;
spamdiagnosticoutput: 1:23
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: trilliantinc.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Mar 2016 15:07:46.7183 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 4f6fbd13-0dfb-4150-85c3-d43260c04309
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR06MB1762
Archived-At: <http://mailarchive.ietf.org/arch/msg/core/cN6XaFtGCM2sVWI2ESRhftQgRF8>
Cc: Core <core@ietf.org>
Subject: Re: [core] YANG to CBOR mapping
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: Thu, 10 Mar 2016 15:15:24 -0000

Hi Peter

=== About the octet string

I agree that the use of byte string for the hash is slightly disturbing since all the previous works have been done with integers.
The rational is to use a different CBOR type for the three type of naming (string, octet string, integer).
A collateral advantage of using the octet string is that you can now uses the diagnostic notation with hexadecimal digits (e.g h'334c67d9') which is supported by [RFC7049] and tools like http://cbor.me/ .

=== About list instance

On the identification side of list instance, I thinks this is fully documented in section (https://core-wg.github.io/yang-cbor/draft-veillette-core-yang-cbor-mapping-latest.html#rfc.section.5.13) and the third example in this section address specifically this topic.

On the encoding side, we mention list instances in section (https://core-wg.github.io/yang-cbor/draft-veillette-core-yang-cbor-mapping-latest.html#rfc.section.4.2) 
"Collections such as containers, list instances, notifications, RPC inputs, RPC outputs, action inputs and action outputs MUST be encoded using a CBOR map data item (major type 5)."
However, we don't have a specific example.
This is the case also for notifications, RPC inputs, RPC outputs, action inputs and action outputs.
However, we have these examples in CoOL and in CoMI.

Is it sufficient?

Regards,
Michel

-----Original Message-----
From: peter van der Stok [mailto:stokcons@xs4all.nl] 
Sent: March-10-16 4:07 AM
To: Core <core@ietf.org>; Michel Veillette <Michel.Veillette@trilliantinc.com>
Subject: YANG to CBOR mapping


Hi Michel,

I read through the provisional draft; and have a few high level remarks

It is nice to see that you follow the same structure as in netmod-yang-json.

The mapping from YANG name to string, I understand.
The mappings of the SID and the hash pose me problems.
The SID and and hash are both numbers, why not map them both to unsigned integer (major type 0)?
The server does not care how these numbers are produced, it only needs to map the number to the memory locations in the server.

I would also suggest that you add a section about mapping instances of lists.
When you want memory reduction, the sending of a single instance of a list instead of a whole list may result in the saving of tens of bytes if not much more.

Greetings,

peter