[netmod] Re: Defining groupings after the fact? draft-jouqui-netmod-yang-full-include and the reuse of definitions

Jean Quilbeuf <jean.quilbeuf@huawei.com> Tue, 30 July 2024 09:35 UTC

Return-Path: <jean.quilbeuf@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 384B1C14F6A7 for <netmod@ietfa.amsl.com>; Tue, 30 Jul 2024 02:35:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.905
X-Spam-Level:
X-Spam-Status: No, score=-6.905 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=unavailable autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iTkDaRIISxL1 for <netmod@ietfa.amsl.com>; Tue, 30 Jul 2024 02:35:29 -0700 (PDT)
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 DC12DC14F685 for <netmod@ietf.org>; Tue, 30 Jul 2024 02:35:28 -0700 (PDT)
Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4WY94j175bz6K9Gl; Tue, 30 Jul 2024 17:32:53 +0800 (CST)
Received: from frapeml500003.china.huawei.com (unknown [7.182.85.28]) by mail.maildlp.com (Postfix) with ESMTPS id 0CF4C140B30; Tue, 30 Jul 2024 17:35:26 +0800 (CST)
Received: from frapeml500001.china.huawei.com (7.182.85.94) by frapeml500003.china.huawei.com (7.182.85.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 30 Jul 2024 11:35:25 +0200
Received: from frapeml500001.china.huawei.com ([7.182.85.94]) by frapeml500001.china.huawei.com ([7.182.85.94]) with mapi id 15.01.2507.039; Tue, 30 Jul 2024 11:35:25 +0200
From: Jean Quilbeuf <jean.quilbeuf@huawei.com>
To: Alexander L Clemm <ludwig=40clemm.org@dmarc.ietf.org>, "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: [netmod] Defining groupings after the fact? draft-jouqui-netmod-yang-full-include and the reuse of definitions
Thread-Index: AQHa4ey3gH9yIjc1+Umsxy7aCEp/mLIO/0jA
Date: Tue, 30 Jul 2024 09:35:25 +0000
Message-ID: <b0780aa0c8504c93b7d5ff6c837ea697@huawei.com>
References: <e111be29-e825-4357-88e3-19c9b3f87930@clemm.org>
In-Reply-To: <e111be29-e825-4357-88e3-19c9b3f87930@clemm.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [10.206.138.136]
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Message-ID-Hash: KUJTKUE7UVJLMHN6K5BFBIP2G4QK2JM7
X-Message-ID-Hash: KUJTKUE7UVJLMHN6K5BFBIP2G4QK2JM7
X-MailFrom: jean.quilbeuf@huawei.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-netmod.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: [netmod] Re: Defining groupings after the fact? draft-jouqui-netmod-yang-full-include and the reuse of definitions
List-Id: NETMOD WG list <netmod.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/m2YSkNNB-UeenlxhDOaRWI9o8bs>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Owner: <mailto:netmod-owner@ietf.org>
List-Post: <mailto:netmod@ietf.org>
List-Subscribe: <mailto:netmod-join@ietf.org>
List-Unsubscribe: <mailto:netmod-leave@ietf.org>

Hello Alexander, 
I put some answers inline.

> -----Original Message-----
> From: Alexander L Clemm <ludwig=40clemm.org@dmarc.ietf.org>
> Sent: Monday, July 29, 2024 8:22 PM
> To: netmod@ietf.org
> Subject: [netmod] Defining groupings after the fact? draft-jouqui-netmod-yang-
> full-include and the reuse of definitions
> 
> Hello Jean, Benoit, Thomas,
> 
> After your presentation at IETF 120, I looked at your draft
> https://datatracker.ietf.org/doc/html/draft-jouqui-netmod-yang-full-include-
> 02.
> 
> 
> I do have some questions regarding what happens if the embedded module is
> being augmented.  Is the augmentation automatically embedded as well; does
> such embedding need to be explicitly stated?  Is there a way to augment an
> embedded module only within the context of the embedding module?

Yes, as per the example in the slides: if you want ietf-interfaces augmented by ietf-ip, you have to embed them both.

> On a more general note, it strikes me that there is an increased need in reusing
> definitions.  In various forms, we see this in your use cases, in network inventory
> use cases, in schema-mount, in peer-mount.  YANG does not provide good
> support for that, which is somewhat ironic in that it does actually support
> several constructs with reuse and extensibility in mind, from identities to
> groupings.  Hopefully the YANG-next effort will go a long ways towards
> improving definition reuse to that the need for after-the-fact bandaids can be
> avoided.

Fully agree, the full embed as defined here should be a keyword in YANG-next. Similar constructs exist in protobuf and json-schema for instance.

> When it comes to reusing parts of definitions, it seems that a lot of grief could be
> avoided if portions that are to be reused would have been defined as groupings,
> which could then be used wherever needed.  The problem is that the grouping
> construct is rarely used, so many YANG definitions are not available for reuse
> that otherwise might be.

Grouping does not solve everything, you cannot augment a grouping so any augmentation would have to be repeated for each use of the grouping.
I recommend reading the intro of RFC8528 YANG Schema Mount for a detailed description of these reuse issues.

> As a thought, it might be useful to introduce a construct that will allow to define
> a _grouping_ after-the-fact, for later reuse.  I.e., allow groupings to be defined
> in a way that the new grouping embeds an existing definition, then simply make
> use of that grouping.  That would seem perhaps cleanest, able to address many
> of the use cases and have the additional advantage that the semantics here will
> be very clear since part of the exising YANG framework.

There is still the augment issue from above, we have it in draft-ietf-opsawg-collected-data-manifest when reusing ietf-yang-push which augments ietf-subscribed-notifications. All these augments have to be rewritten with paths corresponding to the new location of the uses.

I think the semantics for Schema Mount as defined in RFC8525 is the key to reuse the full semantics of YANG (i.e. not only groupings but also augmentations, rpcs ...) without having to modify existing modules.
What we propose in full embed is just to enable a simplified version of schema mount, for design time.

Best,
Jean
> --- Alex
> 
> 
> 
> _______________________________________________
> netmod mailing list -- netmod@ietf.org
> To unsubscribe send an email to netmod-leave@ietf.org