Monday, March 24, 2014

SDN Opendaylight Controller: Add/Remove Flow Entries using REST

Start Controller
$ ./

Start Open vSwitches using Mininet
$ sudo mn --topo single,2 --controller remote,ip= --switch ovsk,protocols=OpenFlow13     Virtual Machine (VM) where Opendaylight(ODL) Controller is running     VM where Mininet is running

We will be using f206.xml for our testing.

Before using REST request Click on Basic Auth tab and configure username/password as admin/admin which are default credentials for accessing Controller GUI, click Refresh Headers. And configure Content-Type and Accept as shown below

To add a Flow Entry on to OpenvSwitch need to use PUT request method.

table_id, id tags of the XML will be part of REST request URL

Select raw-> XML as data format and copy f206.xml to the text body and click on Send tab. It should return us "200 OK" status code which indicates Flow is successfully sent to Controller without any issues, and the information will be saved in Controllers cache(Configuration Data Store).

Flow being successfully sent to Switch or not can be verified using ovs-ofctl command.

To remove a flow from Switch using REST request use DELETE request instead of PUT.

Following articles might be of interested
SDN Opendaylight Controller: Add/Remove Flow Entries using OSGI CLI

ovs-ofctl OVS action commands for OpenFlow 1.3

ovs-ofctl commands on OpenFlow 1.3 Mininet Open vSwitch (OVSK) 

Interested in Ethical Hacking!