[RFE] Add l2pop support for floating IP resources
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Won't Fix
|
Wishlist
|
ChenjieXu |
Bug Description
Layer 2 population (l2pop) mechanism driver implements the ML2 driver to improve open source plugins overlay implementations (VXLAN with Linux bridge and GRE/VXLAN with OVS)[1]. L2pop avoid the broadcast in MAC learning and ARP resolution by prepopulate the bridge forwarding table[2]. However l2pop doesn’t have support for floating IP resources. If the floating IP resources can be prepopulated, the broadcast for scenarios when two VM instances, residing on different networks, communicate via their respective FIP addresses can be avoided.
Problem Description
=======
Figure-1 illustrates the scenarios for floating IP. The IP address “182.34.4.2” in Port3 is the IP address in floating IP resources. When the client in the external network tries to access VM1, the destination IP “182.34.4.2” is replaced by the IP address “10.0.0.3” of the Port1. Notice that the IP address of Port1 is the IP address of VM1. When VM1 send packets back to client, the source IP “10.0.0.3” will be replaced by “182.34.4.2”.
When users want to use floating IP, they should first require allocating a floating IP from floating IP pool or choose a pre allocated floating IP. Allocating floating IP will create a new port and also updates the new port. Creating port will never trigger l2pop but updating port will trigger l2pop on the condition that the port’s new status is ACTIVE or DOWN. However the status of the port for floating IP will always be N/A. Thus allocating floating IP won’t trigger l2pop.
After getting the available floating IP, users can require to associate the VM and the floating IP. Associating the IP address of the VM with the floating IP only updates the floating IP object and doesn’t update the port for floating IP. Thus associating the VM and the floating IP won’t trigger l2pop.
Based on the above analysis, the FDB of floating IP is not prepopulated. It seems that to we can simply change the status of Port3 from N/A to ACTIVE/DOWN to prepopulate the pair (MAC, IP) of Port3 . But we can’t do that because the MAC address of Port3 is never used. In the non-DVR scenario, the MAC address of router gateway will be replied to answer the ARP request for floating IP. In the DVR scenario, the MAC address of floating IP agent gateway will be replied to answer the ARP request for floating IP.
In the following use case, ARP request will be sent out to query the MAC address related to the specific floating IP. Figure-2 illustrates an environment (DVR disabled) that there are two network nodes and two compute nodes.
Use Case 1
1. Tenant-1 creates Network-1 and Tenant-2 creates Network-2.
2. Tenant-1 creates Subnet-1 belonging to Network-1 and Tenant-2 creates
Subnet-2 belonging to Network-2.
3. Tenant-1 creates Router-1 and links the Router-1 to the external provider
network External_
Router-2 to the same external provider network External_
4. Tenant-1 links the Router-1 to the Subnet-1 and Tenant-2 links Router-2 to
the Subnet-2.
5. Tenant-1 creates VM-1 in Subnet-1 and Tenant-2 creates VM-2 in Subnet-2.
6. Tenant-1 creates FloatingIP-1 and Tenant-2 creates FloatingIP-2.
7. Tenant-1 associates VM-1 with FloatingIP-1 and Tenant2 associates VM-2 with
FloatingIP-2.
8. VM-1 communicates VM-2 by floating IP. For example: VM-1 pings FloatingIP-2
for the first time.
VM-1 has the IP address “10.0.0.1” which is the IP address of Port1 and VM-2 has the IP address “198.0.0.2” which is the IP address of Port2. FloatingIP-1 has the IP address “182.34.4.5” and FloatingIP-2 has the IP address “182.34.4.6”(The related ports are not drawn). The MAC address of Router-1 gateway(Gateway-1) is “fa:16:3e:1b:ee:2b” and the MAC address of Router-2 gateway(Gateway-2) is “fa:16:
VM-1 and VM-2 reside on different networks and communicate via their respective floating IP addresses. When VM-1 pings FloatingIP-2 for the first time, since FloatingIP-2 is not in the same subnet as Port1, VM-1 will send the the ICMP echo request directly to its default gateway which is Gateway-1. And Gateway-1 will first send out an ARP request for a FloatingIP-2 to resolve its MAC address. And the MAC address “fa:16:3e:ab:cf:34” of Gateway-2 will be answered. After L2 MAC address resolution succeeding, L3 level protocols will route the request to the correct destination. If the FDB is pre-populated, the ARP request between the two router gateway interfaces can be avoided. For non-DVR use case, (host_ip, router_
The figure-3 illustrates an environment (DVR enabled). The use case is listed below:
Use Case 2
1. Tenant-1 creates Network-1 and Tenant-2 creates Network-2.
2. Tenant-1 creates Subnet-1 belonging to Network-1 and Tenant-2 creates
Subnet-2 belonging to Network-2.
3. Tenant-1 creates a distributed virtual router DVR-1 and Router-1 is the
distributed router on compute-1. Tenant-2 creates a distributed virtual
router DVR-2 and Router-2 is the distributed router on compute-2.
4. Tenant-1 links the DVR-1 to the external provider network
External_
provider network External_
5. Tenant-1 links the DVR-1 to the Subnet-1 and Tenant-2 links DVR-2 to the
Subnet-2.
6. Tenant-1 creates VM-1 in Subnet-1 and Tenant-2 creates VM-2 in Subnet-2.
7. Tenant-1 creates FloatingIP-1 and Tenant-2 creates FloatingIP-2.
8. Tenant-1 associates VM-1 with FloatingIP-1 and Tenant2 associates VM-2 with
FloatingIP-2.
9. VM-1 communicates VM-2 by floating IP. For example: VM-1 pings FloatingIP-2
for the first time.
VM-1 has the IP address “10.0.0.1” which is the IP address of Port1 and VM-2 has the IP address “190.0.0.2” which is the IP address of Port2. FloatingIP-1 has the IP address “182.34.4.5” which is the IP address of Port5 and FloatingIP-2 has the IP address “182.34.4.6” which is the IP address of Port6. When a floating IP is attached to a VM, the L3 agent will create a FIP namespace (If one does not already exist) for the external network that the FIP belongs to. After the step 8, FIP-1 and FIP-2 will be created. Port9 is FIP-1 floating IP agent gateway and Port10 is FIP-2 floating IP agent gateway. The MAC address of Port9 is “fa:16:3e:e9:87:24” and the MAC address of Port10 is “fa:16:
VM-1 and VM-2 reside on different networks and communicate via their respective floating IP addresses. When VM-1 pings FloatingIP-2 for the first time, since FloatingIP-2 is not in the same subnet as Port1, VM-1 will send the the ICMP echo request directly to its default gateway which is FIP-1 floating IP agent gateway. And FIP-1 floating IP agent gateway will first send out an ARP request for a FloatingIP-2 to resolve its MAC address And the MAC address “fa:16:3e:e7:86:db” of FIP-2 floating IP agent gateway will be answered. After L2 MAC address resolution succeeding, L3 level protocols will route the request to the correct destination. If the FDB is prepopulated, the ARP request between the two floating IP agent gateway interfaces can be avoided. For DVR use case, (host_ip, floatingip_
Proposed Change
=======
The idea is that advertising the FDBs for floating IP when the FIP status changes to "ACTIVE" and withdraw the FDBs for floating IP whenever the status is set to "DOWN" or the resource is deleted or disassociated.
Function _notify_fip_status will be added to send an event after updating floating IPs. Function _delete_floatingip should be modified to use _notify_fip_status to notify the floating IP status. Function _update_fip_assoc is used by function _create_floatingip and _update_floatingip. Both functions will send events after updating floating IP with the result from _update_fip_assoc. Thus we can just insert the status of floating IP into the result of _update_fip_assoc. Function disassociate_
A class L3RouterL2PopMixin should be added to process the event sent after updating floating IP. This class should subscribe the event and register the callback to l2pop mechanism driver to extend the l2pop FDBs (Depends on RFE: https:/
All changes can be viewed through the link below:
https:/
https:/
Data Model Impact
=======
None
REST API Impact
=======
None
Command Line Client Impact
=======
None
Other Impact
=======
None
Other Deployer Impact
=======
None
Performance Impact
=======
Performance testing should be conducted to see test the overhead of adding more information to FDB.
Implementation
Assignee(s)
Work Items
=======
Add function _notify_fip_status to neutron/db/l3_db.py and modify some existing functions in l3_db.py.
Add class L3RouterL2PopMixin to neutron/
Add related tests.
Dependencies
=======
Need the RFE “Enable other subprojects to extend l2pop FDB information” merged in OpenStack. This RFE enables other subprojects to extend l2pop FDB information. We need to add floating IP related information to l2pop FDB. Thus we need to use the ability provided by the RFE. The link for RFE is below:
https:/
Testing
=======
Unit tests are necessary.
Documentation Impact
=======
None.
References
=======
[1] https:/
[2] https:/
Changed in neutron: | |
assignee: | nobody → ChenjieXu (midone) |
description: | updated |
description: | updated |
description: | updated |
tags: | added: rfe |
Changed in neutron: | |
importance: | Undecided → Wishlist |
description: | updated |
Maybe I am misunderstanding, but I am having difficulty understanding the need for this RFE:
1) In both use cases described above, you state that "When VM-1 pings FloatingIP-2 for the first time, it needs to know the MAC address for FloatingIP-2. Thus ARP request is sent out". Since FloatingIP-2 is not in the same subnet as Port1, wouldn't just VM send the the ICMP echo request directly to its default gateway and let L3 level protocols route the request to the correct destination?
2) The summary of your proposal is "The idea is that advertising the FDBs for floating IP when the FIP status changes to "ACTIVE" and withdraw the FDBs for floating IP whenever the status is set to "DOWN" or the resource is deleted or disassociated." Aren't we mixing L2 and L3 concepts here unnecessarily. The FDB entries in L2pop are meant to optimize the communication at L2. Floating IPs should be handled by L3. Am I missing something?