Re: [netmod] Guideline on modeling including features and phased support by a device
Robert Wilton <rwilton@cisco.com> Tue, 06 March 2018 12:41 UTC
Return-Path: <rwilton@cisco.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 27A57127522 for <netmod@ietfa.amsl.com>; Tue, 6 Mar 2018 04:41:35 -0800 (PST)
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, T_KAM_HTML_FONT_INVALID=0.01, T_RP_MATCHES_RCVD=-0.01, 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
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 kvD36nJPm-Fs for <netmod@ietfa.amsl.com>; Tue, 6 Mar 2018 04:41:32 -0800 (PST)
Received: from aer-iport-4.cisco.com (aer-iport-4.cisco.com [173.38.203.54]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A2FB51270A3 for <netmod@ietf.org>; Tue, 6 Mar 2018 04:41:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=39059; q=dns/txt; s=iport; t=1520340091; x=1521549691; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to; bh=JO28x3J/d0W8TlRd9mCc9sFttQSz6rmG0re/GgIappA=; b=guMKpIXP4u6JtiWLG+9SAz2PvJA44gdSUjcXjUTGfi+tugG5r8E0PSIb rJdNofj8yOZCCRyKrtFFkmbKRxfgTqzNjM6Lf4sdvHzSNEEf4D7GHMWJp gWImKRbiC2Awp9rhkouBv+U/ADoJR50lmNfy/e9lNMYAmOfuHaufEl7AI 4=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0CPAADBi55a/xbLJq1cGQEBAQEBAQEBAQEBAQcBAQEBAYJaRYEXcCiNeHSOVQsngRaUNIISAwoYAQqEPk8CgyI0GAECAQEBAQEBAmsnhSMBAQEBAgEBAStBCwULCxEEAQEBIAEGBycfCQgGDQYCAQEXhHgIEKp2JoRMg3eCJoUuhAWCDwyBaoEOgyMLAQGBWwlDhTcEiQmEc4xrCZB4B4kUhWSKe06GDYEuHjgmgSwzGggbFTqCQwmCWoFlQDeJX4JHAQEB
X-IronPort-AV: E=Sophos;i="5.47,431,1515456000"; d="scan'208,217";a="2408732"
Received: from aer-iport-nat.cisco.com (HELO aer-core-1.cisco.com) ([173.38.203.22]) by aer-iport-4.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2018 12:41:27 +0000
Received: from [10.63.23.110] (dhcp-ensft1-uk-vla370-10-63-23-110.cisco.com [10.63.23.110]) by aer-core-1.cisco.com (8.14.5/8.14.5) with ESMTP id w26CfRZN006401; Tue, 6 Mar 2018 12:41:27 GMT
To: "Bogaert, Bart (Nokia - BE/Antwerp)" <bart.bogaert@nokia.com>
Cc: "netmod@ietf.org" <netmod@ietf.org>
References: <AM4PR07MB1716E07EE14F80BA7094C0DD94DA0@AM4PR07MB1716.eurprd07.prod.outlook.com> <9b0efc1c-675a-5cc6-3ab3-e6bae2481a78@cisco.com> <AM4PR07MB171668D649123B2F6F21C88194D90@AM4PR07MB1716.eurprd07.prod.outlook.com> <1ee1d963-ad66-6fa8-65fb-902ca23e164b@cisco.com> <AM4PR07MB1716BBA8251F86270473819294D90@AM4PR07MB1716.eurprd07.prod.outlook.com>
From: Robert Wilton <rwilton@cisco.com>
Message-ID: <756fb202-3478-d7be-b261-87f0846115e6@cisco.com>
Date: Tue, 06 Mar 2018 12:41:27 +0000
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0
MIME-Version: 1.0
In-Reply-To: <AM4PR07MB1716BBA8251F86270473819294D90@AM4PR07MB1716.eurprd07.prod.outlook.com>
Content-Type: multipart/alternative; boundary="------------1016DAFF6ABD899A5E95DF94"
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/EUDh-kh4EWFgQxFMgCmArBWKN-8>
Subject: Re: [netmod] Guideline on modeling including features and phased support by a device
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 06 Mar 2018 12:41:35 -0000
On 06/03/2018 12:04, Bogaert, Bart (Nokia - BE/Antwerp) wrote: > > Rob, > > Just to clarify: in this case we are not changing the model, it is the > same model but the device SW in release X is not supporting the > feature and in release Y it is. Supporting the feature results in > adding that part of the tree to the configuration that is related to > the feature and the data leafs related to that feature are simply not > there in the data configured when SW release X was active. > Yes, but an equivalent way of writing this without a feature, and ignoring namespaces, would be put the feature nodes into a separate YANG module (F) which augments the base module (B). In release X, the device only supports B. In release Y, the device supports B and F. But YANG would not allow F to augment B with a mandatory node for the reasons described previously. Hence, I think that it is probably an oversight that YANG allows this. Probably it should go on the YANG 2.0 issue tracker to consider and potentially disallow this. Thanks, Rob > Regards, Bart > > *From:*Robert Wilton [mailto:rwilton@cisco.com] > *Sent:* Tuesday, March 6, 2018 12:59 PM > *To:* Bogaert, Bart (Nokia - BE/Antwerp) <bart.bogaert@nokia.com> > *Cc:* netmod@ietf.org > *Subject:* Re: [netmod] Guideline on modeling including features and > phased support by a device > > Arguably the guidelines, or YANG, should say "don't allow this" ;-) > > I think that what you are describing is just another instance of > "don't augment with a mandatory node rule", or "only backwards > compatible changes revisions should be made to a published YANG module". > > The key reasoning behind these rules is that the a client should be > able to work unchanged after the server has been upgraded, as long as > they are not making use of any new functionality. > > Thanks, > Rob > > On 06/03/2018 11:34, Bogaert, Bart (Nokia - BE/Antwerp) wrote: > > Hi Rob, > > I agree but the fact is that some of the BBF models have > constructions like that and we were wondering whether this should > not be mentioned in the guildelines document. Normally a server > can’t set config true leafs if there is no default available in > the model. That is the reason we reached out to NETMOD. Your > suggestions can work but require adaptation of the current model. > > Regards, Bart > > *From:*Robert Wilton [mailto:rwilton@cisco.com] > *Sent:* Tuesday, March 6, 2018 10:38 AM > *To:* Bogaert, Bart (Nokia - BE/Antwerp) <bart.bogaert@nokia.com> > <mailto:bart.bogaert@nokia.com>; netmod@ietf.org > <mailto:netmod@ietf.org> > *Subject:* Re: [netmod] Guideline on modeling including features > and phased support by a device > > Hi Bart, > > I think that the best solution to problem is perhaps to avoid it > altogether. I.e. I don't think that the only-if-featureleaf > should be marked mandatory. Instead, it would be better to define > a sensible default value/behaviour if the leaf is absent even when > the feature is supported. > > Alternatively, you can simulate something similar to an if-feature > statement by using a when or must expression instead that is > predicated on a leaf that the client must explicitly set to enable > the feature, giving control back to the client. > > E.g. something along the lines of ... > > leaf enable-super-feature { > if-feature test-feature; > type boolean; > default "false"; > } > > ... > > leaf only-if-feature { > > when '/enable-super-feature = "true"'; > > type string; > > mandatory true; > > } > > It would be interesting if you have a concrete example where > neither of the above suggestions would work or be appropriate. > > Thanks, > Rob > > > On 05/03/2018 09:25, Bogaert, Bart (Nokia - BE/Antwerp) wrote: > > Hi, > > We have a question with respect to YANG models using > features. Assume that a part of the model is defined under a > feature and that this feature-dependent part defines a leaf as > mandatory. > > module servers { > > namespace "http://www.example.com/servers"; > > prefix servers; > > import ietf-inet-types { > > prefix inet; > > } > > revision 2018-03-01 { > > description > > "Initial version."; > > } > > feature test-feature { > > description "testing feature"; > > } > > container servers { > > list server { > > key name; > > max-elements 64; > > leaf name { > > type string; > > } > > leaf ip { > > type inet:ip-address; > > mandatory true; > > } > > leaf port { > > type inet:port-number; > > mandatory true; > > } > > leaf only-if-feature { > > if-feature test-feature; > > type string; > > mandatory true; > > } > > } > > } > > } > > Now assume that we have a device that implements the model > step-wise by first not supporting this feature and in a > sub-sequent release by supporting this feature (and uses a > persistent running datastore). The question arising now is > how to deal with this mandatory leaf? Normally this can only > be configured by a client, meaning that without any “help”, > the NC server will not be able to startup with the data > contained in the device’s persistent datastore unless a value > is set for the mandatory leaf that now becomes available as a > result of supporting the feature. > > When modeling as follows it seems the NC server can start with > the model supporting the feature that was not supported before: > > module servers { > > namespace "http://www.example.com/servers"; > > prefix servers; > > import ietf-inet-types { > > prefix inet; > > } > > revision 2018-03-01 { > > description > > "Initial version."; > > } > > feature test-feature { > > description "testing feature"; > > } > > container servers { > > list server { > > key name; > > max-elements 64; > > leaf name { > > type string; > > } > > leaf ip { > > type inet:ip-address; > > mandatory true; > > } > > leaf port { > > type inet:port-number; > > mandatory true; > > } > > container only-if-feature { > > presence "see if this helps"; > > if-feature test-feature; > > leaf only-if-feature { > > type string; > > mandatory true; > > } > > } > > } > > } > > } > > Are recommendations or guidelines in place to deal with this? > > Regards, Bart > > > > > > _______________________________________________ > > netmod mailing list > > netmod@ietf.org <mailto:netmod@ietf.org> > > https://www.ietf.org/mailman/listinfo/netmod >
- [netmod] Guideline on modeling including features… Bogaert, Bart (Nokia - BE/Antwerp)
- Re: [netmod] Guideline on modeling including feat… Alex Campbell
- Re: [netmod] Guideline on modeling including feat… Robert Wilton
- Re: [netmod] Guideline on modeling including feat… Bogaert, Bart (Nokia - BE/Antwerp)
- Re: [netmod] Guideline on modeling including feat… Robert Wilton
- Re: [netmod] Guideline on modeling including feat… Bogaert, Bart (Nokia - BE/Antwerp)
- Re: [netmod] Guideline on modeling including feat… Robert Wilton
- Re: [netmod] Guideline on modeling including feat… Juergen Schoenwaelder