Re: [DNSOP] Microphone question on back-references - BULK RR

"Woodworth, John R" <John.Woodworth@CenturyLink.com> Fri, 31 March 2017 07:20 UTC

Return-Path: <John.Woodworth@CenturyLink.com>
X-Original-To: dnsop@ietfa.amsl.com
Delivered-To: dnsop@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 85151127B31 for <dnsop@ietfa.amsl.com>; Fri, 31 Mar 2017 00:20:49 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 0ItqsXVGg-Nd for <dnsop@ietfa.amsl.com>; Fri, 31 Mar 2017 00:20:47 -0700 (PDT)
Received: from lxdnp29m.centurylink.com (lxdnp29m.centurylink.com [155.70.32.52]) (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 8297E1293DB for <dnsop@ietf.org>; Fri, 31 Mar 2017 00:20:47 -0700 (PDT)
Received: from lxdnp04n.corp.intranet (lxdnp04n.corp.intranet [151.119.92.83]) by lxdnp29m.centurylink.com (8.14.8/8.14.8) with ESMTP id v2V7Kkgo013827 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 31 Mar 2017 01:20:46 -0600
Received: from lxdnp04n.corp.intranet (localhost [127.0.0.1]) by lxdnp04n.corp.intranet (8.14.8/8.14.8) with ESMTP id v2V7KeAO038576; Fri, 31 Mar 2017 01:20:40 -0600
Received: from lxomp07u.corp.intranet (lxdnp23m.corp.intranet [151.119.92.134]) by lxdnp04n.corp.intranet (8.14.8/8.14.8) with ESMTP id v2V7Kejn038350 (version=TLSv1/SSLv3 cipher=AES256-SHA256 bits=256 verify=NO); Fri, 31 Mar 2017 01:20:40 -0600
Received: from lxomp07u.corp.intranet (localhost [127.0.0.1]) by lxomp07u.corp.intranet (8.14.8/8.14.8) with ESMTP id v2V7Ketf053545; Fri, 31 Mar 2017 02:20:40 -0500
Received: from vodcwhubex502.ctl.intranet (vodcwhubex502.ctl.intranet [151.117.206.28]) by lxomp07u.corp.intranet (8.14.8/8.14.8) with ESMTP id v2V7KelL053542 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Fri, 31 Mar 2017 02:20:40 -0500
Received: from PODCWMBXEX501.ctl.intranet ([169.254.1.196]) by vodcwhubex502.ctl.intranet ([151.117.206.28]) with mapi id 14.03.0339.000; Fri, 31 Mar 2017 02:20:40 -0500
From: "Woodworth, John R" <John.Woodworth@CenturyLink.com>
To: "'Brian Dickson'" <brian.peter.dickson@gmail.com>, "dnsop@ietf.org WG" <dnsop@ietf.org>
CC: "'JW'" <jw@pcthink.com>, "Woodworth, John R" <John.Woodworth@CenturyLink.com>
Thread-Topic: [DNSOP] Microphone question on back-references - BULK RR
Thread-Index: AQHSqbLxZh3GxvcKkk+xKwofOOQn4qGudyxA
Date: Fri, 31 Mar 2017 07:20:39 +0000
Message-ID: <A05B583C828C614EBAD1DA920D92866BD0733FF9@PODCWMBXEX501.ctl.intranet>
References: <CAH1iCiouKZYAtdpSPNEK+fy-O8UQZbEf5O8sH-+zJqUhZdwvGA@mail.gmail.com>
In-Reply-To: <CAH1iCiouKZYAtdpSPNEK+fy-O8UQZbEf5O8sH-+zJqUhZdwvGA@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [151.117.206.8]
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-TM-AS-MML: disable
X-CFilter-Loop: Reflected
Archived-At: <https://mailarchive.ietf.org/arch/msg/dnsop/CIrV3RZJa-NLYBpegFlzFN0D-S0>
Subject: Re: [DNSOP] Microphone question on back-references - BULK RR
X-BeenThere: dnsop@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: IETF DNSOP WG mailing list <dnsop.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dnsop>, <mailto:dnsop-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dnsop/>
List-Post: <mailto:dnsop@ietf.org>
List-Help: <mailto:dnsop-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dnsop>, <mailto:dnsop-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 31 Mar 2017 07:20:50 -0000

> From: DNSOP [mailto:dnsop-bounces@ietf.org] On Behalf Of Brian Dickson
>
> > Apologies but I did not hear the full question regarding BULK RR’s
> > and the perl like back-references.  If you could please repeat
> > the question we would be happy to comment.
> >
> >
> > Thanks,
> > John
> >
>
> Sorry for the delayed response.
>

Hi Brian,

Thank you so much for following up!

>
> The question was:
>
> Given the use of perl-style back-references ( like "${1}" ) - would
> it not make sense to use the same perl syntax to provide
> well-defined targets for those back-references?
>
>
> E.g. "my-special-(<regex-thing>)-(<regex-thing>)-with-suffix" and
> then there is no ambiguity as to what ${1} and ${2} point at?
>
> Perl regex rules are IMHO very clean and clever, and avoid ambiguity
> very nicely.
> (Also historical shout-out to Henry Spencer, whose regex mods served
> as the source for perl's.)
>

Full disclosure:

   I especially love the perl-regex rule engine and can't imagine doing
   even half the things I have to do every day without it.

   I echo your thanks to Mr. Spencer and include the authors of libpcre
   who's dedication has allowed me to easily use the perl-regex ruleset
   for my every whim.


In fact, when we first set out to solve our problem, regex was our
instinctual go-to.  Unfortunately, it soon became clear regex is
simply _too_ complicated for the task at hand.

First, in our case the patterns will _always_ be numeric ranges
(or sets of ranges) and regex, no matter the flavor, simply brings
too much baggage (i.e. overhead) to the party.

Second, regex was designed for string/ substring pattern matching
and is simply horrible at multi-digit numeric ranges
(the one thing we need it for).


Try out this example:

We want to match a numeric range from 0-255.

With PCRE, this becomes:

(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)


With BULK-RR, this becomes:

[0-255]


Now, lets take a slightly more complicated example.  Say we have
an IPv4 /16 broken into 4 /18's.

Depending on which /18 is being targeted, the third octet can be
within the ranges: 0-63, 64-127, 128-191 or 192-255.

[0-63]    vs. (0|[1-5][0-9]|6[0-3])
[64-127]  vs. (6[4-9]|[789][0-9]|1[01][0-9]|12[0-7])
[128-191] vs. ???
[192-255] vs. ???

Even if you are an absolute regex genius and this poses zero
challenge, in situation like this I often ask myself:

  -  Which would you rather figure out in the middle of the night?
  Or
  -  Would I like to be woken up for this or should it be easier
     for 'someone else'?

>
> Things inside parentheses are the target of back-refs.
> In Perl, there is no need to escape the parentheses within regexes.
>

The square brackets can only contain numeric ranges (or sets of ranges)
so no need to escape within them either.


Thanks again,
John


NOTE: The regex pattern for 0-255 was borrowed from a quick web
      search (link below).

      https://chrisjwarwick.wordpress.com/2012/09/16/
      more-regular-expressions-regex-for-ip-v4-addresses/

>
> Brian
>
>
-- THESE ARE THE DROIDS TO WHOM I REFER:
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.