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

Salvatore Orlando sorlando at nicira.com
Sat Mar 21 00:10:04 UTC 2015


If we feel a need for specifying the relative position of gateway address
and allocation pools when creating a subnet from a pool which will pick a
CIDR from its prefixes, then the integer value solution is probably
marginally better than the "fake IP" one (eg.: 0.0.0.1 to say the gateway
is the first IP). Technically they're equivalent - and one could claim that
the address-like notation is nothing bug and octet based representation of
a number.

I wonder why a user would ask for a random CIDR with a given prefix, and
then mandate that gateway IP and allocation pools are in precise locations
within this randomly chosen CIDR. I guess there are good reasons I cannot
figure out by myself. In my opinion all that counts here is that the
semantics of a resource attribute should be the same in the request and the
response. For instance, one should not have gateway_ip as a relative
"counter-like" IP in the request body and then as an actual IP address in
the response object.

Salvatore

On 21 March 2015 at 00:08, Tidwell, Ryan <ryan.tidwell at hp.com> wrote:

>  Great suggestion Kevin.  Passing 0.0.0.1 as gateway_ip_template (or
> whatever you call it) is essentially passing an address index, so when you
> OR 0.0.0.1 with the CIDR you get your gateway set as the first usable IP in
> the subnet.  The intent of the user is to allocate the first usable IP
> address in the subnet to the gateway.  The wildcard notation for gateway IP
> is really a more convoluted way of expressing this intent.  Something like
> address_index is a little more explicit in my mind.  I think Kevin is on to
> something.
>
>
>
> -Ryan
>
>
>
> *From:* Kevin Benton [mailto:blak111 at gmail.com]
> *Sent:* Friday, March 20, 2015 2:34 PM
> *To:* OpenStack Development Mailing List (not for usage questions)
> *Subject:* Re: [openstack-dev] [api][neutron] Best API for generating
> subnets from pool
>
>
>
> What if we just call it 'address_index' and make it an integer
> representing the offset from the network start address?
>
>
>
> On Fri, Mar 20, 2015 at 12:39 PM, Carl Baldwin <carl at ecbaldwin.net> wrote:
>
> On Fri, Mar 20, 2015 at 1:34 PM, Jay Pipes <jaypipes at gmail.com> wrote:
> > How is 0.0.0.1 a host address? That isn't a valid IP address, AFAIK.
>
> It isn't a valid *IP* address without the network part.  However, it
> can be referred to as the "host address on the network" or the host
> part of the IP address.
>
> Carl
>
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
>
>
>
> --
>
> Kevin Benton
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150321/e4f86bf6/attachment.html>


More information about the OpenStack-dev mailing list