From 74857ba474918cd23146f77d35bd605cd3c1dc4f Mon Sep 17 00:00:00 2001 From: cody burkard Date: Sat, 27 Sep 2014 02:07:08 -0700 Subject: [PATCH 1/2] remove User Switch from linearBandwidth due to poor performance --- examples/linearbandwidth.py | 5 ++--- examples/test/test_linearbandwidth.py | 8 +++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/linearbandwidth.py b/examples/linearbandwidth.py index dee5490..90ca2ed 100755 --- a/examples/linearbandwidth.py +++ b/examples/linearbandwidth.py @@ -24,7 +24,7 @@ of switches, this example demonstrates: """ from mininet.net import Mininet -from mininet.node import UserSwitch, OVSKernelSwitch, Controller +from mininet.node import OVSKernelSwitch, Controller from mininet.topo import Topo from mininet.log import lg from mininet.util import irange @@ -67,8 +67,7 @@ def linearBandwidthTest( lengths ): switchCount = max( lengths ) hostCount = switchCount + 1 - switches = { 'reference user': UserSwitch, - 'Open vSwitch kernel': OVSKernelSwitch } + switches = { 'Open vSwitch kernel': OVSKernelSwitch } topo = LinearTestTopo( hostCount ) diff --git a/examples/test/test_linearbandwidth.py b/examples/test/test_linearbandwidth.py index d3c1144..95a18ac 100755 --- a/examples/test/test_linearbandwidth.py +++ b/examples/test/test_linearbandwidth.py @@ -21,7 +21,6 @@ class testLinearBandwidth( unittest.TestCase ): while True: index = p.expect( opts, timeout=600 ) if index == 0: - previous_bw = 10 ** 10 # 10 Gbits count += 1 elif index == 1: n = int( p.match.group( 1 ) ) @@ -32,12 +31,15 @@ class testLinearBandwidth( unittest.TestCase ): elif unit[ 0 ] == 'M': bw *= 10 ** 6 elif unit[ 0 ] == 'G': - bw *= 10 ** 9 - self.assertTrue( bw < previous_bw ) + bw *= 10 ** 9a + # check that we have a previous result to compare to + if n != 1: + self.assertTrue( bw < previous_bw ) previous_bw = bw else: break + # verify that we received results from at least one switch self.assertTrue( count > 0 ) if __name__ == '__main__': From 9cbf4688b25514987bb714624b4cdaf51bce8085 Mon Sep 17 00:00:00 2001 From: cody burkard Date: Sat, 27 Sep 2014 02:56:40 -0700 Subject: [PATCH 2/2] add 1ms delay to all links to exaggerate TCP bandwidth decrease across an increasing number of links --- examples/linearbandwidth.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/examples/linearbandwidth.py b/examples/linearbandwidth.py index 90ca2ed..2477610 100755 --- a/examples/linearbandwidth.py +++ b/examples/linearbandwidth.py @@ -24,10 +24,12 @@ of switches, this example demonstrates: """ from mininet.net import Mininet -from mininet.node import OVSKernelSwitch, Controller +from mininet.node import UserSwitch, OVSKernelSwitch, Controller from mininet.topo import Topo from mininet.log import lg from mininet.util import irange +from mininet.link import TCLink +from functools import partial import sys flush = sys.stdout.flush @@ -67,15 +69,23 @@ def linearBandwidthTest( lengths ): switchCount = max( lengths ) hostCount = switchCount + 1 - switches = { 'Open vSwitch kernel': OVSKernelSwitch } + switches = { 'reference user': UserSwitch, + 'Open vSwitch kernel': OVSKernelSwitch } topo = LinearTestTopo( hostCount ) for datapath in switches.keys(): + # we can remove this later when/if the userswitch is fixed + if switches[ datapath ] is UserSwitch: + print "*** Skipping User Switch due to poor performance" + continue print "*** testing", datapath, "datapath" Switch = switches[ datapath ] results[ datapath ] = [] - net = Mininet( topo=topo, switch=Switch, controller=Controller, waitConnected=True ) + link = partial( TCLink, delay='1ms' ) + net = Mininet( topo=topo, switch=Switch, + controller=Controller, waitConnected=True, + link=link ) net.start() print "*** testing basic connectivity" for n in lengths: