Document

Open vSwitch
What is Open vSwitch ?

Open vSwitch is an open source OpenFlow capable virtual switch
that is typically used with hypervisor to interconnect virtual machines
within a host and virtual machines between different host across the
network.

Open vSwitch licenced under Apache 2.0

it is also used on some dedicated switching hardware.

OVS can be a critical in an SDN solutions.
OVS Features

Visibility into inter-VM communication via NetFlow, sFlow(R), IPFIX, SPAN, RSPAN, and GRE-tunneled mirrors

LACP (IEEE 802.1AX-2008)

Standard 802.1Q VLAN model with trunking

BFD and 802.1ag link monitoring

STP (IEEE 802.1D-1998)

Fine-grained QoS control

Support for HFSC qdisc

Per VM interface traffic policing

NIC bonding with source-MAC load balancing, active backup, and L4 hashing

OpenFlow protocol support (including many extensions for virtualization)

IPv6 support

Multiple tunneling protocols (GRE, VXLAN, IPsec, GRE and VXLAN over IPsec)

Remote configuration protocol with C and Python bindings

Kernel and user-space forwarding engine options

Multi-table forwarding pipeline with flow-caching engine

Forwarding layer abstraction to ease porting to new software and hardware platforms
The newest version is 2.3.0
Main Component
ovsdb - server

Database that holds switch-level configuration.
•
Bridge, Interface, tunnel definision.

Configuration is stored on disk and survives a reboot.

Log based (good for debugging)

ovsdb-tool
command-line tool to manage the database

ovsdb
persist the data across reboots. Configures ovs-vswitchd
ovs-vswitchd

Core component in the system:
•
Communicates with outside world using OpenFlow
•
Communicates with ovsdb server using management protocol
(ovsdb)
•
Communicates with kernel module over netlink

Support multiple independent datapaths (bridges)

Implements mirroring, bonding, and VLANs through modifications
of the same flow table exposed through OF.
openvswitch_mod.ko

Kernel module
•
Handles switching and tunneling
•
Designed to be fast and simple.
•
If flow found, actions are executed otherwise passed to the user
space.
•
Implements tunnels and caches flows.
Some OVS utility

ovs-ofctl – management utility for openflow

ovs-dpctl – Open vSwitch datapath management utility

ovs-vsctl – manage the switch through interaction with ovsdbserver

ovs-appctl – utility for managing logging levels

ovsdb-client – monitoring OVS database.
Installing Open vSwitch on Ubuntu

Prepare the system
•
Check the system kernel version and release
$ uname –r
•
Stop the network-manager service
$ sudo service network-manager stop
•
Update the system.
$ sudo apt-get update
Installing Open vSwitch on Ubuntu

Installing dependencies.
•
pkg-config
•
python-simplejson
•
lib-ssl-dev
•
python-qt4
•
iproute
•
python-twisted-conch
•
tcpdump
•
automake
•
Linux-headers
•
autoconf
•
gcc
Command:
•
uml-utilities
$ apt-get install [packet-name]
•
libtool
•
build-essential
Installing Open vSwitch on Ubuntu
Installing Open vSwitch on Ubuntu

Download the Open vSwitch

2 ways:

Download the tar.gz file from the website via web browser

Using command line.
$ wget http://openvswitch.org/releases/openvswitch-2.3.0.tar.gz

Extract the tar.gz file.
$ tar xf openvswitch-2.3.0.tar.gz

Navigate to the folder.
$ cd [folder-name]
Installing Open vSwitch on Ubuntu
Installing Open vSwitch on Ubuntu

Compile and install
$ ./boot.sh
$ ./configure
--with-linux=/lib/modules/’uname –r’/build
$ sudo make
$ sudo make install
Installing Open vSwitch on Ubuntu

After the installation, we need to load the kernel module
$ insmod datapath/linux/openvswitch.ko

Create the configuration file.
$ touch /usr/local/etc/ovs-vswitch.conf
$ mkdir –p /usr/local/etc/openvswitch
$ vsdb-tool create /usr/local/etc/openvswitch/conf.db
Installing Open vSwitch on Ubuntu
Installing Open vSwitch on Ubuntu

Start the ovs-switchd.
Before starting ovs-vswitchd itself, we need to start its
configuration database, ovsdb-server. Each machine on which Open
vSwitch is installed should run its own copy of ovsdb-server.
Command:
$ ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock
--remote=db:Open_vSwitch,Open_vSwitch,manager_options
--private-key=db:Open_vSwitch,SSL,private_key
--certificate=db:Open_vSwitch,SSL,certificate
--bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert
--pidfile --detach
Installing Open vSwitch on Ubuntu
Installing Open vSwitch on Ubuntu

Initialize the database.
initialize the database using ovs-vsctl. This is only necessary the first time after
you create the database with ovsdb-tool (but running it at any time is harmless):
Command:
$ ovs-vsctl --no-wait init
Installing Open vSwitch on Ubuntu

Start the Open vSwitch Daemon.
Then start the main Open vSwitch daemon, telling it to connect to the same
domain socket:
Command:
$ ovs-vswitchd --pidfile --detach
Installing Open vSwitch on Ubuntu

Start the Open vSwitch Daemon.
Then start the main Open vSwitch daemon, telling it to connect to the same
domain socket:
Command:
$ ovs-vswitchd --pidfile --detach
Installing Open vSwitch on Ubuntu

Check the installation and overview the database.
Command:
$ ovs-vsctl --version
$ ovs-vsctl show
Thank You