Upgrading Open vSwitch in Mininet 2.0 VM to OVS 1.10
August 20, 2013 5 Comments
Update: I have a followup post on how to do the same thing but instead building and installing Debian package files. It’s a cleaner approach and allows easier upgrades over and over.
—————————
Just want to share something I learned from the Mininet mailing list and tried out. These are instructions, courtesy of Vikram Dham from this post, but have been slightly altered for my own reading.
The following instruction are how to upgrade the Open vSwitch version that comes in the Mininet 2.0 VM to Open vSwitch 1.10. Some features that I have seen are support for OpenFlow 1.2 and VXLAN tunnels.
1. Setting up Mininet VM, it you already don’t have it.
– Download the Mininet 2.0 vm and import it in VirtualBox. These should be similar to the instruction on the Mininet site.
– Download Mininet 2.0 from https://github.com/mininet/mininet/downloads/
– Import unzip the package
– Import appliance into VirtualBox
– Change setting to add additional Host Only network adapter
– Start VM and login as mininet
– Enable the second interface ‘sudo dhclient eth1’
2. Become root
sudo -s
3. Remove old packaes
apt-get remove openvswitch-common openvswitch-datapath-dkms openvswitch-controller openvswitch-pki openvswitch-switch
4. Download and unpack Open vSwitch 1.10
cd /root
wget http://openvswitch.org/releases/openvswitch-1.10.0.tar.gz
tar zxvf openvswitch-1.10.0.tar.gz
5. Build and install
cd openvswitch-1.10.0
./configure –prefix=/usr –with-linux=/lib/modules/`uname -r`/build
make
make install
make modules_install
rmmod openvswitch
depmod -a
6. Disable to default controller
echo “manual” >> /etc/init/openvswitch-controller.override
/etc/init.d/openvswitch-controller stop
7. Start OVS server process
/etc/init.d/openvswitch-switch start
Now you should have a working Mininet using OVS 1.10. Below are some steps to test the new OVS 1.10 features that you now have available.
8. Start mininet with a test topology
cd /home/mininet/mininet/examples
./emptynet.py
9. In another window, check what protocol the switch is running.
ovs-ofctl -O OpenFlow10 show s3
ovs-ofctl -O OpenFlow12 show s3
10. One of the above will error, showing that is does not support that version. Now let’s change it to OF1.2.
ovs-vsctl set bridge s3 protocols=OpenFlow12
You will see that OpenFlow12 command worked.
11. You can run another command to see if the protocol is set on the switch.
root@mininet-vm:~# ovs-vsctl list bridge s3
_uuid : e3171ac1-0b53-4770-be32-e5903e3801be
controller : [b82acc19-5536-42b9-95eb-22942e683b98]
datapath_id : "0000000000000003"
datapath_type : ""
external_ids : {}
fail_mode : secure
flood_vlans : []
flow_tables : {}
mirrors : []
name : "s3"
netflow : []
other_config : {datapath-id="0000000000000003"}
ports : [34a45885-7cda-4cb8-a76c-35e048795201, c33e59b5-050b-4fad-92da-e495d66de4a4, d0c18e1a-fc46-4f41-89df-968cd59c01d5]
protocols : ["OpenFlow12"]
sflow : []
status : {}
stp_enable : false
12. You can enable all supported protocols by running the following.
ovs-vsctl set bridge s3 protocols=OpenFlow10,OpenFlow12,OpenFlow13