Re: [netmod] Use of unrestricted string in YANG (was RE: naming scope of a grouping which uses a grouping)
Andy Bierman <andy@yumaworks.com> Fri, 13 January 2023 17:13 UTC
Return-Path: <andy@yumaworks.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 6025CC1522DD for <netmod@ietfa.amsl.com>; Fri, 13 Jan 2023 09:13:59 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.094
X-Spam-Level:
X-Spam-Status: No, score=-2.094 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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=yumaworks.com
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 CRrYxq9lsTci for <netmod@ietfa.amsl.com>; Fri, 13 Jan 2023 09:13:55 -0800 (PST)
Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 08BEAC1524B5 for <netmod@ietf.org>; Fri, 13 Jan 2023 09:13:54 -0800 (PST)
Received: by mail-lf1-x134.google.com with SMTP id cf42so34051810lfb.1 for <netmod@ietf.org>; Fri, 13 Jan 2023 09:13:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=V1U9YQajOs3/jag2tpB++JkD657VbRP5IyyOuQNEuqU=; b=JH37HMems4wG4CDXglnweCmSCe1oFnsGBSIikR2VNQIPcOFUY0KUQxFBuhUnnSGck7 Z+KIJhBwrdDHS4p/sYdgUFM/doeNKtI3yYM/gaQiY1D4fo5w7oYv9Pa195aMCppXKc3X grjP61hRcwPqgErD6ps0yLl2SNLBYWMMkGlN0HybkP97IT8aXCKVjo+ILP0fED7y/DtW iusgA3SRvMOJL3h9uvZWHfhhhhAtMW7yd4ZxVKeOODHz5wGqgXckZB5fEnRK7EohXz07 swjr7p4aUkDSkSOOZu6TPp4vAHnkDyyd9UKL2xLEGgp0C8QtlnsdLcacmaevZpJhK0zR sMBg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=V1U9YQajOs3/jag2tpB++JkD657VbRP5IyyOuQNEuqU=; b=eTR5TwNrtw96veTPD5SU6ihHPLoyah/+Wgwsz9HrR86Bz0f08hlnB1GCzUZ7cj7m+F astsT903ZWzIn6OPfLzDMgCCXf9G3fCMW58ksCGyMd6GlCM3OMLRi9kE/jE3XGMisr1h 8Mk4+MPF/EGI35LJSRbPGAFzJYgd+lyBIpjEkqoO5VJwb1RWeKUzwwR5kBjFQJ6DfCDp FUEHjwwjOaIscTkTfjI5QLsceRlylttDAZFJq+DHH2zgUefM6d3uue3FL6YrI5X4a6t2 ynhggQheCYKc1J7Cd92t31kfFSniuPW/+FWoWzAMaJbALYYY+mgIrJh9Xx5GRx3LxBGs 5Z+g==
X-Gm-Message-State: AFqh2koVCu2xeUoiKDcrppaG8Hv3PpD9C8iwRXPxXLqed52dZNvvRAWq XVhCiii5VaBx3UIyhDu3TnFL8szk6vjOaKSuFvitjw==
X-Google-Smtp-Source: AMrXdXvrbKL3kt6rovWibJYIReLrELJidv2aI9tBZH/JkaWABb0r+zOHCxKwQc/zoC4FL4MvQC+C4x1rcnkz6v4caq4=
X-Received: by 2002:a05:6512:31d0:b0:4b5:5b36:28b6 with SMTP id j16-20020a05651231d000b004b55b3628b6mr9096044lfe.4.1673630032714; Fri, 13 Jan 2023 09:13:52 -0800 (PST)
MIME-Version: 1.0
References: <cb2ab59f5e0f4142b7d7f2c23d8accba@huawei.com> <20230112154557.p2oiqjeke77jl7y7@anna> <BY5PR11MB4196474E5153B229D51909A6B5C29@BY5PR11MB4196.namprd11.prod.outlook.com>
In-Reply-To: <BY5PR11MB4196474E5153B229D51909A6B5C29@BY5PR11MB4196.namprd11.prod.outlook.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Fri, 13 Jan 2023 09:13:41 -0800
Message-ID: <CABCOCHQfZ4HYpsHL0uVDHO2tA3HuPRg1U0pJNDQ29F9B1WKhxg@mail.gmail.com>
To: "Rob Wilton (rwilton)" <rwilton=40cisco.com@dmarc.ietf.org>
Cc: Jürgen Schönwälder <j.schoenwaelder@jacobs-university.de>, Italo Busi <Italo.Busi=40huawei.com@dmarc.ietf.org>, "netmod@ietf.org" <netmod@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000095ef9205f2285b60"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/YHp96zohaFPWGXxn3JoVmfFpUGY>
Subject: Re: [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: Fri, 13 Jan 2023 17:13:59 -0000
On Fri, Jan 13, 2023 at 8:19 AM Rob Wilton (rwilton) <rwilton= 40cisco.com@dmarc.ietf.org> wrote: > > > > -----Original Message----- > > From: netmod <netmod-bounces@ietf.org> On Behalf Of Jürgen Schönwälder > > Sent: 12 January 2023 15:46 > > To: Italo Busi <Italo.Busi=40huawei.com@dmarc.ietf.org> > > Cc: netmod@ietf.org > > Subject: Re: [netmod] Use of unrestricted string in YANG (was RE: naming > scope > > of a grouping which uses a grouping) > > > > My take is that arbitrary limites are worse than no limits. > > Robust implementations will reject values that go beyond certain > > implementation and platform specific limits. > > > > If anything makes sense to standardize, then it is the minimum lengths > > that must be supported, for which we do not really have formal syntax. > [Rob Wilton (rwilton)] > > +1. > > It is quite likely that implementations will choose some reasonable limit > for most of these unlimited strings, so it isn't really that they are > unlimited, but the limit is set by the implementation rather than at the > generic API. Of course, even with YANG, an implementation could deviate > all of these unlimited length string leaves to indicate what the actual > limit is. Whether this would be genuinely helpful or end up just being > noise by hiding "real deviations" in a sea of noise is unclear to me. > > And I agree with Juergen, that from an interop perspective, knowing the > minimum length that all implementations are expected to support may do more > to improve interoperability. E.g., knowing that all server implementations > are expected to support interface descriptions of 256 bytes may be more > helpful than knowing that some implementations limit them to 1 Mb. > > One possible implementation strategy is to let the operator decide how to use up the device memory and just start failing if it runs out. Here is the YumaPro implementation-specific internal limits: https://docs.yumaworks.com/en/latest/cli/netconfd-pro.html#max-strlen IMO this text in RFC 7950 should apply to string values for identifiers: https://www.rfc-editor.org/rfc/rfc7950#section-6.2 Implementations MUST support identifiers up to 64 characters in length and MAY support longer identifiers. This does not prevent a YANG module from using a pattern or length-stmt that is less than 64 bytes. > Rob > > // No hats. > > > > > > /js > Andy > > > > On Thu, Jan 12, 2023 at 12:38:13PM +0000, Italo Busi wrote: > > > 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 > > > > > _______________________________________________ > > > netmod mailing list > > > netmod@ietf.org > > > https://www.ietf.org/mailman/listinfo/netmod > > > > > > -- > > Jürgen Schönwälder Constructor University Bremen gGmbH > > Phone: +49 421 200 3587 Campus Ring 1 | 28759 Bremen | Germany > > Fax: +49 421 200 3103 <https://www.jacobs-university.de/> > > > > _______________________________________________ > > netmod mailing list > > netmod@ietf.org > > https://www.ietf.org/mailman/listinfo/netmod > _______________________________________________ > netmod mailing list > netmod@ietf.org > https://www.ietf.org/mailman/listinfo/netmod >
- [netmod] Use of unrestricted string in YANG (was … Italo Busi
- Re: [netmod] Use of unrestricted string in YANG (… Carsten Bormann
- Re: [netmod] Use of unrestricted string in YANG (… Andy Bierman
- Re: [netmod] Use of unrestricted string in YANG (… Jürgen Schönwälder
- Re: [netmod] Use of unrestricted string in YANG (… Jürgen Schönwälder
- Re: [netmod] Use of unrestricted string in YANG (… Andy Bierman
- Re: [netmod] Use of unrestricted string in YANG (… Italo Busi
- Re: [netmod] Use of unrestricted string in YANG (… Andy Bierman
- Re: [netmod] Use of unrestricted string in YANG (… Rob Wilton (rwilton)
- Re: [netmod] Use of unrestricted string in YANG (… Andy Bierman
- Re: [netmod] Use of unrestricted string in YANG (… tom petch
- Re: [netmod] Use of unrestricted string in YANG (… Italo Busi
- Re: [netmod] Use of unrestricted string in YANG (… Andy Bierman
- Re: [netmod] Use of unrestricted string in YANG (… Carsten Bormann
- Re: [netmod] Use of unrestricted string in YANG (… tom petch
- Re: [netmod] Use of unrestricted string in YANG Martin Björklund