Re: [core] YANG to CBOR mapping version 1

Michel Veillette <Michel.Veillette@trilliantinc.com> Tue, 12 July 2016 15:23 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 497A212D18C for <core@ietfa.amsl.com>; Tue, 12 Jul 2016 08:23:35 -0700 (PDT)
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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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 3_mi6CBabNtI for <core@ietfa.amsl.com>; Tue, 12 Jul 2016 08:23:33 -0700 (PDT)
Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0128.outbound.protection.outlook.com [104.47.42.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id BC29112DDCF for <core@ietf.org>; Tue, 12 Jul 2016 07:57:04 -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=B6bX2n2tTqotZKJPHHLmyDIxdr1Lr2zOtY6xtOd4D1w=; b=iGbEqO+5S1zE2aeSrZvbslwKTZnYi1+J87mxeYeAm7IePpJbOluFDIjY+kyTqHpins0XYv8tJRBX//0H2+MVb/6C2fc/dbTwHO1WBcAv+dVOXStCPzydyYiC7qSc0u1cMCgi6YycUcIKzm6QSzTYLJM6y+mkyqRRCRWNdHVtbYU=
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; Tue, 12 Jul 2016 14:57:03 +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:57:03 +0000
From: Michel Veillette <Michel.Veillette@trilliantinc.com>
To: Alexander Pelov <a@ackl.io>, Carsten Bormann <cabo@tzi.org>
Thread-Topic: [core] YANG to CBOR mapping version 1
Thread-Index: AQHR1qK2U/a50X7m60OAxt73Sipz+qAOmnXwgAYAFQCAAAGjAIAAD30AgAAvp4CAABES0A==
Date: Tue, 12 Jul 2016 14:57:03 +0000
Message-ID: <BLUPR06MB1763BF04E17F6CC4232F2EF5FE300@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> <68BC10EA-5978-4DF0-A380-7585597C7AE5@ackl.io>
In-Reply-To: <68BC10EA-5978-4DF0-A380-7585597C7AE5@ackl.io>
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: dcf1ff01-d883-46e2-0e02-08d3aa64c8e8
x-microsoft-exchange-diagnostics: 1; BLUPR06MB1764; 6:XYHDGL2z3L3ID95VzDjWzAkk3+TZkyNg+Q7rCNASfq48Xd7r34pD/d9b196G2U1UObEXH1y7vtEB/UoQ56sJ5eT7o5522FI1lKi9Y6FH7JUJSaDvId5cSNB32bh7MXa1xyXaoL/6HU1cWUuFYlcwkqFvPx24fOJxeTjaDZVSlSO5k/9gqiuYL9v6jBDfzc16ns1gTKPW2aY2GO7vrLSeWi5rRTzCZWB+iY9x5axPlUUAyw07afaoeNpVqpe91ZNKJaCnjIk05XoyKoOC8arPimL4PmSPq7ZL82udA+qVqHc=; 5:rD8xzJquLixgLKJVdTFqcgnIWvHmu4fF5DVeIO/aPCf/SmTdcuJ2J6QglYEgbUWMRl4Ox1kUgBn8EpinqMrEPlr+ufz7QtKIejpNIrQ89kvkzbsgoXq21DLj7wMLbnID6egIvGUzs2vTXCON4sBy9g==; 24:PNrQC4zWV1P/rpSU3i+dR+5DQK1hr9ZLtTrq/MniViFkWhpKLJrR8uYE7f0hsc7Z92t5sQ8vEJuOeH5rtCMbym667gyRMPuEN0fHHIfzQM4=; 7:NBrgqL2ztiE0LMzTZDCSEfvCQQj0kXxnHoh4KScMHcNh4P5Scg5nT1nhYSJ47BATkAoiETbJQVIcQtCljwiXiwQrzl7lL+nLKvgaG3NyJ9jO+dr4CafJ8j3Va9M+fcv6cl9K/swCQt8MB3jNVPTR3YbrljWvyZwSlkwBShW4/x53RgWc//g1O4LSOppdN47RyhQz6doUKIKUeh2OZC+k+IQse4RCj7JKNr/n+t/C/LTyEoIiEVreF2FXbIg873+P
x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR06MB1764;
x-microsoft-antispam-prvs: <BLUPR06MB17646632BE9A53AC371AEED3FE300@BLUPR06MB1764.namprd06.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(158342451672863)(100405760836317)(21748063052155);
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:BLUPR06MB1764; BCL:0; PCL:0; RULEID:; SRVR:BLUPR06MB1764;
x-forefront-prvs: 0001227049
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(7916002)(189002)(377454003)(51444003)(24454002)(199003)(33656002)(10400500002)(8676002)(16236675004)(86362001)(8936002)(105586002)(11100500001)(87936001)(66066001)(81156014)(81166006)(97736004)(189998001)(5003600100003)(5001770100001)(7846002)(19609705001)(790700001)(7696003)(7736002)(50986999)(76176999)(74316002)(68736007)(19580405001)(6116002)(7906003)(76576001)(54356999)(99286002)(101416001)(3846002)(19625215002)(9686002)(15975445007)(102836003)(5002640100001)(2950100001)(2900100001)(586003)(19580395003)(77096005)(19617315012)(93886004)(3660700001)(92566002)(106116001)(106356001)(3280700002)(2906002)(4326007)(19300405004)(122556002)(781001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR06MB1764; 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: multipart/alternative; boundary="_000_BLUPR06MB1763BF04E17F6CC4232F2EF5FE300BLUPR06MB1763namp_"
MIME-Version: 1.0
X-OriginatorOrg: trilliantinc.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jul 2016 14:57:03.1923 (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/VfkNj0ylU0GbD1loN3vcFBT_t10>
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:23:35 -0000

Hi Alexander

I want to be sure of your answer.
The CBOR tag 4 (Decimal fraction) require 3 bytes of overhead, see example for RFC 8049 section 2.4.3 bellow.
This is the tag you are proposing?
This tag will be used all the time (within the context of a union and without)?

C4             # Tag 4
  82           # Array of length 2
    21         # -2
    19 0101    # unsigned(257)

Regards,
Michel

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

Hi Carsten,

Yes, you are right. I thought that we could keep this representation outside of unions. But of course, we need to balance the complexity of doing this.

There could be a confusion if the server and the client have different versions of the same module (rare, but must be taken care of). Which is of course, the thing we’ve always tried to avoid.. So yeah, for the moment we could keep the CBOR decimal tag.

Best,
Alexander

Le 12 juil. 2016 à 12:59, Carsten Bormann <cabo@tzi.org<mailto:cabo@tzi.org>> a écrit :

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