From 11782ae0deebcd0e61b90a250f0c3711e1ca9836 Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Mon, 25 Oct 2010 21:52:14 -0700 Subject: [PATCH] Commented out kernel ref, moved to Open vSwitch. --- examples/linearbandwidth.py | 11 ++++++----- examples/multitest.py | 6 +++--- examples/scratchnet.py | 18 +++++++++--------- examples/sshd.py | 4 ++-- examples/tree1024.py | 4 ++-- examples/treeping64.py | 2 +- 6 files changed, 23 insertions(+), 22 deletions(-) diff --git a/examples/linearbandwidth.py b/examples/linearbandwidth.py index e93839a..da14898 100755 --- a/examples/linearbandwidth.py +++ b/examples/linearbandwidth.py @@ -10,7 +10,7 @@ h1 <-> sN+1 <-> sN+2 .. sN+N-1 | | | h2 h3 hN -Note: by default, the reference controller only supports 16 +WARNING: by default, the reference controller only supports 16 switches, so this test WILL NOT WORK unless you have recompiled your controller to support 100 switches (or more.) @@ -27,7 +27,8 @@ import sys flush = sys.stdout.flush from mininet.net import init, Mininet -from mininet.node import KernelSwitch, UserSwitch, OVSKernelSwitch +# from mininet.node import KernelSwitch +from mininet.node import UserSwitch, OVSKernelSwitch from mininet.topo import Topo, Node from mininet.log import lg @@ -68,7 +69,7 @@ def linearBandwidthTest( lengths ): switchCount = max( lengths ) hostCount = switchCount + 1 - switches = { 'reference kernel': KernelSwitch, + switches = { # 'reference kernel': KernelSwitch, 'reference user': UserSwitch, 'Open vSwitch kernel': OVSKernelSwitch } @@ -104,8 +105,8 @@ def linearBandwidthTest( lengths ): print if __name__ == '__main__': - lg.setLogLevel( 'warning' ) + lg.setLogLevel( 'info' ) init() - sizes = [ 1, 10, 20 ] + sizes = [ 1, 10, 20, 40, 60, 80, 100 ] print "*** Running linearBandwidthTest", sizes linearBandwidthTest( sizes ) diff --git a/examples/multitest.py b/examples/multitest.py index a17da23..bcb40f7 100755 --- a/examples/multitest.py +++ b/examples/multitest.py @@ -8,7 +8,7 @@ For a more complicated test example, see udpbwtest.py. from mininet.cli import CLI from mininet.log import lg, info from mininet.net import Mininet -from mininet.node import KernelSwitch +from mininet.node import OVSKernelSwitch from mininet.topolib import TreeTopo def ifconfigTest( net ): @@ -20,9 +20,9 @@ def ifconfigTest( net ): if __name__ == '__main__': lg.setLogLevel( 'info' ) info( "*** Initializing Mininet and kernel modules\n" ) - KernelSwitch.setup() + OVSKernelSwitch.setup() info( "*** Creating network\n" ) - network = Mininet( TreeTopo( depth=2, fanout=2 ), switch=KernelSwitch) + network = Mininet( TreeTopo( depth=2, fanout=2 ), switch=OVSKernelSwitch) info( "*** Starting network\n" ) network.start() info( "*** Running ping test\n" ) diff --git a/examples/scratchnet.py b/examples/scratchnet.py index a8de87a..cdb1329 100755 --- a/examples/scratchnet.py +++ b/examples/scratchnet.py @@ -9,7 +9,7 @@ For most tasks, the higher-level API will be preferable. """ from mininet.net import init -from mininet.node import Node, KernelSwitch +from mininet.node import Node, OVSKernelSwitch from mininet.util import createLink from mininet.log import setLogLevel, info @@ -32,27 +32,27 @@ def scratchNet( cname='controller', cargs='ptcp:' ): info( str( h0 ) + '\n' ) info( str( h1 ) + '\n' ) - info( "*** Starting network using kernel datapath\n" ) + info( "*** Starting network using Open vSwitch kernel datapath\n" ) controller.cmd( cname + ' ' + cargs + '&' ) - switch.cmd( 'dpctl deldp nl:0' ) - switch.cmd( 'dpctl adddp nl:0' ) + switch.cmd( 'ovs-dpctl del-dp dp0' ) + switch.cmd( 'ovs-dpctl add-dp dp0' ) for intf in switch.intfs.values(): - switch.cmd( 'dpctl addif nl:0 ' + intf ) - switch.cmd( 'ofprotocol nl:0 tcp:localhost &' ) + print switch.cmd( 'ovs-dpctl add-if dp0 ' + intf ) + print switch.cmd( 'ovs-openflowd dp0 tcp:127.0.0.1 &' ) info( "*** Running test\n" ) h0.cmdPrint( 'ping -c1 ' + h1.IP() ) info( "*** Stopping network\n" ) controller.cmd( 'kill %' + cname ) - switch.cmd( 'dpctl deldp nl:0' ) - switch.cmd( 'kill %ofprotocol' ) + switch.cmd( 'ovs-dpctl del-dp dp0' ) + switch.cmd( 'kill %ovs-openflowd' ) switch.deleteIntfs() info( '\n' ) if __name__ == '__main__': setLogLevel( 'info' ) info( '*** Scratch network demo (kernel datapath)\n' ) - KernelSwitch.setup() + OVSKernelSwitch.setup() init() scratchNet() diff --git a/examples/sshd.py b/examples/sshd.py index 16db692..9082d7d 100755 --- a/examples/sshd.py +++ b/examples/sshd.py @@ -19,7 +19,7 @@ demonstrates: from mininet.net import Mininet from mininet.cli import CLI from mininet.log import lg -from mininet.node import Node, KernelSwitch +from mininet.node import Node, OVSKernelSwitch from mininet.topolib import TreeTopo from mininet.util import createLink @@ -67,5 +67,5 @@ def sshd( network, cmd='/usr/sbin/sshd', opts='-D' ): if __name__ == '__main__': lg.setLogLevel( 'info') - net = TreeNet( depth=1, fanout=4, switch=KernelSwitch ) + net = TreeNet( depth=1, fanout=4, switch=OVSKernelSwitch ) sshd( net ) diff --git a/examples/tree1024.py b/examples/tree1024.py index 0af55e1..9397131 100755 --- a/examples/tree1024.py +++ b/examples/tree1024.py @@ -9,10 +9,10 @@ and running sysctl -p. Check util/sysctl_addon. from mininet.cli import CLI from mininet.log import setLogLevel -from mininet.node import KernelSwitch +from mininet.node import OVSKernelSwitch from mininet.topolib import TreeNet if __name__ == '__main__': setLogLevel( 'info' ) - network = TreeNet( depth=2, fanout=32, switch=KernelSwitch ) + network = TreeNet( depth=2, fanout=32, switch=OVSKernelSwitch ) network.run( CLI, network ) diff --git a/examples/treeping64.py b/examples/treeping64.py index 0f502e6..7438feb 100755 --- a/examples/treeping64.py +++ b/examples/treeping64.py @@ -10,7 +10,7 @@ def treePing64(): "Run ping test on 64-node tree networks." results = {} - switches = { 'reference kernel': KernelSwitch, + switches = { # 'reference kernel': KernelSwitch, 'reference user': UserSwitch, 'Open vSwitch kernel': OVSKernelSwitch }