Statistics
| Branch: | Tag: | Revision:

mininet / examples / treeping64.py @ 9bfc7c77

History | View | Annotate | Download (950 Bytes)

1 45e82d09 Bob Lantz
#!/usr/bin/python
2
3
"Create a 64-node tree network, and test connectivity using ping."
4 41badb96 Bob Lantz
5 45e82d09 Bob Lantz
from mininet.log import setLogLevel
6 54d320ce Bob Lantz
from mininet.node import UserSwitch, OVSKernelSwitch  # , KernelSwitch
7 4720f559 Bob Lantz
from mininet.topolib import TreeNet
8 41badb96 Bob Lantz
9 45e82d09 Bob Lantz
def treePing64():
10 41badb96 Bob Lantz
    "Run ping test on 64-node tree networks."
11
12 45e82d09 Bob Lantz
    results = {}
13 2e089b5e Brandon Heller
    switches = {  # 'reference kernel': KernelSwitch,
14
                  'reference user': UserSwitch,
15
                  'Open vSwitch kernel': OVSKernelSwitch }
16 45e82d09 Bob Lantz
17 6ef2973f Bob Lantz
    for name in switches:
18 45e82d09 Bob Lantz
        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 41badb96 Bob Lantz
    print
25 45e82d09 Bob Lantz
    print "*** Tree network ping results:"
26 6ef2973f Bob Lantz
    for name in switches:
27 45e82d09 Bob Lantz
        print "%s: %d%% packet loss" % ( name, results[ name ] )
28
    print
29 41badb96 Bob Lantz
30 45e82d09 Bob Lantz
if __name__ == '__main__':
31 41badb96 Bob Lantz
    setLogLevel( 'info' )
32
    treePing64()