Skip to content
Snippets Groups Projects
README 2.91 KiB
Newer Older
Bob Lantz's avatar
Bob Lantz committed

Bob Lantz's avatar
Bob Lantz committed
Mininet Examples

Bob Lantz's avatar
Bob Lantz committed
These examples are intended to help you get started using
baresshd.py:

This example uses Mininet's medium-level API to create an sshd
process running in a namespace. Doesn't use OpenFlow.

Bob Lantz's avatar
Bob Lantz committed
consoles.py:

This example creates a grid of console windows, one for each node, 
Bob Lantz's avatar
Bob Lantz committed
and allows interaction with and monitoring of each console, including
graphical monitoring.
This example creates a network with multiple controllers, by
using a custom Switch() subclass.

controllers2.py:

This example creates a network with multiple controllers by
creating an empty network, adding nodes to it, and manually
starting the switches.
cpu.py:

This example tests iperf bandwidth for varying CPU limits.

Bob Lantz's avatar
Bob Lantz committed
emptynet.py:

This example demonstrates creating an empty network (i.e. with no
topology object) and adding nodes to it.

hwintf.py:

This example shows how to add an interface (for example a real
hardware interface) to a network after the network is created.

limit.py:

This example shows how to use link and CPU limits.

Bob Lantz's avatar
Bob Lantz committed
linearbandwidth.py:
Bob Lantz's avatar
Bob Lantz committed

This example shows how to create a custom topology programatically
by subclassing Topo, and how to run a series of tests on it.

Bob Lantz's avatar
Bob Lantz committed
miniedit.py:

This example demonstrates creating a network via a graphical editor.

multiping.py:

This example demonstrates one method for 
monitoring output from multiple hosts, using node.monitor().

multipoll.py:

This example demonstrates monitoring output files from multiple hosts.

multitest.py:

This example creates a network and runs multiple tests on it.

Bob Lantz's avatar
Bob Lantz committed
nat.py:

This example shows how to connect a Mininet network to the Internet
using NAT. It also answers the eternal question "why can't I ping
google?"

popen.py:

This example monitors a number of hosts using host.popen() and
pmonitor().

popenpoll.py:

This example demonstrates monitoring output from multiple hosts using
the node.popen() interface (which returns Popen objects) and pmonitor().

Bob Lantz's avatar
Bob Lantz committed
scratchnet.py, scratchnetuser.py:
Bob Lantz's avatar
Bob Lantz committed

These two examples demonstrate how to create a network by using the lowest-
level Mininet functions. Generally the higher-level API is easier to use,
but scratchnet shows what is going on behind the scenes.

simpleperf.py:

A simple example of configuring network and CPU bandwidth limits.

sshd.py:

This example shows how to run an sshd process in each host, allowing
you to log in via ssh. This requires connecting the Mininet data network
to an interface in the root namespace (generaly the control network
already lives in the root namespace, so it does not need to be explicitly
connected.)


This example creates a 64-host tree network, and attempts to check full
connectivity using ping, for different switch/datapath types.

tree1024.py:

This example attempts to create a 1024-host network, and then runs the
CLI on it. It may run into scalability limits, depending on available
memory and sysctl configuration (see INSTALL.)