From 83086439cc396c10fcf4bda66992a5957beb10d4 Mon Sep 17 00:00:00 2001 From: Brandon Heller Date: Sat, 2 Jan 2010 05:38:24 -0800 Subject: [PATCH] Remove/merge obsolete examples --- INSTALL | 8 ++++---- bin/mn_run.py | 19 +++++++++++++++---- examples/cli.py | 10 ---------- examples/grid.py | 17 ----------------- examples/multitest.py | 14 -------------- examples/nox.py | 17 ----------------- examples/ripcordtest.py | 16 ---------------- examples/tree1024.py | 15 --------------- examples/treeping64.py | 28 ---------------------------- 9 files changed, 19 insertions(+), 125 deletions(-) delete mode 100755 examples/cli.py delete mode 100755 examples/grid.py delete mode 100755 examples/multitest.py delete mode 100755 examples/nox.py delete mode 100755 examples/ripcordtest.py delete mode 100755 examples/tree1024.py delete mode 100755 examples/treeping64.py diff --git a/INSTALL b/INSTALL index 7d180fc..cf47bde 100644 --- a/INSTALL +++ b/INSTALL @@ -63,10 +63,6 @@ Preliminary Mininet Installation/Configuration Notes to /etc/sysctl.conf (modified as necessary for your desired configuration): - # OpenFlow: get rid of ipv6 - net.ipv6.conf.all.disable_ipv6 = 1 - net.ipv6.conf.default.disable_ipv6 = 1 - # Mininet: Increase open file limit fs.file-max = 100000 @@ -85,6 +81,10 @@ Preliminary Mininet Installation/Configuration Notes # Mininet: increase routing table size net.ipv4.route.max_size=32768 + To save the config change, run: + + sysctl -p + --- diff --git a/bin/mn_run.py b/bin/mn_run.py index 5980bd2..2ea290e 100755 --- a/bin/mn_run.py +++ b/bin/mn_run.py @@ -12,6 +12,7 @@ from ripcord.topo import FatTreeTopo from mininet.logging_mod import lg, set_loglevel, LEVELS from mininet.net import Mininet, init from mininet.node import Switch, Host, Controller, ControllerParams +from mininet.node import NOXController from mininet.topo import TreeTopo # built in topologies, created only when run @@ -19,6 +20,7 @@ TOPO_DEF = 'minimal' TOPOS = {'minimal' : (lambda: TreeTopo(depth = 2, fanout = 2)), 'tree16' : (lambda: TreeTopo(depth = 3, fanout = 4)), 'tree64' : (lambda: TreeTopo(depth = 4, fanout = 4)), + 'tree1024' : (lambda: TreeTopo(depth = 3, fanout = 32)), 'fattree4' : (lambda: FatTreeTopo(k = 4)), 'fattree6' : (lambda: FatTreeTopo(k = 6))} @@ -29,11 +31,11 @@ HOST_DEF = 'process' HOSTS = {'process' : Host} CONTROLLER_DEF = 'ref' -CONTROLLERS = {'ref' : Controller} +CONTROLLERS = {'ref' : Controller, + 'nox' : NOXController} # optional tests to run -TESTS = ['cli', 'build', 'ping_all', 'ping_pair'] - +TESTS = ['cli', 'build', 'ping_all', 'ping_pair', 'iperf', 'all'] def add_dict_option(opts, choices_dict, default, name, help_str = None): '''Convenience function to add choices dicts to OptionParser. @@ -97,6 +99,11 @@ class MininetRunner(object): # validate environment setup init() + # check for invalid combinations + if 'fattree' in self.options.topo and self.options.controller == 'ref': + raise Exception('multipath topos require multipath-capable ' + 'controller.') + def begin(self): '''Create and run mininet.''' @@ -125,6 +132,10 @@ class MininetRunner(object): hosts = [hosts_unsorted[0], hosts_unsorted[1]] dropped = mn.ping_test(hosts = hosts, verbose = True) lg.info("*** Test results: %i%% dropped\n", dropped) + elif test == 'all': + mn.start() + mn.ping() + mn.iperf() mn.stop() else: raise NotImplementedError('unknown test: %s' % @@ -135,4 +146,4 @@ class MininetRunner(object): if __name__ == "__main__": - MininetRunner() \ No newline at end of file + MininetRunner() diff --git a/examples/cli.py b/examples/cli.py deleted file mode 100755 index 393c15c..0000000 --- a/examples/cli.py +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/python - -"Create a tree network and run the CLI on it." - -from mininet.mininet import init, TreeNet, Cli - -if __name__ == '__main__': - init() - network = TreeNet( depth=2, fanout=4, kernel=True ) - network.run( Cli ) diff --git a/examples/grid.py b/examples/grid.py deleted file mode 100755 index c025772..0000000 --- a/examples/grid.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/python - -"Instantiate a Grid network and use NOX as the controller." - -from mininet.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/multitest.py b/examples/multitest.py deleted file mode 100755 index 403b215..0000000 --- a/examples/multitest.py +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/python - -"Run multiple tests on a network." - -from mininet.mininet import init, TreeNet, pingTestVerbose, iperfTest, Cli - -if __name__ == '__main__': - init() - network = TreeNet( depth=2, fanout=2, kernel=True ) - network.start() - network.runTest( pingTestVerbose ) - network.runTest( iperfTest) - network.runTest( Cli ) - network.stop() diff --git a/examples/nox.py b/examples/nox.py deleted file mode 100755 index 95413be..0000000 --- a/examples/nox.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/python - -"Instantiate a Tree network and use NOX as the controller." - -from mininet.mininet import init, Controller, TreeNet, Cli - -class NoxController( Controller ): - def __init__( self, name, **kwargs ): - Controller.__init__( self, name, - controller='nox_core', - cargs='--libdir=/usr/local/lib -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 ) diff --git a/examples/ripcordtest.py b/examples/ripcordtest.py deleted file mode 100755 index 7ac2578..0000000 --- a/examples/ripcordtest.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/python -'''Run a FatTree network from the Ripcord project.''' - -from ripcord.topo import FatTreeTopo - -from mininet.logging_mod import set_loglevel -from mininet.net import init, Mininet -from mininet.node import Switch, Host, NOXController, ControllerParams - -if __name__ == '__main__': - set_loglevel('info') - init() - controller_params = ControllerParams(0x0a000000, 8) # 10.0.0.0/8 - mn = Mininet(FatTreeTopo(4), Switch, Host, NOXController, - controller_params) - mn.interact() \ No newline at end of file diff --git a/examples/tree1024.py b/examples/tree1024.py deleted file mode 100755 index 1abdf94..0000000 --- a/examples/tree1024.py +++ /dev/null @@ -1,15 +0,0 @@ -#!/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.mininet import init, TreeNet, Cli - -if __name__ == '__main__': - init() - network = TreeNet( depth=2, fanout=32, kernel=True ) - network.run( Cli ) diff --git a/examples/treeping64.py b/examples/treeping64.py deleted file mode 100755 index 5dc8e29..0000000 --- a/examples/treeping64.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/python - -"Create a 64-node tree network, and test connectivity using ping." - -from mininet.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() -