|
| 1 | +# Mininet: `mn` |
| 2 | + |
| 3 | +`mn` - create a Mininet network. (`v2.3.0`) |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## Synopsis |
| 8 | + |
| 9 | +``` |
| 10 | +mn [options] |
| 11 | +``` |
| 12 | + |
| 13 | +## Description |
| 14 | + |
| 15 | +``` |
| 16 | +(type mn -h for details) |
| 17 | +
|
| 18 | +The mn utility creates Mininet network from the command line. It can create parametrized |
| 19 | +topologies, invoke the Mininet CLI, and run tests. |
| 20 | +``` |
| 21 | + |
| 22 | +## Options |
| 23 | + |
| 24 | +``` |
| 25 | +-h, --help |
| 26 | + show this help message and exit |
| 27 | +
|
| 28 | +--switch=SWITCH |
| 29 | + default|ivs|lxbr|ovs|ovsbr|ovsk|user[,param=value...] user=UserSwitch |
| 30 | + ovs=OVSSwitch ovsbr=OVSBridge ovsk=OVSSwitch ivs=IVSSwitch lxbr=LinuxBridge |
| 31 | + default=OVSSwitch |
| 32 | +
|
| 33 | +--host=HOST |
| 34 | + cfs|proc|rt[,param=value...] proc=Host rt=CPULimitedHost{'sched': 'rt'} |
| 35 | + cfs=CPULimitedHost{'sched': 'cfs'} |
| 36 | +
|
| 37 | +--controller=CONTROLLER |
| 38 | + default|none|nox|ovsc|ref|remote|ryu[,param=value...] ref=Controller |
| 39 | + ovsc=OVSController nox=NOX remote=RemoteController ryu=Ryu |
| 40 | + default=DefaultController none=NullController |
| 41 | +
|
| 42 | +--link=LINK |
| 43 | + default|ovs|tc|tcu[,param=value...] default=Link tc=TCLink tcu=TCULink ovs=OVSLink |
| 44 | +
|
| 45 | +--topo=TOPO |
| 46 | + linear|minimal|reversed|single|torus|tree[,param=value ...] minimal=MinimalTopo |
| 47 | + linear=LinearTopo reversed=SingleSwitchReversedTopo single=SingleSwitchTopo |
| 48 | + tree=TreeTopo torus=TorusTopo |
| 49 | +
|
| 50 | +-c, --clean |
| 51 | + clean and exit |
| 52 | +
|
| 53 | +--custom=CUSTOM |
| 54 | + read custom classes or params from .py file(s) |
| 55 | +
|
| 56 | +--test=TEST |
| 57 | + pingall|pingpair|iperf|iperfudp|all|none|build |
| 58 | +
|
| 59 | +-x, --xterms |
| 60 | + spawn xterms for each node |
| 61 | +
|
| 62 | +-i IPBASE, --ipbase=IPBASE |
| 63 | + base IP address for hosts |
| 64 | +
|
| 65 | +--mac automatically set host MACs |
| 66 | +
|
| 67 | +--arp set all-pairs ARP entries |
| 68 | +
|
| 69 | +-v VERBOSITY, --verbosity=VERBOSITY |
| 70 | + debug|info|output|warning|warn|error|critical |
| 71 | +
|
| 72 | +--innamespace |
| 73 | + sw and ctrl in namespace? |
| 74 | +
|
| 75 | +--listenport=LISTENPORT |
| 76 | + base port for passive switch listening |
| 77 | +
|
| 78 | +--nolistenport |
| 79 | + don't use passive listening port |
| 80 | +
|
| 81 | +--pre=PRE |
| 82 | + CLI script to run before tests |
| 83 | +
|
| 84 | +--post=POST |
| 85 | + CLI script to run after tests |
| 86 | +
|
| 87 | +--pin pin hosts to CPU cores (requires --host cfs or --host rt) |
| 88 | +
|
| 89 | +--nat [option=val...] adds a NAT to the topology that connects Mininet hosts to the |
| 90 | + physical network. Warning: This may route any traffic on the machine that uses |
| 91 | + Mininet's IP subnet into the Mininet network. If you need to change Mininet's IP |
| 92 | + subnet, see the --ipbase option. |
| 93 | +
|
| 94 | +--version |
| 95 | + prints the version and exits |
| 96 | +
|
| 97 | +-w, --wait |
| 98 | + wait for switches to connect |
| 99 | +
|
| 100 | +-t WAIT, --twait=WAIT |
| 101 | + timed wait (s) for switches to connect |
| 102 | +
|
| 103 | +--cluster=server1,server2... |
| 104 | + run on multiple servers (experimental!) |
| 105 | +
|
| 106 | +--placement=block|random |
| 107 | + node placement for --cluster (experimental!) |
| 108 | +``` |
| 109 | + |
| 110 | +## Examples |
| 111 | + |
| 112 | +Create a linear topology with 3 switches, using Linux Bridge switches, no controller, and automatic MAC addressing: |
| 113 | + |
| 114 | +``` |
| 115 | +sudo mn --topo=linear,3 --mac --switch=lxbr --controller=none |
| 116 | +``` |
| 117 | + |
| 118 | +Create a tree topology of depth 2 and fanout 3, using Open vSwitch switches and a remote controller at IP address 192.168.1.100: |
| 119 | + |
| 120 | +``` |
| 121 | +sudo mn --topo=tree,2,3 --switch=ovs --controller=remote,ip=192.168.1.100 |
| 122 | +``` |
0 commit comments