def perfTest(lossy=True):
 topo = SingleSwitchTopo(n=4, lossy=lossy)
 net = Mininet(topo=topo, host=CPULimitedHost, link=TCLink, autoStaticArp=True)
 net.start()
 info('Dumping host connections\n')
 dumpNodeConnections(net.hosts)
 info('Testing bandwidth between h1 and h4\n')
 (h1, h4) = net.getNodeByName('h1', 'h4')
 net.iperf((h1, h4), l4Type='UDP')
 net.stop()

def perfTest ( lossy = True ) : topo = SingleSwitchTopo ( n = 4 , lossy = lossy ) net = Mininet ( topo = topo , host = CPULimitedHost , link = TCLink , autoStaticArp = True ) net . start ( ) info ( 'Dumping host connections\n' ) dumpNodeConnections ( net . hosts ) info ( 'Testing bandwidth between h1 and h4\n' ) ( h1 , h4 ) = net . getNodeByName ( 'h1' , 'h4' ) net . iperf ( ( h1 , h4 ) , l4Type = 'UDP' ) net . stop ( )
create network and run simple performance test .