Re: [netmod] Guideline on modeling including features and phased support by a device

Robert Wilton <rwilton@cisco.com> Tue, 06 March 2018 11:59 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 8C6341273B1 for <netmod@ietfa.amsl.com>; Tue, 6 Mar 2018 03:59:29 -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 3kuUSmeZEOd8 for <netmod@ietfa.amsl.com>; Tue, 6 Mar 2018 03:59:27 -0800 (PST)
Received: from aer-iport-1.cisco.com (aer-iport-1.cisco.com [173.38.203.51]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 97AF2120047 for <netmod@ietf.org>; Tue, 6 Mar 2018 03:59:26 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=31208; q=dns/txt; s=iport; t=1520337566; x=1521547166; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to; bh=FZ8Wyqs1MU0DuiuakAsOSfgXCaxjES7wPR49NUZzanY=; b=BWEZBb3VyizWF4Tbn9kBvkTlBpjA32qxGkMa2z2aB+8CZCGOnR8Os6ug kCixW5qVEVewPJWLTPQiPAPSqqXSOzD99R+JH81+HuqLHLa8GJ1YRBqEu ezcOFpoKNOFa+24ZTTDP+JZE6gis5HEVpe+l2Bh1cUZiUtWoKGVzNM5Ho s=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0B0AQAlgZ5a/xbLJq1cGQEBAQEBAQEBA?= =?us-ascii?q?QEBAQcBAQEBAYJaRYEXcCiObI5VMoEWlDSCEgMKGAEKhD5PAoMhNRcBAgEBAQE?= =?us-ascii?q?BAQJrJ4UjAQEBAQMBAStBCxALEQQBAQEgAQYHJx8JCAYNBgIBAReFABCqfyaET?= =?us-ascii?q?IN3giaFLoQFgg+BdoEOgyMLAQGBWwlDhTcEiQmEc4xrCZB4B4kUhWSKe06GDYE?= =?us-ascii?q?uIAE1JoEsMxoIGxU6gkMJglqBZUA3iV+CRwEBAQ?=
X-IronPort-AV: E=Sophos;i="5.47,431,1515456000"; d="scan'208,217";a="2458730"
Received: from aer-iport-nat.cisco.com (HELO aer-core-3.cisco.com) ([173.38.203.22]) by aer-iport-1.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2018 11:59:24 +0000
Received: from [10.63.23.110] (dhcp-ensft1-uk-vla370-10-63-23-110.cisco.com [10.63.23.110]) by aer-core-3.cisco.com (8.14.5/8.14.5) with ESMTP id w26BxOgd032076; Tue, 6 Mar 2018 11:59:24 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>
From: Robert Wilton <rwilton@cisco.com>
Message-ID: <1ee1d963-ad66-6fa8-65fb-902ca23e164b@cisco.com>
Date: Tue, 6 Mar 2018 11:59:24 +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: <AM4PR07MB171668D649123B2F6F21C88194D90@AM4PR07MB1716.eurprd07.prod.outlook.com>
Content-Type: multipart/alternative; boundary="------------F315DFBAB59727E5F9F41F24"
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/HSVxA1dV41zRyUuTdRyG4mtTvrM>
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 11:59:29 -0000

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>om>; 
> 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-feature leaf 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
>