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