Re: [core] YANG to CBOR mapping version 1

Michel Veillette <Michel.Veillette@trilliantinc.com> Fri, 15 July 2016 18:27 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 EA68812D107 for <core@ietfa.amsl.com>; Fri, 15 Jul 2016 11:27:30 -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 8xl7PLFGktIv for <core@ietfa.amsl.com>; Fri, 15 Jul 2016 11:27:28 -0700 (PDT)
Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0121.outbound.protection.outlook.com [104.47.32.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3D82512B04F for <core@ietf.org>; Fri, 15 Jul 2016 11:27:27 -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=MMIiyUetEsG9bjNYSo+nJOzTC4g3F5KmIqIKX9RM4VA=; b=iRaTws4b2/t+9v1XiTp9YNO7YFPo8NGWazoxGVV/82d+vb6cNniIr9Ah+/Xm2ZhiMGbnymC4azfWFxcsuPUuLeUtkVyDmGTujd2YVam2sckZ3gUK312+7+b9u16U5sXDh1kknNoghcbsnSa+CxbHN+HG0AdyrycEp+xOs6kZkyM=
Received: from BLUPR06MB1763.namprd06.prod.outlook.com (10.162.224.149) by BLUPR06MB1764.namprd06.prod.outlook.com (10.162.224.150) with Microsoft SMTP Server (TLS) id 15.1.539.14; Fri, 15 Jul 2016 18:27:25 +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.0539.019; Fri, 15 Jul 2016 18:27:25 +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+qAOmnXwgAYCugCAAFEisIABBZSAgACEZ/CAACjkgIAAAPZAgAD7JwCAADlmwIAAR/CAgAG5FcA=
Date: Fri, 15 Jul 2016 18:27:25 +0000
Message-ID: <BLUPR06MB17632AADA019754440C56D99FE330@BLUPR06MB1763.namprd06.prod.outlook.com>
References: <1ed9a5d16aca7d13412259e94afc1aa2@xs4all.nl> <BLUPR06MB17639739570760661AEC32C3FE3C0@BLUPR06MB1763.namprd06.prod.outlook.com> <e18f0f45bfae89fc55df444fdd957550@xs4all.nl> <BLUPR06MB17638EB4CCB4235B5101D540FE300@BLUPR06MB1763.namprd06.prod.outlook.com> <d58ca58bd8f89b9856a2e23290a18ba8@xs4all.nl> <BLUPR06MB1763A212CD1C3386722B88D9FE310@BLUPR06MB1763.namprd06.prod.outlook.com> <8aa9950d6b8ff0cfe8968276d18cad7d@xs4all.nl> <BLUPR06MB1763D6B8ADAE036D5E63FBA3FE310@BLUPR06MB1763.namprd06.prod.outlook.com> <43805298839959a534d83c720ac6239c@xs4all.nl> <BLUPR06MB176328C63F415719D140489BFE320@BLUPR06MB1763.namprd06.prod.outlook.com> <8a6ece7e540f02c064c8d638b2d83463@xs4all.nl>
In-Reply-To: <8a6ece7e540f02c064c8d638b2d83463@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: 1f8f1529-cc59-4b3f-84b9-08d3acddab8f
x-microsoft-exchange-diagnostics: 1; BLUPR06MB1764; 6:Hy7wpdW38zGwc7qPupFv3hIYvKgQ5tDh/vhL3nf/FBbFj8i33JQIVxJAozn4AD7BPTSRRV0PByYb+R3v9O9O3W7FotfcDSsFyEQdvc7h0ou7wv6ib2Gs6N1XZ90qbiGklopxlUfq9SDJc1RcZdXXWKaUdv+Yjyk1na7Gjc3NppGHFsBrHY42xDrJNibKJLgfw2Tua4F/LGUowhsZ4ubZllN7UPOM7TvI740OXrZoUvnKBxFC7RnilmFlchq8eph05ord5G218aO5gCiGw/OVyNTewWaKpdQ2esk82KJXLl4=; 5:DzHLH5Qch0RJXlVHOg5UKf8f3UjGjoUcAcaHmx0bOIQiG+mDUMzZDSO2sTOpcoPcM3naKuRi7ES55DW1wKdmsExki/uoi0HQ7aVTdBWrxoV1dyKXPsvh3VtHwpTCvHuYZX8tiIdnqRjRmD3EAduuew==; 24:bFXL4ecLTP64kTlAYDDRwYdifaKfpBJiI2GBE2QXJEYl+HvhUjI4RErYbMUetD7S9fmsHr5/YZQoalBwYsZ3eLqrpbTsXWyPWAd2a6Vn5mc=; 7:rQjxEw7lhMBslRR9baLmXWfcApgVWH71moZa5pyGF44Qn/ceCc2z2TeN6Y6qiP8nnmoM5iKUvZNkcBmocEdQodUGcqOfiRzZQKFURqg3LjbTQKzM29+CNm3GLkog7Me2jAnO1+0XvKKAJi5QCmH3iHX/bfLKjd5wxvjkimOgLY2zYyuroqHHaAH7uyA5I2C/alY1FCmtnu/8ibW1k3jdAJzUuDhQFhClpwXyNEdzyfzELZBKCA5alA7Rj0xuH5Fc
x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR06MB1764;
x-microsoft-antispam-prvs: <BLUPR06MB1764868E4DF5ADB2DF08DE15FE330@BLUPR06MB1764.namprd06.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(158342451672863)(120809045254105);
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046); SRVR:BLUPR06MB1764; BCL:0; PCL:0; RULEID:; SRVR:BLUPR06MB1764;
x-forefront-prvs: 00046D390F
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(7916002)(13464003)(199003)(189002)(377454003)(377424004)(101416001)(3846002)(15975445007)(4326007)(99286002)(2900100001)(19580395003)(586003)(102836003)(2950100001)(122556002)(305945005)(5002640100001)(6116002)(19580405001)(2501003)(2351001)(76176999)(3280700002)(106356001)(9686002)(2906002)(1720100001)(54356999)(106116001)(5640700001)(92566002)(77096005)(76576001)(3660700001)(7696003)(66066001)(93886004)(81166006)(7846002)(33656002)(10400500002)(8936002)(105586002)(86362001)(11100500001)(1730700003)(87936001)(8676002)(74316002)(50986999)(68736007)(81156014)(5003600100003)(97736004)(110136002)(7736002)(189998001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR06MB1764; 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="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: trilliantinc.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jul 2016 18:27:25.4390 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 4f6fbd13-0dfb-4150-85c3-d43260c04309
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR06MB1764
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/4SSaqC94OR2qrHidzwpuU3hQsBI>
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, 15 Jul 2016 18:27:31 -0000

Hi Peter

"Meta data" is defined as "data that provides information about other data"
The identification of  which data nodes are listed in the 'key' YANG statement is information about the data transferred, not the data itself.

So yes, extra meta-date is required if we want to identify the list of key(s) in the encoded payload.

Updating the list of keys is not something typical and if done, I assume  that the interactions between clients and servers change significantly. I still believe that the discovery process is the most appropriate and generic way to address these types of problems.

Regards,


-----Original Message-----
From: peter van der Stok [mailto:stokcons@xs4all.nl] 
Sent: Thursday, July 14, 2016 11:40 AM
To: Michel Veillette <Michel.Veillette@trilliantinc.com>
Cc: consultancy@vanderstok.org; Core <core@ietf.org>
Subject: RE: [core] YANG to CBOR mapping version 1

Hi Michel,


> In this case, you propose to add more meta data than 
> "draft-ietf-netmod-yang-json"
> which don't share the same limitations on the payload size.
> https://tools.ietf.org/html/draft-ietf-netmod-yang-json-10#section-5.4

I don't think extra meta-data is needed (depending on your definition of
meta-data)

> 
> Regards,
> Michel

Greetings,

Peter

> 
> 
> -----Original Message-----
> 
> From: peter van der Stok [mailto:stokcons@xs4all.nl]
> Sent: Thursday, July 14, 2016 3:57 AM
> To: Michel Veillette <Michel.Veillette@trilliantinc.com>
> Cc: consultancy@vanderstok.org; Core <core@ietf.org>
> Subject: RE: [core] YANG to CBOR mapping version 1
> 
> Hi Michel,
> 
> IMO, an error is an error and should be treated as such. Trying to 
> salvage unhealthy situations leads to worse problems.
> 
> My approach would be that servers and clients are simple and don't 
> need to parse the yang modules during operation; and keep extensive 
> state information about each other.
> 
> The discussion seems to confirm my growing conviction that the CoMI 
> and CoOL approaches are fundamentally different.
> 
> Peter
> 
> Michel Veillette schreef op 2016-07-13 19:06:
>> Hi Peter
>> 
>> I'm not convinced that Including in the encoding which data nodes are 
>> the keys completely solve the issue.
>> If the client transmit a payload with one key and the server required 
>> two keys, the payload will be rejected.
>> If the client transmit a payload with two keys (marked as such) and 
>> the server require one key, the payload will be rejected.
>> To work, both sides need to known the number of keys used by the 
>> other side and only 'ietf-cool-library' can resolve that.
>> 
>> Also, not making which data nodes are keys might help during the 
>> migration.
>> 
>> Regards,
>> Michel
>> 
>> -----Original Message-----
>> From: peter van der Stok [mailto:stokcons@xs4all.nl]
>> Sent: Wednesday, July 13, 2016 12:55 PM
>> To: Michel Veillette <Michel.Veillette@trilliantinc.com>
>> Cc: consultancy@vanderstok.org; Core <core@ietf.org>
>> Subject: RE: [core] YANG to CBOR mapping version 1
>> 
>> Hi Michel,
>> 
>> That looks pretty complex to me; while the keys can be elegantly 
>> expressed in the CBOR contents.
>> 
>> Peter
>> 
>> Michel Veillette schreef op 2016-07-13 16:36:
>>> Hi Peter
>>> 
>>> The scenario you described is part of the generic discovery problem.
>>> To perform its tasks, clients typically need to known the list of 
>>> modules, features, deviations implemented by a server and associated 
>>> versions.
>>> This problem is addressed in
>>> http://core-wg.github.io/yang-cbor/draft-veillette-core-cool-library
>>> -
>>> l
>>> atest.html
>>> which is the constrained version of
>>> https://datatracker.ietf.org/doc/rfc7895/
>>> 
>>> module: ietf-cool-library
>>>    +--ro modules-state
>>>       +--ro module-set-id    union
>>>       +--ro module* [sid revision]
>>>          +--ro sid                 sid
>>>          +--ro revision            revision
>>>          +--ro feature*            sid
>>>          +--ro deviation* [sid revision]
>>>          |  +--ro sid         sid
>>>          |  +--ro revision    revision
>>>          +--ro conformance-type    enumeration
>>>          +--ro submodules
>>>             +--ro submodule* [sid revision]
>>>                +--ro sid         sid
>>>                +--ro revision    revision
>>> notifications:
>>>    +---n yang-library-change
>>>       +--ro module-set-id    -> /modules-state/module-set-id
>>> 
>>> Regards
>>> Michel
>>> 
>>> -----Original Message-----
>>> From: peter van der Stok [mailto:stokcons@xs4all.nl]
>>> Sent: Wednesday, July 13, 2016 2:34 AM
>>> To: Michel Veillette <Michel.Veillette@trilliantinc.com>
>>> Cc: consultancy@vanderstok.org; Core <core@ietf.org>
>>> Subject: RE: [core] YANG to CBOR mapping version 1
>>> 
>>> Hi Michel,
>>> 
>>> When a specification changes it set of of keys, I don't think the 
>>> SIDs will change.
>>> It is for sure that the hashes are not affected by the attribution 
>>> of a key.
>>> 
>>> Therefore, what happens when client and server use different keys in 
>>> otherwise identical list specification?
>>> 
>>> Peter
>>> 
>>> Michel Veillette schreef op 2016-07-12 17:07:
>>>> Hi Peter
>>>> 
>>>> The validations performed by the entity which de-serialize the CBOR 
>>>> payload is based on the YANG schema.
>>>> This validation is based on all king of YANG statements such as:
>>>> key, unique, range, pattern, length, min-elements, max-elements, 
>>>> must, when, if-feature
>>>> 
>>>> The identification of which data nodes are keys is considered 
>>>> unnecessary meta-data since available in the schema.
>>>> Even more heavy weight representations such as xml and json don't 
>>>> include this meta-data in the encode payload.
>>>> 
>>>> Regards,
>>>> Michel
>>>> 
>>>> -----Original Message-----
>>>> From: peter van der Stok [mailto:stokcons@xs4all.nl]
>>>> Sent: Tuesday, July 12, 2016 6:08 AM
>>>> To: Michel Veillette <Michel.Veillette@trilliantinc.com>
>>>> Cc: consultancy@vanderstok.org; Core <core@ietf.org>
>>>> Subject: RE: [core] YANG to CBOR mapping version 1
>>>> 
>>>> Hi Michel,
>>>> 
>>>>> 
>>>>> 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.
>>>>> __________________________________________________________________
>>>>> _
>>>>> _
>>>>> _
>>>>> _
>>>>> _______________________
>>>> 
>>>> With the current text I don't see how you distinguish instances 
>>>> with the same key from instances with different keys.
>>>> 
>>>> Example:
>>>> 
>>>> list server {
>>>>       key name;
>>>> 
>>>>       leaf name {
>>>>         type string;
>>>>       }
>>>>       leaf iburst {
>>>>         type boolean;
>>>>         default false;
>>>>     }
>>>> 
>>>> How to distinguish that in the list below that two instances are 
>>>> identical (should not occur)
>>>>     [
>>>>       {
>>>>         1755 : "NRC TIC server",          # name (SID 1755)
>>>>         1754 : false,                     # iburst (SID 1754)
>>>>       },
>>>>       {
>>>>         1755 : "NRC TIC server",          # name (SID 1755)
>>>>         1754 : true,                     # iburst (SID 1754)
>>>>       }
>>>>     ]
>>>> 
>>>> And the following two instances are different  (valid array)
>>>> 
>>>>     [
>>>>       {
>>>>         1755 : "NRC TAC server",          # name (SID 1755)
>>>>         1754 : true,                      # iburst (SID 1754)
>>>>       },
>>>>       {
>>>>         1755 : "NRC TIC server",          # name (SID 1755)
>>>>         1754 : true,                     # iburst (SID 1754)
>>>>       }
>>>>     ]