Working on examples.
Added new example to create xterms. Other minor changes.
This commit is contained in:
+24
-13
@@ -1,36 +1,47 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
"""
|
||||
Test bandwidth on a linear network of varying size, using both
|
||||
the kernel and user datapaths.
|
||||
|
||||
The network looks like:
|
||||
|
||||
h0 <-> s0 <-> s1 .. sN <-> h1
|
||||
"""
|
||||
|
||||
from mininet import init, LinearNet, iperfTest
|
||||
|
||||
def linearBandwidthTest():
|
||||
"""Test bandwidth on a linear network of varying size, using both
|
||||
the kernel and user datapaths."""
|
||||
|
||||
print "*** Testing Mininet with kernel and user datapath"
|
||||
|
||||
datapaths = [ 'kernel' ]
|
||||
|
||||
datapaths = [ 'kernel', 'user' ]
|
||||
switchCounts = [ 1, 20, 40, 60, 80, 100 ]
|
||||
results = {}
|
||||
|
||||
|
||||
for datapath in datapaths:
|
||||
k = datapath == 'kernel'
|
||||
results[ datapath ] = []
|
||||
for switchCount in range( 1, 17, 2 ):
|
||||
print "*** Creating Linear Network of size", switchCount
|
||||
for switchCount in switchCounts:
|
||||
print "*** Creating linear network of size", switchCount
|
||||
network = LinearNet( switchCount, k)
|
||||
bandwidth = network.run( iperfTest )
|
||||
results[ datapath ] += [ ( switchCount, bandwidth ) ]
|
||||
|
||||
for datapath in datapaths:
|
||||
print
|
||||
print "*** Linear network results for", datapath, "datapath"
|
||||
print "*** Linear network results for", datapath, "datapath:"
|
||||
print
|
||||
result = results[ datapath ]
|
||||
print "SwitchCount\tiPerf results"
|
||||
for switchCount, bandwidth in result:
|
||||
print "switchCount:", switchCount, "bandwidth:", bandwidth[ 0 ]
|
||||
|
||||
print switchCount, '\t\t',
|
||||
print bandwidth[ 0 ], 'server, ', bandwidth[ 1 ], 'client'
|
||||
print
|
||||
print
|
||||
|
||||
if __name__ == '__main__':
|
||||
init()
|
||||
print "*** Running linearBandwidthTest"
|
||||
linearBandwidthTest()
|
||||
exit( 1 )
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user