Re: [netmod] question about unprefixed path in leafref

tom petch <ietfc@btconnect.com> Thu, 10 February 2022 16:34 UTC

Return-Path: <ietfc@btconnect.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 43F393A0D8D for <netmod@ietfa.amsl.com>; Thu, 10 Feb 2022 08:34:24 -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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=btconnect.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 TbPg7jMXs4BR for <netmod@ietfa.amsl.com>; Thu, 10 Feb 2022 08:34:20 -0800 (PST)
Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20708.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1b::708]) (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 A5DAA3A0D9A for <netmod@ietf.org>; Thu, 10 Feb 2022 08:34:14 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n2FhdODPqmCPeHkBEpVqUqMMlpS023WP0HbQrXJjLsAdykWEjpJuOoUNRJS9SoYCz9icmcbCxvOx7Kdwv8ScIBIobXolXY6wK7F8cznkUnv0Oj37m5kDnd6VWrzaN2zlemHx6Z4sEFzOZd1bgp1ZDxT4Xh4kMAZ/lfCsqOuedF+QSrxrr5iyc1j2OBWaToGXYtv0KbAma9nbop8r6N0TdaFEkuey2pFy1GIiQ+DssgXBePzDUrhhcB9074YwkVExgLqR503HNcJsvgCBhrGZYhY450pszNGorqAFZOW2ikNNztzIJR+T5fgeN9Z2cHOAE+ylbgwlZCwJW33zgSgxMw==
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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vy0xZ24vJUhNGdCOnk58R7XQWOOuBH8vemOZd7oVo+U=; b=KQ0W/FUTM8E0e7XmLZyT0yu+tgIl8f8irIjkaONUT4g1YeP03ZoNvBXZLoQtx2t7s1FnOWTfSG64vwBCD+jhk+BFJr3BkVczQ2t1xCAQlxLL2FfDbWpQFB26mXX81Wu7myU4mSKYEdboQBRaRtcbsqPFMWK+4ato/t53hx56Y9Kxl3uXZ2HyspwPG/ByIQHLH5OC0g60UeopAFhoqhxmjr+mv1wDKV0p8O4FLdBAPnu1jzSaSUe3gnCMMBg3GJAWiFnftDAsdv+SyiFWXhIyOv9b/o9YXyRp0cN6LHpoPrgdok0dGnrU/68rpZKp0BxcAC+TNfWrnF+BKpuropMw7w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=btconnect.com; dmarc=pass action=none header.from=btconnect.com; dkim=pass header.d=btconnect.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=btconnect.onmicrosoft.com; s=selector2-btconnect-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vy0xZ24vJUhNGdCOnk58R7XQWOOuBH8vemOZd7oVo+U=; b=lw+4VAnGEjXnjLIpOX1WonC1qZB9OYye6dGjDpf9mg1MUQHvo7nwQ1nPugH2pmoMZthCOooTYKUc0DovyqluAFku6NooJ8Ety06JfZFlhGLlfVnGbv2cVHTU4NJqnLWltcY3J3JpJCPNFgTdi8CzUW7YhZCdQfsVpxq4evRVqbk=
Received: from AM7PR07MB6248.eurprd07.prod.outlook.com (2603:10a6:20b:134::11) by AM6PR07MB5240.eurprd07.prod.outlook.com (2603:10a6:20b:3b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.6; Thu, 10 Feb 2022 16:34:07 +0000
Received: from AM7PR07MB6248.eurprd07.prod.outlook.com ([fe80::4fb:7a5:68d8:a33a]) by AM7PR07MB6248.eurprd07.prod.outlook.com ([fe80::4fb:7a5:68d8:a33a%6]) with mapi id 15.20.4975.011; Thu, 10 Feb 2022 16:34:07 +0000
From: tom petch <ietfc@btconnect.com>
To: Ladislav Lhotka <ladislav.lhotka@nic.cz>, "Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com>, Jernej Tuljak <jernej.tuljak@mg-soft.si>, "Fengchong (frank)" <frank.fengchong=40huawei.com@dmarc.ietf.org>, "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: [netmod] question about unprefixed path in leafref
Thread-Index: Adgck9MwG/qknU6FTZy7nQGK6GtDkgA/cgUAAECDtIAAANR9gAABKNN1
Date: Thu, 10 Feb 2022 16:34:07 +0000
Message-ID: <AM7PR07MB62488AC9406F9F8F85B074B0A02F9@AM7PR07MB6248.eurprd07.prod.outlook.com>
References: <70d5c82cf41042e28aa71cfd39a147ab@huawei.com> <fd4bdca6-ba49-493a-4d2a-fe70dd3941f6@mg-soft.si> <DM6PR08MB5084A75FA033B6C10B91B52F9B2F9@DM6PR08MB5084.namprd08.prod.outlook.com> <87v8xmd88k.fsf@nic.cz>
In-Reply-To: <87v8xmd88k.fsf@nic.cz>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
suggested_attachment_session_id: d1a61fe6-864f-e3e6-a9b5-7edef637e821
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=btconnect.com;
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 39de145c-34d2-4c0a-9634-08d9ecb328a5
x-ms-traffictypediagnostic: AM6PR07MB5240:EE_
x-microsoft-antispam-prvs: <AM6PR07MB524016F475F2B337CFF02DBEA02F9@AM6PR07MB5240.eurprd07.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:9508;
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: //KKF86Re0JRvIzXUxalq0J31ZFandLIBhhsXLUltZumGAID9dZRdnkvL3CdnyFhZpZi4RMsbprX0WcgENqkskOfKspIGF/o8uSvDaNexLxfhCTmybIm3xCiQ211a7nQjXq1FvnwRfYA8wS1l2khowREz6ypnlfu8pNQwaqv+V+q25bM5iUc73pZiVDhkKleurkCqBvcVvBPmQ9TtoSw04kgMif7Hg4dbglbjxTapjLCqTD8ilVjKkf99uDHXHAwbX0XrjSb+tMIM79kQhoBqJ1bD0qbeGcxQeY6qI81/d7gVrhYmjc/WdkygVUTaGRf58SK39hkq4pAWW202OGKTgEYMiX7Ivu3SdpDIkPGNpQqTQgniIcWN1be+a5gkZtfoY8MTMa3+bfONWfsrgxMStIIIk57GUYx+EqDsP6S8WDUr9RZYFEPDwDD3T1h+VQaJ77OS4h+dM6sDze3BsBuWRUc+qyxLDGMiJ/72YrKDzvqSu7j0BQx8ZG1VYq3fsBYGakksdLkOWz51LtyNi/VGns1d0ZY9DJOb8pY0pfp5uWYCszRp3ppd1icVXB9wO3I41iW8lQXu2ZjDkFyAUApR9t5nV5KUbPil/SDyum/2nvQ2e6ZUZsyNWC9+F+pcn9go5+UPC/EiZwLa0aH84v0pPSI8TvWQPiBAh+nmeSp4xp4aCyb1J4FF9LsImHdeZdshGQUEfOMDvzBMWqDu/LvG8Bd8Hdi6RtTcgU95XAtVb0GeEfjaFywH1QWhTLFe/mO3fQdTryyUdeNCf9hegMVG8UqcGxiNZkAQ+Kdxifc5L36J/SPyD8FpiBCzrO1qJybUYZprGh5MWZYCFBDMwHpUqZaYINhVVisBnV/ppP1IME=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR07MB6248.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(9686003)(2906002)(186003)(26005)(55016003)(38070700005)(86362001)(83380400001)(966005)(82960400001)(316002)(91956017)(76116006)(508600001)(38100700002)(66946007)(33656002)(122000001)(66556008)(66476007)(66446008)(64756008)(8676002)(71200400001)(5660300002)(53546011)(6506007)(7696005)(52536014)(8936002)(110136005)(21314003); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 61695nUhkAS+zd1akyyXGpPsdZ5rZX5jy/LJsQ5/IyV9znp65/U4Ls/WhsXvZLjBP4aZV23/jrkPTOUZjUOGGc1YT+aop4XlthyGFfvJpY9/g11pyFsdjz3f4jA2JHnvp+c1nJ2vKFSCC5eD8hBRfCt4hEhpfgrpC8vTheNNC1NS4BMgK1+A0qANBwIlcxu060nGGpBX/Gab8ghV2Fp1noxNJ06fyzIteepN6xcgWB3/kBEZxLu4tMY/77Rx26IAVjpZrOAbUd8fTaMgleFFkGS4ihxXjR1zuPJnNgypjZl/HIgOp4kVUJzRJReAyqOK8oEiHQJusvG5L+CY8cIl6O0kJLuklr0wMpRWjzNMUd4kYFKA0bs4waEhgEHOP1lUhZfCFirWQykaU20FFtGVlU8FE7iGRMQfCzHQP0AQeVys06erDO40ILAKUlX+sc6cUgmsxZEXRhIV6z22qqh1uGBnNpB5Y4DCRxTEMxf0Gk7zlZ8XpmQe8aZRVCLgJy8SSiUvFPBziVrXWxWoYmYHpndmkMKTCjqvydlw4WJ3Brxl3eo+VrL37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-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: btconnect.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: AM7PR07MB6248.eurprd07.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 39de145c-34d2-4c0a-9634-08d9ecb328a5
X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Feb 2022 16:34:07.3471 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: cf8853ed-96e5-465b-9185-806bfe185e30
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: /94lqbftR2cm3/mrbts0jYXGGUpX7JHaTBp47mfb13Z1r6gSx6u0NmPPoFHzLMNcPMOKPnyM1a6oLR6jISu+Vw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR07MB5240
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/CjNMTvelmxsC_J8bWxtPvOEinMQ>
Subject: Re: [netmod] question about unprefixed path in leafref
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: Thu, 10 Feb 2022 16:34:24 -0000

From: netmod <netmod-bounces@ietf.org> on behalf of Ladislav Lhotka <ladislav.lhotka@nic.cz>
Sent: 10 February 2022 15:58

"Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com> writes:

> This immediately made me worried about all such xxx-ref constructs in YANG that I've seen in a few modules.
>
> But looking at IETF interfaces https://datatracker.ietf.org/doc/html/rfc8343 I see that this error is avoided because interface-ref is fully qualified right ?
>

RFC 8407, sec 4.2:

   o  The local module prefix SHOULD be used instead of no prefix in all
      path expressions.

This is particularly important for typedefs that are intended to be used in other modules.

<tp>

I cannot recall which I-D triggered it but this point was hammered home, at least to me, some time back, a year or two perhaps, and I have looked out for it ever since.  It was probably a TEAS I-D that gave different results with different validators.

Tom Petch
Lada

>      typedef interface-ref {
>        type leafref {
>          path "/if:interfaces/if:interface/if:name";
>        }
>        description
>          "This type is used by data models that need to reference
>           interfaces.";
>      }
>
> Jason
>
> From: netmod <netmod-bounces@ietf.org> On Behalf Of Jernej Tuljak
> Sent: Wednesday, February 9, 2022 3:47 AM
> To: Fengchong (frank) <frank.fengchong=40huawei.com@dmarc.ietf.org>; netmod@ietf.org
> Subject: Re: [netmod] question about unprefixed path in leafref
>
>
> On 08/02/2022 03:40, Fengchong (frank) wrote:
> Hi all,
>
> In RFC7950 sec6.4.1 says:
>
>
> o  Names without a namespace prefix belong to the same namespace as
>
>       the identifier of the current node.  Inside a grouping, that
>
>       namespace is affected by where the grouping is used (see
>
>       Section 7.13<https://datatracker.ietf.org/doc/html/rfc7950#section-7.13>).  Inside a typedef, that namespace is affected by
>
>       where the typedef is referenced.  If a typedef is defined and
>
>       referenced within a grouping, the namespace is affected by where
>
>       the grouping is used (see Section 7.13<https://datatracker.ietf.org/doc/html/rfc7950#section-7.13>).
>
> But in module openconfig-aft-network-instance:
>
>   augment "/oc-ni:network-instances/oc-ni:network-instance/" +
>           "oc-ni:afts/oc-ni:next-hops/oc-ni:next-hop/oc-ni:state" {
>
>     description
>       "Add leaves that require referencing of a network instance to the
>       operational state parameters of a next-hop within the AFT for IPv4
>       unicast.";
>
>     uses aft-nexthop-ni-state;
>   }
>
>   grouping aft-nexthop-ni-state {
>     description
>       "Operational state parameters relating to a next-hop which reference a
>       network instance.";
>
>     leaf network-instance {
>       type oc-ni:network-instance-ref;
>       description
>         "The network-instance within which the next-hop should be resolved.
>          When this leaf is unspecified, the next-hop is resolved within
>          the local instance.";
>     }
>   }
>
> The typedef network-instance-ref is defined in module openconfig-network-instance:
>
>   typedef network-instance-ref {
>     type leafref {
>       path "/network-instances/network-instance/config/name";
>     }
>     description
>       "A re-usable type that can be referenced within other
>        modules that references a network instance.";
>   }
>
> The leafref’s path is a unprefixed path.
>
> So, according RFC7950, the typedef network-instance-ref is referenced in leaf network-instance, and the leaf is inside grouping aft-nexthop-ni-state, and this grouping is used in augment "/oc-ni:network-instances/oc-ni:network-instance/" +
>           "oc-ni:afts/oc-ni:next-hops/oc-ni:next-hop/oc-ni:state"
> So the path "/network-instances/network-instance/config/name" ‘s namespace is module openconfig-aft-network-instance’s namespace. But in fact, there is no node called network-instances with namespace: http://openconfig.net/yang/aft/ni.
>
> Is it incorrect?
>
> I try to use pyang to compile it, and no error is reported.
>
> These modules are written in YANG 1.0, therefore RFC6020 applies, not RFC7950. This was one of the cases where RFC6020 was unclear, hence new text you quote from RFC7950. If you change openconfig-network-instance to YANG 1.1, pyang should report an error for that "path" when the "typedef" gets used in openconfig-aft-network-instance.
>
> Jernej
>
>
>
> 本邮件及其附件含有华为公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件!
> This e-mail and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!
>
>
>
>
> _______________________________________________
>
> netmod mailing list
>
> netmod@ietf.org<mailto:netmod@ietf.org>
>
> https://www.ietf.org/mailman/listinfo/netmod
>
> _______________________________________________
> netmod mailing list
> 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
https://www.ietf.org/mailman/listinfo/netmod