Statistics
| Branch: | Tag: | Revision:

mininet / examples / tree1024.py @ 45e82d09

History | View | Annotate | Download (781 Bytes)

1
#!/usr/bin/python
2

    
3
"""
4
Create a 1024-host network, and run the CLI on it.
5
If this fails because of kernel limits, you may have
6
to adjust them, e.g. by adding entries to /etc/sysctl.conf
7
and running sysctl -p. Check util/sysctl_addon.
8
"""
9

    
10
from mininet.cli import CLI
11
from mininet.log import setLogLevel
12
from mininet.net import init, Mininet
13
from mininet.node import KernelSwitch
14
from mininet.topolib import TreeTopo
15

    
16
def TreeNet( depth=1, fanout=2, **kwargs ):
17
    "Convenience function for creating tree networks."
18
    topo = TreeTopo( depth, fanout )
19
    return Mininet( topo, **kwargs )
20
    
21
if __name__ == '__main__':
22
    setLogLevel( 'info' )
23
    init()
24
    KernelSwitch.setup()
25
    network = TreeNet( depth=2, fanout=32, switch=KernelSwitch )
26
    network.run( CLI, network )