The best way to emulate almost any network on your laptop!
Mininet 2.2.1
Mininet emulates a complete network of hosts, links, and switches on a single machine. To create a sample two-host, one-switch network, just run:
sudo mn
Mininet is useful for interactive development, testing, and demos, especially those using OpenFlow and SDN. OpenFlow-based network controllers prototyped in Mininet can usually be transferred to hardware with minimal changes for full line-rate execution.
Mininet creates virtual networks using process-based virtualization
and network namespaces - features that are available in recent Linux
kernels. In Mininet, hosts are emulated as bash processes running in
a network namespace, so any code that would normally run on a Linux
server (like a web server or client program) should run just fine
within a Mininet "Host". The Mininet "Host" will have its own private
network interface and can only see its own processes. Switches in
Mininet are software-based switches like Open vSwitch or the OpenFlow
reference switch. Links are virtual ethernet pairs, which live in the
Linux kernel and connect our emulated switches to emulated hosts
(processes).
Mininet includes:
-
A command-line launcher (
mn) to instantiate networks. -
A handy Python API for creating networks of varying sizes and topologies.
-
Examples (in the
examples/directory) to help you get started. -
Full API documentation via Python
help()docstrings, as well as the ability to generate PDF/HTML documentation withmake doc. -
Parametrized topologies (
Toposubclasses) using the Mininet object. For example, a tree network may be created with the command:mn --topo tree,depth=2,fanout=3 -
A command-line interface (
CLIclass) which provides useful diagnostic commands (likeiperfandping), as well as the ability to run a command to a node. For example,mininet> h11 ifconfig -atells host h11 to run the command
ifconfig -a -
A "cleanup" command to get rid of junk (interfaces, processes, files in /tmp, etc.) which might be left around by Mininet or Linux. Try this if things stop working!
mn -c