Unable to create /32 subnet with Quantum

Bug #1177196 reported by Hyunsun Moon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Invalid
Wishlist
Hyunsun Moon

Bug Description

Quantum does not support /32 subnet properly.
When I create /32 subnet it successes but with wrong settings.

root@devstack:~/devstack# quantum subnet-create private-net 192.168.0.1/32
Created a new subnet:
+------------------+--------------------------------------+
| Field | Value |
+------------------+--------------------------------------+
| allocation_pools | |
| cidr | 192.168.0.1/32 |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 192.168.0.2 |
| host_routes | |
| id | 9f4dee10-7852-4b21-be32-e5bec6f6e691 |
| ip_version | 4 |
| name | |
| network_id | 6dd423d3-2fa8-4c6f-8f7d-46b2c74c8eb8 |
| tenant_id | 543146e3aae04aedb4394c4c61479723 |
+------------------+--------------------------------------+

/32 subnet could be useful for some cases and in that case the IP would be in allocation_pools and disable dhcp with no gateway_ip.

Tags: l3-ipam-dhcp
description: updated
Revision history for this message
yong sheng gong (gongysh) wrote :

what cases will need this kind of cidr?

Revision history for this message
Hyunsun Moon (hyunsun-moon) wrote :

Our network service model uses /32 subnet for floating IP. (mostly to acheive floating ip mobility)
I found that floating ip is assigned with /32 mask so no problem, but the problem is quantum router's default gateway, it is assigned with actual mask.

See the example.

28: qg-fc9eb6a0-a6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether fa:16:3e:77:dd:5b brd ff:ff:ff:ff:ff:ff
    inet 172.16.0.101/24 brd 172.16.0.255 scope global qg-fc9eb6a0-a6 # external gateway
    inet 172.16.0.102/32 brd 172.16.0.102 scope global qg-fc9eb6a0-a6 # floating IP
    inet6 fe80::f816:3eff:fe77:dd5b/64 scope link
       valid_lft forever preferred_lft forever

Except that, it looks like a bug for me.
Um...what do you think so? We're using fixed version of this issue on our deploy, by the way.

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

There might be better ways to achieve what you are trying to do instead of using a /32 subnet.

One can disagree with specifications but it's pretty clear from IETF rfc that /32 are used to indicate a host route, not subnets. I would argue that this bug should be rephrased as "Quantum does not raise an error when creating networks with /32 CIDR's".

If I understood your requirement correctly, how about using the --allocation-pool option to constraint the size of your floating ip pool to one?

Revision history for this message
Mark McClain (markmcclain) wrote :

I agree with Armando. The bug is that Quantum allows you to complete this operation in the first place. A /32 should be an invalid subnet. Unless there is objection, I'm going to file a bug to specifically raise an error when a /32 subnet is requested.

Changed in quantum:
status: New → Incomplete
tags: added: l3-ipam-dhcp
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

Mark, feel free to assign the bug to me.

Cheers,
Armando

Revision history for this message
Aaron Rosen (arosen) wrote :

Creating a subnet with a /32 cidr is valid. I also agree that we should disable dhcp and set no gateway_ip.. But I don't understand the issue you're are having.

Revision history for this message
Hyunsun Moon (hyunsun-moon) wrote :

Sorry for my poor explanation.
I was trying to say that we want to use /32 cidr for public IPs(for floating IPs and router's gateway IPs) and I found that it is impossible with current quantum.

Anyway, it will be great if quantum allows /32 cidr for subnet-create.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to quantum (master)

Fix proposed to branch: master
Review: https://review.openstack.org/28539

Changed in quantum:
assignee: nobody → Hyunsun Moon (hyunsun-moon)
status: Incomplete → In Progress
Revision history for this message
Brian Haley (brian-haley) wrote :

Even a /31 is pretty unusable - one address is the network, the other the broadcast, no space for a host.

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

a subnet with /32 is a valid cidr, but it's not a subnet, it's a host; I don't think that discussing naming conventions can get us anywhere :)

Revision history for this message
Aaron Rosen (arosen) wrote :

Can you point me to anything that says a /32 isn't a valid subnet ?

@Brian it doesn't actually reserve a bcast address for /31, /32

root@arosen-laptop:/home/arosen# ifconfig eth0 192.168.3.1/32
root@arosen-laptop:/home/arosen# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 40:6c:8f:1a:a9:31
          inet addr:192.168.3.1 Bcast:255.255.255.255 Mask:0.0.0.0

root@arosen-laptop:/home/arosen# ifconfig eth0 192.168.3.1/31
root@arosen-laptop:/home/arosen# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 40:6c:8f:1a:a9:31
          inet addr:192.168.3.1 Bcast:255.255.255.255 Mask:255.255.255.254

I agree though this isn't very useful but I don't see why we shouldn't support it over not supporting it.

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

I am looking at the IETF Request for Comment:

http://tools.ietf.org/html/rfc4632

/32 is a "host route", /31 a "p2p link"

Revision history for this message
Hyunsun Moon (hyunsun-moon) wrote :

We are using /32 subnet mask IP by making the host holding the IP to advertise routing announce.
I know this is very special use case and understand that quantum cannot cover all the special use cases, but it is valid.

If there is another way to register /32 IP pool on quantum DB, please share, it would be very helpful.

To Armando, I hvave tried --allocation-pool option(if I understood your suggestion correctly) but it failed to pass validation.
stack@devstack:~/devstack$ quantum subnet-create private 10.0.0.1/32 --no-gateway --disable-dhcp --allocation-pool start=10.0.0.1,end=10.0.0.1
The allocation pool {u'start': u'10.0.0.1', u'end': u'10.0.0.1'} spans beyond the subnet cidr 10.0.0.1/32.

Revision history for this message
Akihiro Motoki (amotoki) wrote :

Hi Hyunsun,

According to your previous comment, you are trying to say that we want to use /32 cidr for public IPs(for floating IPs and router's gateway IPs) and I found that it is impossible with current quantum.

In my understanding what you want to do are:
- want to specify an IP address to a gateway interface of a router
- create a floating IP pool with several IP addresses which can not be represented by netmask
- IP addresses of the gateway interface and the pool are not consecutive.
For example, IP address of a gateway interface is 10.0.0.254 and a pool consists of 10.0.0.2 (and 10.0.0.20).
Is my understanding correct?

If my understanding is correct, the current quantum does not support such case since we don't have a way to specify an IP address of a gateway interface (connected to the external network).

P.S.
I also think a subnet for an external network should be a valid "subnet", since the subnet needs a default gateway to the Internet or somewhere even when an floating IP has only one IP address.

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

Hyunsun Moon,

Are you still facing the issue and thinking to propose a fix? If so, please update the bug report. Otherwise, I think there's ground to mark this bug as invalid.

Changed in neutron:
status: In Progress → Invalid
Aaron Rosen (arosen)
Changed in neutron:
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.