Added openvswitch kernel switch.

This commit is contained in:
Bob Lantz
2010-03-17 23:43:03 -07:00
parent 8abc3472e3
commit 3e624fb237
+9 -5
View File
@@ -27,7 +27,7 @@ import sys
flush = sys.stdout.flush flush = sys.stdout.flush
from mininet.net import init, Mininet from mininet.net import init, Mininet
from mininet.node import KernelSwitch, UserSwitch from mininet.node import KernelSwitch, UserSwitch, OVSKernelSwitch
from mininet.topo import Topo, Node from mininet.topo import Topo, Node
from mininet.log import lg from mininet.log import lg
@@ -59,18 +59,22 @@ class LinearTestTopo( Topo ):
# Consider all switches and hosts 'on' # Consider all switches and hosts 'on'
self.enable_all() self.enable_all()
def linearBandwidthTest( lengths ): def linearBandwidthTest( lengths ):
"Check bandwidth at various lengths along a switch chain." "Check bandwidth at various lengths along a switch chain."
datapaths = [ 'kernel', 'user' ]
results = {} results = {}
switchCount = max( lengths ) switchCount = max( lengths )
hostCount = switchCount + 1 hostCount = switchCount + 1
for datapath in datapaths: switches = { 'reference kernel': KernelSwitch,
'reference user': UserSwitch,
'Open vSwitch kernel': OVSKernelSwitch }
for datapath in switches.keys():
print "*** testing", datapath, "datapath" print "*** testing", datapath, "datapath"
Switch = KernelSwitch if datapath == 'kernel' else UserSwitch Switch = switches[ datapath ]
results[ datapath ] = [] results[ datapath ] = []
net = Mininet( topo=LinearTestTopo( hostCount ), switch=Switch ) net = Mininet( topo=LinearTestTopo( hostCount ), switch=Switch )
net.start() net.start()
@@ -87,7 +91,7 @@ def linearBandwidthTest( lengths ):
results[ datapath ] += [ ( n, bandwidth ) ] results[ datapath ] += [ ( n, bandwidth ) ]
net.stop() net.stop()
for datapath in datapaths: for datapath in switches.keys():
print print
print "*** Linear network results for", datapath, "datapath:" print "*** Linear network results for", datapath, "datapath:"
print print