Monday, October 14, 2013

Understanding Mininet Network Topology


Mininet has a set of default network topologies which can be chosen on the command line.

The below example creates a network topology with single openflow switch and 3 hosts connected to it.



Another example where mininet creates a linear network topology with each switch connected to one host and the switch adjacent to it.


In the above example mn is a launch script which executes the below python code.


The main class in the code snippet is Mininet which spawns hosts, switches and controller and add links between them. Mininet class takes topo parameter which describes the network topology.

The Topo class is the abstract class used to build custom topologies. One of the derived classes is LinearTopo which creates linear topology of k switches, with n hosts per switch.

net.start will start all the switches, controller and hosts. Next net.cli initiates a simple command line interface to talk to the nodes.

The other default topologies are SingleSwitchReversedTopo, SingleSwitchTopo  and TreeTopo

1 comment :

  1. Nice to see your posts man... Basically it allows user to write their own topology and without bothering much about internals..just run with mininet...

    ReplyDelete