You are on page 1of 11

Table of Contents

1 Mininet Features.....................................................................................................................................1
1.1 Flexibility:.......................................................................................................................................1
1.2 Applicability:...................................................................................................................................1
1.3 Interactivity.....................................................................................................................................1
1.4 Scalability........................................................................................................................................1
1.5 Share-ability....................................................................................................................................1
2 Characteristics of Mininet.......................................................................................................................2
3 Default Topology.....................................................................................................................................2
4 Built In Topologies..................................................................................................................................3
4.1 Linear...............................................................................................................................................3
4.2 Single...............................................................................................................................................4
4.3 Reversed..........................................................................................................................................5
4.4 Torus................................................................................................................................................5
4.5 Tree..................................................................................................................................................6
5 Custom Topology....................................................................................................................................6
6 Conclusion..............................................................................................................................................9
Bibliography.............................................................................................................................................10

MININET FOR SDN


Features, Characteristics, Default and Custom Topologies
Mininet is a network emulator which creates a network of virtual hosts, switches, controller and links
on a single Linux kernel. Mininet is an open source project and under active development.

1 Mininet Features
The mininet consists of following features:

1.1 Flexibility:
The mininet can be used to model wide range of network including new topologies and functionalities.
The mininet can be run in almost all popular operating system using the mininet virtual image. In
addition, the mininet support many type of controllers (Floodlight Openflow controller, OpenDaylight
platform, NOX, pox etc) and the southbound APIs beside openflow.

1.2 Applicability:
The prototype network emulated in the mininet can be deployed in a hardware based network, with no
changes to code of configuration. Since the real hardware are based on the Linux kernel and so does
mininet so the mininet is applicable for real time implementation.

1.3 Interactivity
The components in the network built in the mininet have same real time behavior as the real hardware
system. Various attributes of the controller, switches, hosts and links can be specified so that the
network would be as realistic as possible.

1.4 Scalability
Using mininet, we can build the network from the small sizes to the one with hundreds of switches.
Realistic. Using the programming structures in python languages, large network can also be designed
using iteration.

1.5 Share-ability
The prototypes and algorithm developed in the mininet can be shared with other collaborators. Due to
1

the open source, the larger community can work on the project and share their knowledge and
contribute. The prototype designed by one can be run and modified by others as well.

2 Characteristics of Mininet
The mininet was designed for the network emulation of the open software standard. Other emulation
tools still exist, however the mininet is the most widely used and popular as well. The following
characteristics of the mininet make it very applicable.
A.
In mininet the network can be instantiated with a command-line launcher (mn). The network
can be be augmented using parameters by specifying variables and parameters like custom, topology,
mac, arp, switch, controller etc.
eg.

sudo mn - - switch ovsk - - controller remote

B.

A python API can be used to customize, change attribute and scale the networks.

C.
A network can be initialized using the parametrized topologies using 'Topo' subclass. The
common topologies are single, linear, tree etc.
eg.

sudo mn - - topo tree, depth=2, fanout=4


sudo mn - - topo linear,3

D.
The command line interface (CLI) has been provided in the mininet to test the network, view
the network parameters like IP, MAC etc, to configure etc. The CLI can be activated with the python
API as well.
E.
After finishing work with mininet, the cleaning function has been provided to free the system
resource, delete temporary file and junks. The function can be achieved using simple command as
follows:
eg.

sudo mn -c

or,

sudo mn - -clean

F.
The remote controller can be incorporated in the mininet that allows to use different kind of
custom controller. Floodlight, OpenDaylight controller are popular ones besides the built in NOX and
pox controller.

3 Default Topology
The default topology of the mininet I is the minimal topology consisting of 1 controller (c0), 1
switch(s1) and two hosts (h1 & h2) as shown in the figure below. The command for network with
default topology is :

$ sudo mn
The links of the topology would be h1-eth0 < - - - > s1-eth1 and h2-eth0 < - - - > s1-eth1.

Figure 1: Default Topology

4 Built In Topologies
Beside the default topologies, there are some built in topologies in the mininet which can be
instantiated as a parameters in the command line.

4.1 Linear
The linear topology consists of k switches with n hosts per switch. For example:
$ sudo mn --topo linear,k,n
would give the following topologies.(k=3, n=2)

Figure 2: Linear Topology

4.2 Single
The topology consists of a single switch connecting to the k hosts. For example,
$ sudo mn topo single,k
would give the following topology (with k = 3).

Figure 3: Single Topology

mininet> links
h1-eth0<->s1-eth1
h2-eth0<->s1-eth2
h3-eth0<->s1-eth3
The topology has been defined in the class mininet.topo.SingleSwitchTopo.

4.3 Reversed
The topology is same as the single switch topology, except the reversed ports. The lowest numbered
host is connected to the highest numbered port. The links for the command will be as shown:
$ sudo mn topo reversed,3
>links
h1-eth0< -- >s1-eth3
h2-eth0< -- >s1-eth2
h3-eth0 < -- >s1-eth1
The topology has been defined in the class mininet.topo.SingleSwitchReversedTopo.

4.4 Torus
The Torus topology consists of 2D torus like topologies with loops. So this topology doesn't work with
the default controller and any ethernet bridge without (Spanning Tree Protocol) STP enabled. The torus
network must be used with the STP in the switch. For example:
$ sudo mn -- topo torus,k,n switch lxbr, stp=1
In mininet, the dimenstion of torus k *m must be greater than 3 * 3. With torus,3,3 the network will
have following topology:
Hosts:

h1x1 h1x2 h1x3 h2x1 h2x2 h2x3 h3x1 h3x2 h3x3

Switches:

s1x1 s1x2 s1x3 s2x1 s2x2 s2x3 s3x1 s3x2 s3x3

Links:
(h1x1, s1x1) (h1x2, s1x2) (h1x3, s1x3) (h2x1, s2x1) (h2x2, s2x2) (h2x3, s2x3) (h3x1, s3x1) (h3x2,
s3x2) (h3x3, s3x3)
(s1x1, s1x2) (s1x1, s2x1) (s1x2, s1x3) (s1x2, s2x2) (s1x3, s1x1) (s1x3, s2x3)
(s2x1, s2x2) (s2x1, s3x1) (s2x2, s2x3) (s2x2, s3x2) (s2x3, s2x1) (s2x3, s3x3)
5

(s3x1, s1x1) (s3x1, s3x2) (s3x2, s1x2) (s3x2, s3x3) (s3x3, s1x3) (s3x3, s3x1)

4.5 Tree
The tree topology in mininet gives a tree network with a specified depth and fanout. The inline
command for the tree topology is as follows:
$ sudo mn topo tree,depth=k,fanout=n
Here, the depth represent the length of vertical chain of switches while fanout refers to the number of
host per switch. The following figure shows the tree topology with depth 3 and fanout 2.

Figure 4: Tree Topology with depth 3 and fanout 2


The topology has been defined in the mininet.topolib.TreeTopo in mininet Python API.

5 Custom Topology
The custom topology can be built in the mininet using the python API. In python file for the custom
topology, the new Topology class has to be defined. The new class has to be the subclass of the built in
class Topo defined in mininet.topo.Topo.

The custom topologies can be created using the methods like addHost(), addSwitch(), addController(),
addLink() etc of the class mininet.net.Mininet. The network with custom topology will have following
pattern of use:
$ sudo mn custom <path to the python file .py> --topo topo_name[, arguments]
Following python file creates a topology with mesh aggregate switches and linear access switches.

#! /usr/bin/python
#usage: mn --custom <path-to-file> --topo aatopo,m,n,k ....

from mininet.topo import Topo


from mininet.net import Mininet

class MyTopo(Topo):
""
def __init__(self, nAggr=2, nAccess=2, nHost=2, **opts):
""" nAggr= number of aggregation switch,
nAccess = number of access switch per aggregation switch
nHost= no of host per access switch """
Topo.__init__(self, **opts)
aggrSwitchList = []
accessSwitchList = []

for i in range(1, (nAggr+1)):


aggrSwitch = self.addSwitch('g%d' % i)
lastAccessSwitch= None
for j in range(1, (nAccess+1)):
accessSwitch = self.addSwitch('s%dg%d' % (j,i))
self.addLink(accessSwitch, aggrSwitch)
7

for k in range(1, (nHost+1)):


host = self.addHost('h%ds%dg%d' % (k, j, i))
self.addLink(host, accessSwitch)
if lastAccessSwitch:
self.addLink(lastAccessSwitch,accessSwitch)
lastAccessSwitch = accessSwitch
for previousAggrSwitch in aggrSwitchList:
self.addLink(previousAggrSwitch, aggrSwitch)
aggrSwitchList.append(aggrSwitch)
topos = {'aatopo': MyTopo}

The network created using the command as:


$ sudo mn custom ~/mininet/aatopo.py topo aatopo,3,2,2 switch lxbr, stp=1
will be as shown:

Figure 5: Custom Topology created with python script

6 Conclusion
The mininet is a versatile open source platform for simulation the network. Its features can be added as
well due to its open source nature. Also the future additions and directions are also mentioned so surely
more features are due to come. Due to its adaptability with other controller, the mininet is getting more
functionalities.
The mininet provides built in functionalities for the popular topologies. In addition to the more
topologies can be designed as per necessity in python. The other popular topologies can be suggested to
incorporated as the built in. There are sample topologies given in the examples folder of the mininet
installation.

Bibliography
1. Mininet Team. Mininet Overview [Online]. Available: http://mininet.org/overview/
2. Mininet Team. Mininet Walkthrough [Online]. Available: http://mininet.org/walkthrough/
3. B. Lantz, B. Heller and N. McKeown. A Network in a Laptop: Rapid Prototyping for Software
Defined Networks, Stanford University, Stanford, Oct 2010.
4. B. Lantz, N. Handigol, B. Heller and V. Jeyakumar. Introduction to Mininet [Online]. Available:
https://github.com/mininet/mininet/wiki/Introduction-to-Mininet [15 Sept, 2015]
5. Mininet Team. Mininet Python API Reference Manual. Available:
http://mininet.org/api/hierarchy.html

10

You might also like