Re: [yang-doctors] Style question from individuals working on IEEE YANG

Schönwälder, Jürgen <J.Schoenwaelder@jacobs-university.de> Wed, 15 January 2020 12:55 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 5B73F120143 for <yang-doctors@ietfa.amsl.com>; Wed, 15 Jan 2020 04:55:55 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_NONE=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=jacobsuniversity.onmicrosoft.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 OY14gJNC-SP2 for <yang-doctors@ietfa.amsl.com>; Wed, 15 Jan 2020 04:55:49 -0800 (PST)
Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2071.outbound.protection.outlook.com [40.107.21.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9B5DE120178 for <yang-doctors@ietf.org>; Wed, 15 Jan 2020 04:55:43 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XjxqTrB+N73T0FYXu6A6Hrf/ppGXWO3lIztS1bdSvmoWdkmeGmovbVbxjI2h91/EBHUpG4be9pHQkmazTJzGOMD1g7LOa3UtgpTWIkqJ0UkgctLGWkoHdhLxTVEnuRdTm0g81r8eZUyAH8yERzj46r5lOH9mn4mt/aVLsAVhrC1NMlTMEv+O8SGMuDJie9WRpJloOLWNE1dfk7thJSJPckYWT0Z2oblXzy/E3Kovyz6dN02Tf9IV0ngmSbniCtDsx10+jDDd0lacKdCdUP41aS09L/FPV1fXaxSmrOwv0TF/4P1ODNsXflsjX3peTsO7Ulv40vvzrZC1khwmHR5Q8A==
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=g0w1ClsptrwzHSEgOfhhUZxtd6Jc0lwwNGG7w2ZjBvo=; b=XklrAFkUwLicu9YpoUcgG7MfoY+XthA2/bs3jWVnMWjbBWkv9Vs7ADR9lK/2z98IbCvxEHSSQElqh4cuXziLh7yQ9ujLY2AV7O0TaMkGpb+3CUhUeeOAxIf7KTTUTwMxqkUEIfw0Bw8xO4dN7QMfGTwWqqcoKt3zWnT9N8Tyl2nYfGLGbfwU/Lk60mrg+jE7EBfOMOrHbNUDuJkQhif/19/VkGzbQHsPti54T+ZGG/I2YkVNO+G5E9i01LAxa4Du0UhCeUku0VauFW2S2FftHlFVuzA5njyLsdCRutUbZ1w01i/pf9BF6JlaLLshTrnDbkpO4zJx9Q2CDIGwZLloXg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=jacobs-university.de; dmarc=pass action=none header.from=jacobs-university.de; dkim=pass header.d=jacobs-university.de; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jacobsuniversity.onmicrosoft.com; s=selector2-jacobsuniversity-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g0w1ClsptrwzHSEgOfhhUZxtd6Jc0lwwNGG7w2ZjBvo=; b=BRdtPn0x/drx6NM8W8BXiCVrBh1kXbWa+fdlt9oCdm0XUGnZbLlZTlMcJPufgRxid90ROx/T3rgqS8A254/0tTMGR8A+PdnVUvSmCCZy+7eoiq5F5OzOrFrsWVGaw8890Ta9wRcVco8SKlmMYNoH19MvqP49f+XWsX8khdgsL+Y=
Received: from DB6P190MB0312.EURP190.PROD.OUTLOOK.COM (10.165.140.31) by DB6P190MB0085.EURP190.PROD.OUTLOOK.COM (10.172.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.10; Wed, 15 Jan 2020 12:55:41 +0000
Received: from DB6P190MB0312.EURP190.PROD.OUTLOOK.COM ([fe80::bcdc:4d6:7dfc:a946]) by DB6P190MB0312.EURP190.PROD.OUTLOOK.COM ([fe80::bcdc:4d6:7dfc:a946%6]) with mapi id 15.20.2644.015; Wed, 15 Jan 2020 12:55:40 +0000
Received: from localhost (2001:638:709:5::7) by AM0PR01CA0081.eurprd01.prod.exchangelabs.com (2603:10a6:208:10e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19 via Frontend Transport; Wed, 15 Jan 2020 12:55:40 +0000
From: =?iso-8859-1?Q?Sch=F6nw=E4lder=2C_J=FCrgen?= <J.Schoenwaelder@jacobs-university.de>
To: Scott Mansfield <scott.mansfield=40ericsson.com@dmarc.ietf.org>
CC: "yang-doctors@ietf.org" <yang-doctors@ietf.org>
Thread-Topic: [yang-doctors] Style question from individuals working on IEEE YANG
Thread-Index: AdXLnSlUWHhFHNStQciOhysBaa3xVgABeziA
Date: Wed, 15 Jan 2020 12:55:40 +0000
Message-ID: <20200115125539.bcfybqzugsirrw5g@anna.jacobs.jacobs-university.de>
References: <SN6PR15MB23827FBAD5C61D8868ECECEE8B370@SN6PR15MB2382.namprd15.prod.outlook.com>
In-Reply-To: <SN6PR15MB23827FBAD5C61D8868ECECEE8B370@SN6PR15MB2382.namprd15.prod.outlook.com>
Reply-To: =?iso-8859-1?Q?Sch=F6nw=E4lder=2C_J=FCrgen?= <J.Schoenwaelder@jacobs-university.de>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-clientproxiedby: AM0PR01CA0081.eurprd01.prod.exchangelabs.com (2603:10a6:208:10e::22) To DB6P190MB0312.EURP190.PROD.OUTLOOK.COM (2603:10a6:6:34::31)
authentication-results: spf=none (sender IP is ) smtp.mailfrom=J.Schoenwaelder@jacobs-university.de;
x-ms-exchange-messagesentrepresentingtype: 1
x-originating-ip: [2001:638:709:5::7]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 72f36036-c940-4d3b-5007-08d799ba39a5
x-ms-traffictypediagnostic: DB6P190MB0085:
x-ms-exchange-transport-forked: True
x-microsoft-antispam-prvs: <DB6P190MB00856843E569733691BAD699DE370@DB6P190MB0085.EURP190.PROD.OUTLOOK.COM>
x-ms-oob-tlc-oobclassifiers: OLM:9508;
x-forefront-prvs: 02830F0362
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(376002)(346002)(39850400004)(396003)(199004)(189003)(81166006)(478600001)(71200400001)(3450700001)(8676002)(4326008)(81156014)(2906002)(66446008)(52116002)(6496006)(6486002)(16526019)(1076003)(186003)(316002)(66946007)(64756008)(5660300002)(786003)(86362001)(66556008)(66476007)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6P190MB0085; H:DB6P190MB0312.EURP190.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1;
received-spf: None (protection.outlook.com: jacobs-university.de does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: s0Azjm5PrEt7lm6g6jLcxsHic2S16yoY4xSRd52LxONPltLo4OYQOqeoC8379185UV1MFKvAwLogZggX3Xp1Kbk3+idEngYk51YtaRRR6pHe/0+OECn4f0mO6BOtH5Mv+dusU1N7rH3WhL8gXmp0tDTyhDLpE0AAQ04BgglHg3VwYeGhyMz1V6oUs9wKEzUVq95i99kBvX/uj8FCoxqIDlPQQnTcO0UFpyZDVMBfOf0rPzQYwXg4aZTdOnm+nJAJ+tiXe3P2CRm6p1q4zifPHaKEfFU5pyse3i+n/0SgASB89oS27EDvpX1DYcVnN+FSL/6929tBIdQoNEs39742TaXIEgScmB+f7CiXGXuM4SNMQgsttXQHhquO+3fu4h+5NzwlspqZpun43fTMfMoNbiSCDmXdu6WgciNW/mSzA5wsFnUuV4Ddwz5y+hvBuqZr6v1ZNnucBO9xqrV+YIqY62pHVVj0hH4DoAAj3BVMHqEvmNxt7PHbWK82UIza+IL5
Content-Type: text/plain; charset="iso-8859-1"
Content-ID: <C808008C0F220548B9AFD8077C722341@EURP190.PROD.OUTLOOK.COM>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: jacobs-university.de
X-MS-Exchange-CrossTenant-Network-Message-Id: 72f36036-c940-4d3b-5007-08d799ba39a5
X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:55:40.8725 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: f78e973e-5c0b-4ab8-bbd7-9887c95a8ebd
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: wZXRSlG3XQA8mMVeCk1B1CZW7wBEvDQBg5lmRz1teQQxqQ38T1PFgdx4IjuICAhiD17mYFlzh7Lr0/4E8XqqRNeD0uHq0lNWQpnDi0IxAm4=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6P190MB0085
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/-qNrhlwp6SS-QnEOQwDwL_6At80>
Subject: Re: [yang-doctors] Style question from individuals working on IEEE YANG
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: Wed, 15 Jan 2020 12:55:55 -0000

On Wed, Jan 15, 2020 at 12:15:19PM +0000, Scott Mansfield wrote:
> 
> The YANG people from IEEE 802.1 discovered a symmetric modelling
> issue related to YANG lists, and kindly request for feedback about
> the common practices in YANG modules beyond those from IEEE 802.1.
> 
> Consider the following YANG code example:
> 
> 01: leaf my-list-size {
> 02:   type uint32;
> 03:   config false;
> 04:   description "The number of elements in 'my-list'";
> 06: }
> 
> 07: leaf-list my-list {
> 08:   type my-list-element-type;
> 09: }
> 
> The state value of leaf my-list-size (L01) needs to be consistent with the
> number of elements in leaf-list my-list (L07). Therefore, IEEE 802.1 
> identified the following options:
> 
> A)           Delete the size leaf (i.e., my-list-size).
> B)            Formulate consistency requirements in IEEE standards documents
> C)            Formulate consistency requirements in YANG description nodes
> (e.g., L04).
> D)           Formulate consistency requirements in YANG must statement(s)
> E)            ???

Looking at this from an NMDA perspective, the my-list-size leaf can
only report correctly the size of my-list in the <operational>
datastore, i.e., the applied config. The my-list that exists in lets
say the <running> datastore may have more or fewer entries.

For configuration datastores, I would rather not have such size leafs.
For the operation state datastore, they are easy to do and I would
define the requirements where the size leaf is defined, i.e., the YANG
description statement. Note that the operational state datastore
should return the true state of the device, i.e., YANG must statements
would not help you much since there is no configuration change
operation that can be rejected due to a must violation.

/js

-- 
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/>