Re: [core] YANG to CBOR mapping version 1

Michel Veillette <Michel.Veillette@trilliantinc.com> Tue, 12 July 2016 15:30 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 459AF12D97D for <core@ietfa.amsl.com>; Tue, 12 Jul 2016 08:30:10 -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 STKIDchOxu2O for <core@ietfa.amsl.com>; Tue, 12 Jul 2016 08:30:04 -0700 (PDT)
Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0118.outbound.protection.outlook.com [104.47.36.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6E99F12DB6E for <core@ietf.org>; Tue, 12 Jul 2016 08:07:14 -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=YcvT+9tQ7BTq2Tsbza8IR+tdm1ls7F9xjWocoXLQMLM=; b=DctC18K7ItsjDnXzxB4ELn5bfsB93Yx6a3QvP/yRi3dY8gfJz8XwUVg/Ilpv4cgj8WniZeRyufNwFjERLMYxDLB4A2FGBU4209m7T/PTigz1xz4BqCJebfXAg5Toi28iTEttWe+OOaMa613sClT6sBOlR3rGZ/PFHMCXAXYMHnU=
Received: from BLUPR06MB1763.namprd06.prod.outlook.com (10.162.224.149) by BLUPR06MB1763.namprd06.prod.outlook.com (10.162.224.149) with Microsoft SMTP Server (TLS) id 15.1.539.14; Tue, 12 Jul 2016 15:07:13 +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; Tue, 12 Jul 2016 15:07:13 +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+qAOmnXwgAYCugCAAFEisA==
Date: Tue, 12 Jul 2016 15:07:12 +0000
Message-ID: <BLUPR06MB17638EB4CCB4235B5101D540FE300@BLUPR06MB1763.namprd06.prod.outlook.com>
References: <1ed9a5d16aca7d13412259e94afc1aa2@xs4all.nl> <BLUPR06MB17639739570760661AEC32C3FE3C0@BLUPR06MB1763.namprd06.prod.outlook.com> <e18f0f45bfae89fc55df444fdd957550@xs4all.nl>
In-Reply-To: <e18f0f45bfae89fc55df444fdd957550@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: eff7cfdd-ff78-49fe-9760-08d3aa663461
x-microsoft-exchange-diagnostics: 1; BLUPR06MB1763; 6:S43Niepu97Gx7Gmd1F10Z6VIdiYcVjQqT5R37ZqIVAZalHMIoGz1Ee0y8WrU5yYDD38O5lts9ZYLJBsrN0/DhuDUvMgxb1mVZVqrkFvFXEQoxFQzk0cQ4GmFdrAxKHl/Jk/GczrR+RuJ9TBeyV0qLOClYEogt0tghikINH8P3nrMFb/0jPEhZ401Hmu7Lb3+XC+a1UU8aUsaVfXvsAE0yzf/a1ywb2fk5rUSAYPUNQrJ56rW22aiYMP1szQEf7tjm26tTd92JSuTqa6Qh4qxVnZ+VwF/M931rUSyCqfyNOY=; 5:uco3VGZKFg0s59pyb6DiVU7Uox7VYJZJl/q5HpxSN+pZOZdX9sol7HL5jV+N1RmAeIzvfD/rBwwKLkCVkQgcC0Jt7U50GDyU0B0ryRPYd4bmYM4E9k0WPFFQV/aA2kP0eXceSsV7xPkg7TgT1rRg4w==; 24:5HTSpt/dLe3Tl8J4nNHW9HH863Hyp5H5/l/UOQ/AT8cLAD4Qkbn/hVpzHu6LEc7InvHaNa9EvN2pO8Z4hV9KlWm+fe2AyTI48A2dGG+my60=; 7:pg6fKr6MNMQr58/9x9+XjmCClqnIBB+XIHJGpBSP6Uhi5nbBw0roh4ETjT/AOtTzjmnMaob2+M6lL56ltDq+uH6EX6COwRGfWnqYtmcswjrN0bfoFyW616CqOHNn7ivzvb1r0XNNWq8M0mXUjOkblOlTFJnfwBY87icCH5K2L9SZuqkIiGyTjO7QRGN2phTP0MZJOznPNP7RUfiX7b4XI7Iy4ii8SGmECgqUhzpgr1gYEWqFVKXyQs9Hph9th8cT
x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR06MB1763;
x-microsoft-antispam-prvs: <BLUPR06MB1763EA1CC845A03D04B8ED2BFE300@BLUPR06MB1763.namprd06.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(158342451672863);
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:BLUPR06MB1763; BCL:0; PCL:0; RULEID:; SRVR:BLUPR06MB1763;
x-forefront-prvs: 0001227049
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(7916002)(377454003)(189002)(13464003)(199003)(8936002)(81156014)(81166006)(6116002)(3846002)(102836003)(10400500002)(110136002)(87936001)(86362001)(50986999)(77096005)(189998001)(3660700001)(76176999)(5002640100001)(54356999)(586003)(122556002)(2900100001)(97736004)(2950100001)(66066001)(68736007)(2351001)(92566002)(106356001)(106116001)(2906002)(33656002)(11100500001)(101416001)(4326007)(9686002)(7736002)(7696003)(5003600100003)(2501003)(8676002)(1730700003)(19580405001)(105586002)(5640700001)(99286002)(7846002)(74316002)(19580395003)(305945005)(3280700002)(76576001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR06MB1763; H:BLUPR06MB1763.namprd06.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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: 12 Jul 2016 15:07:13.0778 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 4f6fbd13-0dfb-4150-85c3-d43260c04309
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR06MB1763
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/IfioJJLykmMm6JUQymrfLhgUM_o>
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: Tue, 12 Jul 2016 15:30:10 -0000

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)
      }
    ]