[openstack-dev] [api][neutron] Best API for generating subnets from pool

Carl Baldwin carl at ecbaldwin.net
Mon Mar 23 22:45:28 UTC 2015


On Mon, Mar 23, 2015 at 4:23 PM, Kevin Benton <blak111 at gmail.com> wrote:
> How would you represent that you want the last address in a /26 network if
> you don't know what address range you are getting? 0.0.0.63? That seems
> pretty confusing when the resulting address turns out to be 192.168.10.191.
>
>>It isn't a new concept to think about the network and host parts of an IP
>> address separately.
>
> Definitely, but with small subnets like the example above, it is impossible
> to know the absolute numbers for the host portion of the address.
>
> It's about setting the right expectation for the caller. Specifying
> '0.0.0.63' implies the caller is going to get something back that ends in
> '63', which is only true some of the time. By using 'ip_index', I was trying
> to convey that you are getting something counted from the start of whatever
> is chosen, rather than getting a specific address ending.

I see what you're saying but it still doesn't do it for me.  To me,
0.0.0.63 didn't say that I'd get something ending in .63.  I know that
I can get something ending in .127, .191, or .255.  Also, I don't
think that a raw integer like 63 would do any better at setting the
expectation.  I bet the same users who would be surprised by one would
be surprised by the other.  My vote would still be to use the
dotted-quad notation.

When working with ipv4 addresses, one must understand that the address
is a 32-bit number.  Dotted quad is just the familiar format for
seeing them but, no matter the format, the concept is the same.  The
same is true for the host part.

Carl



More information about the OpenStack-dev mailing list