Remove/merge obsolete examples

This commit is contained in:
Brandon Heller
2010-01-02 10:55:46 -08:00
parent 8f20b95d56
commit 83086439cc
9 changed files with 19 additions and 125 deletions
+4 -4
View File
@@ -63,10 +63,6 @@ Preliminary Mininet Installation/Configuration Notes
to /etc/sysctl.conf (modified as necessary for your desired to /etc/sysctl.conf (modified as necessary for your desired
configuration): 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 # Mininet: Increase open file limit
fs.file-max = 100000 fs.file-max = 100000
@@ -85,6 +81,10 @@ Preliminary Mininet Installation/Configuration Notes
# Mininet: increase routing table size # Mininet: increase routing table size
net.ipv4.route.max_size=32768 net.ipv4.route.max_size=32768
To save the config change, run:
sysctl -p
--- ---
+15 -4
View File
@@ -12,6 +12,7 @@ from ripcord.topo import FatTreeTopo
from mininet.logging_mod import lg, set_loglevel, LEVELS from mininet.logging_mod import lg, set_loglevel, LEVELS
from mininet.net import Mininet, init from mininet.net import Mininet, init
from mininet.node import Switch, Host, Controller, ControllerParams from mininet.node import Switch, Host, Controller, ControllerParams
from mininet.node import NOXController
from mininet.topo import TreeTopo from mininet.topo import TreeTopo
# built in topologies, created only when run # built in topologies, created only when run
@@ -19,6 +20,7 @@ TOPO_DEF = 'minimal'
TOPOS = {'minimal' : (lambda: TreeTopo(depth = 2, fanout = 2)), TOPOS = {'minimal' : (lambda: TreeTopo(depth = 2, fanout = 2)),
'tree16' : (lambda: TreeTopo(depth = 3, fanout = 4)), 'tree16' : (lambda: TreeTopo(depth = 3, fanout = 4)),
'tree64' : (lambda: TreeTopo(depth = 4, fanout = 4)), 'tree64' : (lambda: TreeTopo(depth = 4, fanout = 4)),
'tree1024' : (lambda: TreeTopo(depth = 3, fanout = 32)),
'fattree4' : (lambda: FatTreeTopo(k = 4)), 'fattree4' : (lambda: FatTreeTopo(k = 4)),
'fattree6' : (lambda: FatTreeTopo(k = 6))} 'fattree6' : (lambda: FatTreeTopo(k = 6))}
@@ -29,11 +31,11 @@ HOST_DEF = 'process'
HOSTS = {'process' : Host} HOSTS = {'process' : Host}
CONTROLLER_DEF = 'ref' CONTROLLER_DEF = 'ref'
CONTROLLERS = {'ref' : Controller} CONTROLLERS = {'ref' : Controller,
'nox' : NOXController}
# optional tests to run # 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): def add_dict_option(opts, choices_dict, default, name, help_str = None):
'''Convenience function to add choices dicts to OptionParser. '''Convenience function to add choices dicts to OptionParser.
@@ -97,6 +99,11 @@ class MininetRunner(object):
# validate environment setup # validate environment setup
init() 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): def begin(self):
'''Create and run mininet.''' '''Create and run mininet.'''
@@ -125,6 +132,10 @@ class MininetRunner(object):
hosts = [hosts_unsorted[0], hosts_unsorted[1]] hosts = [hosts_unsorted[0], hosts_unsorted[1]]
dropped = mn.ping_test(hosts = hosts, verbose = True) dropped = mn.ping_test(hosts = hosts, verbose = True)
lg.info("*** Test results: %i%% dropped\n", dropped) lg.info("*** Test results: %i%% dropped\n", dropped)
elif test == 'all':
mn.start()
mn.ping()
mn.iperf()
mn.stop() mn.stop()
else: else:
raise NotImplementedError('unknown test: %s' % raise NotImplementedError('unknown test: %s' %
@@ -135,4 +146,4 @@ class MininetRunner(object):
if __name__ == "__main__": if __name__ == "__main__":
MininetRunner() MininetRunner()
-10
View File
@@ -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 )
-17
View File
@@ -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 )
-14
View File
@@ -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()
-17
View File
@@ -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 )
-16
View File
@@ -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()
-15
View File
@@ -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 )
-28
View File
@@ -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()