Wednesday 5 February 2014

Multiple controller for one Open Virtual Switch

Ever since inception of SDN, having one or more controller in standby seemed like a proper choice, as lot is dependent on controller. With Open daylights clustering concept, it is possible to have common database and synch with them. I am not aware any other controller(e.g POX or NOX provides this facility). Mininet uses Open Virtual Switches code to emulate switch. So my first task was to find whether OVS supports multiple controller or not. Did some google and found this as "http://openvswitch.org/cgi-bin/ovsman.cgi?page=utilities%2Fovs-ofctl.8".
When a switch has more than one controller configured, only the traffic to and from a single controller is output. If none of the controllers is configured as a master or a slave (using a Nicira extension to OpenFlow), then a controller is chosen arbitrarily among them. If there is a master controller, it is chosen; otherwise, if there are any controllers that are not masters or slaves, one is chosen arbitrarily; otherwise, a slave controller is chosen arbitrarily. This choice is made once at connection time and does not change as controllers reconfigure their roles.
Good ! At least switch supports it. Now how to initiate these multiple controllers. So i did some digging in 'mininet.node' code; when switch is initiated it loops for available controllers and joins their name. So next time when you want to have multiple controller just give controller list in start(), And you are good to go.