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.
29 lines
678 B
Python
Executable File
29 lines
678 B
Python
Executable File
#!/usr/bin/python
|
|
|
|
"Create a 64-node tree network, and test connectivity using ping."
|
|
|
|
from mininet import init, TreeNet, pingTestVerbose
|
|
|
|
def treePing64():
|
|
results = {}
|
|
datapaths = [ 'user', 'kernel' ]
|
|
|
|
print "*** Testing Mininet with user and kernel datapaths"
|
|
|
|
for datapath in datapaths:
|
|
k = datapath == 'kernel'
|
|
network = TreeNet( depth=2, fanout=8, kernel=k )
|
|
result = network.run( pingTestVerbose )
|
|
results[ datapath ] = result
|
|
|
|
print
|
|
print "*** TreeNet ping results:"
|
|
for datapath in datapaths:
|
|
print "%s:" % datapath, results[ datapath ]
|
|
print
|
|
|
|
if __name__ == '__main__':
|
|
init()
|
|
treePing64()
|
|
|