Re: [netmod] Questions about how to assign default values with YANG
Italo Busi <Italo.Busi@huawei.com> Wed, 10 March 2021 19:24 UTC
Return-Path: <Italo.Busi@huawei.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 9347E3A1645 for <netmod@ietfa.amsl.com>; Wed, 10 Mar 2021 11:24:48 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.9
X-Spam-Level:
X-Spam-Status: No, score=-6.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] 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 GRX_L6IUTa1q for <netmod@ietfa.amsl.com>; Wed, 10 Mar 2021 11:24:46 -0800 (PST)
Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2B0BB3A163F for <netmod@ietf.org>; Wed, 10 Mar 2021 11:24:46 -0800 (PST)
Received: from fraeml708-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Dwhjt6KPpz67nbJ; Thu, 11 Mar 2021 03:20:18 +0800 (CST)
Received: from fraeml715-chm.china.huawei.com (10.206.15.34) by fraeml708-chm.china.huawei.com (10.206.15.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 10 Mar 2021 20:24:43 +0100
Received: from fraeml715-chm.china.huawei.com ([10.206.15.34]) by fraeml715-chm.china.huawei.com ([10.206.15.34]) with mapi id 15.01.2106.013; Wed, 10 Mar 2021 20:24:42 +0100
From: Italo Busi <Italo.Busi@huawei.com>
To: 'Juergen Schoenwaelder' <j.schoenwaelder@jacobs-university.de>
CC: "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: [netmod] Questions about how to assign default values with YANG
Thread-Index: AdbvCmZgzen+a6G4QWicT/glaRAynP///QGA///e3yCAAEHcAP//waGggACHKYD/tcyd8BK8WnuAAACoPAD//yMQoP/99AcA//vNQxD/95QgAP/vD80Q/94RSgD/vA358A==
Date: Wed, 10 Mar 2021 19:24:42 +0000
Message-ID: <94eaf06f5bb9463081f0129a4aec7b99@huawei.com>
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>
In-Reply-To: <20210310183338.bdkozhpsu67rp7u5@anna.jacobs.jacobs-university.de>
Accept-Language: it-IT, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [10.47.94.173]
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-CFilter-Loop: Reflected
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/oDF0_0QOX9PvX2GY9Boy67_F14o>
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:24:49 -0000
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. Italo > -----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] Questions about how to assign default va… Italo Busi
- Re: [netmod] Questions about how to assign defaul… Juergen Schoenwaelder
- Re: [netmod] Questions about how to assign defaul… Italo Busi
- Re: [netmod] Questions about how to assign defaul… Juergen Schoenwaelder
- Re: [netmod] Questions about how to assign defaul… Italo Busi
- Re: [netmod] Questions about how to assign defaul… Juergen Schoenwaelder
- Re: [netmod] Questions about how to assign defaul… Italo Busi
- Re: [netmod] Questions about how to assign defaul… Andy Bierman
- Re: [netmod] Questions about how to assign defaul… Ladislav Lhotka
- Re: [netmod] Questions about how to assign defaul… Ladislav Lhotka
- Re: [netmod] Questions about how to assign defaul… Andy Bierman
- Re: [netmod] Questions about how to assign defaul… Ladislav Lhotka
- Re: [netmod] Questions about how to assign defaul… Italo Busi
- Re: [netmod] Questions about how to assign defaul… Juergen Schoenwaelder
- Re: [netmod] Questions about how to assign defaul… Andy Bierman
- Re: [netmod] Questions about how to assign defaul… Italo Busi
- Re: [netmod] Questions about how to assign defaul… Juergen Schoenwaelder
- Re: [netmod] Questions about how to assign defaul… Ladislav Lhotka
- Re: [netmod] Questions about how to assign defaul… Andy Bierman
- Re: [netmod] Questions about how to assign defaul… William Lupton
- Re: [netmod] Questions about how to assign defaul… Ladislav Lhotka
- Re: [netmod] Questions about how to assign defaul… Italo Busi
- Re: [netmod] Questions about how to assign defaul… William Lupton
- Re: [netmod] Questions about how to assign defaul… Andy Bierman
- Re: [netmod] Questions about how to assign defaul… Juergen Schoenwaelder
- Re: [netmod] Questions about how to assign defaul… Italo Busi
- Re: [netmod] Questions about how to assign defaul… Juergen Schoenwaelder
- Re: [netmod] Questions about how to assign defaul… Italo Busi
- Re: [netmod] Questions about how to assign defaul… Andy Bierman