r/openstack • u/[deleted] • Apr 20 '21
How does OVN work with Openstack?
I am using Redhat OpenStack in my environment with OVN as the default network plugin and I'm having a hard time understanding how OVN works. I was able to understand the connection between NB and SB database and function of northd, I was also able to list the flows from SB. What I don't understand is how it integrates with br-int, br-ex and br-tenant on the compute host.
br-tenant as I understand is the interface for the vms to communicate with each other, but when I do tcpdump on it I see no action, and traceroute from the guest vms don't show the actual path the packets are taking -- I'm thinking this is because of encapsulation.
I see multiple tap ports on br-int and I only see patch ports between br-int and br-ex. There is no patch port on br-tenant. Does that mean br-tenant is redundant here and not being used at all?
Are there any good resources on this topic. I could find a few good resources that cover the OVS plugin but not many for OVN. I was just looking the understand the packet flow. If you have answer to my question, or know of any good resources please let me know.
2
u/amedeos Apr 21 '21
the standard installation of rhosp with ovn, usually, comes wih only the integration bridge br-int, where you can see on one node the remote_ip of all other nodes, and the external bridge br-ex, where you can put the external (floating ip) vlans for your instances.
if you have a br-tenant on your rhosp, have a look at your tripleo templates, I think you're creating that bridge on your "network" templates, as a tip, if you want to see the rendered templates from your roles_data.yaml and network_data.yaml you can run:
(undercloud) [stack@undercloud ~]$ mkdir ~/rendered
(undercloud) [stack@undercloud ~]$ THT=/usr/share/openstack-tripleo-heat-templates
(undercloud) [stack@undercloud ~]$ cd $THT
(undercloud) [stack@undercloud openstack-tripleo-heat-templates]$ tools/process-templates.py -r ~/templates/roles_data.yaml -n ~/templates/network_data.yaml -o ~/renderedlast but not least, if you're a customer you can open a support case
2
u/slaweq Apr 21 '21
Generally bridges are similar to what is with ML2/OVS backend so:
- br-int - it is integration bridge to which all ports (VMs, routers, etc.) are plugged,
- br-ex (or any other bridge configured in bridge mapping, like in Your case br-tenant also probably) are bridges used by the provider networks. Provider networks are vlan or flat networks in neutron. Such network has some physical_network configured in neutron db so packets send to that network from vm will be visible in the bridge which is mapped to that physical network on the node.
- in ML2/OVS case there is also bridge called br-tun which is used for the tenant networks like vxlan and there are tunnel endpoints in that bridge created. I don't have any ML2/OVN running env now to check that for sure but I'm not sure if there is such bridge in OVN case too. You will need to check that.
2
u/amedeos Apr 21 '21
in ovn there aren't br-tun -> in a simple answer it uses north bridge and south bridge...
if you want to tcpdump the "traffic" on one node/interface you can run:
tcpdump -ni eth0 "port 6081" -eeethe port 6081 is the geneve port (no vxlan -> geneve)
also if you want, you can play with ovn-trace in order to see if the network flow is allowed or not, for example:
[root@overcloud-controller-0 ~]# CID=$(podman ps -f name=ovn-dbs-bundle-podman -q) [root@overcloud-controller-0 ~]# podman exec -ti $CID ovn-nbctl show |grep "aka private" -A 10 switch 41cb0617-c95e-4d0f-9c0c-262263b670c4 (neutron-40af4d2c-669d-4486-94b1-7f362738982d) (aka private) port f3b14dc0-3a37-426b-b604-36c9175da95f type: router router-port: lrp-f3b14dc0-3a37-426b-b604-36c9175da95f port 60fa650b-53b2-4883-bff4-bb1d6b40c7d3 addresses: ["fa:16:3e:c8:52:0f 192.168.100.100"] port 9ae0c159-b45b-4246-a3ab-c48d00d96497 (aka vm1port) addresses: ["fa:fa:fa:d0:d0:d0 192.168.100.101", "unknown"] port be0d9563-a9fd-4690-88a3-dc730f01b55d type: localport addresses: ["fa:16:3e:33:81:6f 192.168.100.2"] [root@overcloud-controller-0 ~]# ap=60fa650b-53b2-4883-bff4-bb1d6b40c7d3 [root@overcloud-controller-0 ~]# bp=9ae0c159-b45b-4246-a3ab-c48d00d96497 [root@overcloud-controller-0 ~]# AP_MAC=fa:16:3e:c8:52:0f [root@overcloud-controller-0 ~]# BP_MAC=fa:fa:fa:d0:d0:d0 [root@overcloud-controller-0 ~]# podman exec -ti $CID ovn-sbctl lflow-list private ... <- logical flow with datapath [root@overcloud-controller-0 ~]# podman exec -ti $CID ovn-trace private "inport == \"$ap\"" # reg14=0x2,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,dl_type=0x0000 ingress(dp="private", inport="60fa65") -------------------------------------- 0. ls_in_port_sec_l2: no match (implicit drop) [root@overcloud-controller-0 ~]# echo $ap 60fa650b-53b2-4883-bff4-bb1d6b40c7d3 [root@overcloud-controller-0 ~]# ^^^^ ap dropped because mac address doesn't match ^^^^ [root@overcloud-controller-0 ~]# podman exec -ti $CID ovn-trace private "inport == \"$bp\"" # reg14=0x4,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,dl_type=0x0000 ingress(dp="private", inport="vm1port") --------------------------------------- 0. ls_in_port_sec_l2 (ovn-northd.c:4360): inport == "vm1port", priority 50, uuid 3ecca18a next; 17. ls_in_l2_lkup (ovn-northd.c:6437): 1, priority 0, uuid 2732554d outport = "_MC_unknown"; output; multicast(dp="private", mcgroup="_MC_unknown") ---------------------------------------------- egress(dp="private", inport="vm1port", outport="vm1port") --------------------------------------------------------- /* omitting output because inport == outport && !flags.loopback */ [root@overcloud-controller-0 ~]# ^^^^ bp allowed because it doesn't has port security ^^^^
5
u/[deleted] Apr 20 '21
I am on the same path, trying to understand.
There is a tutorial on https://docs.ovn.org/en/latest/tutorials/ovn-openstack.html that seems quite helpful.