Re: [core] YANG to CBOR mapping
Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Thu, 19 November 2015 10:11 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 AAEC71B3162 for <core@ietfa.amsl.com>; Thu, 19 Nov 2015 02:11:55 -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 dY7NckmScf7s for <core@ietfa.amsl.com>; Thu, 19 Nov 2015 02:11: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 7D0EF1B3161 for <core@ietf.org>; Thu, 19 Nov 2015 02:11:53 -0800 (PST)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas3.jacobs-university.de (Postfix) with ESMTP id 50DD61483; Thu, 19 Nov 2015 11:11:52 +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 2jcGBFegN14E; Thu, 19 Nov 2015 11:11:50 +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 11:11:50 +0100 (CET)
Received: from localhost (demetrius1.jacobs-university.de [212.201.44.46]) by hermes.jacobs-university.de (Postfix) with ESMTP id 621E720054; Thu, 19 Nov 2015 11:11:50 +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 a1uARITIjZuL; Thu, 19 Nov 2015 11:11:48 +0100 (CET)
Received: from elstar.local (elstar.jacobs.jacobs-university.de [10.50.231.133]) by hermes.jacobs-university.de (Postfix) with ESMTP id 5F99A2003B; Thu, 19 Nov 2015 11:11:48 +0100 (CET)
Received: by elstar.local (Postfix, from userid 501) id 367B338E315F; Thu, 19 Nov 2015 11:11:46 +0100 (CET)
Date: Thu, 19 Nov 2015 11:11:45 +0100
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: consultancy@vanderstok.org
Message-ID: <20151119101143.GA2107@elstar.local>
Mail-Followup-To: consultancy@vanderstok.org, Core <core@ietf.org>, lhotka@nic.cz
References: <02d2efc9e66b090dd7b7932ae4e749cd@xs4all.nl>
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: <02d2efc9e66b090dd7b7932ae4e749cd@xs4all.nl>
User-Agent: Mutt/1.4.2.3i
Archived-At: <http://mailarchive.ietf.org/arch/msg/core/b67wYAZKuci3QVcjRV7kJyDniR4>
Cc: 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 10:11:55 -0000
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] YANG to CBOR mapping peter van der Stok
- Re: [core] YANG to CBOR mapping Somaraju Abhinav
- Re: [core] YANG to CBOR mapping Juergen Schoenwaelder
- Re: [core] YANG to CBOR mapping Juergen Schoenwaelder
- Re: [core] YANG to CBOR mapping Michel Veillette
- Re: [core] YANG to CBOR mapping Carsten Bormann
- Re: [core] YANG to CBOR mapping Juergen Schoenwaelder
- Re: [core] YANG to CBOR mapping Michel Veillette
- Re: [core] YANG to CBOR mapping Ladislav Lhotka
- Re: [core] YANG to CBOR mapping Ladislav Lhotka
- Re: [core] YANG to CBOR mapping Carsten Bormann
- [core] YANG to CBOR mapping peter van der Stok
- Re: [core] YANG to CBOR mapping Carsten Bormann
- Re: [core] YANG to CBOR mapping peter van der Stok
- Re: [core] YANG to CBOR mapping Michel Veillette
- Re: [core] YANG to CBOR mapping peter van der Stok
- Re: [core] YANG to CBOR mapping Michel Veillette