Neutron network:dhcp port is not assigned EUI64 IPv6 address for SLAAC subnet

Bug #1330826 reported by Sridhar Gaddam
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Dane LeBlanc
Juno
Fix Released
Undecided
Unassigned

Bug Description

In an IPv6 subnet which has ipv6_address_mode set to slaac or dhcpv6-stateless, Neutron should use EUI-64 address assignment for all the addresses. Also if a fixed IP address is specified for such a subnet, we should report an appropriate error message during port creation or port update operation.

A simple scenario to reproduce this issue...

#As an admin user, create a provider network and associate an IPv4 and IPv6 subnet.
cd ~/devstack
source openrc admin admin
neutron net-create N-ProviderNet --provider:physical_network=ipv6-net --provider:network_type=flat --shared
neutron subnet-create --name N-ProviderSubnet N-ProviderNet 20.1.1.0/24 --gateway 20.1.1.1 --allocation-pool start=20.1.1.100,end=20.1.1.150
neutron subnet-create --name N-ProviderSubnetIPv6 --ip_version 6 --ipv6-address-mode slaac --gateway fe80::689d:41ff:fe20:44ca N-ProviderNet 2001:1:2:3::/64

As a normal tenant, launch a VM with the provider net-id. You could see that ipAddress assigned to dhcp port is "2001:1:2:3::1" which is not an EUI64 based address.

sridhar@ControllerNode:~/devstack$ neutron port-list -F mac_address -F fixed_ips
+-------------------+-------------------------------------------------------------------------------------------------------+
| mac_address | fixed_ips |
+-------------------+-------------------------------------------------------------------------------------------------------+
| fa:16:3e:6a:db:6f | {"subnet_id": "61d2661d-22a0-449c-8823-b4d781515f66", "ip_address": "172.24.4.2"} |
| fa:16:3e:54:56:13 | {"subnet_id": "3e3487de-036c-4ab7-ba3f-c6b5db041fb2", "ip_address": "20.1.1.101"} |
| | {"subnet_id": "716234df-1f46-434c-be48-d976a86438d6", "ip_address": "2001:1:2:3::1"} |
| fa:16:3e:dd:e9:82 | {"subnet_id": "61d2661d-22a0-449c-8823-b4d781515f66", "ip_address": "172.24.4.4"} |
| fa:16:3e:52:1f:43 | {"subnet_id": "fbad7350-83c4-4cad-aa95-fecac232cea1", "ip_address": "10.0.0.101"} |
| fa:16:3e:8a:f0:b6 | {"subnet_id": "61d2661d-22a0-449c-8823-b4d781515f66", "ip_address": "172.24.4.3"} |
| fa:16:3e:02:d2:50 | {"subnet_id": "fbad7350-83c4-4cad-aa95-fecac232cea1", "ip_address": "10.0.0.1"} |
| fa:16:3e:45:5c:00 | {"subnet_id": "3e3487de-036c-4ab7-ba3f-c6b5db041fb2", "ip_address": "20.1.1.102"} |
| | {"subnet_id": "716234df-1f46-434c-be48-d976a86438d6", "ip_address": "2001:1:2:3:f816:3eff:fe45:5c00"} |
+-------------------+-------------------------------------------------------------------------------------------------------+

sridhar@ControllerNode:~/devstack$ sudo ip netns exec qdhcp-93093763-bc7d-4be4-91ad-0ef9ba69273c ifconfig
tap4828cfbd-fe Link encap:Ethernet HWaddr fa:16:3e:54:56:13
          inet addr:20.1.1.101 Bcast:20.1.1.255 Mask:255.255.255.0
          inet6 addr: 2001:1:2:3:f816:3eff:fe54:5613/64 Scope:Global
          inet6 addr: 2001:1:2:3::1/64 Scope:Global
          inet6 addr: fe80::f816:3eff:fe54:5613/64 Scope:Link
          UP BROADCAST RUNNING MTU:1500 Metric:1
          RX packets:337 errors:0 dropped:0 overruns:0 frame:0
          TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:37048 (37.0 KB) TX bytes:3936 (3.9 KB)

tags: added: ipv6
Revision history for this message
Xu Han Peng (xuhanp) wrote :

I will debug and find the root cause.

Changed in neutron:
assignee: nobody → Xu Han Peng (xuhanp)
Revision history for this message
Xu Han Peng (xuhanp) wrote :

The reason of dhcp port is not going through the eui64 calculation logic is that fixed_configured is True after this line since p['fixed_ips'] has subnet_id in it

https://github.com/openstack/neutron/blob/master/neutron/db/db_base_plugin_v2.py#L663

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

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

Changed in neutron:
status: New → In Progress
Xu Han Peng (xuhanp)
summary: - Neutron network:dhcp port is not assigned EUI64 IPv6 address
+ Neutron network:dhcp port is not assigned EUI64 IPv6 address for SLAAC
+ subnet
Kyle Mestery (mestery)
Changed in neutron:
milestone: none → juno-rc1
importance: Undecided → High
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

I am confused by the bug description: how is dhcp supposed to work on a flat provider network? I don't think dhcp works even for IPv4.

It's possible that the fix is still genuine and addresses other use cases, but I'd like to get some clarity as to what the reported is trying to accomplish

Revision history for this message
Xu Han Peng (xuhanp) wrote :

Armando, see me reply to your comment #4 in https://review.openstack.org/#/c/101433/

Revision history for this message
Sridhar Gaddam (sridhargaddam) wrote :

@Armando, I've seen this issue in a provider network setup where the DHCP port on an SLAAC IPv6 subnet is assigned with Non-EUI64 based address. The fix from Xu Han Peng is valid and the commit message includes possible scenarios under which this problem would be reproduced. I'll update the bug report.

description: updated
Revision history for this message
Sridhar Gaddam (sridhargaddam) wrote :

Armando, Xu Han Peng, I've updated the bug report accordingly. Please feel free to modify it, if you think it needs some additional description.

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

Can we have a simpler set of steps that we can use to reproduce this issue? I think using a provider network is sidetracking us.

Revision history for this message
Kyle Mestery (mestery) wrote :

Moving this out of RC1. If we have to spin an RC2 and the issues raised by Armando are resolved we can reconsider adding this into RC2.

Changed in neutron:
milestone: juno-rc1 → kilo-1
Revision history for this message
Xu Han Peng (xuhanp) wrote :

Simple steps to recreate the bug without provider network:

1. Create a network:
neutron net-create ipv6_net

2. Create subnet on this network:
neutron subnet-create --name ipv6_subnet --ip_version 6 --ipv6-address-mode slaac --gateway fe80::689d:41ff:fe20:44ca ipv6_net 2001:1:2:3::/64

3. Create an instance using this network:
nova boot --image d47c60ac-1a17-4004-b8fc-8c4ac4bba1e0 --flavor 1 --nic net-id=8322f539-05c6-4166-82dc-3e810b0b1ee7 ipv6_vm

4. Check the DHCP port and we can see the address is not EUI64 based:
neutron port-show 421c89f4-2ff7-4a35-a799-d7ff5ece0ec8
+-----------------------+--------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------+--------------------------------------------------------------------------------------+
| admin_state_up | True |
| allowed_address_pairs | |
| binding:host_id | ubuntu-server1 |
| binding:profile | {} |
| binding:vif_details | {"port_filter": true, "ovs_hybrid_plug": true} |
| binding:vif_type | ovs |
| binding:vnic_type | normal |
| device_id | dhcp647fc77f-a839-5b86-86aa-28e0c81bbf82-8322f539-05c6-4166-82dc-3e810b0b1ee7 |
| device_owner | network:dhcp |
| extra_dhcp_opts | |
| fixed_ips | {"subnet_id": "d86b26ca-6a64-4feb-bcda-bd63eb20767c", "ip_address": "2001:1:2:3::1"} |
| id | 421c89f4-2ff7-4a35-a799-d7ff5ece0ec8 |
| mac_address | fa:16:3e:cf:9d:8b |
| name | |
| network_id | 8322f539-05c6-4166-82dc-3e810b0b1ee7 |
| security_groups | |
| status | ACTIVE |
| tenant_id | a29caf0688554d3e8d2f4da3dac5093d |
+-----------------------+--------------------------------------------------------------------------------------+

Xu Han Peng (xuhanp)
tags: added: juno-rc-potential
duy nguyen (dnlove)
information type: Public → Public Security
information type: Public Security → Public
Changed in neutron:
assignee: Xu Han Peng (xuhanp) → Dane LeBlanc (leblancd)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/101433
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=3ba06618f79fed899188aac87a8694b3344ee995
Submitter: Jenkins
Branch: master

commit 3ba06618f79fed899188aac87a8694b3344ee995
Author: Xu Han Peng <email address hidden>
Date: Fri Jun 20 14:59:53 2014 +0800

    Use EUI64 for IPv6 SLAAC when subnet is specified

    This commit uses EUI64 for SLAAC and stateless IPv6 address
    when subnet id in fixed_ip is specified.

    After this patch, all the ports created on a subnet which has
    ipv6_address_mod=slaac or ipv6_address_mod=dhcpv6-stateless
    will use EUI64 as the address.
    This patch also checks if fixed IP address is specified
    for a IPv6 subnet with address mode slaac or dhcpv6-stateless
    during creating or updating a port. If yes, raise InvalidInput
    error to stop the port creation or update.

    Remove unit test test_generated_duplicate_ip_ipv6 because
    fixed_ip should not be specified for a slaac subnet.

    Change-Id: Ie481cfb2f4313baf44bf1a838ebda374a5c74c6a
    Closes-Bug: 1330826

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
tags: added: juno-backport-potential
removed: juno-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/129144

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/juno)

Reviewed: https://review.openstack.org/129144
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=330ca8179bbcbc0025b1347bc1cf6fcf28c9eed6
Submitter: Jenkins
Branch: stable/juno

commit 330ca8179bbcbc0025b1347bc1cf6fcf28c9eed6
Author: Xu Han Peng <email address hidden>
Date: Fri Jun 20 14:59:53 2014 +0800

    Use EUI64 for IPv6 SLAAC when subnet is specified

    This commit uses EUI64 for SLAAC and stateless IPv6 address
    when subnet id in fixed_ip is specified.

    After this patch, all the ports created on a subnet which has
    ipv6_address_mod=slaac or ipv6_address_mod=dhcpv6-stateless
    will use EUI64 as the address.
    This patch also checks if fixed IP address is specified
    for a IPv6 subnet with address mode slaac or dhcpv6-stateless
    during creating or updating a port. If yes, raise InvalidInput
    error to stop the port creation or update.

    Remove unit test test_generated_duplicate_ip_ipv6 because
    fixed_ip should not be specified for a slaac subnet.

    Change-Id: Ie481cfb2f4313baf44bf1a838ebda374a5c74c6a
    Closes-Bug: 1330826
    (cherry picked from commit 3ba06618f79fed899188aac87a8694b3344ee995)

tags: added: in-stable-juno
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (feature/lbaasv2)

Fix proposed to branch: feature/lbaasv2
Review: https://review.openstack.org/130864

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (feature/lbaasv2)
Download full text (72.6 KiB)

Reviewed: https://review.openstack.org/130864
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=c089154a94e5872efc95eab33d3d0c9de8619fe4
Submitter: Jenkins
Branch: feature/lbaasv2

commit 62588957fbeccfb4f80eaa72bef2b86b6f08dcf8
Author: Kevin Benton <email address hidden>
Date: Wed Oct 22 13:04:03 2014 -0700

    Big Switch: Switch to TLSv1 in server manager

    Switch to TLSv1 for the connections to the backend
    controllers. The default SSLv3 is no longer considered
    secure.

    TLSv1 was chosen over .1 or .2 because the .1 and .2 weren't
    added until python 2.7.9 so TLSv1 is the only compatible option
    for py26.

    Closes-Bug: #1384487
    Change-Id: I68bd72fc4d90a102003d9ce48c47a4a6a3dd6e03

commit 17204e8f02fdad046dabdb8b31397289d72c877b
Author: OpenStack Proposal Bot <email address hidden>
Date: Wed Oct 22 06:20:15 2014 +0000

    Imported Translations from Transifex

    For more information about this automatic import see:
    https://wiki.openstack.org/wiki/Translations/Infrastructure

    Change-Id: I58db0476c810aa901463b07c42182eef0adb5114

commit d712663b99520e6d26269b0ca193527603178742
Author: Carl Baldwin <email address hidden>
Date: Mon Oct 20 21:48:42 2014 +0000

    Move disabling of metadata and ipv6_ra to _destroy_router_namespace

    I noticed that disable_ipv6_ra is called from the wrong place and that
    in some cases it was called with a bogus router_id because the code
    made an incorrect assumption about the context. In other case, it was
    never called because _destroy_router_namespace was being called
    directly. This patch moves the disabling of metadata and ipv6_ra in
    to _destroy_router_namespace to ensure they get called correctly and
    avoid duplication.

    Change-Id: Ia76a5ff4200df072b60481f2ee49286b78ece6c4
    Closes-Bug: #1383495

commit f82a5117f6f484a649eadff4b0e6be9a5a4d18bb
Author: OpenStack Proposal Bot <email address hidden>
Date: Tue Oct 21 12:11:19 2014 +0000

    Updated from global requirements

    Change-Id: Idcbd730f5c781d21ea75e7bfb15959c8f517980f

commit be6bd82d43fbcb8d1512d8eb5b7a106332364c31
Author: Angus Lees <email address hidden>
Date: Mon Aug 25 12:14:29 2014 +1000

    Remove duplicate import of constants module

    .. and enable corresponding pylint check now the only offending instance
    is fixed.

    Change-Id: I35a12ace46c872446b8c87d0aacce45e94d71bae

commit 9902400039018d77aa3034147cfb24ca4b2353f6
Author: rajeev <email address hidden>
Date: Mon Oct 13 16:25:36 2014 -0400

    Fix race condition on processing DVR floating IPs

    Fip namespace and agent gateway port can be shared by multiple dvr routers.
    This change uses a set as the control variable for these shared resources
    and ensures that Test and Set operation on the control variable are
    performed atomically so that race conditions do not occur among
    multiple threads processing floating IPs.
    Limitation: The scope of this change is limited to addressing the race
    condition described in the bug report. It may not address other issues
    such as pre-existing issue wit...

Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: kilo-1 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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