Re: [netconf] [core] YANG encoding in CBOR

Carsten Bormann <cabo@tzi.org> Mon, 25 March 2019 06:23 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3F96E120360; Sun, 24 Mar 2019 23:23:49 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.2
X-Spam-Level:
X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3] 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 F3wgb2uN70ua; Sun, 24 Mar 2019 23:23:47 -0700 (PDT)
Received: from smtp.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C4DEE12035F; Sun, 24 Mar 2019 23:23:46 -0700 (PDT)
Received: from surfer-172-30-2-245-hotspot.internet-for-guests.com (107.223.broadband2.iol.cz [83.208.223.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.uni-bremen.de (Postfix) with ESMTPSA id 44SPNJ5BnRz10Q6; Mon, 25 Mar 2019 07:23:44 +0100 (CET)
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <CABCOCHTNWz=VWZP3BzYxdBXTFytYyJjge2gX6fihz1B1Xf5bOQ@mail.gmail.com>
Date: Mon, 25 Mar 2019 07:23:44 +0100
Cc: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>, "netconf@ietf.org" <netconf@ietf.org>, "core@ietf.org" <core@ietf.org>
X-Mao-Original-Outgoing-Id: 575187822.01148-4f3da4270b3f661c3b433a83b313ed81
Content-Transfer-Encoding: quoted-printable
Message-Id: <5D0AEDAC-4AD2-4DFD-BF19-EA210773EF66@tzi.org>
References: <6235c6683ff14848a661f8b8cec94280@XCH-RCD-007.cisco.com> <BL0PR06MB5042823429DB7CDA0F33408B9A430@BL0PR06MB5042.namprd06.prod.outlook.com> <588401AB-483E-40F5-95BB-20A066E56DAC@tzi.org> <15fbaf84b20343a1b83f40b571149a14@XCH-RCD-007.cisco.com> <1ADF8201-ABB4-44FD-A515-F3F8E0DBF5FC@tzi.org> <20190323101003.gp3zvsvqqwc26jip@anna.jacobs.jacobs-university.de> <6BAAAC0E-F91B-411B-8768-F628C57FF2E0@tzi.org> <20190323133519.nv6sw72upxchr7p3@anna.jacobs.jacobs-university.de> <3D7C33C9-CB86-4965-899D-93C4B7343DF7@tzi.org> <CABCOCHRcEPUB=Yf2Vdf6ZpN-SxjYeMPL_54-EKMYSpUO9b-RwA@mail.gmail.com> <640708E8-F80E-49EE-9AEF-DA8DAEE3AA57@tzi.org> <CABCOCHTNWz=VWZP3BzYxdBXTFytYyJjge2gX6fihz1B1Xf5bOQ@mail.gmail.com>
To: Andy Bierman <andy@yumaworks.com>
X-Mailer: Apple Mail (2.3445.9.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/N06PrtVhk5PZNXG7QA1Dzz0Kpj0>
Subject: Re: [netconf] [core] YANG encoding in CBOR
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETCONF WG list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Mar 2019 06:23:49 -0000

Hi Andy,

> On Sun, Mar 24, 2019 at 3:24 PM Carsten Bormann <cabo@tzi.org>; wrote:
> On Mar 24, 2019, at 12:29, Andy Bierman <andy@yumaworks.com>; wrote:
> > 
> > The answer seems to be simple but inefficient:
> > Always encode bits or enumeration as a string, if this is within a union type.
> 
> For enum values within unions (which are already handled specially by giving them a CBOR tag) we could simply use a SID (that we then would have to generate for each enum value) instead of a string.  We could also extend this to enums outside unions; but here the recurrence to the (outside unions unambiguous) value sounds better to me.
> 
> Bits.  Oh.  Same procedure, I’d say.


> On Mar 24, 2019, at 23:52, Andy Bierman <andy@yumaworks.com>; wrote:
> 
> This seems like it would make the SID file very complicated.

Not necessarily:

> Not sure it would work since leaf/leaf-list can define their own types.
> Plus, all the enum typedefs would have to be numbered this way.

Right!
It would amount to defining an identifier scheme for all the so far anonymous enums (and bits defs, I gather).

> Maybe the SID authors can comment on how this would be done.

Well, such an identifier scheme would benefit the whole YANG ecosystem, so you can have a transition from “first match wins” to proper name equivalence.  So we would need to do it in a way that over time it can become part of the core YANG definition.

We can maybe cheat:  Use strings for enums inside unions for now, and values only outside.
But it would be good if the SID files generated (and registered) for a YANG module already had those enum/bits type identifiers so we only have to do the SID generation once, so I’m not sure if I like cheating; doing the SIDs for those identifiers right from the outset would win so much more.

So does anyone have an idea how such an identifier scheme might look like?

Grüße, Carsten