Added INSTALL file incorporating Brandon's suggestions.

More tweaks for examples, which are still in progress.
This commit is contained in:
Bob Lantz
2009-12-11 03:22:09 -08:00
parent 42ba5d92c3
commit af8f0b61b6
5 changed files with 98 additions and 20 deletions
+2 -2
View File
@@ -1,10 +1,10 @@
#!/usr/bin/python
"""
Test bandwidth on a linear network of varying size, using both
Test bandwidth on linear networks of varying size, using both
the kernel and user datapaths.
The network looks like:
Each network looks like:
h0 <-> s0 <-> s1 .. sN <-> h1
"""
+9 -3
View File
@@ -1,6 +1,13 @@
#!/usr/bin/python
"Create a network and start sshd on the hosts."
"""Create a network and start sshd(8) on the hosts.
This is probably overkill - rshd(8) would be
perfectly adequate, considering that the openflow
network is private to the machine it's running on.
It would also be lighter weight/faster.
Nonetheless, most people already have sshd installed,
and it's a good demo to show that mininet makes a
'real', usable network! """
from mininet import init, Node, createLink, TreeNet, Cli
@@ -14,8 +21,7 @@ def nets( hosts ):
return nets.keys()
def addRoutes( node, nets, intf ):
"""Add routes from node to nets through intf, assuming
a 24-bit netmask."""
"Add routes from node to nets through intf."
for net in nets:
node.cmdPrint( 'route add -net ' + net + ' dev ' + intf )
+3 -7
View File
@@ -1,14 +1,10 @@
#!/usr/bin/python
"""Create a tree network and run the CLI on it."""
"Create a tree network and run the CLI on it."
from mininet import init, TreeNet, Cli
def treeInteract():
network = TreeNet( depth=2, fanout=4, kernel=True )
network.run( Cli )
if __name__ == '__main__':
init()
treeInteract()
network = TreeNet( depth=2, fanout=4, kernel=True )
network.run( Cli )
+16 -8
View File
@@ -1,6 +1,9 @@
#!/usr/bin/python
"Create a network and run an xterm (connected via screen) on each host."
"""
Create a network and run an xterm (connected via screen(1) ) on each host.
Requires xterm(1) and GNU screen(1).
"""
import os
from subprocess import Popen
@@ -16,6 +19,12 @@ def makeXterm( node, title ):
cmd += [ '-e', 'screen', '-D', '-RR', '-S', node.name ]
return Popen( cmd )
def cleanUpScreens():
"Remove moldy old screen sessions."
# XXX We need to implement this - otherwise those darned
# screen sessions will just accumulate
pass
def makeXterms( nodes, title ):
terms = []
for node in nodes:
@@ -28,15 +37,14 @@ def xterms( controllers, switches, hosts ):
terms += makeXterms( controllers, 'controller' )
terms += makeXterms( switches, 'switch' )
terms += makeXterms( hosts, 'host' )
# Wait for completion
# Wait for xterms to exit
for term in terms:
os.waitpid( term.pid, 0 )
def treeXterms():
print "Running xterms on", os.environ[ 'DISPLAY' ]
network = TreeNet( depth=2, fanout=2, kernel=True )
network.run( xterms )
if __name__ == '__main__':
init()
treeXterms()
print "Running xterms on", os.environ[ 'DISPLAY' ]
cleanUpScreens()
network = TreeNet( depth=2, fanout=2, kernel=True )
network.run( xterms )
cleanUpScreens()