Re: [yang-doctors] Identities vs enums

Andy Bierman <andy@yumaworks.com> Wed, 23 August 2017 19:46 UTC

Return-Path: <andy@yumaworks.com>
X-Original-To: yang-doctors@ietfa.amsl.com
Delivered-To: yang-doctors@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0D6451323FD for <yang-doctors@ietfa.amsl.com>; Wed, 23 Aug 2017 12:46:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.com
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 xhv_phHL8DPK for <yang-doctors@ietfa.amsl.com>; Wed, 23 Aug 2017 12:46:40 -0700 (PDT)
Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1C453132192 for <yang-doctors@ietf.org>; Wed, 23 Aug 2017 12:46:40 -0700 (PDT)
Received: by mail-wm0-x232.google.com with SMTP id r134so6216556wmf.0 for <yang-doctors@ietf.org>; Wed, 23 Aug 2017 12:46:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=9VRftAyTDOnL4vVPBWXBnzgBjjSIta4zvFAPCWY3O7o=; b=U6vCI4Z6Mh20tx3ZvNDkoaZzyKY/x894YSVswGcs7jDLRpqlfnic24eIdXo1KX79J8 1srzcZfLTRDHEDOLN3YzV3dx9FbshWoTHklqYAOXpCP3fJ7BL7jif9pv9dDIhw7p3/SF /bSiXiLo06RaPpd87I7nJcAVZrohxz9/jU4gO/L/WQxnK43xoGEzym4esv0yGiFwXrfb NPlW8fRfqJEPG7ds6VuuDosrI7mTn0iniIXiioM9MnaICVh+rJjAGu6hNfNFKAZHHDGj If09fnCggGtRLvAQIgKA15t50ED2WQN4ZTwd0AW3amCW+Q1y39cZ/xRKdbStn9JwOQ1a 80lA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=9VRftAyTDOnL4vVPBWXBnzgBjjSIta4zvFAPCWY3O7o=; b=UlOIX3NnGGeF2G7YmtOdNAUdgyhXg3jcgX5Lef3qtjMdlzhSF/bCukH/EzA9PiDOzB Y4bnP5HuWFkhFv3kDlQAUfRii1t8jx6YgTWPcTWCr6bqWImNRjoHOdwyud+R8OZTA/sW TCBz/dQ5mRnftJIwPT7KoBV7jOXqAeD4d06Rod+v6undbIA3H3pBlA/yArLGtCK7TK0b LHLBUyHGwYgisJUzqtu8JnQ2biGyXtWmX+ADgJuSp3xvFxckKAfx+jwfMBOWsshFk3R8 SrLxAjZR/OY/xQHePC8GwGEcy6xUBlsN0LfgevmB5aWzNHFcpIycUaQtJFw1Zd7uuo72 hhYg==
X-Gm-Message-State: AHYfb5glRgcIP2hsp9dRAs9nUHyEmhsNgvLEzKx5nRWVeSYB+zehH8q8 tPS4677izbhSZyQcsTXfLn/QfJpAsG4r
X-Received: by 10.28.101.5 with SMTP id z5mr2724325wmb.136.1503517598515; Wed, 23 Aug 2017 12:46:38 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.223.164.221 with HTTP; Wed, 23 Aug 2017 12:46:37 -0700 (PDT)
In-Reply-To: <20170820080301.asf2fx6o4abupq4h@elstar.local>
References: <D5BE0363.C241B%acee@cisco.com> <20170820080301.asf2fx6o4abupq4h@elstar.local>
From: Andy Bierman <andy@yumaworks.com>
Date: Wed, 23 Aug 2017 12:46:37 -0700
Message-ID: <CABCOCHRyQyCm8NaPeh_FUGrAPytcDigoPFo-EhUrySnM2_Tjbw@mail.gmail.com>
To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>, "Acee Lindem (acee)" <acee@cisco.com>, YANG Doctors <yang-doctors@ietf.org>, "netmod@ietf.org" <netmod@ietf.org>, Rodney Cummings <rodney.cummings@ni.com>
Content-Type: multipart/alternative; boundary="001a114b31165ffb5b055770f8be"
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/o0z3XNs-lmfHX4R3-dFhAj_HR1c>
Subject: Re: [yang-doctors] Identities vs enums
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors/>
List-Post: <mailto:yang-doctors@ietf.org>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 23 Aug 2017 19:46:43 -0000

On Sun, Aug 20, 2017 at 1:03 AM, Juergen Schoenwaelder <
j.schoenwaelder@jacobs-university.de> wrote:

> On Sat, Aug 19, 2017 at 07:02:04PM +0000, Acee Lindem (acee) wrote:
> > All,
> > In the context iana-routing-types.yang, we’ve been having a discussion
> of the merits of identities vs enums. We’ve followed the lead of RFC 7224
> and used identities which allow augmentation. However, for IANA code
> points, there could be merit in having the type represent the actual
> numeric value. Any thoughts on this?
> >
> > In the next version of YANG, it would be useful for a base identity to
> allow it to have a "base-type" (mutually exclusive of "identity-ref"). For
> all identities a "base-value" would be allowed as long as it conformed to
> the constraints of the actual or inherited (via “identity-ref”) “base-type”.
> >
>
> The question here really is who is charge of controlling assignments
> of a name space.
>
> - If there is a single authority controlling the assignments, an enum
>   works fine.
>
> - If the assignments are not controlled by a single authority, an
>   identity works fine.
>
> We sometimes have situations that are somewhere in between, i.e., a
> central authority controlling assignments but delegating parts of the
> name space to other authoritities. I agree, we do not have good
> support to model this explicitly in YANG today.
>
>
I think Acee is asking about a new feature that does not exist in YANG,
which is to add
an enum value-stmt to an identity-stmt somehow.  Seems like a valid
use-case.

It is easy to be confused into thinking the "value" and "position"
assignments have any
relevance to the protocols, but unfortunately they do not (for NETCONF and
RESTCONF).
Think of them as "reference" statements, to identify conceptual codepoints
that are never
sent on the wire. Only the enum or bit names are sent on the wire in XML or
JSON.

Actually CORE WG is developing YANG-to-CBOR, which does use the value
and position fields for the binary encoding.


/js
>
>
Andy


> --
> 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/>
>
> _______________________________________________
> yang-doctors mailing list
> yang-doctors@ietf.org
> https://www.ietf.org/mailman/listinfo/yang-doctors
>