Skip to content
Snippets Groups Projects
treeping64.py 961 B
Newer Older
#!/usr/bin/python

"Create a 64-node tree network, and test connectivity using ping."
Bob Lantz's avatar
Bob Lantz committed

from mininet.log import setLogLevel
from mininet.net import init, Mininet
from mininet.node import KernelSwitch, UserSwitch, OVSKernelSwitch
from mininet.topolib import TreeNet
Bob Lantz's avatar
Bob Lantz committed

Bob Lantz's avatar
Bob Lantz committed
    "Run ping test on 64-node tree networks."

    results = {}
    switches = { 'reference kernel': KernelSwitch,
        'reference user': UserSwitch,
        'Open vSwitch kernel': OVSKernelSwitch }

    for name in switches:
        print "*** Testing", name, "datapath"
        switch = switches[ name ]
        network = TreeNet( depth=2, fanout=8, switch=switch )
        result = network.run( network.pingAll )
        results[ name ] = result

Bob Lantz's avatar
Bob Lantz committed
    print
    print "*** Tree network ping results:"
    for name in switches:
        print "%s: %d%% packet loss" % ( name, results[ name ] )
    print
Bob Lantz's avatar
Bob Lantz committed

if __name__ == '__main__':
Bob Lantz's avatar
Bob Lantz committed
    setLogLevel( 'info' )
    treePing64()