[yang-doctors] Identities vs enums

"Rob Wilton (rwilton)" <rwilton@cisco.com> Thu, 29 August 2019 10:25 UTC

Return-Path: <rwilton@cisco.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 169B412011C for <yang-doctors@ietfa.amsl.com>; Thu, 29 Aug 2019 03:25:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.5
X-Spam-Level:
X-Spam-Status: No, score=-14.5 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.com header.b=HfQJp7DC; dkim=pass (1024-bit key) header.d=cisco.onmicrosoft.com header.b=BO3FkKYH
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 U37vnOqtWM2m for <yang-doctors@ietfa.amsl.com>; Thu, 29 Aug 2019 03:25:07 -0700 (PDT)
Received: from alln-iport-8.cisco.com (alln-iport-8.cisco.com [173.37.142.95]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D53B7120019 for <yang-doctors@ietf.org>; Thu, 29 Aug 2019 03:25:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=6637; q=dns/txt; s=iport; t=1567074306; x=1568283906; h=from:to:subject:date:message-id:mime-version; bh=F4vfPj+AE5SClh8/YQpJKFLBJM9hpCbm3lnmg9/T9mA=; b=HfQJp7DCZJ7CFbJFgrm3W3EOyy2iWQvKy0hhInOB4Quck7b0MUKwP8AQ lDW6PbAMJEQFjr7mCp8kI890gI++E86lcPaaaU1wpjCkY4woQhn8CaCYZ tp9mPWbK90JbuKBITBrz2tX/yuE9kRmlz1CB1+xNycIqecX3jnmOe7uPc M=;
IronPort-PHdr: =?us-ascii?q?9a23=3A4uAbXRZf6Ck681d9Qzk7ceX/LSx94ef9IxIV55?= =?us-ascii?q?w7irlHbqWk+dH4MVfC4el20gebRp3VvvRDjeee87vtX2AN+96giDgDa9QNMn?= =?us-ascii?q?1NksAKh0olCc+BB1f8KavwcC0+AMNEfFRk5Hq8d0NSHZW2ag=3D=3D?=
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BSAADQpmdd/4sNJK1cCRwBAQEEAQE?= =?us-ascii?q?HBAEBgVMHAQELAYEVL1ADbVYgBAsqCodeA4RShh9NlR2EXIEugSQDVAkBAQE?= =?us-ascii?q?MAQEtAgEBhD8CglgjNAkOAgMIAQEEAQEBAgEGBG2FLgyFYxsTAQE4EQGBACY?= =?us-ascii?q?BBBsagwGBHU0DHQECnxcCgTiIYYIlgnwBAQWFDBiCFgmBNAGLdhiBQD+BV4I?= =?us-ascii?q?fAYUELIM7giaUPpdLCQKCHgOUaZhdpiQCBAIEBQIOAQEFgVA4gVhwFYMngkK?= =?us-ascii?q?DcopTcoEpjREBgSIBAQ?=
X-IronPort-AV: E=Sophos;i="5.64,442,1559520000"; d="scan'208,217";a="321216208"
Received: from alln-core-6.cisco.com ([173.36.13.139]) by alln-iport-8.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 29 Aug 2019 10:25:05 +0000
Received: from XCH-RCD-007.cisco.com (xch-rcd-007.cisco.com [173.37.102.17]) by alln-core-6.cisco.com (8.15.2/8.15.2) with ESMTPS id x7TAP3KD021086 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL) for <yang-doctors@ietf.org>; Thu, 29 Aug 2019 10:25:05 GMT
Received: from xhs-rtp-003.cisco.com (64.101.210.230) by XCH-RCD-007.cisco.com (173.37.102.17) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 29 Aug 2019 05:25:02 -0500
Received: from xhs-rcd-001.cisco.com (173.37.227.246) by xhs-rtp-003.cisco.com (64.101.210.230) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 29 Aug 2019 06:25:01 -0400
Received: from NAM02-BL2-obe.outbound.protection.outlook.com (72.163.14.9) by xhs-rcd-001.cisco.com (173.37.227.246) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Thu, 29 Aug 2019 05:25:00 -0500
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GQsF78Bplc3L0TD//7gX9cEXEJc6odkDFKvOw7rxeffl4YYIiUOo9wXH2pMMeVt5R3YKXSM3D82iz/8RVrUJVKr2Hupyx/hzlc6iy6GcvTWVTvx0iX1yNWzHBRsLyNcXOJYusSD9Wrf3mDWj+ou07g6vt0L+9IaB71sE9opz7a+8UGxTCSYe/hz1a8gYbmD2+36nKMXw8VInxV/iKE8Gdl5rffvLXQXP76KuDSX5jGHUjHnTCtQSq8GOnMmXqEvipH/X3Olm6eOBFcVxHogT5oIPb8yjEwT3EDP6N2KA2Oys/6U0e5eWT83v7oreMXnriacpUlWUuOtvJbBtkm1wvw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ALmt+oKmfxy8Y1ce7zyPMG/WQ03wnKXxMRS8gSK7+Lc=; b=B2gKF6S08xtCeEVXwR+r5AUFalM+n0Wo9zjq9uzF/SfbOpGCNmYEyz/2zfNg6diukbGcxI0YGzyWRwTSPmU8tjLvJEU+T6ySBjBhUQ+tX+2LdZ1dDHkTx1Zr9NB2pu58ugJcnNyXhGRbije6Nncy+ui2A5vGmWBa3Q321eVQ7IL89E8yaGf7+7sOdqarnfxAvfeoxiHIvomAQ9IbOvIo27Ol4sr3lhUT5Uqr2OgD9OilexQt+FT5R0pVXB4CgrPwuPAvlfPFx03QEWe1Y/kLhSDUEEMdLWWNK9FhABuv5acD5F5p1KfImR6Jk4IY6c3eeV6kJnwch4LgIu7PVrPoPg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cisco.com; dmarc=pass action=none header.from=cisco.com; dkim=pass header.d=cisco.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cisco.onmicrosoft.com; s=selector2-cisco-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ALmt+oKmfxy8Y1ce7zyPMG/WQ03wnKXxMRS8gSK7+Lc=; b=BO3FkKYHKbngFlHpFiQ7oLwrFJlp++qr0G8Q2b9bWttwk6HEtG872+OAHgR0IXNYjlec0GKvj5R4vQNkYmgi4YsrZQUINxnww3T3BJTwRuTShK6c5O9Egko34p1ebu2PcnnYVCTuudYirJ7qw28mtkqEn76j5SGdbTl6ZeXq34A=
Received: from MN2PR11MB4366.namprd11.prod.outlook.com (52.135.38.209) by MN2PR11MB4192.namprd11.prod.outlook.com (20.179.151.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2220.18; Thu, 29 Aug 2019 10:24:59 +0000
Received: from MN2PR11MB4366.namprd11.prod.outlook.com ([fe80::6db3:f4c:467b:30f6]) by MN2PR11MB4366.namprd11.prod.outlook.com ([fe80::6db3:f4c:467b:30f6%7]) with mapi id 15.20.2220.013; Thu, 29 Aug 2019 10:24:59 +0000
From: "Rob Wilton (rwilton)" <rwilton@cisco.com>
To: YANG Doctors <yang-doctors@ietf.org>
Thread-Topic: Identities vs enums
Thread-Index: AdVeUoj6Gm62w2r9QP2N1RJZSFrmWQ==
Date: Thu, 29 Aug 2019 10:24:59 +0000
Message-ID: <MN2PR11MB4366B7D24FF907FE8E0802E9B5A20@MN2PR11MB4366.namprd11.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=rwilton@cisco.com;
x-originating-ip: [173.38.220.59]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: d6a6fb00-e5d6-4aed-fcb7-08d72c6b2589
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MN2PR11MB4192;
x-ms-traffictypediagnostic: MN2PR11MB4192:
x-ms-exchange-purlcount: 2
x-microsoft-antispam-prvs: <MN2PR11MB41925CE616C2671775941751B5A20@MN2PR11MB4192.namprd11.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-forefront-prvs: 0144B30E41
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(136003)(39860400002)(346002)(376002)(366004)(199004)(189003)(54896002)(6306002)(3846002)(6116002)(74316002)(55016002)(8936002)(7736002)(3480700005)(99286004)(9686003)(66066001)(5660300002)(53936002)(8676002)(76116006)(81166006)(81156014)(52536014)(316002)(66946007)(66446008)(64756008)(6436002)(66476007)(66556008)(33656002)(186003)(7696005)(6916009)(7116003)(14454004)(2906002)(478600001)(71200400001)(102836004)(71190400001)(256004)(86362001)(26005)(790700001)(25786009)(6506007)(476003)(486006); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4192; H:MN2PR11MB4366.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1;
received-spf: None (protection.outlook.com: cisco.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info: MyRXyaAtvRXSWOswJz9HWubMcqbaXsu7v4qY7PF2xu0v5Ov5v5Tx/p8S6RmakN15K9+H9FJoUzdQeUXLJAyMqloOdGGHBUSZmixgpQg77Bleoay2/gGHAAXFZte5NNRQB8grZkgOcmih4oRxdmbuYY8HmYOkSKP63AUIotbFl7+8d7yHVWb7wl95XQ6xbGYQ0NoPxEV7FXFsYH3UTXnh9FfIu9gQDMYiqn5GZUo01BdyiDdm1FNRTzqfgfweoqsLNNFEtZUFfV8fW2RYU+lU/wfh+u3ZkpYq7jD4EVbR7ZGj7FBrsDHBfFWVUfBjZ0z4WwaK9M93GfclyT0RH0Fd1QPyQv8CzY2tHwOoTgxC+AMb+qVcLolC4GCfxSpA8+2NLqgyxyAqWY7SbhQyx5hyZsRUdYelI4AUxNanmiNb/r8=
x-ms-exchange-transport-forked: True
Content-Type: multipart/alternative; boundary="_000_MN2PR11MB4366B7D24FF907FE8E0802E9B5A20MN2PR11MB4366namp_"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: d6a6fb00-e5d6-4aed-fcb7-08d72c6b2589
X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Aug 2019 10:24:59.7808 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5ae1af62-9505-4097-a69a-c1553ef7840e
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: tb3d3sRWMPHkJmKNQGV3a+BVCLsAlHuHCEhJ7+DI4RNCzz0rQXzhsf3IBooxt9YOhrSoAQqH4cm45UxYEz2dSw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4192
X-OriginatorOrg: cisco.com
X-Outbound-SMTP-Client: 173.37.102.17, xch-rcd-007.cisco.com
X-Outbound-Node: alln-core-6.cisco.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/6lLzj__Da_9In-Cvysnxa8DCr7o>
Subject: [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:25:09 -0000

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