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

Kristian Larsson <> Mon, 01 April 2019 21:29 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id B0E0C12000E for <>; Mon, 1 Apr 2019 14:29:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id CcdvHiL2iFMR for <>; Mon, 1 Apr 2019 14:29:27 -0700 (PDT)
Received: from Mail1.SpriteLink.NET ( []) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 3F2CC120033 for <>; Mon, 1 Apr 2019 14:29:27 -0700 (PDT)
Received: from mbp.local ( []) by Mail1.SpriteLink.NET (Postfix) with ESMTPSA id 315283F439; Mon, 1 Apr 2019 23:29:24 +0200 (CEST)
To: Mahesh Jethanandani <>
Cc: Martin Bjorklund <>,,
References: <> <> <> <> <> <>
From: Kristian Larsson <>
Message-ID: <>
Date: Mon, 1 Apr 2019 23:29:23 +0200
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.5.3
MIME-Version: 1.0
In-Reply-To: <>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Archived-At: <>
Subject: Re: [netmod] 6991bis: address-with-prefix-length
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 01 Apr 2019 21:29:31 -0000

On 2019-04-01 22:51, Mahesh Jethanandani wrote:
>> On Apr 1, 2019, at 12:37 PM, Kristian Larsson <> wrote:
>>> On 2019-04-01 19:29, Martin Bjorklund wrote:
>>> Hi,
>>> The request was for a combined type that contains both an ip address
>>> *and* a prefix length in one value.  Hence the name
>>> "ip-address-and-prefix-length" :)
>> Right you are, though I'm open to other names but let's first agree on use case / need :)
>>> I know that this type is convenient, esp. if you use it for manual
>>> input, but I wonder if it really is good practice to squeeze two
>>> values into one.
>> Dunno how "manual" has any bearing. This is IMHO just about natural data modeling.
>> You say it's two values but when one can't be used without the other, are they so separated? You can't configure an interface with just an address or just a subnet mask. You need both - they belong together.
> That can be modeled into the data module, I.e. that you have to specify both the address and the prefix length.

I am aware. It wasn't for ip-prefix though, presumably because ip-prefix 
is more natural and so is ip-address-and-prefix-length.

> The reason Martin mentioned two values is because even if they are modeled with a ‘/‘ character, the end system will consume them as two separate values
Not sure if you are arguing against me or just trying to explain :) I 
understand full well how it can be done and I'm saying I've written 
models like that. They are not elegant. Now I want the prettier way to 
do it and preferably with an IETF standardised data type, which is why 
I'm suggesting we add one in 6991bis. Two values or not, they belong 
together and should not exist without the other. The cost of using 
multiple leaves in YANG is quite high so for things that naturally 
belong together I think it's perfectly fine to make a datatype that 
includes the component values. We do it for ip-prefix already. In fact 
you could argue that the normal ipv6-prefix is a compound type since the 
zone is really a separate value from the address. Anyway, similar to how 
ip-prefix makes it easier to work with things likes routes in a routing 
table or how it simplifies the source and destination address matches in 
the ACL RFC we worked on together, an ip-address-and-prefix-length 
datatype will make other things easier which is why I'm suggesting it be