Re: [netmod] Pattern statements [was Re: Query about augmenting module from submodule in YANG 1.0]

Ladislav Lhotka <lhotka@nic.cz> Wed, 23 August 2017 19:45 UTC

Return-Path: <lhotka@nic.cz>
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 D81351323FD for <netmod@ietfa.amsl.com>; Wed, 23 Aug 2017 12:45:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.999
X-Spam-Level:
X-Spam-Status: No, score=-6.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nic.cz
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 1ggU20cV6zcD for <netmod@ietfa.amsl.com>; Wed, 23 Aug 2017 12:45:18 -0700 (PDT)
Received: from mail.nic.cz (mail.nic.cz [217.31.204.67]) (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 186D4132192 for <netmod@ietf.org>; Wed, 23 Aug 2017 12:45:18 -0700 (PDT)
Received: from birdie (unknown [IPv6:2a01:5e0:29:ffff:ffc6:c393:cdb9:8db1]) by mail.nic.cz (Postfix) with ESMTPSA id ECB6160991; Wed, 23 Aug 2017 21:45:15 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1503517516; bh=+YvReGNL/PHkcZ3vMCM9kU9KAtRBOYfBGKOsQMeE3u0=; h=From:To:Date; b=XDyNVjZAuufb9Usp/dLV7uW7b2rjZtI1+5oM7mrekcziLq0nHf/qj3OB9+KLqgizG 7IHqnPvMjTnZic2wUVqf9qowKuYIKLY+CymVA81HKu14mXWGw8K5qg3YGsARw5AHju X8MeHFvOaBJfwswNkBTJ4+835mIKEP6tzFLXsMLE=
Message-ID: <1503517541.5001.18.camel@nic.cz>
From: Ladislav Lhotka <lhotka@nic.cz>
To: "t.petch" <ietfc@btconnect.com>, netmod@ietf.org, Andy Bierman <andy@yumaworks.com>
Date: Wed, 23 Aug 2017 21:45:41 +0200
In-Reply-To: <01de01d31c2f$2a7c34a0$4001a8c0@gateway.2wire.net>
References: <E3378E0605547F4E854DEE0CB1116AB020865B@gbcdcmbx03.intl.att.com> <85A1FF5A-EF0B-4278-B4FF-3FE431486B2C@tail-f.com> <E3378E0605547F4E854DEE0CB1116AB02102DC@gbcdcmbx03.intl.att.com> <11857e8e-f46e-dc2e-cf99-80224859d221@transpacket.com> <E3378E0605547F4E854DEE0CB1116AB0210631@gbcdcmbx03.intl.att.com> <defe35bb-bb8b-f1f0-d8c4-2d2d0f23731b@transpacket.com> <1502290869.16638.15.camel@nic.cz> <20170809151312.GC42207@elstar.local> <6ef68131-f731-0edc-b731-d7ec85924f03@cisco.com> <E3378E0605547F4E854DEE0CB1116AB021CE2D@gbcdcmbx03.intl.att.com> <D5C05EB3.C2681%acee@cisco.com> <7614040f-9f8f-09c2-1854-63ad9ffb6be1@cisco.com> <044b01d31bf4$d3b37500$4001a8c0@gateway.2wire.net> <87vale1ro2.fsf@cesnet.cz> <01de01d31c2f$2a7c34a0$4001a8c0@gateway.2wire.net>
Organization: CZ.NIC
Content-Type: text/plain; charset="UTF-8"
X-Mailer: Evolution 3.24.5
Mime-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Virus-Scanned: clamav-milter 0.99.2 at mail
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/ojWKAZPp0sDEdg6MPqWdoZQJc6A>
Subject: Re: [netmod] Pattern statements [was Re: Query about augmenting module from submodule in YANG 1.0]
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
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: Wed, 23 Aug 2017 19:45:22 -0000

t.petch píše v St 23. 08. 2017 v 17:28 +0100:
> ----- Original Message -----
> From: "Ladislav Lhotka" <lhotka@nic.cz>
> Sent: Wednesday, August 23, 2017 11:53 AM
> 
> > "t.petch" <ietfc@btconnect.com> writes:
> > 
> > > ----- Original Message -----
> > > From: "Robert Wilton" <rwilton@cisco.com>
> > > Sent: Monday, August 21, 2017 4:14 PM
> > > 
> > > > That makes sense.
> 
> <snip>
> > > > 
> > > > Of course, this would allow more invalid values, but most servers
> > > 
> > > would
> > > > be expected to reject those when it converts them into an internal
> > > > binary format any way.
> > > > 
> > > > What do you, and others, think?
> > > 
> > > Simplify!
> > > 
> > > Bear in mind that the regex for an IPv6 address was wrong for a long
> > > time in base YANG before anyone noticed - it was just too complex.
> > 
> > Why was it wrong? Just because it was too complex?
> 
> No; it contained a definite error.
> 
> This was probably in yang-types and probably around 2012, quite late in
> the day, and it stuck in my mind that so many had looked at it and
> failed to spot that it was wrong, not just that it did not cater for
> some aspects such as interface I-D.  I have used it before as an example
> of over complexity
> 
> I will have the e-mail filed, along with several thousand other NETMOD
> ones so I will find it later rather than sooner.

I believe you mean the case when it was realized that "ipv4-address" and "ipv6-
address" permit also zone indices: 

https://www.ietf.org/mail-archive/web/netmod/current/msg07456.html

We can hardly blaim the pattern expression for this though.

Other than that, I am not aware of any reported problem concerning the "ipv6-
address" type. In fact, I even don't think the two ANDed regexs are excessively
complex. Just compare them to ABNF productions proposed for the same purpose in
RFC 3986, Appendix A.

Lada

PS. Yes, it's my child, so I do have a reason to feel offended. :-)

> 
> Tom Petch
> 
> 
> 
> > > 
> > > And ABNF learnt long ago that just because something could be
> 
> expressed
> > > in code does not mean that it is a good idea to do so.  If a simple
> > > English statement replaces many lines of ABNF, then that is a good
> > > tradeoff.
> > 
> > Well, YANG models are also intended to be read by tools that so far
> > don't understand English statements. Concerning human users, the
> 
> easiest
> > thing might be to refer to a corresponding RFC, which the descriptions
> > already do.
> > 
> > > 
> > > Pragmatically I am not sure what the cutoff for complexity should be
> 
> but
> > > it should be less than we have now.
> > > 
> > > Paradoxically, given the original thread, the time when large
> > > expressions may work ok is when they have a 'sub-module' like
> 
> structure,
> > > when I can look at a group of lines in isolation and form a view of
> 
> what
> > > it does then move on to the next group and so on, building up an
> 
> overall
> > > picture piece by piece.
> > 
> > Of course, regular expression languages are notorically human
> > unfriendly, no matter what flavour we take. The ability to build them
> > step by step from reusable pieces, e.g. using non-terminals, would
> > certainly help.
> > 
> > Lada
> > 
> > > 
> > > Tom Petch
> > > 
> > > > Thanks,
> > > > Rob
> > > > 
> > > > 
> > > > On 21/08/2017 15:01, Acee Lindem (acee) wrote:
> > > > > Hi William, Rob, Andy,
> > > > > 
> > > > > Given their limited usefulness and the detriments, perhaps we
> 
> should
> > > > > discourage the creation of new submodules in RFC6087Bis.
> > > > > 
> > > > > Thanks,
> > > > > Acee
> > > > > 
> > > > > On 8/21/17, 9:44 AM, "netmod on behalf of Ivory, William"
> > > > > <netmod-bounces@ietf.org on behalf of william.ivory@intl.att.com>
> > > 
> > > wrote:
> > > > > 
> > > > > > Hi Rob,
> > > > > > 
> > > > > > That would make it very hard to update existing 1.x YANG models
> 
> to
> > > use
> > > > > > new features in YANG 2.x if they used submodules.  Maybe that's
> > > 
> > > something
> > > > > > that no one would ever consider doing anyway, or maybe YANG 1.1
> > > 
> > > already
> > > > > > has similar differences to 1.0?  I had (perhaps naively) assumed
> > > 
> > > that you
> > > > > > could migrate a namespace / model from YANG 1.0 to 2.0?
> > > > > > 
> > > > > > Regards,
> > > > > > 
> > > > > > William
> > > > > > 
> > > > > > -----Original Message-----
> > > > > > From: netmod [mailto:netmod-bounces@ietf.org] On Behalf Of
> 
> Robert
> > > Wilton
> > > > > > Sent: 21 August 2017 11:24
> > > > > > To: netmod@ietf.org
> > > > > > Subject: Re: [netmod] Query about augmenting module from
> 
> submodule
> > > in
> > > > > > YANG 1.0
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > On 09/08/2017 16:13, Juergen Schoenwaelder wrote:
> > > > > > > On Wed, Aug 09, 2017 at 05:01:09PM +0200, Ladislav Lhotka
> 
> wrote:
> > > > > > > > I remember that in early stages of YANG there was some
> 
> irrational
> > > > > > > > fear of introducing too many namespaces, and submodules may be
> 
> a
> > > > > > > > consequence of it. As you write, submodules provide no
> 
> benefits
> > > > > > > > whatsoever in terms of modularity, but the overhead in terms
> 
> of
> > > > > > > > metadata, IANA registration etc. is pretty much the same as
> 
> for
> > > > > > > > modules.
> > > > > > > 
> > > > > > > In case YANG 2.0 is ever done, I suggest someone files a
> 
> proposal
> > > to
> > > > > > > remove submodules if the cost/benefit ratio is at odds. There
> 
> is
> > > > > > > nothing wrong with removing stuff that has been found
> 
> problematic.
> > > > > > I agree.
> > > > > > 
> > > > > > I've added
> > > > > > 
> 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_netmod-2
> > > Dw
> > > > > > 
> 
> g_yang-2Dnext_issues_26&d=DwICAg&c=LFYZ-o9_HUMeMTSQicvjIg&r=p8kyeK3u4ZYi
> > > aQ
> > > > > > 
> 
> 2ZPGqwkyXmQgBH6r5jpYiYWzhqJ48&m=l7c4IPL049A2bVVO14fyBMly211xU61xSHgPlAT7
> > > ow
> > > > > > I&s=-kR4fUtXArQy0RwWb32DpT1bP4X_cNqt2zJVoC0JiX8&e=
> > > > > > 
> > > > > > Rob
> > > > > > 
> > > > > > > The motivation for submodules was that organizations
> 
> maintaining
> > > large
> > > > > > > modules with multiple people can do so without having to mess
> > > 
> > > around
> > > > > > > with tools like m4 scripts to produce a single module from
> > > 
> > > 'snippets'
> > > > > > > and to avoid integration surprises. But perhaps using m4
> 
> scripts
> > > and
> > > > > > > decent version control systems (that can integrate and compile
> 
> on
> > > > > > > checkin) is indeed cheaper than having submodules part of the
> 
> YANG
> > > > > > > language itself.
> > > > > > > 
> > > > > > > /js
> > > > > > > 
> > > > > > 
> > > > > > _______________________________________________
> > > > > > netmod mailing list
> > > > > > netmod@ietf.org
> > > > > > 
> 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ietf.org_mailma
> > > n_
> > > > > > 
> 
> listinfo_netmod&d=DwICAg&c=LFYZ-o9_HUMeMTSQicvjIg&r=p8kyeK3u4ZYiaQ2ZPGqw
> > > ky
> > > > > > 
> 
> XmQgBH6r5jpYiYWzhqJ48&m=l7c4IPL049A2bVVO14fyBMly211xU61xSHgPlAT7owI&s=t7
> > > vG
> > > > > > IH8ABuAm00e-bkSowD9eawModGq0N2OkjANtpYI&e=
> > > > > > 
> > > > > > _______________________________________________
> > > > > > 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 mailing list
> > > netmod@ietf.org
> > > https://www.ietf.org/mailman/listinfo/netmod
> > 
> > --
> > Ladislav Lhotka
> > Head, CZ.NIC Labs
> > PGP Key ID: 0xB8F92B08A9F76C67
> 
> 
-- 
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67