Re: [core] YANG to CBOR mapping version 1

Michel Veillette <Michel.Veillette@trilliantinc.com> Tue, 12 July 2016 14:53 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 6F85812D878 for <core@ietfa.amsl.com>; Tue, 12 Jul 2016 07:53:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.921
X-Spam-Level:
X-Spam-Status: No, score=-1.921 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, 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 YrCbB5KxTxlY for <core@ietfa.amsl.com>; Tue, 12 Jul 2016 07:53:42 -0700 (PDT)
Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0099.outbound.protection.outlook.com [104.47.36.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 82B2412D879 for <core@ietf.org>; Tue, 12 Jul 2016 07:14:22 -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=9VDMSe/3cYC2eho9KP5SKhUllpjM1U04xbJ5q/+NAms=; b=LuYfYmTsHaY5qq8CL8HOJpIbaiXQuoTIiUUwzDVCvi25q2/i5oFzEj17lKTik8otHIm4FuYsrzhzq3rbekb7bkI5k++zMBbDozoqv132yeySJ3GbWAZXW0m1rS+gQ7dFViYSeTp3rbZcCSToK0b4mlbkW35DnKCJLbJiQWad1OA=
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 14:14:20 +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 14:14:20 +0000
From: Michel Veillette <Michel.Veillette@trilliantinc.com>
To: Carsten Bormann <cabo@tzi.org>, Alexander Pelov <a@ackl.io>, peter van der Stok <stokcons@xs4all.nl>
Thread-Topic: [core] YANG to CBOR mapping version 1
Thread-Index: AQHR1qK2U/a50X7m60OAxt73Sipz+qAOmnXwgAYAFQCAAAGjAIAAD30AgAAx9YA=
Date: Tue, 12 Jul 2016 14:14:20 +0000
Message-ID: <BLUPR06MB1763FC956DF032F49366A22EFE300@BLUPR06MB1763.namprd06.prod.outlook.com>
References: <1ed9a5d16aca7d13412259e94afc1aa2@xs4all.nl> <BLUPR06MB17639739570760661AEC32C3FE3C0@BLUPR06MB1763.namprd06.prod.outlook.com> <aba83b0a6b9794f74ddfcb9706eba6d1@xs4all.nl> <BB0DCC21-3198-4BA2-81ED-5A73724E1367@ackl.io> <30945651-d704-4b8a-9c4f-6a56a23daefb@roku>
In-Reply-To: <30945651-d704-4b8a-9c4f-6a56a23daefb@roku>
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: a631d584-4e1f-4e8c-51c1-08d3aa5ed178
x-microsoft-exchange-diagnostics: 1; BLUPR06MB1763; 6:jijpZdPKswU3vNzaHyBVQpck+M8OcP4xYgV2mM2hNH4IWnKr1vUQrf5nu1aXEZU15kbVuDJPKXP1cI4DitUzfws6+otG9xC7mmx4IAcICypbh1/Ucv6W9zBElxGtMCivfrmbX2Ws6RfDkxxmxpvGmBdXDDfh3niSUtxH6/1jSdwdldkK3JLdk+tYk8kzwwfzSU+lpez4dQOmaFa2HLTRiXNoSPph6jf+sXey5681XzU28JZYjARxzPJnvdohwVixULhwnGDltgnERb7TDpjzm4w9cB5rJ93um+77InaFL+s=; 5:9IEklv7VB/PqbY/sHYS1IoLndNrvyvNCEWx95jJl9PWca3UYl2+fckF7HLkdAPXL/rrEbWgLnISJH2dNdcf4qHQvIwAZCFZsvBdozpgHOD4rLWqIJxneU9SzT9Z0f4/RYgbI7NPpM57VwtYf/Os/OQ==; 24:7zx+zq54zxkDb4FbF+TTQPPzfDm2VOtALE+sBhlbqcEFMJRgpnV+FqI6LauVspvauRftVqsY0sq5gSo+pAqhTYhT5DjzawqSanVKjH/YyPE=; 7:5ojSY2kIaZfR4Rkomqa5XZ/EbvS3YTbPvVZFPlVECAORfHXRm+sg9o2RIE469Wi/sEbQCB6Iqo8LDDNDM0k8YGtHJES68P6JnipPWqDwgi1g4P1Jv9jsCE3KmbDIEhFDPTDAnz8JuDfbrBbqVQ0LAH4jd4cVhhxekNz5pc8JrNYMO7/DLWJTxFMMhVWtz3tj2usTsRdBrpIMHWa5N4bss7u1rk9jEhTAGdLQTVlmw/1l5+LaNqtD4hC31/Esm0/6
x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR06MB1763;
x-microsoft-antispam-prvs: <BLUPR06MB17637C71D9D31ACD4F4C0478FE300@BLUPR06MB1763.namprd06.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(100405760836317)(21748063052155)(17755550239193);
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)(7916002)(199003)(51444003)(24454002)(377454003)(189002)(19617315012)(4326007)(9686002)(19625215002)(93886004)(33656002)(11100500001)(101416001)(19300405004)(7906003)(74316002)(7846002)(3280700002)(76576001)(19580395003)(8676002)(19580405001)(7696003)(5003600100003)(7736002)(99286002)(105586002)(87936001)(86362001)(54356999)(586003)(15975445007)(189998001)(50986999)(77096005)(5002640100001)(3660700001)(76176999)(8936002)(16236675004)(10400500002)(81156014)(790700001)(102836003)(3846002)(81166006)(6116002)(2906002)(106356001)(106116001)(2950100001)(97736004)(2900100001)(5001770100001)(122556002)(92566002)(68736007)(66066001)(781001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR06MB1763; 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: multipart/alternative; boundary="_000_BLUPR06MB1763FC956DF032F49366A22EFE300BLUPR06MB1763namp_"
MIME-Version: 1.0
X-OriginatorOrg: trilliantinc.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jul 2016 14:14:20.5701 (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/9a0ku97pgLMtyVa65kJil2ubl4E>
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 14:53:45 -0000

Hi Carsten

The current solution is based on the following line in the file "20160525 – minutes.docx".
"DECIMAL – use CBOR’s DECIMAL Tag (we lose one byte, but there are only 5 values of this type)

Since tag 4 (Decimal fraction) require at least 3 bytes of overhead, I assumed the introduction of a new tag used sorely in the context of the union datatype.
(Similar approach as the other 4 tags used in unions)

The use of tag 4 (decimal fraction) for decimal64 values inside or outside the context of an union is another viable solution I will support.

Any strong opinion?

Michel

From: core [mailto:core-bounces@ietf.org] On Behalf Of Carsten Bormann
Sent: Tuesday, July 12, 2016 7:00 AM
To: Alexander Pelov <a@ackl.io>
Cc: Core <core@ietf.org>
Subject: Re: [core] YANG to CBOR mapping version 1

Hi Alexander,

This is right. However, I thought that in the discussion of unions we had arrived at encoding decimals as CBOR decimal fraction tags. But maybe I'm misremembering.

Grüße, Carsten

On 12 Jul 2016 12:04, Alexander Pelov wrote:

Dear Peter,

In this case you can infer the decimal point position from the YANG definition, e.g. the statement "fraction-digits 2;"

Which indicates that 257 represents the number 2.57. 2 represents 0.02, 50 represents 0.50, 1000 represents 10.00

I think that you are right that we should provide more examples to be clear on this point.

Best,
Alexander

Le 12 juil. 2016 à 11:58, peter van der Stok <stokcons@xs4all.nl<mailto:stokcons@xs4all.nl>> a écrit :

Hi Michel,

I separated my answer into three parts to simplify the discussion.


Section 5.3;
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.

The following example shows the encoding of leaf 'my-decimal' set to
2.57.

Definition example from [RFC7317]:

leaf my-decimal {
type decimal64 {
fraction-digits 2;
range "1 .. 3.14 | 10 | 20..max";
}
}

CBOR diagnostic notation: 257

<pvds>
Should it not be pointed out more strongly that the yang to cbor conversion fails in this case?
I don't see how a change from 2.57 or 257 represents loosing unnecessary meta information.
Unless I completely miss the point of the example.
</pvds>

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

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