Re: [netmod] a question about 'when'

"Rob Wilton (rwilton)" <rwilton@cisco.com> Wed, 07 August 2019 15:53 UTC

Return-Path: <rwilton@cisco.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 D1E0412045F for <netmod@ietfa.amsl.com>; Wed, 7 Aug 2019 08:53:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.499
X-Spam-Level:
X-Spam-Status: No, score=-14.499 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.com header.b=O67DxDw2; dkim=pass (1024-bit key) header.d=cisco.onmicrosoft.com header.b=09juY2Gl
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 gIrRTZqbWl5c for <netmod@ietfa.amsl.com>; Wed, 7 Aug 2019 08:53:14 -0700 (PDT)
Received: from alln-iport-2.cisco.com (alln-iport-2.cisco.com [173.37.142.89]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7AFC1120475 for <netmod@ietf.org>; Wed, 7 Aug 2019 08:53:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=33114; q=dns/txt; s=iport; t=1565193194; x=1566402794; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=mvdusH39rimZ2psQW4Pi9wQJKitNmr9nTfBYdYFw9bQ=; b=O67DxDw2OI+krQX3SUdh0GLfF4x9TOeF6EH3xZ+8iK0TQmdP+hvgRnnT foZkHaS8/NMKjjgiE+NLXUjJKOfrk2WcqaNsChb6RU13cljqTQ5Tyq/G0 O7bYaQ86YCDTST4A9hzw8xdCfvMRH3LUMwJ0Nuc0Tk9SlKluFTlbMt3B6 E=;
IronPort-PHdr: 9a23:UH2UjB1G6OSoFswusmDT+zVfbzU7u7jyIg8e44YmjLQLaKm44pD+JxKHt+51ggrPWoPWo7JfhuzavrqoeFRI4I3J8RVgOIdJSwdDjMwXmwI6B8vQE1L6KOLtaQQxHd9JUxlu+HToeUU=
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0ANAAAu80pd/4cNJK1lGgEBAQEBAgEBAQEHAgEBAQGBVAQBAQEBCwGBFS8kLANtVSAECyoKhBSDRwOLM4Jbl12BLoEkA1QJAQEBDAEBGAEKCgIBAYN6RQIXgjsjNQgOAQQBAQQBAQMBCm2FJwyFSgEBAQECAQEBEBEKEwEBLAsBBAcEAgEIEQQBAQEYCAcDAgICJQsUCQgCBA4FCBqDAYEdTQMODwECDKAuAoE4iGBxgTKCegEBBYUSGIIUAwaBNAGLYxeBQD+BV4JMPoJhAQGBKiEYKwkZgjwygiZ4izOCLyARhQaCL5RwCQKCHJQ+gjCWAo8BlkACBAIEBQIOAQEFgVICNIFYcBU7gmyCQoNxhRSFP3KBKYsrAiICB4EEAYEgAQE
X-IronPort-AV: E=Sophos;i="5.64,357,1559520000"; d="scan'208,217";a="306369732"
Received: from alln-core-2.cisco.com ([173.36.13.135]) by alln-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 07 Aug 2019 15:53:13 +0000
Received: from XCH-ALN-011.cisco.com (xch-aln-011.cisco.com [173.36.7.21]) by alln-core-2.cisco.com (8.15.2/8.15.2) with ESMTPS id x77FrDvY004316 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Wed, 7 Aug 2019 15:53:13 GMT
Received: from xhs-aln-002.cisco.com (173.37.135.119) by XCH-ALN-011.cisco.com (173.36.7.21) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 7 Aug 2019 10:53:12 -0500
Received: from xhs-aln-002.cisco.com (173.37.135.119) by xhs-aln-002.cisco.com (173.37.135.119) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 7 Aug 2019 10:53:11 -0500
Received: from NAM05-BY2-obe.outbound.protection.outlook.com (173.37.151.57) by xhs-aln-002.cisco.com (173.37.135.119) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Wed, 7 Aug 2019 10:53:11 -0500
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nht4rfetNKya5cfO3sTLB2iiK/YInFL9Yrofzqawm/sNtjGlHJdWoTkv2MYJ0YjsZ7BqpGO1fg220h3sz9w4YMcEN8ns+26VDsofDEZ+5WZKCEAqQlB/GvsUXybTcLbyWFANOnq8B88sLYEGxvBZ4Jvbc6HYECrgVME8OqlVLKUIAeLEoTDN1sj57iR/n2Um1kXjmgk3lfnnZ/fOEXhE4xedWVwMSiW4enowqDq76fE5XHEyKPqDsGQVG9C1vJPDtPhJe3gtO8QBDkDeXSWMDEownYiNVJlvn4NkeRcr+9UDklUL2+625XqltjJlcwU3UbI8AQr63CUCxLFfnVAvog==
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=mvdusH39rimZ2psQW4Pi9wQJKitNmr9nTfBYdYFw9bQ=; b=eFas/KHOxCziGnHZ0TxN4rhBt1KdnSVZ1ejwo7N+HXdqb0IYQrxcE7lAKUEiiTyo6adY6ZdxypfXIlkzs2vTigVSx1wBPYN7xd/DGT7navWvn/HWd40EbKv9joNnq0qQy5najikACyeRfFZq3qoC5icS1PCsrcxAy8DwvEh0pHvopAMNVY1EgenR+Vj4MLOq/EETOvG1KtoWARxXzyPX1s/fRrxGAS1k7uzbEb3HcgPw+qRSB+JBBDj4MmHJ/vIALMhiqnsmj736GwvJZXLgafViYNBwyuATCZxngmpkLd4pGporEaFlYBYsR4owzQTbIXYOi6J69j9OW5oYDs9LRA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=cisco.com;dmarc=pass action=none header.from=cisco.com;dkim=pass header.d=cisco.com;arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cisco.onmicrosoft.com; s=selector2-cisco-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mvdusH39rimZ2psQW4Pi9wQJKitNmr9nTfBYdYFw9bQ=; b=09juY2GleOkQs4QmSvZPC5M2drSgb9ijLeug1LpmCKVb7rv7DalZGt021Fd2vbwh5uy8g8bAyZVGe9gKzOoNRCQeypS8pJ+uZ5uLu1KjBcilG6yzR4jn9zNONo0XTHCJ8dp7vdGK45I8uX04MiHhFySc/WvKLEMKf9U1ETiYclc=
Received: from BYAPR11MB2631.namprd11.prod.outlook.com (52.135.227.28) by BYAPR11MB2789.namprd11.prod.outlook.com (52.135.228.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.16; Wed, 7 Aug 2019 15:53:10 +0000
Received: from BYAPR11MB2631.namprd11.prod.outlook.com ([fe80::91da:1669:aaf0:d428]) by BYAPR11MB2631.namprd11.prod.outlook.com ([fe80::91da:1669:aaf0:d428%4]) with mapi id 15.20.2136.018; Wed, 7 Aug 2019 15:53:10 +0000
From: "Rob Wilton (rwilton)" <rwilton@cisco.com>
To: Andy Bierman <andy@yumaworks.com>
CC: Ladislav Lhotka <lhotka@nic.cz>, "Fengchong (frank)" <frank.fengchong@huawei.com>, "netmod@ietf.org" <netmod@ietf.org>, "Zhangxiaoping (C)" <zhang.xiaoping@huawei.com>, liuzhiying <liuzhiying@huawei.com>
Thread-Topic: [netmod] a question about 'when'
Thread-Index: AdVLPM5Xmpgaa94hSz6Z+hOvCeCLfwANi6kAAD2D/oAAIoPxAAABScmgAA8qoIAAAB/6IA==
Date: Wed, 07 Aug 2019 15:53:10 +0000
Message-ID: <BYAPR11MB26317E5F1ED33289D07AC440B5D40@BYAPR11MB2631.namprd11.prod.outlook.com>
References: <5756FB984666AD4BB8E1D63E2E3AA3D001EE95B1@DGGEMM533-MBS.china.huawei.com> <87o914gcxn.fsf@nic.cz> <CABCOCHQLqB60o1JJQ24TV_ogZFKS3poJ8PxBZeM4+po==qZqcQ@mail.gmail.com> <8736ide87b.fsf@nic.cz> <BYAPR11MB2631BBE3A5726FBDB016D24DB5D40@BYAPR11MB2631.namprd11.prod.outlook.com> <CABCOCHT_9EhEkdPKiGxAZYEvsDGauDNQw=TMUkm+qZFCRPXr7Q@mail.gmail.com>
In-Reply-To: <CABCOCHT_9EhEkdPKiGxAZYEvsDGauDNQw=TMUkm+qZFCRPXr7Q@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=rwilton@cisco.com;
x-originating-ip: [173.38.220.41]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: c962e889-63f1-4024-7544-08d71b4f591b
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:BYAPR11MB2789;
x-ms-traffictypediagnostic: BYAPR11MB2789:
x-ms-exchange-purlcount: 3
x-microsoft-antispam-prvs: <BYAPR11MB27894BC7C5C76F4E854FCAB6B5D40@BYAPR11MB2789.namprd11.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-forefront-prvs: 01221E3973
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(136003)(346002)(39860400002)(366004)(376002)(53754006)(199004)(52314003)(189003)(13464003)(51444003)(25786009)(53546011)(14444005)(68736007)(9326002)(6916009)(256004)(6246003)(8936002)(11346002)(186003)(446003)(81166006)(81156014)(8676002)(33656002)(486006)(26005)(14454004)(3846002)(966005)(476003)(99286004)(102836004)(5660300002)(76176011)(606006)(6116002)(54906003)(7736002)(7696005)(6506007)(478600001)(74316002)(76116006)(71200400001)(52536014)(66476007)(66556008)(64756008)(66446008)(66946007)(71190400001)(790700001)(53936002)(229853002)(6306002)(2906002)(316002)(54896002)(4326008)(236005)(86362001)(66066001)(6436002)(55016002)(9686003); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR11MB2789; H:BYAPR11MB2631.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1;
received-spf: None (protection.outlook.com: cisco.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info: UjBYlzll/xA6M2qhqG7veaIowvYtZd2cEmzr+2i2juvoAJp5OS9Pgtg1+fhqd11x/jLQa+qFF2DIR1lrQK8M39KD9mle+4zECr8oWiFW2zu/GM3MVyhCu1lZFtwBqJT8wbqAX6MhuWpljXzbIDym/FuPVeCwnwGiUFroKmouYUwcEvNz5ukLnTN9d0nZeA08DaHery2Iq04SPPq4q4hmLpPdlxQXiBi5MvjG+AS9/XnAc4reYqIfBcZ/rz+cAz2X4uqTTa1a0NJ3bs2QVLdcp4yfE2eShvdVQrPs213YmbCur4xtnQR0QOQVgREoigHq0LXokYSc7PDeB6ML5xVzYf5rL5hS66npUXSM+hudLFauBqjNV9ac0XTM6JpydWK2RnoSEpauUeYNNVv+0ZPMAZTdj/E3evI+qI17atFyCW0=
Content-Type: multipart/alternative; boundary="_000_BYAPR11MB26317E5F1ED33289D07AC440B5D40BYAPR11MB2631namp_"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: c962e889-63f1-4024-7544-08d71b4f591b
X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Aug 2019 15:53:10.6393 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5ae1af62-9505-4097-a69a-c1553ef7840e
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: rwilton@cisco.com
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2789
X-OriginatorOrg: cisco.com
X-Outbound-SMTP-Client: 173.36.7.21, xch-aln-011.cisco.com
X-Outbound-Node: alln-core-2.cisco.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/SW0O-P8k1s-zoN_SPsghyRyyPTw>
Subject: Re: [netmod] a question about 'when'
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, 07 Aug 2019 15:53:28 -0000

Hi Andy,

From: Andy Bierman <andy@yumaworks.com>
Sent: 07 August 2019 16:30
To: Rob Wilton (rwilton) <rwilton@cisco.com>
Cc: Ladislav Lhotka <lhotka@nic.cz>; Fengchong (frank) <frank.fengchong@huawei.com>; netmod@ietf.org; Zhangxiaoping (C) <zhang.xiaoping@huawei.com>; liuzhiying <liuzhiying@huawei.com>
Subject: Re: [netmod] a question about 'when'



On Wed, Aug 7, 2019 at 2:07 AM Rob Wilton (rwilton) <rwilton@cisco.com<mailto:rwilton@cisco.com>> wrote:
I can see that 'when automatic deletion' processing can be useful if the configuration is being manipulated by a human.  E.g. if I delete a VRF then all the configuration that references that VRF can magically disappear.  Assuming the server supports config rollback then even if I make a catastrophic mistake, it isn't usually that hard to recover from.

But for a fully automated client, then I agree with Lada, in that I see the server side 'when automatic deletion' processing as unhelpful.  The client logically needs to know/understand the full configuration anyway, so it should be able to generate the complete configuration change required to update the server with a new valid configuration state.  In these scenarios, having the server perform 'when automatic deletion' processing seems to increase the risk that that client and server views of the configuration could end up out of sync.  Some clients simplify the protocol operations by always doing a config replace on every config change to guarantee that the copy of the configuration on the server matches what is in the client.

For clients that exist somewhere between no automation and full automation, then I can imagine that for some cases 'when automatic deletion' processing might be useful, and other cases where it is unhelpful.


I don't see the big distinction between types of clients.
YANG has 2 mechanisms (must and leafref) that will cause an error instead of a silent deletion.
The when-stmt is used to indicate that the subtree is not relevant to the model if the result is false.
[RW]
The definition of a “when” statement is fine (i.e. the subtree becomes invalid if the ‘when’ check fails).  My only issue is with the automatic deletion behaviour that I think is unhelpful at times.

You can easily use must-stmt instead to cause the error behavior instead of deletion behavior.
This should be part of the model design, not left up to server developers.
[RW]
But as a client I would not want the server to silently remove configuration because a when condition became false.  Instead, I would rather do it explicitly and have the server return an error so that I can fix the behaviour of the client.  If the client is aware of the schema then it can also prune config associated with failed when conditions if it wants.

Ultimately, my aim as a client is to get a complete configuration in the client down to the server, and to be sure that the two are consistent.  The ‘when automatic deletion’ behaviour doesn’t help with that, it makes it riskier.  As mentioned previously, this can be mitigated by always sending the entire configuration down as a config replace, at which point I would presume that the ‘when’ statements are evaluated equivalently to ‘must’ statements anyway – although I’m not sure whether RFC 7950 is clear on this.

Personally, I would have preferred that the 'when automatic deletion' processing was controlled via an explicit protocol option, with the default behaviour to just validate when statements (equivalently to must statements) and not perform any automatically config deletion.

There has been nothing preventing anyone from augmenting the operations to turn off auto-deletion.
Is this widely implemented?  Implemented at all?
[RW]
I think that it is as Lada stated, some servers just don’t check must or when statements at all, or don’t perform the automatic deletion.  I’m not advocating that is a good or the right thing to do.  They just don’t comply to that part of the RFC.

Thanks,
Rob



Thanks,
Rob

Andy


-----Original Message-----
From: netmod <netmod-bounces@ietf.org<mailto:netmod-bounces@ietf.org>> On Behalf Of Ladislav Lhotka
Sent: 07 August 2019 08:39
To: Andy Bierman <andy@yumaworks.com<mailto:andy@yumaworks.com>>; Fengchong (frank) <frank.fengchong@huawei.com<mailto:frank.fengchong@huawei.com>>; netmod@ietf.org<mailto:netmod@ietf.org>; Zhangxiaoping (C) <zhang.xiaoping@huawei.com<mailto:zhang.xiaoping@huawei.com>>; liuzhiying <liuzhiying@huawei.com<mailto:liuzhiying@huawei.com>>
Subject: Re: [netmod] a question about 'when'

Andy Bierman <andy@yumaworks.com<mailto:andy@yumaworks.com>> writes:

> On Mon, Aug 5, 2019 at 2:49 AM Ladislav Lhotka <lhotka@nic.cz<mailto:lhotka@nic.cz>> wrote:
>
>> "Fengchong (frank)" <frank.fengchong@huawei.com<mailto:frank.fengchong@huawei.com>> writes:
>>
>> > Hi all,
>> >
>> > I encounter a question about 'when', when I implement yang model
>> associated when condition.
>> >
>> > Yang model:
>> >
>> > leaf password-type {
>> >    type enumeration {
>> >       enum null;
>> >       enum simple;
>> >       enum cipher;
>> >    }
>> > }
>> >
>> > leaf password-text {
>> > type string;
>> > when "../password-type != null";
>> > }
>> >
>> > I config these two leafs as below:
>> > <password-type>simple</password-type>
>> > <password-text>123456</password-text>
>> >
>> > And I changed password-type to null, I get the config like below:
>> > <password-type>null</password-type>
>> >
>> > And then, I reconfig the password-type to simple, what data should
>> > be
>> returned?
>> >
>> > Is
>> >   <password-type>simple</password-type>
>>
>> According to RFC 7950, sec. 8.2, the server deleted "password-text"
>> after you changed "password-type" to null but the original value
>> isn't recovered after you change the type back.
>>
>> This server behaviour means that a typo or similar trivial error may
>> have catastrophic consequences such as auto-deletion of entire
>> configuration subtrees. That's why our RESTCONF implementation
>> (jetconf) does something
>> else: it won't permit you to change "password-type" to null as long
>> as the "password-text" exists.
>>
>>
> It seems odd to optimize the server for client mistakes.

This is just the principle of least embarrassment. The problem is that it is not indicated in the data model that deleting or changing something may have far-reaching consequences.

> It is far more likely (99 to 1?) that the client knows what it is
> doing and expects the standard to be followed.  Consider the burden on
> the client deleting all the "false-when" nodes manually. This is

If it is a significant burden, then it's also quite likely that the client may not be completely aware of what's going to be auto-deleted.

> also inconsistent with the standard behavior for choice-stmt (new case
> deletes the old case automatically).

This is quite different in that the impact is localized: one can easily see that a given leaf is a case in a choice so that it cannot exist along with another case.

Lada

>
> Lada
>>
>>
> Andy
>
>
>> >
>> > Or
>> >
>> >   <password-type>simple</password-type>
>> >   <password-text>123456</password-type>
>> > _______________________________________________
>> > netmod mailing list
>> > netmod@ietf.org<mailto:netmod@ietf.org>
>> > https://www.ietf.org/mailman/listinfo/netmod
>>
>> --
>> Ladislav Lhotka
>> Head, CZ.NIC Labs
>> PGP Key ID: 0xB8F92B08A9F76C67
>>
>> _______________________________________________
>> netmod mailing list
>> netmod@ietf.org<mailto:netmod@ietf.org>
>> https://www.ietf.org/mailman/listinfo/netmod
>>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org<mailto:netmod@ietf.org>
> https://www.ietf.org/mailman/listinfo/netmod

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

_______________________________________________
netmod mailing list
netmod@ietf.org<mailto:netmod@ietf.org>
https://www.ietf.org/mailman/listinfo/netmod