Statistics
| Branch: | Tag: | Revision:

mininet / examples / treeping64.py @ edf60032

History | View | Annotate | Download (947 Bytes)

1
#!/usr/bin/python
2

    
3
"Create a 64-node tree network, and test connectivity using ping."
4

    
5
from mininet.log import setLogLevel
6
from mininet.node import UserSwitch, OVSKernelSwitch  # , KernelSwitch
7
from mininet.topolib import TreeNet
8

    
9
def 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

    
30
if __name__ == '__main__':
31
    setLogLevel( 'info' )
32
    treePing64()