Re: [core] YANG to CBOR mapping

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Thu, 19 November 2015 12:30 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 EDE251ACE6E for <core@ietfa.amsl.com>; Thu, 19 Nov 2015 04:30:41 -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 ZJ1KjjvugrTR for <core@ietfa.amsl.com>; Thu, 19 Nov 2015 04:30:38 -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 1176A1ACE67 for <core@ietf.org>; Thu, 19 Nov 2015 04:30:36 -0800 (PST)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas3.jacobs-university.de (Postfix) with ESMTP id DB834162C; Thu, 19 Nov 2015 13:30:34 +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 ZzVN8QoDlvPN; Thu, 19 Nov 2015 13:30:32 +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 13:30:32 +0100 (CET)
Received: from localhost (demetrius3.jacobs-university.de [212.201.44.48]) by hermes.jacobs-university.de (Postfix) with ESMTP id 735312003B; Thu, 19 Nov 2015 13:30:32 +0100 (CET)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius3.jacobs-university.de [212.201.44.32]) (amavisd-new, port 10024) with ESMTP id Xr82wRi7BluO; Thu, 19 Nov 2015 13:30:28 +0100 (CET)
Received: from elstar.local (elstar.jacobs.jacobs-university.de [10.50.231.133]) by hermes.jacobs-university.de (Postfix) with ESMTP id 92CCE2004E; Thu, 19 Nov 2015 13:30:27 +0100 (CET)
Received: by elstar.local (Postfix, from userid 501) id D55CB38E342F; Thu, 19 Nov 2015 13:30:25 +0100 (CET)
Date: Thu, 19 Nov 2015 13:30:24 +0100
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Somaraju Abhinav <abhinav.somaraju@tridonic.com>
Message-ID: <20151119123024.GA3162@elstar.local>
Mail-Followup-To: Somaraju Abhinav <abhinav.somaraju@tridonic.com>, "consultancy@vanderstok.org" <consultancy@vanderstok.org>, "lhotka@nic.cz" <lhotka@nic.cz>, Core <core@ietf.org>
References: <20151119101143.GA2107@elstar.local> <0E9A48AB39AF3547ACD28A6DE3E2906A0F1ACEDF@ATBRAGMSX02.itiso.net>
Mime-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
X-Clacks-Overhead: GNU Terry Pratchett
Content-Transfer-Encoding: 8bit
In-Reply-To: <0E9A48AB39AF3547ACD28A6DE3E2906A0F1ACEDF@ATBRAGMSX02.itiso.net>
User-Agent: Mutt/1.4.2.3i
Archived-At: <http://mailarchive.ietf.org/arch/msg/core/VUT4ryo6H7ugI69KZU1Jtxs8qSU>
Cc: Core <core@ietf.org>, "lhotka@nic.cz" <lhotka@nic.cz>
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 12:30:42 -0000

Yes, good point. I did not track this. We need to check this carefully
and perhaps there is not even much left to do. But more likely we will
detect differences and then we need to figure out what to do about
them.

/js

On Thu, Nov 19, 2015 at 10:37:15AM +0000, Somaraju Abhinav wrote:
> Hi Juergen,
> 
> I agree with you about the modularity and like your proposal. However, there is one issue we need to watch out for. The CBOR spec. [RFC7049] already says something about converting from JSON to CBOR. So, we should probably be careful that we do not have two ways of getting to CBOR from YANG - via YANG to JSON to CBOR vs YANG to CBOR.
> 
> Abhinav
> ________________________________________
> From: core [core-bounces@ietf.org] on behalf of Juergen Schoenwaelder [j.schoenwaelder@jacobs-university.de]
> Sent: Thursday, November 19, 2015 11:11 AM
> To: consultancy@vanderstok.org
> Cc: lhotka@nic.cz; Core
> Subject: Re: [core] YANG to CBOR mapping
> 
> I am not CoOL but as contributor I think that the CBOR encoding of
> YANG data should follow in style the JSON encoding document but it
> should not normatively depend on the JSON encoding document. The
> reason is modularity. There are systems that only want JSON and there
> are systems that only want CBOR.
> 
> >From the NETMOD perspective, I am pretty sure CBOR is _not_ added to
> the JSON encoding document. The reasons is modularity (see above) and
> also the fact that the JSON document is pretty much done and several
> other documents depend on it and we won't hold things off for another
> N months.
> 
> Whether the CBOR encoding is done in CORE or NETMOD can be discussed.
> I guess this is a decision whether this requires more CBOR expertise
> or more YANG expertise. Given that this work started being discussed
> in CORE, I personally would not mind to leave the work in CORE and to
> ensure that NETMOD is kept updated when things become stable (e.g.,
> the CBOR encoding document goes to WG last call).
> 
> /js
> 
> On Thu, Nov 19, 2015 at 11:00:03AM +0100, peter van der Stok wrote:
> > Hi CoOL authors.
> >
> > I have looked at your section 5, and see an enormous overlap with the
> > CoMI section 6. Actually the two proposals are almost completely
> > interoperable, with a few exceptions. Much of the CoMI proposal is based
> > on the work of Ladislav Lhotka, described in
> > draft-ietf-netmod-yang-json. CoMI refers to this draft and uses it
> > extensively. In the CoOL draft the yang-json draft is ignored. That is a
> > pity because you are redoing much of the work already done in the
> > yang-json draft. In the CoMI draft we used the results of yang-json
> > draft, exchanged the YANG name by the hash value, and passed it through
> > the diagnostic JSON to CBOR translator. Quite a satisfactory and elegant
> > solution.
> > Below, I have summarized my comparison between CoMI YANG to CBOR and
> > CoOL YANG to CBOR. Please check for omissions and mistakes.
> > Differences concern Binary byte string and Bits. The CoMI choice of CBOR
> > type is derived from yang-json, and I should like to hear the opinion of
> > Ladislav on this aspect.
> > Other differences concern decimal64, and int; but I expect that is an
> > oversight in the CoOL draft.
> > A major difference is the encoding of lists and list instances; I
> > discuss that in a separate e_mail.
> > Given the overlap of work and the need for the expertise of the netmod
> > WG, I recommend that a YANG CBOR draft is submitted to the netmod wg and
> > uses as much as possible the contents of yang-json draft. Alternatively,
> > I can imagine that CBOR mapping is added to the yang-json draft if the
> > author, Ladislav Lhotka, and the WGs agree with that.
> >
> > Greetings,
> >
> > Peter
> > ______________________________________________________________________________
> > Comparison of draft veillette-core cool, denoted with CoOL
> > With draft vanderstok-core-comi, denoted with CoMI
> > And draft ietf-netmod-yang-json, denoted with yang-json
> > Simple YANG type can be :
> > Binary byte string:                   CoMI, major type 2;
> >          CoOL,  major type 0
> > Bits:                                 CoMI, array of text;
> >          CoOL, major type 0
> > Boolean:                              CoMI, major type 7 (20,21);
> >          CoOL, major type 7 (20,21)
> > decimal64:                            CoMI, major type 0 (pos) and
> > 1(neg);        CoOL major type 0
> > empty:                                CoMI major type 7(22);
> >          CoOL major type 7(22)
> > enumeration:                          CoMI, major type 0;
> >          CoOL major type 0
> >  identityref:                         CoMI, major type 3;
> >           CoOL major type 3
> >  int8, int16, int32, int64:           CoMI, major type 0 (pos) and
> > 1(neg);         CoOL major type 0
> >  leafref:                             CoMI, follows leaf type;
> >           CoOL follows leaf type
> >  string:                              CoMI, major type 3,
> >           CoOL major type 3
> >  uint8, uint16, uint32, uint64:       CoMI, major type 0;
> >           CoOL major type 0
> >
> > In netmod-yang-json draft  JSON objects are used:
> > JSON object := { name: JSON object}, where name is a string. For CoMI
> > and CoOL the name can be an integer which is valid for diagnostic JSON
> > used for CBOR, giving:
> > CBOR object := {integer: CBOR object}
> >
> > Leaf:
> > Yang-json,  Name : value, where name is the string identifier of the
> > leaf, and value of Simple YANG type
> > CoMI: major type 5 containing: uint64, value;      CoOL: not defined
> >
> > Union:
> > Yang-json,  use corresponding media type for type of value
> > CoMI, use corresponding CBOR type; CoOL, use corresponding CBOR type
> >
> > anyxml,
> > YANG-json, value can be of any type.
> > CoMI, not applicable; CoOL, can be any CBOR type
> >
> > Anydate,
> > Yang-json, follows container
> > CoMI, not applicable,                           CoOL, not applicable
> >
> > container,
> > yang-json,     name:  JSON object
> > CoMI: major type 5;                             CoOL, major type 5
> >
> > leaf-list
> > yang-json, name: [ value 1, value 2,……]
> > CoMI, major type 4,                             CoOL, major type 4
> >
> > List
> > Yang-json, name:[ JSON object1, JSON object2, ….]
> > CoMI, major type 5 of major type 5,             CoOL, major type 4 of
> > major type 5
> >
> >
> >
> > --
> > Peter van der Stok
> > vanderstok consultancy
> > mailto: consultancy@vanderstok.org
> >
> 
> --
> 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/>
> 
> _______________________________________________
> core mailing list
> core@ietf.org
> https://www.ietf.org/mailman/listinfo/core
> ________________________________________________________ The contents of this e-mail and any attachments are confidential to the intended recipient. They may not be disclosed to or used by or copied in any way by anyone other than the intended recipient. If this e-mail is received in error, please immediately notify the sender and delete the e-mail and attached documents. Please note that neither the sender nor the sender's company accept any responsibility for viruses and it is your responsibility to scan or otherwise check this e-mail and any attachments.

-- 
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/>