Open vSwitch (OVS): Setup and Working
In this blog post we will be discussing about OVS, its working and the associated commands for access. This will be coupled up with installation of OVS in mininet so that you can cary out experimentation at the switch kernel.
The very first step is to install the latest LTS release(I prefer it personally), it is the OVS v2.5.x. Mininet comes with OVS v1.x, you would like to work on latest or atleast LTS releases. Moreover, you might find it hard time to locate the kernel code of OVS in the default mininet installation. So, installing OVS should definelty help you in locating the code and carrying out further experemntation.
For the working and understanding of OVS, visit the following blog. Its breifly written on how each component in OVS operates. For the installation, I will be following binary build option. If you are interested in Debain packages you can follow the mininet tutorial wiki. A lot of this information upnext has been taken from the same wiki I just mentioned.
Become root:
mininet@mininet-vm$ sudo -s
Remove old packages:
root@mininet-vm# apt-get remove openvswitch-common openvswitch-datapath-dkms openvswitch-controller openvswitch-pki openvswitch-switch
Download and unpack OpenVSwitch 2.5.5:
root@mininet-vm# cd /root
root@mininet-vm# wget http://openvswitch.org/releases/openvswitch-2.5.5.tar.gz
root@mininet-vm# tar zxvf openvswitch-2.5.5.tar.gz
Binary build and install:
root@mininet-vm# cd openvswitch-2.5.5/
root@mininet-vm# ./configure --prefix=/usr --with-linux=/lib/modules/`uname -r`/build
root@mininet-vm# make
root@mininet-vm# make install
root@mininet-vm# make modules_install
root@mininet-vm# rmmod openvswitch
root@mininet-vm# depmod -a
Then do some post install steps to keep the Open vSwitch Controller from starting automatically on boot:
root@mininet-vm# /etc/init.d/openvswitch-controller stop
root@mininet-vm# update-rc.d openvswitch-controller disable
Start OVS server process:
root@mininet-vm# /etc/init.d/openvswitch-switch start
That should be it. Once you have finished, you can confirm that you have the latest Open vSwitch installed and the latest kernel module. You should see something like the example below.
root@mininet-vm# ovs-vsctl show
a96f86e7-ca43-487f-b65d-e18b52a64330
ovs_version: "2.5.5"
root@mininet-vm# modinfo openvswitch | grep version:
version: 2.5.5
srcversion: 90A0BE65A0CF67E0BEA2D57
For further experimentation, you may go ahead and explore each file and read more about it. I will post more on this relating to my project once my paper gets published.
Note: Each time you make any changes at the kernel code of the OVS, make sure to build it before you carry out simulations etc. As any changes done at kernel level needs to be followed by build again. Therefore to build, follow the build instructions above.