Lab-4:Configuring OVS using ODL northbound REST API

The objective of this lab is  to manage a open virtual switch (OVS) using north-bound REST API interface and south-bound OVSDB plugin on ODL controller. I will be adding/deleting bridge and adding & deleting ports on OVS bridge using OVSDB REST API . I will use  ODL controller GUI and OVS cli to confirm the test. I will use Chrome POSTMAN for RESTAPI operations

It is import you have Lab-2 running before you try this lab as I have not given instructions how to start ODL and OVS topology

Topology:

ovsdb_nb_0

Components required:

ODL karaf based Lithium-SR3 controller, mininet on VM, POSTMAN & OVSDB plugin for ODL controller

Pre-condition:

  • Lab-3 running
  • Google POSTMAN installed

Procedure:

  • Check ovsdb plugin in ODL karaf interface and install if they are missing
    • >feature:install odl-ovsdb-openstack
    • >feature:install odl-ovsdb-northbound
      • Note: if error/warning raised on karaf console while installing ovsdb-northbound, logout and start karaf  again
  • Check network topology in DLUX gui

ovsdb_4

ovsdb_nb_1

ovsdb_nb_2

Open_vSwitch UUID: 0b8ed0aa-67ac-4405-af13-70249a7e8a96

  • Paste below JSON on POSTMAN ‘raw’ tab make sure JSON is selected

JSON:

{
"parent_uuid":"0b8ed0aa-67ac-4405-af13-70249a7e8a96",
  "row":{
    "Bridge":{
      "name":"testBridge1",
      "ports":{
        "name":"testPort1",
                "interfaces":{
          "name":"testPort1"
       },
                "qos":{
          "type": "linux-htb"
        }
      }
    }
  }
}

ovsdb_nb_3

JSON:

{   "parent_uuid":"0b8ed0aa-67ac-4405-af13-70249a7e8a96",
        "row": {
         "Bridge": {
            "protocols": "OpenFlow11"
          }
        }
}

 

Note: I couldn’t find a way to delete port and bridge using REST API.

 

 

Lab-3:OVS switch configuration using OVSDB cli

 

The objective of this lab is to manage OVS switch using OVSDB cli. I will  demonstrate how to add bridge, delete bridge, add port and add link between bridges. I will use ODL controller to verify topology discovery.

Brief overview of OVSDB from RFC 7047

The OVSDB management interface is used to perform management and
configuration operations on the OVS instance.
Examples of operations that are supported by OVSDB include:

  • Creation, modification, and deletion of OpenFlow datapaths
    (bridges), of which there may be many in a single OVS instance;
  • Configuration of the set of controllers to which an OpenFlow
    datapath should connect;
  • Configuration of the set of managers to which the OVSDB server
    should connect;
  • Creation, modification, and deletion of ports on OpenFlow
    datapaths;
  • Creation, modification, and deletion of tunnel interfaces on
    OpenFlow datapaths;
  • Creation, modification, and deletion of queues;
  • Configuration of QoS (quality of service) policies and attachment
    of those policies to queues; and
  • Collection of statistics.

OVSDB does not perform per-flow operations, leaving those instead to
OpenFlow.

ovsdb_1

Components required:

ODL Lithium-SR3 controller with OVSDB southbound plugin, OVS in a  VM

Pre-condition:

Procedure:

  • Start ODL controller
    • sudo ./karaf
  • Check ovsdb plugin and install if they are missing
    • >feature:install odl-ovsdb-openstack
    • >feature:list –i | grep ‘ovsdb-openstack’
  • Setup OVS ovsdb manager with port# 6640 in active mode. type below commands on OVS VM. in ‘active’ mode OVS proactively create  connection with ODL
    • sudo ovs-vsctl show
    • sudo ovs-vsctl set-manager tcp:192.168.56.1:6640

ovsdb_0

  • open a browser and point to this location
  • Add bridge s1 and controller using ovsdb cli
    • ovs-vsctl add-br s1
    • ovs-vsctl set-controller tcp:192.168.56.1:6633
  • Add second bridge and controller
    • ovs-vsctl add-br s2
    • ovs-vsctl set-controller tcl:192.168.56.1:6633
  • Add ports to bridge s1 and s2
    • ovs-vsctl add-port s1 s1-eth1
    • ovs-vsctl add-port s2 s1-eth1
  • Check topology in ODL gui. Bridge discovered but no link between bridges

ovsdb_2

  • Set interface type=patch
    • ovs-vsctl set interface s1-eth1 type=patch
    • ovs-vsctl set interface s2-eth1 type=patch
  • Add link between bridges thru interface s1-eth1 & s2-eth1
    • ovs-vsctl set interface s1-eth1 options:peer=s2-eth1
    • ovs-vsctl set interface s2-eth1 options:peer=s1-eth1
  • Check topology in ODL gui , link between bridge discovered

 

ovsdb_4

  • Dump from OVS switch

ovsdb_3

  • Delete bridge, delete port
    • ovs-vsctl del-br s1
    • ovs-vsctl del-port s1 s1-eth1

Lab-2: Openday light (ODL) controller and OVS integration

The objective of this lab is to integrate OVS switch with ODL controller. Use Mininet to create OVS bridge topology and make sure ODL can discover the topology and data path can be created thru ODL controller

Components required:

ODL controller Lithium-SR3, Mininet, Oracle virtual box, Linux machine with Ubuntu 14.04 LTS

Precondition:

  1. ODL controller installed. Try this link to install ODL Lithium-SR3
  2. Mininet installed. Try this link to download Mininet VM ISO image

Procedure:

  • Start ODL controller
    • cd distribution-karaf-0.3.3-Lithium-SR3/bin
    • sudo ./karaf
  • Install below plugins
    • > feature:install odl-restconf odl-mdsal-apidocs odl-dlux-all odl-l2switch-switch-ui
  • Access ODL DLUX GUI. Open a browser in host machine and  point to this location

odl_mininet_0

Virtual Box setup for Mininet

  • Setup VM adapter as ‘Host-only Adapter’. This will create virtual interface on host machine which will be used to communicate between host and guest machine. See below picture

odl_mininet_1

  • Virtual interface (vboxnet0) created on host machine. run ‘ifconfig’ on command line.

odl_mininet_2

  • Start Mininet VM using the ISO image. Change adapter setting to ‘Host-only’ and check IP address on ‘eth0’ interface

odl_mininet_3

odl_mininet_4

  • Start Mininet with single bridge and two hosts. controller set to remote with IP address 192.168.56.1 which is the IP address of vboxnet0 interface on host machine
    • sudo mn –controller=remote,ip=192.168.56.1,port=6633
    • Note: If error ‘can’t connect to controller’ reported it means 1) either controller is not running or controller Openflow port =6633 is not listening. you can check listening port by running this command ‘netstat -anp | grep 6633’
  • Perform ping operation.
    • pingall
  • Press ‘Reload’ button in DLUX GUI. Topology shows one bridge and two hosts

odl_mininet_5