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

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Wed, 10 March 2021 18:33 UTC

Return-Path: <J.Schoenwaelder@jacobs-university.de>
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 B75993A1555 for <netmod@ietfa.amsl.com>; Wed, 10 Mar 2021 10:33:46 -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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=jacobsuniversity.onmicrosoft.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 XDX6ElZiFMRk for <netmod@ietfa.amsl.com>; Wed, 10 Mar 2021 10:33:44 -0800 (PST)
Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70045.outbound.protection.outlook.com [40.107.7.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B6E103A1552 for <netmod@ietf.org>; Wed, 10 Mar 2021 10:33:42 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YFB5Vqeea+/yxLjM+QWOiprRJjgRiX905LgZkpAIY069yqrYWMi060UHzNk38CGDswV0KoPje7s7ECOamNnNiI6bqR1Z8o/fvHp26Lso2DWGa9GzSeiZ8ul+9cPkJ02H0m2uNxdr8Vdf5FC5oo8eVwZGnvY5JyEQD2Et6X+joISKgnbg8amb10z7PiVComeSEHCaMYxyARFi/SoHuPEXOoET107rxo27D5so4jmUOnPXI2KLQcMSc2QiX4WVzaYl5VRca/Hz7cwONdwz64wAFq4bk6XWtVpSEeJ9Wf23mZbZhb9JjDKUaSi7bwhf4IO/h5VL48b2Salg2w++wWreVA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cK8Dk7I6t9C4v7mS70l5McTCLzP6c7t7L43llgVDhNQ=; b=JzmaQHZovg0fnWAy+PXnXpmQ+Iw1vGkGfdyyW/OWwOiofHFv4GO2TRhUUOXVjYXAQjF/miyz4b6mZv4acO3bQN29wayiejTkVsvkiu1djwC1SL4E5jy1NfmdRlRpi3AtwxDA1jOqVJoCVAqaoinsxOSaucszWr24/rmgT40S4OUYKk904jxLsYu/De80r1R92+PKm537rKtWcfhLnKNHOkmoPG++eL2F5FBpsa1eqDH/sM4Z5xqrtDJzUWOjyppBmyOIp/cvLngu0UWkXFxAUv/E0ESWkomayovnsuqDVxzoF4iXn6jNKZfMKRTqKv/UUL74iK5de++DctgAomHfDA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=jacobs-university.de; dmarc=pass action=none header.from=jacobs-university.de; dkim=pass header.d=jacobs-university.de; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jacobsuniversity.onmicrosoft.com; s=selector2-jacobsuniversity-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cK8Dk7I6t9C4v7mS70l5McTCLzP6c7t7L43llgVDhNQ=; b=TrxE2udw14yTE2Ca4JzfRXqHXbd4Ze/XglNpqgvkUFOS4Bi7lUhT7kSd/CvFjRSyhyy+UcmBRQz3BmtJXsAn/AvSeycNurhz8rhBMoGv7aJZ8WULNQZ2fiyJ+WR93sXC9pBobMC4SIzYE/WNNKixM6b+lKQ+9eSsoRdq3tgdBY8=
Authentication-Results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=jacobs-university.de;
Received: from AM0P190MB0641.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:194::23) by AM9P190MB1346.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:26d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.19; Wed, 10 Mar 2021 18:33:39 +0000
Received: from AM0P190MB0641.EURP190.PROD.OUTLOOK.COM ([fe80::e8a2:9886:8dfa:41c6]) by AM0P190MB0641.EURP190.PROD.OUTLOOK.COM ([fe80::e8a2:9886:8dfa:41c6%4]) with mapi id 15.20.3912.030; Wed, 10 Mar 2021 18:33:39 +0000
Date: Wed, 10 Mar 2021 19:33:38 +0100
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Italo Busi <Italo.Busi@huawei.com>
Cc: "netmod@ietf.org" <netmod@ietf.org>
Message-ID: <20210310183338.bdkozhpsu67rp7u5@anna.jacobs.jacobs-university.de>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: Italo Busi <Italo.Busi@huawei.com>, "netmod@ietf.org" <netmod@ietf.org>
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>
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <53a7042e5b1a47b7a3122c56a7900ac7@huawei.com>
X-Originating-IP: [212.201.44.244]
X-ClientProxiedBy: AM0PR05CA0086.eurprd05.prod.outlook.com (2603:10a6:208:136::26) To AM0P190MB0641.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:194::23)
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
Received: from localhost (212.201.44.244) by AM0PR05CA0086.eurprd05.prod.outlook.com (2603:10a6:208:136::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17 via Frontend Transport; Wed, 10 Mar 2021 18:33:39 +0000
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: e0811461-339a-4708-e0bc-08d8e3f3065f
X-MS-TrafficTypeDiagnostic: AM9P190MB1346:
X-MS-Exchange-Transport-Forked: True
X-Microsoft-Antispam-PRVS: <AM9P190MB1346E23E1084AF3A6DB25D25DE919@AM9P190MB1346.EURP190.PROD.OUTLOOK.COM>
X-MS-Oob-TLC-OOBClassifiers: OLM:10000;
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: zavyWqsTUogzoBu4Sa2rt5lCwVv2uhUbvpHUTxS/qTBLyztzFbePkI73OAf/yaZUH6uTgklhziSNGajwb4t+OXmAnotljryvYe6sinqy3GRL5o3YDwKoIX+R9fyup7o3MECtTd00+BPLwWx8W8bBTwYMt7nrJJiFafsW+UszEowkrQJa4WxzRYM9H0CnnSlTosiK9pMW3Aq2trd8tbrPB8KJiyD73kvd/ln7xeL10GaI/RXHWEEQ4z2F0NSU0kOG744YGIx5Y77AmvaueT0ZZhQwzwV/pZ3+o4Xj6sEy9dIBJcdaUz17zjKPgVuBAUTwooagPGsJ1Z5jj9qn78YBvxHoLRfXg001+QoV+wYCVSxxrLxHvM+5WA2uC6Jo/s50lef5NykaN5DeSoSkAfn0MKFGuNfeyfNOQNtJRgZdUCVMYV3+ULJSkSm32KaFrT1lCRzYR6RLFJlDrJRMQMvNsWe7Vh1Hb10mU4RVO/RyzqunKj0NArnOt9Rbox1aEglGfXo60+4rfDpD/zo8qT8TP+x4aRHOBDQJzea7mGTVzq7JrOTz7ASir3Y7lSNnWbN8DDI2W1wCxHj0RM995JpqObqqmW+7MrvCF35MBkX3i/A=
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0P190MB0641.EURP190.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(39850400004)(346002)(136003)(396003)(376002)(366004)(3450700001)(1076003)(6486002)(5660300002)(52116002)(478600001)(8936002)(8676002)(6916009)(186003)(83380400001)(86362001)(16526019)(956004)(66476007)(2906002)(66556008)(4326008)(66946007)(6496006)(316002)(786003)(26005); DIR:OUT; SFP:1101;
X-MS-Exchange-AntiSpam-MessageData: DktM4/X3+Nwzqm3rNMp/PkFgW/JpaeQuovJvW0mxgl8lXsMw90yuuxOYMMaRQfKlFaBTdIvSo6zOgdoSPLbuGbw7lgsiG6Pgt5J6pSM89VgIkGTjcr7PawXd3YUkWVBTd2SjFm2SGUlE8XyfKEOmAzkOblxG6kMdkUevt+K7tazy5MKWneat7wpYseSL3Yd94Twbu0EfWOtW5w5yEMBPh4F5vP8J15NcGnWT1MRKp4SvhJNrMkKoMaeSCBJNxRPOx1pfCZGjvZOtRUaJ4aR/WtM1ApNr/oLCzxe+/FXPzBkuo+fPGSBj1OgWvFualna4x8kIVdcwqBIwgaNgusG0DqE7uCZ1sr4krkfEmJ3EAbucX6YCh8SyZYtnQRpsCRXQazCMmVC3fS4LCEHtm2uNqR0QaByYDbN6tIxdN2pX/CRgnI9Lo92WHjo6Qu5d0qAKWqWgMKxuG8rvEeTSqmZPbx6J4KyqQ+HcYqMTxmeDkJuKPvYwVQxSfCqDKUFWWR5W88ArO1xm7IVFklh9z7fw5F+tMCY8YimyhF85QnSITzz7HyRohzDjwicOUMiVsSkTftVOa3ZICKshe13WoJAfABy5CKKgOJiVUE4ig8EZxZVR/phRV4gUL14yRHzWyo3+W8GvEP8vpFUysDPEHomaiVTbM3zUADVZI6cbAHjiefMDW55xlY4RUsmdGKclAnFm6pLbpyFJt/RDUQpNcoNpOwWZQ1PDFNQFpYqk4RFPeyc9mpbnDOO8IblWISTR3brA6sCXv4/4Ur7m8FbNy8RUXeSlDN7d3+CGXNI1ZROgUKUMzCmcg39z6nsqg93H9BznlKyAoE+9SBniwdNzLdimpiJkRS58g/rEuJ8ZqiNu97yZVIrjAyP8RJXHRak6LXlpkwZWWRv6xZ4IxRSQ1wi0G+Xqo0ynKQ/26B2Ab32NvrGDBtGcGOOYykNiO1cw+YooQ6fiwiHSsx02YuI0+EwJ4sBUAnbWWcPk9NUuwBUz/M1MelnLtfP1zvv5lMtaw7pLIVg2JHPREc2yqIzE1omLeVKTdDqjGeLz8iVcgnor4hi/ydiK/twfWXhf6i7jLUuSGBuhTl8IWn8j+JpRqIycV4VeHXO8HXqLLJAPsoge5v67YmBf1A+VM/K+Jf7VzfLZCm5PY8aItaT784iAaiTnsv6G2ye8iQSJ97IEAYDxHlPDBGpIL+FeiID6oZbzrjRZfTZ7UONgIJ3cz5y2jodWOXEO3lok+9I9JRuVDfL4swYH+DSpXdbLXw9B5TDUfQ5tgEExB5YSol4Zc1I7XGrt1+lWAYB/oc08xfO01ccArVxeQkE6QxvvKqzz2y16JnCg
X-OriginatorOrg: jacobs-university.de
X-MS-Exchange-CrossTenant-Network-Message-Id: e0811461-339a-4708-e0bc-08d8e3f3065f
X-MS-Exchange-CrossTenant-AuthSource: AM0P190MB0641.EURP190.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2021 18:33:39.8003 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f78e973e-5c0b-4ab8-bbd7-9887c95a8ebd
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: E7YV0m2ixEOod3FfrQZ6s+2HBj5EDfarsBgm/pTC6sV6Gs1oquhbYFMoUSzzXwheQ/DRBNJC5U21uUCMhL47qdKRx2nsuZdGlVPs4wlGc+Y=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9P190MB1346
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/HseVV2Mb1cll5zA3c3xX61MTTYE>
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 18:33:47 -0000

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/>