0
votes

I am learning about SDN controllers and was hoping to implement a custom topology with a main controller (Floodlight) connected to sub controllers (POX and RYU) which are connected to switches in the network. I have drawn a brief diagram of what i'm trying to achieve here (excuse my bad drawing skills)

I had a go at programming the controllers to connect with the other controllers but I'm not sure if I done it right.

from mininet.net import Mininet
from mininet.node import OVSSwitch, Controller, RemoteController
from mininet.topolib import TreeTopo
from mininet.log import setLogLevel
from mininet.cli import CLI

setLogLevel( 'info' )

c0 = RemoteController( 'pox', ip='192.168.56.102', port=6633 )
c1 = RemoteController( 'floodlight', ip='192.168.56.101', port=6653 )
c2 = RemoteController( 'ryu', ip='192.168.56.103', port=6653 )
y
cmap = { 's1': c0, 's2': c0, 's3': c1, 's4': c1, 's5': c2, 's6': c2}

class MultiSwitch( OVSSwitch ):
    "Custom Switch() subclass that connects to different controllers"
    def start( self, controllers ):
        return OVSSwitch.start( self, [ cmap[ self.name ] ] )

topo = TreeTopo( depth=2, fanout=5 )
net = Mininet( topo=topo, switch=MultiSwitch, build=False )
for c in [ c0,c1,c2 ]:
    net.addController(c)
net.build()
net.start()
CLI( net )
net.stop()

As you can see from the code, I have a custom topology which connects switches to multiple controllers using a tree topology. However I am not sure if the controllers are connected to each other.

How can I make Floodlight the main controller and POX and RYU sub controllers?

Also, are the switches connected to the right controllers?

Any advice would be helpful!

1

1 Answers

0
votes

You program your controller's logic on your own. If you want your controllers to interconnect than you must implement it on its own as any other inter-process communication on top of a network. In other words, your controllers should connect to each other using network communication. As such, they will exchange with each other information and instructions.