Statistics
| Branch: | Tag: | Revision:

mininet / examples / treeping64.py @ 4720f559

History | View | Annotate | Download (975 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.net import init, Mininet
7
from mininet.node import KernelSwitch, UserSwitch, OVSKernelSwitch
8
from mininet.topolib import TreeNet
9

    
10
def treePing64():
11
    "Run ping test on 64-node tree networks."
12

    
13
    results = {}
14
    switches = { 'reference kernel': KernelSwitch,
15
        'reference user': UserSwitch,
16
        'Open vSwitch kernel': OVSKernelSwitch }
17

    
18
    for name in switches.keys():
19
        print "*** Testing", name, "datapath"
20
        switch = switches[ name ]
21
        network = TreeNet( depth=2, fanout=8, switch=switch )
22
        result = network.run( network.pingAll )
23
        results[ name ] = result
24

    
25
    print
26
    print "*** Tree network ping results:"
27
    for name in switches.keys():
28
        print "%s: %d%% packet loss" % ( name, results[ name ] )
29
    print
30

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