Upgrading Open vSwitch in Mininet 2.0 VM to OVS 1.10

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

5 Responses to Upgrading Open vSwitch in Mininet 2.0 VM to OVS 1.10

  1. Jay says:

    Beautifully written!!!
    Clear cut instructions.

  2. Arun Sharma says:

    Thanks…..i tried it works

  3. pankaj says:

    Hi,

    I read all of your blogs they are quite useful and informative. Thanks for uploading your the information. i tried to get hands on OVS, mininet and opendaylight.

    i installed mininet using install.sh -nfv and after that i installed Open vSwitch 2.1.0.
    (Basically i Followed the this tutorial, to install nbew version of openvswitch https://github.com/mininet/mininet/wiki/Installing-new-version-of-Open-vSwitch)

    i created a topology in mininet and connected to the opendaylight controller using
    sudo mn –custom custom/trial.py –topo mytopo –switch ovsk –controller=remote,ip=192.168.44.144,port=6633

    My question is how to know whether mininet is using the new version of Open-vSwitch or the inbuilt version of openvswitch?
    what is the difference between –switch user and –switch ovsk?

    i hope ovs supports openflow version 1.1 to 1.3, because of following results

    root@ubuntu:/root/openvswitch-2.1.0# sudo ovs-ofctl –version
    ovs-ofctl (Open vSwitch) 2.1.0
    Compiled Aug 30 2014 07:07:34
    OpenFlow versions 0x1:0x4

    Thanks,
    Pankaj

    • gregorygee says:

      Thanks for reading, I’m glad it is useful information to people. So to answer your questions.

      1. There is usually only one version of OVS installed. If you used the post to upgrade the packages, then the old version was replaced by you new package. You can test it using the command you used above or the following.

      mininet@mininet:~$ sudo ovs-vsctl show
      850e4c64-af4a-4c43-97a6-fa8c4161c35b
          ovs_version: "2.0.1"

      2. Yes, OVS added OpenFlow 1.1 and 1.3 in the OVS 1.10.0 release. Later versions of OVS added 1.2.

      3. In OVS 2.1.0, OpenFlow is still default to OF1.0. You explicitly have to turn on the other protocols. You can set it to accept multiple versions or a list of OF versions.

      sudo ovs-vsctl -- set bridge s2 protocols='OpenFlow13,OpenFlow11'

      If using the latest Mininet from GIT, then you can set it when you add the switch.

      s2 = net.addSwitch( 's2', protocols='OpenFlow13,OpenFlow11' )

      Also, I believe starting in OVS 2.3.0, OF 1.3 is turned on by default as well.

      4. For the post you reference here, there is a followup post on how to upgrade using Ubuntu packages which would be a cleaner way to upgrade.

      5. If you installed Mininet from the latest GIT instead of using the VM, there is an option in the Mininet installer to upgrade your OVS now. Just use the -V (capital V) following by the OVS version you want instead of using the -v options. eg. ‘install.sh -V 2.1.0’. This will make the Mininet installer download OVS 2.1.0 source, compile, package and install it.

      Hope this information helps.

Leave a comment