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

Kristian Larsson <kristian@spritelink.net> Thu, 18 April 2019 08:09 UTC

Return-Path: <kristian@spritelink.net>
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 B5CDF12024F for <netmod@ietfa.amsl.com>; Thu, 18 Apr 2019 01:09:50 -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, SPF_PASS=-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 ZDAY5lu6dI1H for <netmod@ietfa.amsl.com>; Thu, 18 Apr 2019 01:09:48 -0700 (PDT)
Received: from Mail1.SpriteLink.NET (Mail1.spritelink.net [195.182.5.127]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3B729120041 for <netmod@ietf.org>; Thu, 18 Apr 2019 01:09:48 -0700 (PDT)
Received: from mbp.local (c-bb9de253.014-82-73746f13.bbcust.telenor.se [83.226.157.187]) by Mail1.SpriteLink.NET (Postfix) with ESMTPSA id DAF933F42C for <netmod@ietf.org>; Thu, 18 Apr 2019 10:09:45 +0200 (CEST)
To: netmod@ietf.org
References: <10d3413c-df96-6e7d-df82-5542bb02348d@spritelink.net> <20190401161321.seiodlfsmjjvjcp5@anna.jacobs.jacobs-university.de> <699d2c10-9b08-97f1-69d9-f66e3a83c643@spritelink.net> <20190417192013.zdhz4e5fwakm3x4a@anna.jacobs.jacobs-university.de> <048ecdb8-759e-2905-11a8-4c1caedc9371@spritelink.net> <20190417195437.gpnvh6woidqkkqtt@anna.jacobs.jacobs-university.de> <874l6vsqvi.fsf@nic.cz>
From: Kristian Larsson <kristian@spritelink.net>
Message-ID: <4ef7deb6-9904-6ce1-5b84-4cd18a48256d@spritelink.net>
Date: Thu, 18 Apr 2019 10:09:45 +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: <874l6vsqvi.fsf@nic.cz>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/CgNmH2gpr75D1vey_zV4sHMKaTo>
Subject: Re: [netmod] 6991bis: address-with-prefix-length
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
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: Thu, 18 Apr 2019 08:09:51 -0000


On 2019-04-18 09:40, Ladislav Lhotka wrote:
> Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> writes:
> 
>> On Wed, Apr 17, 2019 at 09:35:51PM +0200, Kristian Larsson wrote:
>>>
>>> I wonder though, isn't ipX-address-and-prefix-length the clearer name, or if
>>> we do want to shorten then ipX-address-and-plen. I think Martin stated the
>>> case for ipX-address-and-prefix but that is IMHO not the way this is
>>> typically perceived by people.
>>>
>>> 1.2.3.4/24
>>> ^^^^^^^----- ipv4 address
>>>         ^^^-- ipv4 prefix length
>>>
>>> now, taking the prefix-length you know that 1.2.3 is the prefix but does
>>> that mean the above is an IPv4 address and a prefix? Or is it just that you
>>> can infer the prefix from the above? It's just different ways of looking at
>>> it. My experience tells me ipX-address-and-prefix-length is the clearer way
>>> of conveying what this is.
>>>
>>
>> I guess this is somewhat subjective. The prefix length is the number
>> used to convey what the prefix is. So you are effectively defining an
>> address and the prefix that this address belongs to. ;-)
> 
> Strictly speaking, what is being defined by the number is a subnet mask.

Heh, amazing how something so binary can turn out to be so subjective ;) 
This sort of turns into philosophical questions and I'm not sure we need 
to straighten it all out. I'd still call the prefix-length the 
prefix-length. It directly maps to the typical subnet mask 
representation and as you say, they can be thought of as the same thing.

Does this mean you prefer ipX-address-and-subnet-mask? Because I think 
that when someone reads that they are going to expect a value that looks 
like 1.2.3.4/255.255.255.0 rather than 1.2.3.4/24, which is why I still 
think ipX-address-and-prefix-length (possibly s/prefix-length/plen/) is 
the better name :)


>> Given that we already have ip-prefix (which does as well use a prefix
>> length to convey what the prefix is), it seems ip-address-and-prefix
>> is more consistent with the existing RFC 6991 definitions. Being
>> consistent with what we have was the main reason for me to prefer
>> ip-address-and-prefix.
> 
> I am not in favour of adding this type. Having ip-prefix next to
> ip-address-and-prefix is confusing.

Confusing or not, they are NOT interchangeable and actually do different 
things, which is why both are needed. There's plenty of precedence to 
this, like postgresql has data types (cidr and inet) that map exactly to 
this behaviour, i.e. both store something that looks like an IP address 
and a prefix-length but one (cidr for pg) forces bits in host portion to 
be set to all 0. Python ipaddress has the same with IPv4Address and 
IPv4Interface.


> Moreover, the most natural use for
> this type would be the address specification in the "ietf-ip" module,
> but we already have two leaves there: ip and prefix-length.

Like I said in another mail, I think it is nice if these common 
datatypes become used by vendors and implementors. Many use proprietary 
models but at least using standard datatypes allows us to easily parse 
the data into sensible datatypes on our end, like Python's 
ipaddress.IPv4Interface.

   kll