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

Alexander L Clemm <ludwig@clemm.org> Thu, 01 August 2024 20:50 UTC

Return-Path: <ludwig@clemm.org>
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 DB9AEC20797B; Thu, 1 Aug 2024 13:50:16 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.105
X-Spam-Level:
X-Spam-Status: No, score=-2.105 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=clemm.org
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 TNwiwGLVvH8Z; Thu, 1 Aug 2024 13:50:12 -0700 (PDT)
Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 87851C0900AB; Thu, 1 Aug 2024 13:48:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clemm.org; s=s1-ionos; t=1722545325; x=1723150125; i=ludwig@clemm.org; bh=yPolGy0U+W4O7IgZ5dLqhqsL2UsVYdfHaTEAUz+IZdw=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To: References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=dNkaAEZLX9rff9hzULTL1iGTjARnbSzlKmPCFGaChRsZfRFiTQq1+8nmy8lVhKux DWd6JfRM3qNu7VGc+CxwZ2V+gWSnD0qzqxYHdqH25ck5iExk4O2Q4ydaKaZ5R2xo4 QlNpbeQavdK039DtEPjtYYDWS14VosZF2+iPwaC8FU8GZkybzj112bL/9hnR/Pqtu v+6OCm48FjjLdhO0XkByo+mPQlH8tDWrCssDLeJnT0O4sLVBHWBSLZcvCz0MrDu05 XN/BHQ1XgVvkCj8GGMqaD52cuavPuD2avzXE5fbMXQOJk6IcaCx77l7hte1K73rIG RSTfrW1r74fn7BYUXA==
X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6
Received: from [172.16.0.44] ([172.56.46.195]) by mrelay.perfora.net (mreueus004 [74.208.5.2]) with ESMTPSA (Nemesis) id 1MqJRf-1rv0yk27dr-00idvj; Thu, 01 Aug 2024 22:48:45 +0200
Message-ID: <d804e1bf-931a-44dd-a00f-d21606edd2de@clemm.org>
Date: Thu, 01 Aug 2024 13:48:43 -0700
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: "Shiya Ashraf (Nokia)" <shiya.ashraf=40nokia.com@dmarc.ietf.org>, Alexander L Clemm <ludwig=40clemm.org@dmarc.ietf.org>, Jean Quilbeuf <jean.quilbeuf=40huawei.com@dmarc.ietf.org>, "netmod@ietf.org" <netmod@ietf.org>
References: <e111be29-e825-4357-88e3-19c9b3f87930@clemm.org> <b0780aa0c8504c93b7d5ff6c837ea697@huawei.com> <2abcd109-455b-42f3-8529-fb9f3d68321e@clemm.org> <AM9PR07MB77296196896D50A06FC6A1A39CB22@AM9PR07MB7729.eurprd07.prod.outlook.com>
Content-Language: en-US
From: Alexander L Clemm <ludwig@clemm.org>
In-Reply-To: <AM9PR07MB77296196896D50A06FC6A1A39CB22@AM9PR07MB7729.eurprd07.prod.outlook.com>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: quoted-printable
X-Provags-ID: V03:K1:idX8AdykRva2j/x9HRLaiLv+spSyKGyavaAPKmsUxjA7tMlvzng sPrYhxTxgO1B/U3ZtkXYzY/T+dSZpjnKKi4B3yXqQnQ0T3N1kadYXFuZj406HILxVEVC/F6 Hs1gyeETn9R+U63a0OrTatsbtFtG/IJn7aId/E8KRZthTmSVyYtAOnAYt8kRhV2+K1iGN9q fOC3KPOYiKiXYYR4I962w==
UI-OutboundReport: notjunk:1;M01:P0:V9wu3SSVYCk=;qj15lgqMAPKokFnxzfrTOXzypQS 2tazMpeTsuAMRvlidYPkugUDH/vkr3yX98GfQpKmH8pZ9ohYUD5xqDeoyYVix7BHVy0Qokyax 9PGTjsUB83Pf3wBIYaMCmNGNe1EdyQk79uLs7nVdxUG/nK6LAGZQd6OESaLwuVGgBAw3mZKg2 1YL9ESPg8cwCccVNav65QHCbqmHKhLIqjJxywwyIek5NlPVmosle7+BNoha+NsW9XkFaXwP87 PuOTT0V5pKeaxPTlUo0aByDSyXedTjQW6wis9C3DVTXkKASlMZKJHdB+J20lCwCgNpbbk7pZD xhaOO4Q1mQBVU7vcjF4V4Vw1e80SJGCEGDuuEO2Wf1bp5/c73unm+M1dBbRgLKFaRBfXb71dj c5LCMAJ7hVmIPTSg9UYPU/1YdR7RiWFLaYRF8c7bTnQ3ehQOEXzFcOAFBeTMHQUKErRJ5kMwc oJ17gzCMfWBH9NU1Hc5ZRp+2gT35BLIfA5NHC+5w4WvutyonkmoranarQVDGHq0zXbxvjlMTO deD+bHpCMJEx7zxQpZRe6i0kyxJVonivR19Wab94FqwLnXPMpbo7dxRE124JkOKdfr6nY/aK3 tY78aKk3xQmVnoALIWLXhZr0B7+bm4FQ2U5Ukd9piZy9kxFt5/6aR6H+dh1erUlPEgM0cS3Wq 5tkUcNXJJErio3+qUOpq6NTIYe4tjNr+h2Z/DBMGKvD/eit3c8mlb20+FdOAd9TVrbRHOdtJq veBKhMCZZg6JOLetimwTPNZLmmO4jA4nw==
Message-ID-Hash: QRQIL37C75F3HOL4JD6IGFJUIJHMXPVM
X-Message-ID-Hash: QRQIL37C75F3HOL4JD6IGFJUIJHMXPVM
X-MailFrom: ludwig@clemm.org
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/ntugHq2vNl1WlK8KnnlHt_Ay3jU>
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 Shiya,

re your comment on the "Once models have been defined this way, they
cannot be altered after the fact":  Well, I guess as William has pointed
out, it is possible to update a model with another, equivalent model
which pulls data node definitions into groupings and then uses those
groupings.  That would be a compatible change.  The same groupings will
then also be free for other models to use.  However, even in that case,
an update to the original model is still required - you cannot simply
say "let me use these data definitions from that other models", they
need to be defined as a grouping (or per Jean's proposal in the draft,
you define a new construct that would let you "use" aka embed
definitions without the need for a grouping to be defined).

Cheers

--- Alex

On 8/1/2024 2:20 AM, Shiya Ashraf (Nokia) wrote:
> Hi Alex,
>
> "<AC> Correct, you cannot augment a grouping.  However, you can define a second grouping and then use both groupings.  I do think that with properly designed modules that make extensive use of groupings 99+% of reuse scenarios would be covered. "
> <Shiya> Thanks for bringing this point up and I tend to fully agree here. In fact when I was reading the schema mount RFC where it starts with the short comings of "grouping", I also felt that there could be use-cases where some of these aspects of the groupings can turn out to be its strengths. For eg: for cases where you need greater control on what you want to embed on the mounted tree, for instance, only a selection of the augments from the original module or add new augments only on the embedding context etc. So though schema-mount/full-embed are very good solutions for reusability of existing YANG modules for certain use-cases with its own advantages, for many cases the existing methods based on groupings might do the job and in a much more simpler way.
>
> But then you say: " Once models have been defined this way, they cannot be altered after the fact."
> <Shiya> Could you explain more on this? Technically, One can still define a new grouping with all the data nodes that are today in a standard module and then replaces the content of the standard module with a simple uses statement of the new grouping with out causing a backward compatibility issue or any functional change, can’t we ?
>
> Thanks,
> Shiya
>
> -----Original Message-----
> From: Alexander L Clemm <ludwig=40clemm.org@dmarc.ietf.org>
> Sent: Thursday, August 1, 2024 12:37 AM
> To: Jean Quilbeuf <jean.quilbeuf=40huawei.com@dmarc.ietf.org>; netmod@ietf.org
> Subject: [netmod] Re: Defining groupings after the fact? draft-jouqui-netmod-yang-full-include and the reuse of definitions
>
> [You don't often get email from ludwig=40clemm.org@dmarc.ietf.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information.
>
>
>
> Hi Jean,
>
> thank you - quick replies in line
>
> --- Alex
>
> On 7/30/2024 2:35 AM, Jean Quilbeuf wrote:
>> 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-i
>>> nclude-
>>> 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.
> <AC> I.e., you would need to augment the embedding module as well to embed the augmentation.  The aumentation of the embedding module would then include a new "embed" statement to for the augmentation of the module that had been originally embedded. Correct?
>>> 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.
> <AC> Cool. </ALEX>
>>> 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.
> <AC> Correct, you cannot augment a grouping.  However, you can define a second grouping and then use both groupings.  I do think that with properly designed modules that make extensive use of groupings 99+% of reuse scenarios would be covered.  The problem of course that in general groupings are used only sparingly and in cases where the need for reuse becomes obvious already within the same model.  Once models have been defined this way, they cannot be altered after the fact.  That is one of the shortcomings in YANG today, that it makes it easy to define models that are not as reusable as they should.  </AC>
>>> 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.
> <AC> I don't think that would be an issue, actually.  Just declare modular, fine grained groupings and use those.  Of course, this is somewhat a speculative discussion as YANG is what it is and does not support this today.  This discussion probably belongs in YANG next.
> Perhaps I'll put together some slides at some point to illustrate what I mean. </AC>
>> 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
> <AC> Cheers, Alex </AC>
>>> --- Alex
>>>
>>>
>>>
>>> _______________________________________________
>>> netmod mailing list -- netmod@ietf.org To unsubscribe send an email
>>> to netmod-leave@ietf.org
> _______________________________________________
> netmod mailing list -- netmod@ietf.org
> To unsubscribe send an email to netmod-leave@ietf.org
> _______________________________________________
> netmod mailing list -- netmod@ietf.org
> To unsubscribe send an email to netmod-leave@ietf.org