From af8f0b61b63b1906bd36c00e71f3ca54e334c0e8 Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Fri, 11 Dec 2009 03:22:09 -0800 Subject: [PATCH] Added INSTALL file incorporating Brandon's suggestions. More tweaks for examples, which are still in progress. --- INSTALL | 68 +++++++++++++++++++++++++++++++++++++ examples/linearBandwidth.py | 4 +-- examples/sshd.py | 12 +++++-- examples/treeInteract.py | 10 ++---- examples/xterms.py | 24 ++++++++----- 5 files changed, 98 insertions(+), 20 deletions(-) create mode 100644 INSTALL diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..2c1959e --- /dev/null +++ b/INSTALL @@ -0,0 +1,68 @@ +Preliminary Installation Notes + +- A functional netns binary is required to run mininet, but currently you + have to compile it and install it yourself from the included .c file: + + to make it: make netns (or cc -o netns netns.c) + to test it: ./netns /bin/echo + to 'install' a link to it: + sudo ln -s /home/openflow/mininet/netns /usr/local/bin/netns + + Installation is simplest with a distribution that includes a kernel + which supports the CLONE_NETNS unshare flag by default. Debian 5.0+ + does; Ubuntu doesn't. If your kernel doesn't support it, you will need + to build and install a kernel that does! + +- To run the iPerf test, you need to install iperf: + + sudo aptitude/yum install iperf + + We assume you already have ping installed. + +- You may need other packages to run the examples, e.g. + + sudo aptitude/yum install sshd xterm screen + + Consult the appropriate example file for details. + +- To switch to the most recent OpenFlow 0.8.9 release branch (the most + recent one with NOX support): + + git checkout -b release/0.8.9 remotes/origin/release/0.8.9 + + If you want to automatically load the kernel modules required + for OpenFlow, you could add something like the following to + /etc/rc.local: + + insmod /home/openflow/openflow/datapath/linux-2.6/ofdatapath.ko + modprobe tun + +- For scalable configurations, you might need to increase some of your + kernel limits. For example, you could add something like the following + 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 + + # Mininet: increase network buffer space + net.core.wmem_max = 16777216 + net.core.rmem_max = 16777216 + net.ipv4.tcp_rmem = 10240 87380 16777216 + net.ipv4.tcp_rmem = 10240 87380 16777216 + net.core.netdev_max_backlog = 5000 + + # Mininet: increase arp cache size + net.ipv4.neigh.default.gc_thresh1 = 4096 + net.ipv4.neigh.default.gc_thresh2 = 8192 + net.ipv4.neigh.default.gc_thresh3 = 16384 + + # Mininet: increase routing table size + net.ipv4.route.max_size=32768 + + + diff --git a/examples/linearBandwidth.py b/examples/linearBandwidth.py index bb773bc..5e3b352 100755 --- a/examples/linearBandwidth.py +++ b/examples/linearBandwidth.py @@ -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 """ diff --git a/examples/sshd.py b/examples/sshd.py index ad18ddd..1dac53c 100755 --- a/examples/sshd.py +++ b/examples/sshd.py @@ -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 ) diff --git a/examples/treeInteract.py b/examples/treeInteract.py index ca95f0f..6d49934 100755 --- a/examples/treeInteract.py +++ b/examples/treeInteract.py @@ -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 ) diff --git a/examples/xterms.py b/examples/xterms.py index 9ef419e..f8d195d 100755 --- a/examples/xterms.py +++ b/examples/xterms.py @@ -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() \ No newline at end of file