Statistics
| Branch: | Tag: | Revision:

mininet / examples / treeping64.py @ 51270ce4

History | View | Annotate | Download (686 Bytes)

1 4ccc7ee9 Bob Lantz
#!/usr/bin/python
2
3 f4d9e05d Bob Lantz
"Create a 64-node tree network, and test connectivity using ping."
4 748e35d5 Bob Lantz
   
5 51270ce4 Brandon Heller
from mininet.mininet import init, TreeNet, pingTestVerbose
6 4ccc7ee9 Bob Lantz
7 f4d9e05d Bob Lantz
def treePing64():
8 4ccc7ee9 Bob Lantz
   results = {}
9 2f534913 Bob Lantz
   datapaths = [ 'user', 'kernel' ]
10 f4d9e05d Bob Lantz
   
11 2f534913 Bob Lantz
   print "*** Testing Mininet with user and kernel datapaths"
12 4ccc7ee9 Bob Lantz
   
13 f4d9e05d Bob Lantz
   for datapath in datapaths:
14 4ccc7ee9 Bob Lantz
      k = datapath == 'kernel'
15 f4d9e05d Bob Lantz
      network = TreeNet( depth=2, fanout=8, kernel=k )
16
      result = network.run( pingTestVerbose )
17
      results[ datapath ] = result
18
   
19
   print  
20
   print "*** TreeNet ping results:"
21
   for datapath in datapaths:
22
      print "%s:" % datapath, results[ datapath ]
23
   print
24
   
25 4ccc7ee9 Bob Lantz
if __name__ == '__main__':
26
   init()
27 f4d9e05d Bob Lantz
   treePing64()