Re: [core] YANG to CBOR mapping

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Thu, 19 November 2015 15:27 UTC

Return-Path: <j.schoenwaelder@jacobs-university.de>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6F5271B2B84 for <core@ietfa.amsl.com>; Thu, 19 Nov 2015 07:27:59 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.435
X-Spam-Level:
X-Spam-Status: No, score=-4.435 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_MED=-2.3, RP_MATCHES_RCVD=-0.585] autolearn=ham
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 cweRz8qX1fe9 for <core@ietfa.amsl.com>; Thu, 19 Nov 2015 07:27:53 -0800 (PST)
Received: from atlas3.jacobs-university.de (atlas3.jacobs-university.de [212.201.44.18]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 119301B2B75 for <core@ietf.org>; Thu, 19 Nov 2015 07:27:40 -0800 (PST)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas3.jacobs-university.de (Postfix) with ESMTP id ACBC91483; Thu, 19 Nov 2015 16:27:38 +0100 (CET)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from atlas3.jacobs-university.de ([10.70.0.220]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10030) with ESMTP id uniHFXlpFkrX; Thu, 19 Nov 2015 16:27:37 +0100 (CET)
Received: from hermes.jacobs-university.de (hermes.jacobs-university.de [212.201.44.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hermes.jacobs-university.de", Issuer "Jacobs University CA - G01" (verified OK)) by atlas3.jacobs-university.de (Postfix) with ESMTPS; Thu, 19 Nov 2015 16:27:37 +0100 (CET)
Received: from localhost (demetrius1.jacobs-university.de [212.201.44.46]) by hermes.jacobs-university.de (Postfix) with ESMTP id AAFF92006D; Thu, 19 Nov 2015 16:27:37 +0100 (CET)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius1.jacobs-university.de [212.201.44.32]) (amavisd-new, port 10024) with ESMTP id 4v_2a6Y39QaO; Thu, 19 Nov 2015 16:27:37 +0100 (CET)
Received: from elstar.local (elstar.jacobs.jacobs-university.de [10.50.231.133]) by hermes.jacobs-university.de (Postfix) with ESMTP id 58EDE20069; Thu, 19 Nov 2015 16:27:36 +0100 (CET)
Received: by elstar.local (Postfix, from userid 501) id 70C7038E35BF; Thu, 19 Nov 2015 16:27:35 +0100 (CET)
Date: Thu, 19 Nov 2015 16:27:34 +0100
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Carsten Bormann <cabo@tzi.org>
Message-ID: <20151119152734.GA3518@elstar.local>
Mail-Followup-To: Carsten Bormann <cabo@tzi.org>, Michel Veillette <Michel.Veillette@trilliantinc.com>, Core <core@ietf.org>, "lhotka@nic.cz" <lhotka@nic.cz>
References: <02d2efc9e66b090dd7b7932ae4e749cd@xs4all.nl> <BLUPR06MB1763C6BBEEE42279A79A8F30FE1B0@BLUPR06MB1763.namprd06.prod.outlook.com> <564DE2C1.50205@tzi.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <564DE2C1.50205@tzi.org>
User-Agent: Mutt/1.4.2.3i
Archived-At: <http://mailarchive.ietf.org/arch/msg/core/E5Q8RF0iBVr2HUOA0Y9mgqNMFHA>
Cc: "lhotka@nic.cz" <lhotka@nic.cz>, Core <core@ietf.org>
Subject: Re: [core] YANG to CBOR mapping
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
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: Thu, 19 Nov 2015 15:28:00 -0000

On Thu, Nov 19, 2015 at 03:54:57PM +0100, Carsten Bormann wrote:
> 
> So I think that Peter's reminder to stay close to
> draft-ietf-netmod-yang-json -- unless we do need to deviate -- is quite
> germane.
>

I do not understand what "stay close to draft-ietf-netmod-yang-json"
means. I think this requires an explanation.

To give you an example: draft-ietf-netmod-yang-json is following
I-JSON rules and one of them says that I-JSON numbers are limited in
precision. As a consequence, 64-bit numbers are I-JSON encoded as
strings for I-JSON compliance. I think CBOR does not require this
since it does not have this particular restriction. So do we now
continue to do this even though CBOR does not suffer from I-JSON
limitations?

I think my preference would be a clean mapping YANG to CBOR and not a
mapping YANG to I-JSON to CBOR that carries I-JSON restrictions over
to CBOR. The simple reason is that the longer the transformation
chain, the more arcane rules you accumulate.

But then the CBOR spec has already JSON to CBOR translation rules so
YANG to I-JSON to CBOR is already defined somehow. Someone needs to
compile a list of cases where YANG to CBOR would be different from
YANG to JSON to CBOR before we can take an informed decision.

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>