Monday, March 24, 2014

SDN Opendaylight Controller: Add/Remove Flow Entries using OSGI CLI


Start Controller
$ ./run.sh

Start Switches using mininet
$ sudo mn --topo single,2 --controller remote,ip=192.168.56.101 --switch ovsk,protocols=OpenFlow13

osgi> addMDFlow openflow:1 f40
osgi> removeMDFlow openflow:1 f40

f40 is and XML file, f40.xml located at openlowplugin/test-scripts/xmls which is part of your openflowplugin git clone.

You can also execute addMDFlow command as shown below
osgi> addMDFlow openflow:1 f40 8
where 8 represents new Table ID.

To make sure flows are pushed onto OpenvSwitch(OVS) execute below command
$ sudo ovs-ofctl -O OpenFlow dump-flows s1


Adding a Flow Entry to Switch using OSGI CLI.


Verifying Flow Entry exists on Switch by executing ovs-ofctl command on machine where Mininet is running.


Removing a Flow Entry on Switch using OSGI CLI


Verifying Flow Entry exists on Switch by executing ovs-ofctl command on machine where Mininet is running.


Below articles might be of interest
ovs-ofctl OVS action commands for OpenFlow 1.3
http://blog.disects.com/2014/01/ovs-ofctl-ovs-action-commands-for.html

 ovs-ofctl commands on OpenFlow 1.3 Mininet Open vSwitch (OVSK)
http://blog.disects.com/2014/01/ovs-ofctl-commands-on-openflow-13.html