Re: [netmod] Questions about how to assign default values with YANG

Andy Bierman <andy@yumaworks.com> Wed, 10 March 2021 19:46 UTC

Return-Path: <andy@yumaworks.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 8840D3A1678 for <netmod@ietfa.amsl.com>; Wed, 10 Mar 2021 11:46:45 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.887
X-Spam-Level:
X-Spam-Status: No, score=-1.887 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, T_SPF_PERMERROR=0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.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 PqBj70dCWoqO for <netmod@ietfa.amsl.com>; Wed, 10 Mar 2021 11:46:43 -0800 (PST)
Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D897F3A1684 for <netmod@ietf.org>; Wed, 10 Mar 2021 11:46:42 -0800 (PST)
Received: by mail-lj1-x22c.google.com with SMTP id q14so27192075ljp.4 for <netmod@ietf.org>; Wed, 10 Mar 2021 11:46:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XdUY/TeztA0IAErLqvfUQvYGECGzs9nHgDp4jcNkH4c=; b=mDIdQtTZFO5a/JGudCXRdHGWIVsW3jpERPVlJhPUmebln/2asbNwN4AlhoTLu1cjC0 SzV/zsgQQ/e6g0umFT4YFTcL8LaZmBIy3fI0bgTYH2uqnVSLwM34x2Ih7AYyCoKsAOlk 8U3/fH5aR7ELYWIUdde6eJyU/YR2xd+GRyBmuNvFSVewyIm4kO2PmRiOsO56ZYdkBNKj YcPUpbJ8O9tKOlj7HbHFY+nLqSppWh0WMsVKP/SNoDrUT/ZapownXvdpGpBzJuOsXwYt Esx0OO93zqGcMBEk5doHSZjLdqb3zbYDiLGZYr+yTnexKoXJPPYtrvXerl1baRgxzuqf /5NQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XdUY/TeztA0IAErLqvfUQvYGECGzs9nHgDp4jcNkH4c=; b=WeirDmlD8E9+3IgM98AvZT3igvl9crRoqDVLG5EOiiDuZnJOSpJo52SvMitFuPOI/R Fs6hHuPD9v1QKX5GIMPHtl9EuaGnGwXaJpbj/Jt7phO70MVyx10HMwa6Wg7YFQwRhI5y oHUt8c/NLZi/W2W6ZkxEnwevF8DcnE46r+udT7hSa8AigQw7xXYGWWK+ZWs4bMEwhTAm +KI69rnEGGNX/geh1Y7DGmHaaYfxRjT3/N7f6R7jHrqGoAka4D2BgHG24zePN0Ds/bbN VZgLVQh1LJPAezd3DGpwdl2u50ORU4bH+nVLgFwdkkbu567wnR8N2x/3Fcsf6Xm+IPaM c+Fg==
X-Gm-Message-State: AOAM533BQ3TmtCma/5YDMMt5qR41ImfJJqOt9OEKT0ic/kHZswyA9VN5 0eQ6pXPpcVOqChLN/QtgnaCfuJaVpUGKpQ3+fczKpg==
X-Google-Smtp-Source: ABdhPJyv3uzI7wnd9X77AMA6wbHeZRIkrdXVy/nU0/fcjBHkmejB6wtKucsfJNfnpYg0nxs3NSl1NtxHb4rG3U29xeM=
X-Received: by 2002:a2e:9157:: with SMTP id q23mr2835704ljg.298.1615405600229; Wed, 10 Mar 2021 11:46:40 -0800 (PST)
MIME-Version: 1.0
References: <0ed5638881af42148720dd7f4843c3e6@huawei.com> <20210120160517.hsg5dnpidvrprtso@anna.jacobs.jacobs-university.de> <521a9ccd02e14d178a6e62971b4809ea@huawei.com> <20210309195241.k5lfmdnw2zqq6b4o@anna.jacobs.jacobs-university.de> <CABCOCHQkTsToyZ3qW3am41s3m7VLYt=pAdjBMuR0cMCwahbekg@mail.gmail.com> <bbbd4244a0474c48b3fdecb791cb936a@huawei.com> <CABCOCHTpfX6DDZM3Lhd+wx6ZFCgpsWp+Yb2jDTUYa9Zd8tvWqA@mail.gmail.com> <3a5eea68b8554cbe9ed3e8bc63652ffc@huawei.com> <20210310161454.du65fbe4kot7jrfd@anna.jacobs.jacobs-university.de> <53a7042e5b1a47b7a3122c56a7900ac7@huawei.com> <20210310183338.bdkozhpsu67rp7u5@anna.jacobs.jacobs-university.de> <94eaf06f5bb9463081f0129a4aec7b99@huawei.com>
In-Reply-To: <94eaf06f5bb9463081f0129a4aec7b99@huawei.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Wed, 10 Mar 2021 11:46:29 -0800
Message-ID: <CABCOCHRTaST_v0VFxU_FChWDNJvkXWyaR81kKx4TW57YrzqSRw@mail.gmail.com>
To: Italo Busi <Italo.Busi@huawei.com>
Cc: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>, "netmod@ietf.org" <netmod@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000f85edd05bd33eca2"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/7qNQsNOCmZkHkp1BVfxGD7R7fqk>
Subject: Re: [netmod] Questions about how to assign default values with YANG
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
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, 10 Mar 2021 19:46:46 -0000

On Wed, Mar 10, 2021 at 11:24 AM Italo Busi <Italo.Busi@huawei.com> wrote:

> Hi Jurgen,
>
> Now I can understand your concerns :)
>
> > If all clients are in an
> > NMDA world, the issue is much smaller - it is reduced to "does the client
> > believe the server has a bug or not".
>
> Yes, I was assuming that all the clients and the server were
> NMDA-compliant. It seems worthwhile spelling out this requirement more
> explicitly when defining the work-around.
>
> I think that the solution would also work if the client and the server
> follows the guidelines of section 2 of draft-dsdt-nmda-guidelines-01: in
> this case the behavior of the NMDA module in the running DS would be fully
> compliant with RFC8342, while the non-NMDA module would be an exact copy of
> the operational DS (the client needs to read within this module to get the
> in-use value).
>
> Otherwise, I am not sure how can an non-NMDA client properly operate over
> an NMDA server: the values reported by the server in the running DS do not
> necessarily represent the values in use by the system.
>
> > But even then, I continue to believe that
> > a leaf changing the semantics of another leaf is bad design.
>
> I agree: I am just looking for a reasonable work-around that could work
> when it is not possible to remove an existing YANG default statement.
>
> The lesson-learnt from this discussion is that more care has to be taken
> when defining YANG default statements.
>
>
Or the lesson could be that the concept and implementation of YANG module
conformance
is still "under construction". You want to deviate from the old conformance
and
require a new conformance instead.

In SMIv2, model conformance can be per use-case, not just per-module
and explicit conformance statements are used, instead of conformance
implied by the
YANG statements themselves.

In this case, conformance to the new module is desired (without the YANG
default)
instead of conformance to the old module (with the YANG default). A server
cannot
advertise both modules, unless it also declares that it deviates from the
old module conformance.
(deviate delete default)

A new client finds the new module + the old module + the deviation.
An old client finds the old module and the deviation (if YANG compliant).
An old client thinks the server is deviating from the old module conformance
(because that is exactly what is happening).


Andy


>
> > -----Original Message-----
> > From: Juergen Schoenwaelder [mailto:j.schoenwaelder@jacobs-university.de
> ]
> > Sent: mercoledì 10 marzo 2021 19:34
> > To: Italo Busi <Italo.Busi@huawei.com>
> > Cc: netmod@ietf.org
> > Subject: Re: [netmod] Questions about how to assign default values with
> > YANG
> >
> > On Wed, Mar 10, 2021 at 05:34:41PM +0000, Italo Busi wrote:
> > > Juergen,
> > >
> > > I think you have got the problem: "a data model author thought the
> default
> > is always 0 and later he/she realizes that in some contexts the default
> should
> > be something different"
> > >
> > > Unless I am missing something, creating a new leaf (e.g., foo-new)
> would
> > confuse an existing client.
> >
> > No, it does not confuse the client, the client will ignore it.
> >
> > > For example, within the operational DS, the value of foo will be set
> to 0 (as
> > per YANG default statement) while the value of foo-new will be set to 10,
> > which represents the actual value in use by the system.
> >
> > Yes, a new implementation will have to declare that it does not implement
> > foo.
> >
> > > Now, the existing client, which is not aware of foo-new, when reading
> the
> > value of foo in the operational DS will incorrectly think that the
> actual value
> > in use by the system is 0 rather than 10.
> >
> > A client reading <operational> knows the value in use. But clients do
> not have
> > to real operational.
> >
> > > Am I missing anything?
> > >
> > > Instead, if we can find a magic way to apply the value 10 to foo
> within the
> > operational DS, the existing client can read the value of foo in the
> operational
> > DS and correctly understand that the actual value in use by the system
> is 10
> > (even if this is not the default value of foo).
> >
> > In general, you can't assume that clients read operational. I can't
> judge the
> > specific circumstances but in traditional NC/RC, a default statement can
> be
> > interpreted as "assume the default value is in force if this lead is not
> > configured" (unless the client uses RFC 6243 report-all). If all clients
> are in an
> > NMDA world, the issue is much smaller - it is reduced to "does the client
> > believe the server has a bug or not". But even then, I continue to
> believe that
> > a leaf changing the semantics of another leaf is bad design.
> >
> > /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/>
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>