Re: [core] YANG to CBOR mapping version 1

peter van der Stok <stokcons@xs4all.nl> Tue, 12 July 2016 09:58 UTC

Return-Path: <stokcons@xs4all.nl>
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 C985812D77B for <core@ietfa.amsl.com>; Tue, 12 Jul 2016 02:58:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.621
X-Spam-Level:
X-Spam-Status: No, score=-2.621 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 3mzjwGbNmOqb for <core@ietfa.amsl.com>; Tue, 12 Jul 2016 02:58:20 -0700 (PDT)
Received: from lb3-smtp-cloud3.xs4all.net (lb3-smtp-cloud3.xs4all.net [194.109.24.30]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7265E12B026 for <core@ietf.org>; Tue, 12 Jul 2016 02:58:20 -0700 (PDT)
Received: from webmail.xs4all.nl ([194.109.20.200]) by smtp-cloud3.xs4all.net with ESMTP id HlyE1t00F4K0fSy01lyERx; Tue, 12 Jul 2016 11:58:18 +0200
Received: from 2001:983:a264:1:dbf:8e04:7626:a035 by webmail.xs4all.nl with HTTP (HTTP/1.1 POST); Tue, 12 Jul 2016 11:58:14 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset="US-ASCII"; format="flowed"
Content-Transfer-Encoding: 7bit
Date: Tue, 12 Jul 2016 11:58:14 +0200
From: peter van der Stok <stokcons@xs4all.nl>
To: Michel Veillette <Michel.Veillette@trilliantinc.com>
Organization: vanderstok consultancy
Mail-Reply-To: consultancy@vanderstok.org
In-Reply-To: <BLUPR06MB17639739570760661AEC32C3FE3C0@BLUPR06MB1763.namprd06.prod.outlook.com>
References: <1ed9a5d16aca7d13412259e94afc1aa2@xs4all.nl> <BLUPR06MB17639739570760661AEC32C3FE3C0@BLUPR06MB1763.namprd06.prod.outlook.com>
Message-ID: <aba83b0a6b9794f74ddfcb9706eba6d1@xs4all.nl>
X-Sender: stokcons@xs4all.nl (Ceicv1xq3LqnUXJHyyIJvaxlHGmkXTsi)
User-Agent: XS4ALL Webmail
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/ZZ8Z2kHth84CKMqepwafaTYhGDM>
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
Reply-To: consultancy@vanderstok.org
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 09:58:23 -0000

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>