Subject: Re: [netmod] 6991bis: address-with-prefix-length

From: Michael Rehder <[email-masked]>
Date: Mon, 1 Apr 2019 17:53:56 +0000

Some systems require a "canonical" prefix, in that there cannot be bits past the mask length.
Like
  192.168.1.1/24
is not legal due to the ".1" for the last octet, which should be ".0".

The ietf-inet-types definition says this but does not enforce it.
Such enforcement exceeds regexp capability (as far as I know).
Note also that the ietf pattern regexp are not anchored so
" junk192.168.1.1"
and
"    192.168.1.1   "
Are accepted. I don't know why they are unanchored. This makes them unusable in my view.

As a result I've written my own regxp and a somewhat elaborate MUST clause for canonical format check but a specific type would be better.
Another perspective is to ensure there is some way to avoid using MUST to simply constrain type.
Has that ever been discussed?

Thanks
Mike

> -----Original Message-----
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Mon, 1 Apr 2019 16:38:34 +0200
> From: Kristian Larsson <[email-masked]>
> To: [email-masked]
> Subject: [netmod] 6991bis: address-with-prefix-length
> Message-ID: <[email-masked]>
> Content-Type: text/plain; charset=utf-8; format=flowed
> 
> Hello,
> 
> seeing that 6991 is up for a refresh I wonder if this would be the time to
> suggest the addition of a type for address-and-prefix-length, for example like
> 192.0.2.1/24?
> 
> I find that it's the most natural way express the address and prefix-length to
> configure on an interface or for some other use. We currently have an ip-prefix
> type which allows CIDR style prefixes but since all bits to the right of the mask
> is to be 0 it is only possible to use for describing the IP prefix / network address
> itself - not the address of a host in that network.
> 
> I actually wish the interface-ip modules would have used a combined leaf for
> these settings rather than the dual-leaf approach it currently has, but I suppose
> that ship has sailed :/
> 
> Regardless, can we add such a type? Is this the document and time to do it? :)
> 
> Kind regard,
>     Kristian.
> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Mon, 1 Apr 2019 18:13:21 +0200
> From: Juergen Schoenwaelder <[email-masked]>
> To: Kristian Larsson <[email-masked]>
> Cc: <[email-masked]>
> Subject: Re: [netmod] 6991bis: address-with-prefix-length
> Message-ID:
> 	<[email-masked]>
> Content-Type: text/plain; charset="us-ascii"
> 
> This is the right time for this and I would call these ip-address-prefix, ipv4-
> address-prefix and ipv6-address prefix.
> 
> /js
> 
> On Mon, Apr 01, 2019 at 04:38:34PM +0200, Kristian Larsson wrote:
> > Hello,
> >
> > seeing that 6991 is up for a refresh I wonder if this would be the
> > time to suggest the addition of a type for address-and-prefix-length,
> > for example like 192.0.2.1/24?
> >
> > I find that it's the most natural way express the address and
> > prefix-length to configure on an interface or for some other use. We
> > currently have an ip-prefix type which allows CIDR style prefixes but
> > since all bits to the right of the mask is to be 0 it is only possible
> > to use for describing the IP prefix / network address itself - not the
> > address of a host in that network.
> >
> > I actually wish the interface-ip modules would have used a combined
> > leaf for these settings rather than the dual-leaf approach it
> > currently has, but I suppose that ship has sailed :/
> >
> > Regardless, can we add such a type? Is this the document and time to do it?
> > :)
> >
> > Kind regard,
> >    Kristian.
> >
> > _______________________________________________
> > netmod mailing list
> > [email-masked]
> > https://www.ietf.org/mailman/listinfo/netmod
> 
> --
> Juergen Schoenwaelder           Jacobs University Bremen gGmbH
> Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
> Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>
> 
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Mon, 1 Apr 2019 16:31:12 +0000
> From: "Acee Lindem (acee)" <[email-masked]>
> To: Juergen Schoenwaelder <[email-masked]>,
> 	"Kristian Larsson" <[email-masked]>
> Cc: "[email-masked]" <[email-masked]>
> Subject: Re: [netmod] 6991bis: address-with-prefix-length
> Message-ID: <[email-masked]>
> Content-Type: text/plain; charset="utf-8"
> 
> I believe the "address-" could be omitted from the type identifiers. At least
> within the routing area, "ipv4-prefix" is unambiguous.
> Thanks,
> Acee
> 
> ?On 4/1/19, 12:14 PM, "netmod on behalf of Juergen Schoenwaelder"
> <[email-masked] on behalf of j.schoenwaelder@jacobs-
> university.de> wrote:
> 
>     This is the right time for this and I would call these
>     ip-address-prefix, ipv4-address-prefix and ipv6-address
>     prefix.
> 
>     /js
> 
>     On Mon, Apr 01, 2019 at 04:38:34PM +0200, Kristian Larsson wrote:
>     > Hello,
>     >
>     > seeing that 6991 is up for a refresh I wonder if this would be the time to
>     > suggest the addition of a type for address-and-prefix-length, for example
>     > like 192.0.2.1/24?
>     >
>     > I find that it's the most natural way express the address and prefix-length
>     > to configure on an interface or for some other use. We currently have an
>     > ip-prefix type which allows CIDR style prefixes but since all bits to the
>     > right of the mask is to be 0 it is only possible to use for describing the
>     > IP prefix / network address itself - not the address of a host in that
>     > network.
>     >
>     > I actually wish the interface-ip modules would have used a combined leaf
> for
>     > these settings rather than the dual-leaf approach it currently has, but I
>     > suppose that ship has sailed :/
>     >
>     > Regardless, can we add such a type? Is this the document and time to do it?
>     > :)
>     >
>     > Kind regard,
>     >    Kristian.
>     >
>     > _______________________________________________
>     > netmod mailing list
>     > [email-masked]
>     > https://www.ietf.org/mailman/listinfo/netmod
> 
>     --
>     Juergen Schoenwaelder           Jacobs 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
>     [email-masked]
>     https://www.ietf.org/mailman/listinfo/netmod
> 
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Mon, 1 Apr 2019 17:23:37 +0000
> From: "Acee Lindem (acee)" <[email-masked]>
> To: Juergen Schoenwaelder <[email-masked]>,
> 	"Kristian Larsson" <[email-masked]>
> Cc: "[email-masked]" <[email-masked]>
> Subject: Re: [netmod] 6991bis: address-with-prefix-length
> Message-ID: <[email-masked]>
> Content-Type: text/plain; charset="utf-8"
> 
> Ok, now I'm confused. I see that the ietf-inet-type model already has the types
> ipv4-prefix and ipv6-prefix. How are these any different???
> Thanks,
> Acee
> 
> ?On 4/1/19, 12:31 PM, "Acee Lindem (acee)" <[email-masked]> wrote:
> 
>     I believe the "address-" could be omitted from the type identifiers. At least
> within the routing area, "ipv4-prefix" is unambiguous.
>     Thanks,
>     Acee
> 
>     On 4/1/19, 12:14 PM, "netmod on behalf of Juergen Schoenwaelder"
> <[email-masked] on behalf of j.schoenwaelder@jacobs-
> university.de> wrote:
> 
>         This is the right time for this and I would call these
>         ip-address-prefix, ipv4-address-prefix and ipv6-address
>         prefix.
> 
>         /js
> 
>         On Mon, Apr 01, 2019 at 04:38:34PM +0200, Kristian Larsson wrote:
>         > Hello,
>         >
>         > seeing that 6991 is up for a refresh I wonder if this would be the time to
>         > suggest the addition of a type for address-and-prefix-length, for example
>         > like 192.0.2.1/24?
>         >
>         > I find that it's the most natural way express the address and prefix-
> length
>         > to configure on an interface or for some other use. We currently have an
>         > ip-prefix type which allows CIDR style prefixes but since all bits to the
>         > right of the mask is to be 0 it is only possible to use for describing the
>         > IP prefix / network address itself - not the address of a host in that
>         > network.
>         >
>         > I actually wish the interface-ip modules would have used a combined
> leaf for
>         > these settings rather than the dual-leaf approach it currently has, but I
>         > suppose that ship has sailed :/
>         >
>         > Regardless, can we add such a type? Is this the document and time to do
> it?
>         > :)
>         >
>         > Kind regard,
>         >    Kristian.
>         >
>         > _______________________________________________
>         > netmod mailing list
>         > [email-masked]
>         > https://www.ietf.org/mailman/listinfo/netmod
> 
>         --
>         Juergen Schoenwaelder           Jacobs 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
>         [email-masked]
>         https://www.ietf.org/mailman/listinfo/netmod
> 
> 
> 
> 
> 
> ------------------------------
> 
> Subject: Digest Footer
> 
> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod
> 
> 
> ------------------------------
> 
> End of netmod Digest, Vol 133, Issue 2
> **************************************
This email and the information contained herein is proprietary and confidential and subject to the Amdocs Email Terms of Service, which you may review at https://www.amdocs.com/about/email-terms-of-service <https://www.amdocs.com/about/email-terms-of-service>

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 01 Apr 2019 20:03:40 +0200 (CEST)

Hi,

Michael Rehder <[email-masked]> wrote:

[...]

> Are accepted.

No, this is not correct.  YANG uses the XSD "dialect" of regular
expressions.  In this dialect, all patterns are implicitly anchored.

/martin

> I don't know why they are unanchored. This makes them
> unusable in my view.
> 
> As a result I've written my own regxp and a somewhat elaborate MUST
> clause for canonical format check but a specific type would be better.
> > time to
> > prefix-length to
> > ip-address-prefix, ipv4-
> >     > time to
> >     > prefix-length
> >     > leaf
> >         > time to
> >         > prefix-
> This email and the information contained herein is proprietary and
> confidential and subject to the Amdocs Email Terms of Service, which
> you may review at https://www.amdocs.com/about/email-terms-of-service
> <https://www.amdocs.com/about/email-terms-of-service>

---

From: Michael Rehder <[email-masked]>
Date: Mon, 1 Apr 2019 18:08:59 +0000

Yes, correct, my misremembering (I'm working also with JSONSchema which doesn't have that).

> From: Martin Bjorklund [mailto:[email-masked]]
> Sent: Monday, April 1, 2019 2:04 PM
> To: Michael Rehder <[email-masked]>
> Cc: [email-masked]
> > Note also that the ietf pattern regexp are not anchored so "
> > junk192.168.1.1"
> > and
> > "    192.168.1.1   "
> > Are accepted.
> 
> No, this is not correct.  YANG uses the XSD "dialect" of regular expressions.  In
> this dialect, all patterns are implicitly anchored.
> 
> 
> /martin
> 
> > I don't know why they are unanchored. This makes them unusable in my
> > view.
> >
> > > time to suggest the addition of a type for
> > > address-and-prefix-length, for example like 192.0.2.1/24?
> > >
> > > currently have an ip-prefix type which allows CIDR style prefixes
> > > but since all bits to the right of the mask is to be 0 it is only
> > > possible to use for describing the IP prefix / network address
> > > ip-address-prefix, ipv4- address-prefix and ipv6-address prefix.
> > >
> > > /js
> > >
> > > > time to suggest the addition of a type for
> > > > address-and-prefix-length, for example like 192.0.2.1/24?
> > > >
> > > > prefix-length to configure on an interface or for some other use.
> > > > We currently have an ip-prefix type which allows CIDR style
> > > > prefixes but since all bits to the right of the mask is to be 0 it
> > > > is only possible to use for describing the IP prefix / network
> > > > address itself - not the address of a host in that network.
> > > >
> > > > I actually wish the interface-ip modules would have used a
> > > > combined leaf for these settings rather than the dual-leaf
> > > > approach it currently has, but I suppose that ship has sailed :/
> > > >
> > > I believe the "address-" could be omitted from the type identifiers.
> > > At least within the routing area, "ipv4-prefix" is unambiguous.
> > > Thanks,
> > > Acee
> > >
> > > Ok, now I'm confused. I see that the ietf-inet-type model already
> > > has the types ipv4-prefix and ipv6-prefix. How are these any
> > > different???
> > > Thanks,
> > > Acee
> > >