OVN - hpaluch/hpaluch.github.io GitHub Wiki

OVN Open Virtual Network

Disclaimer: I'm just network rookie. Keep in mind that the text below may be incomplete...

To understand OSI layers (which are very common for Network admins) please look at suitable resources, for example:

OVN - Open Virtual Network is software defined L3 router/switch, which means that it is aware of IP protocol and routing and supports DHCP, IP routing and other stuff that is defined for IP Protocol. Under hood it uses OVS:

OVS - Open Virtual switch is software defined switch. It can run standalone (as learning switch, like traditional Linux brigde), with editable configuration and rules (they are stored in database called OVS-DB), or many OVS switches can be managed centrally with so called controller to provide advanced functions (not just central distribution rules, but controller can also hooks for specific events and respond with specific Action). The use communication protocol called OpenFlow.

There are currently two popular controllers:

  1. OVN used by OpenStack Neutron, Kubernetes Overlay network and others.
  2. Faucet

Very quick OVN sandbox

On Debian 11:

sudo apt-get update
sudo apt-get dist-upgrade
# reboot if system was updated
sudo init 6
# NOTE: somehow 'git' is not considered essential
sudo apt-get install build-essential git autoconf libtool automake
mkdir -p ~/projects
cd ~/projects
git clone https://github.com/ovn-org/ovn.git
cd ovn

Now following https://github.com/ovn-org/ovn/blob/main/Documentation/intro/install/general.rst#bootstrapping

./boot.sh
cd ovs/
# now building OVS
./boot.sh 
./configure 
make
# now going back to OVN
cd ..
./configure 
# build and start Sandbox shell
make sandbox

You should see help text like:

----------------------------------------------------------------------
You are running in a dummy Open vSwitch and OVN environment.  You can
use ovn-nbctl, ovn-sbctl, ovs-vsctl, ovs-ofctl, ovs-appctl, and other
tools to work with the dummy runtimes.

The backup server of OVN SB can be accessed by:
* ovn-sbctl --db=unix:/home/ansible/projects/ovn/tutorial/sandbox/sb2.ovsdb
* ovs-appctl -t /home/ansible/projects/ovn/tutorial/sandbox/sb2
The backup database file is sandbox/sb2.db

Log files, pidfiles, and the configuration database are in the
"sandbox" subdirectory.

Exit the shell to kill the running daemons.

Now we can follow: https://github.com/ovn-org/ovn/blob/main/Documentation/tutorials/ovn-sandbox.rst#creating-ovn-resources Simplistic example:

$ ovn-nbctl ls-add sw0 # create logical switch (LS)
$ ovn-nbctl lsp-add sw0 sw0-port1 # add Port to logical switch (LSP)
$ ovn-nbctl lsp-set-addresses sw0-port1 "50:54:00:00:00:01 192.168.0.2"
$ ovn-nbctl show

switch 0ce0528b-beaa-4c3c-9218-6f3fd98c082e (sw0)
    port sw0-port1
        addresses: ["50:54:00:00:00:01 192.168.0.2"]

... see guide ...
... invoke "exit" or Ctrl-d to exit sandbox ...

To invoke sandbox again run make sandbox in ~/projects/ovn directory. You can also invoke ./ovn-setup.sh from Sandbox shell to quickly setup sample Switches, Ports, Routers and Chassis from tutorial...

OVN Resources

Please visit these links for overview:

OVN is included in latest Microstack (Version Beta 245) and also in latest DevStack - DevStack-Quick-Start. In all OpenStack clones it is implemented as OVN plugin for Neutron (Network layer).

More in-depth articles on OVN:

How is OVN integrated into OpenStack?

And really vast resource of OpenStack and OVN:

Integrating OVN with LibVirt/KVM (when you use virt-manager et al. for Virtualisation) - not tested: