[NETVIRT-58] Patch ports are not created while using ODL for L2 handling and Neutron L3-agent to handle L3 in legacy netvirt Created: 12/Aug/16  Updated: 08/Apr/19  Resolved: 27/Dec/16

Status: Resolved
Project: netvirt
Component/s: None
Affects Version/s: Beryllium
Fix Version/s: None

Type: Bug
Reporter: balakrishnan k Assignee: balakrishnan k
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 6395

 Description   

ODL version: Beryllium SR3
openstack version: Mitaka

issue scenario:
Instance in Openstack to use multiple external provider networks.
we are using ODL for L2 handling and Neutron L3-agent to handle L3.
because ODL does not support Multiple external network.
in this scenario we are expecting ODL to create patch port in br-int and br-ex during external network creation.Also ODL controller to wirte the flows which forward the traffic via patch ports when the user attach the gateway and interface to the router.

The same use case with openvswitch as L2 and Neutron L3-agent to handle L3.Openvswitch driver creating patch ports also writing flows(converting local VLAN to provider VLAN and sending the packets to respective interface) in br-int and br-ex to forward the packets to external Network host.

steps to reproduce the Bug:

1.in devstack local.conf file make changes to create vlan network.
Q_ML2_PLUGIN_TYPE_DRIVERS=vlan,gre,vxlan,flat
[ovs]
local_ip=$HOST_IP
bridge_mappings = physnet1:br-ex
[ml2_type_vlan]
network_vlan_ranges=physnet1:171:172

2.comment "ovsdb.l3.fwd.enabled=yes" in "etc/custom.properties" file.
3.start the controller and install "odl-ovsdb-openstack".
4.Run the devstack "./stack.sh"
5.After stack UP create br-ex and add port to it.
"sudo ovs-vsctl add-br br-ex"
"sudo ovs-vsctl add-port br-ex ens35"
6.now create internal network and VM'scenario
7.Create two VLAN provider network.
8.Create two Routers and attach Gateway.
9.Associate floating IP try to reach external Gateway from the openstack VM instance.



 Comments   
Comment by balakrishnan k [ 21/Sep/16 ]

Approach:
1.Added new flag in "etc/custom.properties" enable the flag (ovsdb.l3.multiple.network.enabled=yes) and start the controller.
2.Create external bridge manually in openstack control node and set provider mappings.
"sudo ovs-vsctl add-br br-ex"
"ovs-vsctl set Open_vSwitch 5d633410-99d6-4ada-b371-71ccd1f99546 other_config:provider_mappings=physnet1:br-ex"
3.Add potrs to the external bridge and add VLAN tag.
"sudo ovs-vsctl add-port br-ex ens36"
"sudo ovs-vsctl add-port br-ex ens36.100"
"ovs-vsctl set port ens36.100 tag=100"
4.Execute "sudo ovs-vsctl set-manager tcp:10.106.138.159:6640" in openstack control node.
5.During set-manager execution in netvirt check the new flag(ovsdb.l3.multiple.network.enabled=yes) value, if it is enabled,
create patch port between br-int and external bridge.

a.Read the external bridge from provider-mappings/bridge_mappings.
b.Use external bridge name and integration bridge name to create patch ports between them.

6.Neutron L3-agent will create a port in br-int for router-gateway,netvirt receives port event for router-gateway.in southbound handler check the newflag(ovsdb.l3.multiple.network.enabled=yes) is enabled and port update is for router-gateway then write the following flows to support Vlan external network.

6a.Handle the packets coming from external router gateway to br-int(write the flow to match the external router gateway port and MAC then forward the packets to br-ex via patch port)
6b.Handle the packets reaching on br-ex via patch port(write the flow to tag the VLAN and forward the packets to external interface connected on br-ex).
6c.Handle the packets coming from br-ex via patch port to br-int.

sample flows:

flows added in br-int:
6a.cookie=0x0, duration=7451.336s, table=100, n_packets=147, n_bytes=6230, idle_age=6506, priority=4,in_port=5,dl_src=fa:16:3e:74:a9:2e actions=output:3
6c.cookie=0x0, duration=7451.336s, table=0, n_packets=147, n_bytes=6230, idle_age=6506, priority=4,in_port=3,dl_vlan=100 actions=strip_vlan,output:5

flows added in br-ex:

6b.cookie=0x0, duration=7451.336s, table=0, n_packets=147, n_bytes=6230, idle_age=6506, priority=4,in_port=3,dl_src=fa:16:3e:74:a9:2e actions=mod_vlan_vid:100,NORMAL

additionally default flow in external bridge to drop the packets coming from patch port and no match found.
cookie=0x0, duration=282604.211s, table=0, n_packets=180, n_bytes=12500, idle_age=5680, hard_age=65534, priority=2,in_port=3 actions=drop

port 5 -->external network gateway.
port 3-->patch-ext created in br-int
port 3-->patch-int created in br-ex

we are using table 100 to write the flows in br-int is that fine?
All the above operation performed only when flag(ovsdb.l3.multiple.network.enabled=yes) is enabled, so this will not affect existing functionality of ODL.

we have tested this approach manually by creating patch ports and adding the flows.patch pushed for above aproach: https://git.opendaylight.org/gerrit/#/c/45812/

Generated at Wed Feb 07 20:20:35 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.