blob: ba60f1be51ce844e336c230191f90f41b0b15afc [file] [log] [blame]
carlosmscabralf40ecd12013-02-01 18:15:58 -02001#!/usr/bin/python
2
3"Create a 64-node tree network, and test connectivity using ping."
4
5from mininet.log import setLogLevel
6from mininet.node import UserSwitch, OVSKernelSwitch # , KernelSwitch
7from mininet.topolib import TreeNet
8
9def treePing64():
10 "Run ping test on 64-node tree networks."
11
12 results = {}
13 switches = { # 'reference kernel': KernelSwitch,
14 'reference user': UserSwitch,
15 'Open vSwitch kernel': OVSKernelSwitch }
16
17 for name in switches:
18 print "*** Testing", name, "datapath"
19 switch = switches[ name ]
20 network = TreeNet( depth=2, fanout=8, switch=switch )
21 result = network.run( network.pingAll )
22 results[ name ] = result
23
24 print
25 print "*** Tree network ping results:"
26 for name in switches:
27 print "%s: %d%% packet loss" % ( name, results[ name ] )
28 print
29
30if __name__ == '__main__':
31 setLogLevel( 'info' )
32 treePing64()