Re: [netmod] nmda-guidelines-01: value space for config vs state

Ladislav Lhotka <lhotka@nic.cz> Wed, 26 July 2017 10:46 UTC

Return-Path: <lhotka@nic.cz>
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 BE8FA131FEE for <netmod@ietfa.amsl.com>; Wed, 26 Jul 2017 03:46:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham autolearn_force=no
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 bmAqDxG0QHaY for <netmod@ietfa.amsl.com>; Wed, 26 Jul 2017 03:46:31 -0700 (PDT)
Received: from trail.lhotka.name (trail.lhotka.name [77.48.224.143]) by ietfa.amsl.com (Postfix) with ESMTP id 879E0131FE9 for <netmod@ietf.org>; Wed, 26 Jul 2017 03:46:31 -0700 (PDT)
Received: by trail.lhotka.name (Postfix, from userid 109) id 62AB51820F79; Wed, 26 Jul 2017 12:48:26 +0200 (CEST)
Received: from localhost (unknown [195.113.220.110]) by trail.lhotka.name (Postfix) with ESMTPSA id 3FBE41820F75; Wed, 26 Jul 2017 12:48:23 +0200 (CEST)
From: Ladislav Lhotka <lhotka@nic.cz>
To: "Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com>, Kent Watsen <kwatsen@juniper.net>, "Acee Lindem (acee)" <acee@cisco.com>, "netmod@ietf.org" <netmod@ietf.org>
In-Reply-To: <HE1PR07MB0843C91DB10D0FE0F744BA459BB80@HE1PR07MB0843.eurprd07.prod.outlook.com>
References: <D59BCE00.B9FE5%acee@cisco.com> <AM2PR07MB0836F2130A88CADF2B19BD4B9BBB0@AM2PR07MB0836.eurprd07.prod.outlook.com> <D59BD1D1.B9FFB%acee@cisco.com> <683087D8-C766-4917-A43B-43B319A43466@juniper.net> <HE1PR07MB0843C91DB10D0FE0F744BA459BB80@HE1PR07MB0843.eurprd07.prod.outlook.com>
Date: Wed, 26 Jul 2017 12:46:26 +0200
Message-ID: <m2h8xzzda5.fsf@birdie.labs.nic.cz>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/0sdi1DrzttrezCbsiVRYCOR6eVE>
Subject: Re: [netmod] nmda-guidelines-01: value space for config vs state
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: Wed, 26 Jul 2017 10:46:36 -0000

"Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com> writes:

> OK – so the same leaf (in the schema) has the same value space in the conventional datastores and in the operational datastore.  That probably makes sense since a single schema describes the model for that leaf whether it is accessed in conventional DSes or the operational DS.
>
> But I think that also means that *if* you need slightly different
> value spaces for an item, then you’ll need to split it into multiple
> leafs in the schema.

This is easier said than done: will there be "foo" and "foo-state" as
sibling leaves, both present in <operational>, as sec. 4.7 indicates?

Apart from value space mismatch, there are other potential issues like
the one that I mentioned in Prague: "if-feature" applies to
configuration but not to state data. An example is in ietf-routing: in
config, "router-id" leaf is only present if "router-id" feature is
advertised (other servers derive router-id by other means), but in state
data "router-id" does not depend on the feature.

The assumption made in NMDA that config and state data schemas can be
unified is IMO simply broken. YANG, being basically a document-oriented
schema language, is not designed to support such tricks.

Lada

>
> Jason
>
> From: Kent Watsen [mailto:kwatsen@juniper.net]
> Sent: Monday, July 24, 2017 20:53
> To: Acee Lindem (acee) <acee@cisco.com>; Sterne, Jason (Nokia - CA/Ottawa) <jason.sterne@nokia.com>; netmod@ietf.org
> Subject: Re: [netmod] nmda-guidelines-01: value space for config vs state
>
>
> Related, revised-datastores-03#section-4.7 says:
>
>    As a result of remnant configuration, the semantic constraints
>    defined in the data model cannot be relied upon for <operational>,
>    since the system may have remnant configuration whose constraints
>    were valid with the previous configuration and that are not valid
>    with the current configuration.  Since constraints on "config false"
>    nodes may refer to "config true" nodes, remnant configuration may
>    force the violation of those constraints.  The constraints that may
>    not hold include "when", "must", "min-elements", and "max-elements".
>    Note that syntactic constraints cannot be violated, including
>    hierarchical organization, identifiers, and type-based constraints.
>
> The last sentence implies that the value-space must be the same between
> nodes in <operational> and the conventional datastores.
>
> Kent // contributor
>
>
> On 7/24/17, 4:35 PM, "netmod on behalf of Acee Lindem (acee)" <netmod-bounces@ietf.org<mailto:netmod-bounces@ietf.org> on behalf of acee@cisco.com<mailto:acee@cisco.com>> wrote:
>
> Hi Jason,
>
> From: "Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com<mailto:jason.sterne@nokia.com>>
> Date: Monday, July 24, 2017 at 4:32 PM
> To: Acee Lindem <acee@cisco.com<mailto:acee@cisco.com>>, "netmod@ietf.org<mailto:netmod@ietf.org>" <netmod@ietf.org<mailto:netmod@ietf.org>>
> Subject: RE: [netmod] nmda-guidelines-01: value space for config vs state
>
> Hi Acee,
>
> OK – maybe this example isn’t the best.  But in the general case my concern about using a super-set would be that it implies all those values are valid input values for an edit-config in the candidate/running.  I can’t immediately see a clean way to indicate that some of the values aren’t valid for writing.
>
> Another possible approach we could use is that if the value space is different, then it means we should have separate leafs.   The model designer could have 1 typedef for the common values (i.e. for applied/intended config), and then use a union with additional values for the state/operational leaf that supports the extra values.
>
> Right – if there additional values that the leaf can take, then it is probably pure operational state as opposed to applied config.
>
> Thanks,
> Acee
>
>
> Jason
>
> From: Acee Lindem (acee) [mailto:acee@cisco.com]
> Sent: Monday, July 24, 2017 16:22
> To: Sterne, Jason (Nokia - CA/Ottawa) <jason.sterne@nokia.com<mailto:jason.sterne@nokia.com>>; netmod@ietf.org<mailto:netmod@ietf.org>
> Subject: Re: [netmod] nmda-guidelines-01: value space for config vs state
>
> Hi Jason,
>
> From: netmod <netmod-bounces@ietf.org<mailto:netmod-bounces@ietf.org>> on behalf of "Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com<mailto:jason.sterne@nokia.com>>
> Date: Monday, July 17, 2017 at 6:22 AM
> To: "netmod@ietf.org<mailto:netmod@ietf.org>" <netmod@ietf.org<mailto:netmod@ietf.org>>
> Subject: [netmod] nmda-guidelines-01: value space for config vs state
>
> Hi all,
>
> A note in Rob Wilton’s presentation today in rtgwg mentioned something about consistency in the value space for config vs state leafs.  The NMDA approach results in the same leaf for both config & state in many cases (at least for the cases where the separate config & state leafs were only there to represent intended vs applied config).
>
> But aren’t there some cases where the value space for state will be different than the value space for config ?  I’m thinking of the basic admin/oper state for interfaces for example where config may allow enable/disable but state may have additional values like ‘testing’.  If the config & state value spaces aren’t 100% the same, are module designers recommended to create a separate state leaf ?
>
> In this particular example, the leaf you are describing would be read-only system state as opposed to applied state. If there were such a leaf that could take on a wider range of values of applied state values than the intended state, I’d expect the value space would need to be the superset.
>
> Thanks,
> Acee
>
>
> Rgds,
> Jason
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod

-- 
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67