Network may now be used with custom controllers. An example of doing this is in nox.py, which instantiates at TreeNet using a custom Controller, NoxController, that runs nox_core rather than the reference controller.
18 lines
507 B
Python
Executable File
18 lines
507 B
Python
Executable File
#!/usr/bin/python
|
|
|
|
"Instantiate a Tree network and use NOX as the controller."
|
|
|
|
import time
|
|
from mininet import init, Controller, TreeNet, Cli
|
|
|
|
class NoxController( Controller ):
|
|
def __init__( self, name, **kwargs ):
|
|
Controller.__init__( self, name,
|
|
controller='nox_core', cargs='-i ptcp pyswitch',
|
|
cdir='/usr/local/bin', **kwargs)
|
|
|
|
if __name__ == '__main__':
|
|
init()
|
|
network = TreeNet( depth=2, fanout=4, kernel=True, Controller=NoxController)
|
|
network.run( Cli )
|