Files
mininet/examples/nox.py
T
Bob Lantz 2f53491343 First crack at allowing Controller to be customized.
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.
2009-12-14 20:14:44 -08:00

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 )