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

Italo Busi <Italo.Busi@huawei.com> Wed, 20 January 2021 14:41 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 B87213A1443 for <netmod@ietfa.amsl.com>; Wed, 20 Jan 2021 06:41:43 -0800 (PST)
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, 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 Fc-dlQGSz230 for <netmod@ietfa.amsl.com>; Wed, 20 Jan 2021 06:41:41 -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 C57823A143D for <netmod@ietf.org>; Wed, 20 Jan 2021 06:41:41 -0800 (PST)
Received: from fraeml711-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4DLSnL3PKfz67dKf; Wed, 20 Jan 2021 22:38:30 +0800 (CST)
Received: from fraeml715-chm.china.huawei.com (10.206.15.34) by fraeml711-chm.china.huawei.com (10.206.15.60) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 20 Jan 2021 15:41:39 +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.006; Wed, 20 Jan 2021 15:41:39 +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//waGg
Date: Wed, 20 Jan 2021 14:41:39 +0000
Message-ID: <0ed5638881af42148720dd7f4843c3e6@huawei.com>
References: <a0c43ab5c3c1463a97a1aa594a80ceee@huawei.com> <20210120094737.g5l5pvfzligahrj6@anna.jacobs.jacobs-university.de> <2384a8f549c94ea0ac46d6c772fbca43@huawei.com> <20210120114446.ovih63db7vmv7c7s@anna.jacobs.jacobs-university.de>
In-Reply-To: <20210120114446.ovih63db7vmv7c7s@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.27.133]
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/wb-byR8yyfuQuJucedoRPSVsz7k>
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, 20 Jan 2021 14:41:44 -0000

Thanks again Juergen,

This was really helpful

I still have one doubt:

> > Does it mean that a server may not use/implement in the operational
> datastore a leaf for which a YANG default statement has been defined?
> >
> 
> RFC 7950 section 7.6.1 mentions describes situations where a leaf is
> conditional, i.e., there is when condition or an if-feature expression or the leaf
> is a case node.
>

What about the case the leaf is not conditional (but still mandatory false since a YANG default statement is defined)?

May the server still decide not to use/implement this leaf in the operational datastore?

For example, in appendix C.1 of RFC8342, auto-negotiation is enabled by default.
What should be the behavior of a system which does not implement auto-negotiation?
Return the value false or no value (in the operational datastore)?

Italo

> -----Original Message-----
> From: Juergen Schoenwaelder [mailto:j.schoenwaelder@jacobs-university.de]
> Sent: mercoledì 20 gennaio 2021 12:45
> To: Italo Busi <Italo.Busi@huawei.com>
> Cc: 'netmod@ietf.org' <netmod@ietf.org>
> Subject: Re: [netmod] Questions about how to assign default values with
> YANG
> 
> On Wed, Jan 20, 2021 at 10:51:09AM +0000, Italo Busi wrote:
> >
> > Does it mean that a server may not use/implement in the operational
> datastore a leaf for which a YANG default statement has been defined?
> >
> 
> RFC 7950 section 7.6.1 mentions describes situations where a leaf is
> conditional, i.e., there is when condition or an if-feature expression or the leaf
> is a case node.
> 
> > What would be the value of defining a YANG default statement for  config
> false leaf?
> >
> 
> Technically, this can happen because a type has a defined default value and
> this type may be used by config false leafs.
> 
> An example is the zero-based-counter32 typedef in RFC 6991. However, this
> style may be debated since it (mis)uses a default statement to define an initial
> value. I am not sure whether the pattern of using default statements for
> specifying intial values is a good one.
> 
> /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/>