Re: [yang-doctors] Identities vs enums

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Thu, 29 August 2019 10:53 UTC

Return-Path: <j.schoenwaelder@jacobs-university.de>
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 D0FF812007C for <yang-doctors@ietfa.amsl.com>; Thu, 29 Aug 2019 03:53:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001] 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 4tyPXVWZQ4F4 for <yang-doctors@ietfa.amsl.com>; Thu, 29 Aug 2019 03:53:17 -0700 (PDT)
Received: from atlas5.jacobs-university.de (atlas5.jacobs-university.de [212.201.44.20]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E40AD1201CE for <yang-doctors@ietf.org>; Thu, 29 Aug 2019 03:53:16 -0700 (PDT)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas5.jacobs-university.de (Postfix) with ESMTP id 08406674; Thu, 29 Aug 2019 12:53:15 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from atlas5.jacobs-university.de ([10.70.0.198]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10032) with ESMTP id 7_u38mkZbodQ; Thu, 29 Aug 2019 12:53:14 +0200 (CEST)
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 "DFN-Verein Global Issuing CA" (verified OK)) by atlas5.jacobs-university.de (Postfix) with ESMTPS; Thu, 29 Aug 2019 12:53:14 +0200 (CEST)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by hermes.jacobs-university.de (Postfix) with ESMTP id E47B620140; Thu, 29 Aug 2019 12:53:14 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10028) with ESMTP id V7b7vSr53kRq; Thu, 29 Aug 2019 12:53:14 +0200 (CEST)
Received: from exchange.jacobs-university.de (SXCHMB02.jacobs.jacobs-university.de [10.70.0.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "exchange.jacobs-university.de", Issuer "DFN-Verein Global Issuing CA" (verified OK)) by hermes.jacobs-university.de (Postfix) with ESMTPS id 697B12013F; Thu, 29 Aug 2019 12:53:14 +0200 (CEST)
Received: from anna.localdomain (10.50.218.117) by sxchmb03.jacobs.jacobs-university.de (10.70.0.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Thu, 29 Aug 2019 12:53:13 +0200
Received: by anna.localdomain (Postfix, from userid 501) id 919024D5B06; Thu, 29 Aug 2019 12:53:12 +0200 (CEST)
Date: Thu, 29 Aug 2019 12:53:12 +0200
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: "Rob Wilton (rwilton)" <rwilton@cisco.com>
CC: YANG Doctors <yang-doctors@ietf.org>
Message-ID: <20190829105312.764zyxjbxbvzmaic@anna.jacobs.jacobs-university.de>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: "Rob Wilton (rwilton)" <rwilton@cisco.com>, YANG Doctors <yang-doctors@ietf.org>
References: <MN2PR11MB4366B7D24FF907FE8E0802E9B5A20@MN2PR11MB4366.namprd11.prod.outlook.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <MN2PR11MB4366B7D24FF907FE8E0802E9B5A20@MN2PR11MB4366.namprd11.prod.outlook.com>
User-Agent: NeoMutt/20180716
X-ClientProxiedBy: SXCHMB01.jacobs.jacobs-university.de (10.70.0.120) To sxchmb03.jacobs.jacobs-university.de (10.70.0.155)
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/of3sCjj4KYejs3iuTaMv0enPV_4>
Subject: Re: [yang-doctors] Identities vs enums
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.29
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: Thu, 29 Aug 2019 10:53:20 -0000

A few comments:

- Enums can be extended. RFC 7950 section 11:

   o  An "enumeration" type may have new enums added, provided the old
      enums's values do not change.  Note that inserting a new enum
      before an existing enum or reordering existing enums will result
      in new values for the existing enums, unless they have explicit
      values assigned to them.

  It is important to not change the order and advisable to assign
  explicit numeric values.

- Moving definitions into another module means that one has to use
  module prefixes.

- All identities defined in a module share the same identifier
  namespace. Using the same identifier in other namespaces should not
  be a problem. See RFC 7950 section 6.2.1.

   o  All identity names defined in a module and its submodules share
      the same identity identifier namespace.

- The decision whether an enum or an identity is appropriate should be
  based on whether it is necessary to support future name allocations
  that can made outside of the module, i.e., without updating the
  module. This is where identities shine. But then they also have
  issues since there is currently no standard way yet to define
  subsets of identities, e.g., the subset of identities supported or
  required by an implementation.

/js

On Thu, Aug 29, 2019 at 10:24:59AM +0000, Rob Wilton (rwilton) wrote:
> I doubt that this is the first time that this has come up ...
> 
> draft-ietf-netmod-intf-ext-yang-07, defines 3 identities (along with a base identity) for loopback configuration: "loopback-internal", "loopback-line" and "loopback-connector".
> 
> One of the reviewers is complaining that the "loopback-" prefix in the identity is redundant and noisy.  I.e. he doesn't like having to write loopback='loopback-internal', and would like to be able to write loopback='internal' instead.
> 
> His main suggestion is to move these loopback (or perhaps just the identities) to a separate YANG module so that they don't need to define a "loopback-" prefix.
> 
> There seem to be some choices here:
> 
> (1) Keep with identities with a "loopback-" prefix.  This causes loopback='loopback-internal'
> 
> (2) Keep with identities, but loose the common prefix, i.e. the identities become "internal", "line", "connector".  Given the size of the module, the likelihood of an identity naming clash in future seems quite small, but they are somewhat generic terms.
> (3) Use shorter identity names, but also put them in a separate types module (as requested by the reviewer).
> (4) Use an enum rather than identities.  Although this has the potential issue that the enum cannot be extended (which I'm wondering if this is something that we should consider changing in the hypothetical YANG Next).
> 
> Personally, I'm toying with changing to 4 or perhaps 2.  I'm not keen on 3.
> 
> Any thoughts or opinions from the YANG doctors?
> 
> Thanks,
> Rob
> 

> _______________________________________________
> yang-doctors mailing list
> yang-doctors@ietf.org
> https://www.ietf.org/mailman/listinfo/yang-doctors


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