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

"Acee Lindem (acee)" <> Tue, 22 August 2017 22:21 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 22F8A132A97; Tue, 22 Aug 2017 15:21:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -14.499
X-Spam-Status: No, score=-14.499 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id UpwZ4U1b8CDQ; Tue, 22 Aug 2017 15:21:25 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 87691132A95; Tue, 22 Aug 2017 15:21:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;;; l=21053; q=dns/txt; s=iport; t=1503440485; x=1504650085; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=B5RQz2xTxhz+jJPjWedenAksSga9bXzBFLgjK692vJQ=; b=Tpp0xqpEUu4u+DWrlTn9mdZYkEgfu0GPHDUpUp/V/rXAfiaySNi5EARj kZall1rCWdjDdtumMSxVkOjV/+pjrzzfAM2RhxRZQcdugSUHDk6ENhtZ3 qls2i16XbQYi58SsAFVc/PglyCE72dkJdoL2EJN8kBp7ujKhkzGwV7acT o=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-AV: E=Sophos;i="5.41,414,1498521600"; d="scan'208,217";a="446999873"
Received: from ([]) by with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Aug 2017 22:21:24 +0000
Received: from ( []) by (8.14.5/8.14.5) with ESMTP id v7MMLNuf029083 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Tue, 22 Aug 2017 22:21:24 GMT
Received: from ( by ( with Microsoft SMTP Server (TLS) id 15.0.1210.3; Tue, 22 Aug 2017 18:21:23 -0400
Received: from ([]) by ([]) with mapi id 15.00.1210.000; Tue, 22 Aug 2017 18:21:23 -0400
From: "Acee Lindem (acee)" <>
To: "Robert Wilton -X (rwilton - ENSOFT LIMITED at Cisco)" <>, "''" <>
CC: "" <>
Thread-Topic: Pattern statements [was Re: [netmod] Query about augmenting module from submodule in YANG 1.0]
Thread-Index: AQHTGpA9Gl54VvqvVk+CY8qb3KBKRqKQ9NGA
Date: Tue, 22 Aug 2017 22:21:23 +0000
Message-ID: <>
References: <> <> <> <> <> <> <> <20170809151312.GC42207@elstar.local> <> <> <> <>
In-Reply-To: <>
Accept-Language: en-US
Content-Language: en-US
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: []
Content-Type: multipart/alternative; boundary="_000_D5C2252FC2E98aceeciscocom_"
MIME-Version: 1.0
Archived-At: <>
Subject: Re: [bess] Pattern statements [was Re: [netmod] Query about augmenting module from submodule in YANG 1.0]
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: BGP-Enabled ServiceS working group discussion list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Tue, 22 Aug 2017 22:21:29 -0000

Hi Rob,
I’m fine with simplifying (even if the resultant pattern is much less impressive ;^). I’ve copied the BESS WG to see if there are any objections.

From: "Robert Wilton -X (rwilton - ENSOFT LIMITED at Cisco)" <<>>
Date: Monday, August 21, 2017 at 11:14 AM
To: Acee Lindem <<>>, "Ivory, William" <<>>, "'<mailto:'>'" <<>>, Andy Bierman <<>>
Subject: Pattern statements [was Re: [netmod] Query about augmenting module from submodule in YANG 1.0]

Hi Acee,

That makes sense.

The other thing that I think that we have got wrong is modelling regex pattern statements.  I think that it would be much better if these were written to be less exhaustive and much simpler.

E.g. the "route distinguisher" pattern in draft-ietf-rtgwg-routing-types-09 is defined as this:

         +     '6[0-4][0-9]{3}|'
         +     '[0-5]?[0-9]{0,3}[0-9]):(429496729[0-5]|'
         +     '42949672[0-8][0-9]|'
         +     '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|'
         +     '42949[0-5][0-9]{4}|'
         +     '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|'
         +     '42[0-8][0-9]{7}|4[01][0-9]{8}|'
         +     '[0-3]?[0-9]{0,8}[0-9]))|'
         + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|'
         +     '25[0-5])\.){3}([0-9]|[1-9][0-9]|'
         +     '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|'
         +     '655[0-2][0-9]|'
         +     '65[0-4][0-9]{2}|6[0-4][0-9]{3}|'
         +     '[0-5]?[0-9]{0,3}[0-9]))|'
         + '(2:(429496729[0-5]|42949672[0-8][0-9]|'
         +     '4294967[01][0-9]{2}|'
         +     '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|'
         +     '4294[0-8][0-9]{5}|'
         +     '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|'
         +     '[0-3]?[0-9]{0,8}[0-9]):'
         +     '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
         +     '6[0-4][0-9]{3}|'
         +     '[0-5]?[0-9]{0,3}[0-9]))|'
         + '(6(:[a-fA-F0-9]{2}){6})|'
         + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):'
         +     '[0-9a-fA-F]{1,12})';

But I think that it would be much easier to read, and quite possibly more performant to execute, if the pattern regex was written something like the following:


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?


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.


On 8/21/17, 9:44 AM, "netmod on behalf of Ivory, William"
< on behalf of><> 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?



-----Original Message-----
From: netmod [] On Behalf Of Robert Wilton
Sent: 21 August 2017 11:24
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

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


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.


netmod mailing list<>

netmod mailing list<>