Re: [yang-doctors] question regarding conditional/optional statements

Kent Watsen <kwatsen@juniper.net> Mon, 21 August 2017 14:46 UTC

Return-Path: <kwatsen@juniper.net>
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 AE502132626 for <yang-doctors@ietfa.amsl.com>; Mon, 21 Aug 2017 07:46:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.02
X-Spam-Level:
X-Spam-Status: No, score=-2.02 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_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=juniper.net
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 7CIskHbxV2_u for <yang-doctors@ietfa.amsl.com>; Mon, 21 Aug 2017 07:46:14 -0700 (PDT)
Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0118.outbound.protection.outlook.com [104.47.32.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E906413234B for <yang-doctors@ietf.org>; Mon, 21 Aug 2017 07:46:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4OXyfVyVr42MPBPQ9GG+YbSSBArTciIJexAm8hbx/n4=; b=XMYmWyVfGqYnv8feB4efy7DnccgG9WtLqtpMZHtIfIBgeVhB/x22YHmb5IIrjlO/HMUC+NVRGTeQKvxM0i93VjkZQ3P5olre4K2g1G1RYW4AkUPD4q+qvCjTAIqamvWNkIjsUtBE8MinMAxztWYl/7e+ns0zGcD91wXB00+bDDE=
Received: from CY1PR0501MB1450.namprd05.prod.outlook.com (10.160.149.11) by CY1PR0501MB1450.namprd05.prod.outlook.com (10.160.149.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.4; Mon, 21 Aug 2017 14:46:10 +0000
Received: from CY1PR0501MB1450.namprd05.prod.outlook.com ([10.160.149.11]) by CY1PR0501MB1450.namprd05.prod.outlook.com ([10.160.149.11]) with mapi id 15.01.1385.008; Mon, 21 Aug 2017 14:46:09 +0000
From: Kent Watsen <kwatsen@juniper.net>
To: Norm Strahle <nstrahle@juniper.net>, Andy Bierman <andy@yumaworks.com>
CC: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>, Jan Lindblad <janl@tail-f.com>, "yang-doctors@ietf.org" <yang-doctors@ietf.org>, Ing-Wher Chen <Ing-Wher_Chen@jabil.com>, "Aseem Choudhary (asechoud)" <asechoud@cisco.com>
Thread-Topic: [yang-doctors] question regarding conditional/optional statements
Thread-Index: AdMWuspFVk5k9TDdRCeshA4HU2pVBgAW9agAAAZRqwAAAQt6gAAL2xKAAAn7ZgAAJSDmQACSsDmA
Date: Mon, 21 Aug 2017 14:46:09 +0000
Message-ID: <3E5048BE-1488-462C-B20D-83237FF72DA0@juniper.net>
References: <BN1PR0201MB0833B05FB5307BDEF2E8E3F5C3820@BN1PR0201MB0833.namprd02.prod.outlook.com> <20170817050647.apfeuvfhfw23ws6n@elstar.local> <BCE95ECB-360D-46E0-B062-371931C0F46A@tail-f.com> <20170817083739.u4vfbtkm34vf5utw@elstar.local> <DC062E7E-7422-4037-82E4-52B17422B33E@juniper.net> <CABCOCHQJOBXrYLntdg_7iL3wqy9Fkcd10f0ArwPJUNKo9dZAVQ@mail.gmail.com> <DM2PR0501MB15024D3A6AA8F654C1C7B418CF800@DM2PR0501MB1502.namprd05.prod.outlook.com>
In-Reply-To: <DM2PR0501MB15024D3A6AA8F654C1C7B418CF800@DM2PR0501MB1502.namprd05.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/f.20.0.170309
authentication-results: spf=none (sender IP is ) smtp.mailfrom=kwatsen@juniper.net;
x-originating-ip: [66.129.241.14]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; CY1PR0501MB1450; 6:wjuWS6D2PD7Y5gC4LL5NjaPQMPNer/3cGFQjOyo7BTftQcX2deQdV7ioL618n/IY0YlMEStNtdaLrJdpfZrdetJcrzjWPIX5y0w2hw8Q5GRR6h6YoYUXMjOlV6rc6pPz1w+pVWvgyxX8H6QxUdIwExQcSgl7Z4cYtlbaq6zjBI9ygMLomPWho5d0gC7y/0WfY16TKj0lAWmeq1w7xIWIgjxVfE4m48XEEews9Hq9gTA2AJBmSy5p6M17CCmtcPAvd3cWzWe7OTvdt8fLE8iD7GLGG3OS/8dAnOySvB5oXTB9CpT47S/5mMXES5D9214G4z/shaj3JIvfaahGU4ztZA==; 5:2gPugSXOyBbP+BK8ueyTzmW81vTv0HjWqnczvHIp7nfih8eLAS6ec8VwQJa2tTYZ+YbK89TOagdnu9528NHrhre9CeUrNnTVxNzCahUTYMNm8sllui9rdVQ/RvD7bryCYhiFY7X2dNLw3lvAfZQHUA==; 24:rbHtieygTGVMDvRGPLF4rTIbrrGJWKTd+RtJ7w2OBBzbTq89CaVtswNyL3MguyT2l3ORFYAInplbmV+PuJQbHRhSdOVng9YP/9Z8QA3N4DU=; 7:eKRB6Ot76jcVWFXhGuqNKNQM43EVvwFgECSCpTITqksAv7pAoY3/026mHgHl9ca+TlbMypsLfR54UsiLWRtzkCuklBU3hirPinxMet/hh2WFRpIBfeWyG02VLHXP7TV5/6rMr90nGL8//1Zz/rM8ukmVWglb1E95D6FyzB1zAkWAwV0/OAJ8vIgvFuZ9im+aBxi+SkJj7i+P+tF9Pirl2N9WkIcARKdFydi3592pbAc=
x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR;
x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10019020)(39860400002)(377454003)(189002)(199003)(24454002)(6486002)(53546010)(966005)(86362001)(77096006)(6506006)(102836003)(3846002)(1941001)(101416001)(6116002)(6246003)(76176999)(50986999)(54356999)(606006)(25786009)(66066001)(229853002)(6436002)(2900100001)(189998001)(68736007)(2950100002)(53936002)(97736004)(3660700001)(5660300001)(33656002)(81166006)(4326008)(3280700002)(8936002)(478600001)(4001350100001)(93886005)(8676002)(81156014)(82746002)(7736002)(83716003)(36756003)(14454004)(2906002)(106356001)(54906002)(99286003)(83506001)(105586002)(54896002)(6512007)(6306002)(236005); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0501MB1450; H:CY1PR0501MB1450.namprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en;
x-ms-office365-filtering-correlation-id: 0d56f4bb-7a6b-44f6-c0a6-08d4e8a35c97
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY1PR0501MB1450;
x-ms-traffictypediagnostic: CY1PR0501MB1450:
x-exchange-antispam-report-test: UriScan:(190756311086443)(158342451672863)(138986009662008)(95692535739014)(21748063052155)(21534305686606);
x-microsoft-antispam-prvs: <CY1PR0501MB14504D73DA7DBECFAD3A58B4A5870@CY1PR0501MB1450.namprd05.prod.outlook.com>
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123560025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR0501MB1450; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR0501MB1450;
x-forefront-prvs: 040655413E
received-spf: None (protection.outlook.com: juniper.net does not designate permitted sender hosts)
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_3E5048BE1488462CB20D83237FF72DA0junipernet_"
MIME-Version: 1.0
X-OriginatorOrg: juniper.net
X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Aug 2017 14:46:09.4657 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: bea78b3c-4cdb-4130-854a-1d193232e5f4
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0501MB1450
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/o46cdYHPIH_dj3-TQY9PzvhNQ94>
Subject: Re: [yang-doctors] question regarding conditional/optional statements
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: Mon, 21 Aug 2017 14:46:18 -0000

If being able to specify per-interface is critical, then clearly features won't work.

Too bad, a static/metadata based approach would be better, but it would require us defining something like a hardware-catalog whereby each hardware component comes with a metadata file describing it.  I've done this before, but we have nothing like it in the IETF.

If you use the bit-mechanism, than you chould consider using the bit-is-set() XPath function in a 'when' expression to make the intention clearer, just technical documentation, not something that is expected to constrain the server.

Between the two choices, I'm more for just leaving fields out because it's simpler and, as a client, I'd rather:

            for each child in queuing-statistics-opt-2
                read child, determining which counter it is in the process

than

            for each bit set in 'supported-counters'
                  use switch/case or if/else to map the bit to a counter-leaf name
                      read counter-leaf value


Kent


On 8/18/17, 8:59 AM, "Norm Strahle" <nstrahle@juniper.net<mailto:nstrahle@juniper.net>> wrote:

Hey folks, Appreciate all the feedback.  We discussed yesterday among diffserv-ietf modelers yesterday and had a couple comments:


·         We liked explicit statements (deviations, features, flag-bits) rather than implicit – i.e. option 5 – of vendors leaving unsupported leaves out of containers

·         We think if-features or the “bit” flag mechanism are better than deviations, as it at least allows clients to anticipate up front that some items may not be supported.

·         One advantage of using the “bit” flag mechanism – i.e. option 2 - over features is that this allows a vendor to specify per-interface what is supported.  What features a vendor supports for diffserv is very hardware dependent and may vary from interface to interface within a single device. A device may have multiple types and generations of line cards, and thus, the types of stats supported will be different. The bit-flag mechanism allows a device to reflect that to the client explicitly.

Thoughts on all the above are much appreciated.
Thanks,
Norm

From: Andy Bierman [mailto:andy@yumaworks.com]
Sent: Thursday, August 17, 2017 3:03 PM
To: Kent Watsen <kwatsen@juniper.net>
Cc: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>; Jan Lindblad <janl@tail-f.com>; yang-doctors@ietf.org; Ing-Wher Chen <Ing-Wher_Chen@jabil.com>; Norm Strahle <nstrahle@juniper.net>; Aseem Choudhary (asechoud) <asechoud@cisco.com>
Subject: Re: [yang-doctors] question regarding conditional/optional statements



On Thu, Aug 17, 2017 at 11:17 AM, Kent Watsen <kwatsen@juniper.net<mailto:kwatsen@juniper.net>> wrote:



> I believe a feature for every counter is a misuse of YANG feature
> statements, it will get horribly ugly. I recently observe an increase
> of feature statement usage in order to accomodate server
> implementations and the ultimate solution is a feature statement for
> every leaf, list, rpc, action, notification and perhaps even certain
> value sets. This is ridiculous, but a feature for every counter is
> getting damn close to it.

This is a programmatic API.  I appreciate the concern for a bloat of
bits on the wire, but recall that features are listed in yang-library,
a very special module that has a built-in ETag-like hashing mechanism
to allow for efficient comparisons.  I don't see the bloat issue here.

Having feature statements everywhere may be ridiculous, but not illegal.
Implementations need to be able to handle it already, right?

good points.
They all apply equally to deviations and features.

I think the way you used features in the client-server set of modules is a good example
for solving this sort of problem.  The if-feature-stmts are on containers, not
individual leafs.

I don't think special objects that return which other objects are implemented
is good because it is not a generalized solution.  A better approach would be
to enhance the protocols so "not-implemented" and "temp-unavailable" exceptions
can be returned on request (ala with-defaults)


Kent


Andy

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