Revision 9cbf4688 examples/linearbandwidth.py

View differences:

examples/linearbandwidth.py
24 24
"""
25 25

  
26 26
from mininet.net import Mininet
27
from mininet.node import OVSKernelSwitch, Controller
27
from mininet.node import UserSwitch, OVSKernelSwitch, Controller
28 28
from mininet.topo import Topo
29 29
from mininet.log import lg
30 30
from mininet.util import irange
31
from mininet.link import TCLink
32
from functools import partial
31 33

  
32 34
import sys
33 35
flush = sys.stdout.flush
......
67 69
    switchCount = max( lengths )
68 70
    hostCount = switchCount + 1
69 71

  
70
    switches = { 'Open vSwitch kernel': OVSKernelSwitch }
72
    switches = { 'reference user': UserSwitch,
73
                 'Open vSwitch kernel': OVSKernelSwitch }
71 74

  
72 75
    topo = LinearTestTopo( hostCount )
73 76

  
74 77
    for datapath in switches.keys():
78
        # we can remove this later when/if the userswitch is fixed
79
        if switches[ datapath ] is UserSwitch:
80
            print "*** Skipping User Switch due to poor performance"
81
            continue
75 82
        print "*** testing", datapath, "datapath"
76 83
        Switch = switches[ datapath ]
77 84
        results[ datapath ] = []
78
        net = Mininet( topo=topo, switch=Switch, controller=Controller, waitConnected=True )
85
        link = partial( TCLink, delay='1ms' )
86
        net = Mininet( topo=topo, switch=Switch,
87
                       controller=Controller, waitConnected=True,
88
                       link=link )
79 89
        net.start()
80 90
        print "*** testing basic connectivity"
81 91
        for n in lengths:

Also available in: Unified diff