[netmod] Use of unrestricted string in YANG (was RE: naming scope of a grouping which uses a grouping)

Italo Busi <Italo.Busi@huawei.com> Thu, 12 January 2023 12:38 UTC

Return-Path: <Italo.Busi@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 69662C1BE863 for <netmod@ietfa.amsl.com>; Thu, 12 Jan 2023 04:38:17 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.197
X-Spam-Level:
X-Spam-Status: No, score=-4.197 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham 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 Q-G0ObZ2Q0Ab for <netmod@ietfa.amsl.com>; Thu, 12 Jan 2023 04:38:15 -0800 (PST)
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 30778C151542 for <netmod@ietf.org>; Thu, 12 Jan 2023 04:38:15 -0800 (PST)
Received: from frapeml500008.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Nt3tH0TdYz67tWW; Thu, 12 Jan 2023 20:35:35 +0800 (CST)
Received: from frapeml500007.china.huawei.com (7.182.85.172) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 12 Jan 2023 13:38:13 +0100
Received: from frapeml500007.china.huawei.com ([7.182.85.172]) by frapeml500007.china.huawei.com ([7.182.85.172]) with mapi id 15.01.2375.034; Thu, 12 Jan 2023 13:38:13 +0100
From: Italo Busi <Italo.Busi@huawei.com>
To: Andy Bierman <andy@yumaworks.com>, Martin Björklund <mbj+ietf@4668.se>
CC: "ietfc@btconnect.com" <ietfc@btconnect.com>, "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: Use of unrestricted string in YANG (was RE: [netmod] naming scope of a grouping which uses a grouping)
Thread-Index: AdkmgIopkIErVeSEQRGUQfAUi9iURw==
Date: Thu, 12 Jan 2023 12:38:13 +0000
Message-ID: <cb2ab59f5e0f4142b7d7f2c23d8accba@huawei.com>
Accept-Language: it-IT, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [10.203.246.111]
Content-Type: multipart/alternative; boundary="_000_cb2ab59f5e0f4142b7d7f2c23d8accbahuaweicom_"
MIME-Version: 1.0
X-CFilter-Loop: Reflected
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/eP6wVNQmTBGmC3ru3Nts571YasA>
Subject: [netmod] Use of unrestricted string in YANG (was RE: naming scope of a grouping which uses a grouping)
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.39
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, 12 Jan 2023 12:38:17 -0000

I have seen the comment from Tom about the unrestricted string in YANG on other drafts in WG LC or WG adoption poll and I would like to understand what is the position of the Netmod WG on this issue


Using unrestricted string is quite common practice in existing IETF standard YANG models, also as in key attributes (e.g., see RFC8343). However, the comments looks valid and it is worthwhile investigating it further
From the previous discussion I have understood that Martin does not think this is an issue while Andy agrees with Tom …

I have a mixed feeling about the resolution but I think this is something to be documented either in RFC7950 (update) or in RFC8407 (update)

For integers, RFC7950 defines different built-in types for 8-bit, 16-bit and 64-bit integers, while for string there is only one type and the length sub-statement is optional

While it is true that unrestricted strings can cause an implementation to run out of memory, it is also true that in some cases it is not trivial to define the maximum length for a string attribute

Moreover, I am not sure whether restricting the strings would solve the out of memory: what happens if a huge YANG list is configured?

What is your view/opinion about using the string type in IETF standard YANG models?

Thanks, Italo

From: Andy Bierman <andy@yumaworks.com>
Sent: mercoledì 21 dicembre 2022 00:30
To: Martin Björklund <mbj+ietf@4668.se>
Cc: ietfc@btconnect.com; netmod@ietf.org
Subject: Re: [netmod] naming scope of a grouping which uses a grouping



On Mon, Dec 19, 2022 at 5:15 AM Martin Björklund <mbj+ietf@4668.se<mailto:mbj%2Bietf@4668.se>> wrote:
tom petch <ietfc@btconnect.com<mailto:ietfc@btconnect.com>> wrote:
> From: Martin Björklund <mbj+ietf@4668.se<mailto:mbj%2Bietf@4668.se>>
> Sent: 19 December 2022 12:18
> To: tom petch
>
> tom petch <ietfc@btconnect.com<mailto:ietfc@btconnect.com>> wrote:
> > draft-ietf-opsawg-sap-12
> > defines a grouping sap-list which uses grouping sap-entry.  The groupings are intended for import by service specific modules.  The uses does not include a prefix; should it?
>
> From a YANG perspective this is correct.  Since it references a
> grouping in the local module, the prefix is optional.
>
> <tp>
> But it will not be the local module when it is used in other modules which is the only reason it is a grou[ing

It doesn't matter how sap-list is used; it is well-defined in the
module ietf-sap-ntw.  See section 5.4 in RFC 7950.


/martin


>
> module ietf-sap-vpn
>  prefix sap-vpn
> import ietf-sap-ntw
>  prefix sap
> container sap-l2vpn
>
> list l2vpn-service
>  uses sap:sap-list
> .....
>
> Does it need to know where to find sap-entry which sap-list 'uses' without a prefix?
>
> Tom Petch
>
> > The module also has my favourite YANG construct, an unrestricted string as a YANG key.
>
> I don't think that this is a problem.  Or rather, if the theory is
> that we need to have restricted length on strings b/c otherwise an
> implementation may run out memory, then I don't think this solves that
> problem.  But perhaps there is some other reason?
>

There is an argument to be made that it is better to pick a reasonable length
and a reasonable character set for an administrative string (going back to SnmpAdminString)
That way, every implementation MUST support the same set of strings (modulo resource errors).

I have the same reaction as Tom when I see 'string' as a key.
Really? The server accepts zero-length identifiers, all-whitespace identifiers, and much worse...
Probably not.


>
> /martin


Andy

>
> >
> > Copying Martin as he performed a YANG Doctor review earlier in 2022.
> >
> > Tom Petch

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