diff --git a/cleanup b/cleanup index a93a208db0ac7b1edc908b3b476cd305d1283b28..bee88ea79d978d6ea0ba05120bfb5ecc5e4def27 100755 --- a/cleanup +++ b/cleanup @@ -26,6 +26,7 @@ rm -f /tmp/vconn* /tmp/vlogs* /tmp/*.out /tmp/*.log echo "Killing nox" killall lt-nox_core +killall nox_core echo "Removing old screen sessions" screen -ls | egrep -o '[0-9]+\.[hsc][0-9]+' | sed 's/\.[hsc][0-9]*//g' | kill -9 diff --git a/examples/grid.py b/examples/grid.py new file mode 100755 index 0000000000000000000000000000000000000000..fea7d6ce73a49f165b4022c9039316fcd0113248 --- /dev/null +++ b/examples/grid.py @@ -0,0 +1,17 @@ +#!/usr/bin/python + +"Instantiate a Grid network and use NOX as the controller." + +from mininet import init, Controller, GridNet, Cli + +class NoxController( Controller ): + def __init__( self, name, **kwargs ): + Controller.__init__( self, name, + controller='nox_core', + cargs='-v --libdir=/usr/local/lib -i ptcp: routing', + cdir='/usr/local/bin', **kwargs) + +if __name__ == '__main__': + init() + network = GridNet( 2, 2, kernel=True, Controller=NoxController) + network.run( Cli ) diff --git a/examples/ripcordtest.py b/examples/ripcordtest.py index 719ec6d6874ec81d210b9b94b1df399706e8c289..84a64ac3fb1a05c46bd440619c50bc1fbb0f3bb4 100755 --- a/examples/ripcordtest.py +++ b/examples/ripcordtest.py @@ -9,10 +9,10 @@ from mininet import createLink, flush class NoxController( Controller ): - "A customized Controller that uses NOX." - def __init__( self, name, **kwargs ): - Controller.__init__( self, name, - controller='nox_core', cargs='-i ptcp pyswitch', + def __init__( self, name, kernel=False **kwargs ): + Controller.__init__( self, name, kernel=kernel, + controller='nox_core', + cargs='-v --libdir=/usr/local/lib -i ptcp: routing', cdir='/usr/local/bin', **kwargs) class FatTree( Network ): diff --git a/examples/tree1024.py b/examples/tree1024.py new file mode 100755 index 0000000000000000000000000000000000000000..3c96770e211a281bec2f3cd9c2e3ec075e1886a6 --- /dev/null +++ b/examples/tree1024.py @@ -0,0 +1,15 @@ +#!/usr/bin/python + +""" +Create a 1024-host network, and run the CLI on it. +If this fails because of kernel limits, you may have +to adjust them, e.g. by adding entries to /etc/sysctl.conf +and running sysctl -p. +""" + +from mininet import init, TreeNet + +if __name__ == '__main__': + init() + network = TreeNet( depth=2, fanout=32, kernel=True ) + network.run( Cli )