We have illustrated the significant steps that are involved in the process of creating the network topologies using Mininet.
Networking Components in Mininet
In Mininet, we use some networking components in MiniEdit for the creation of network topologies.
- Controller
- NetLink
- Legacy router
- Legacy switch
- OpenFlow enabled switch
- Host
- Select
Create Network Topologies in Mininet
The Mininet is supportive for the simple python API to create the custom network topologies and then we are capable to create the custom topology through writing the python code which is highlighted in the following along with its functions.
- Sample code to initialize topology
Topo.__init__(self)
- Sample code to add hosts and switches
h1=self.addHost(‘h1’)
h2=self.addHost(‘h2’)
h3=self.addHost(‘h3’)
h4=self.addHost(‘h4’)
leftSwitch=self.addSwitch(‘s1’)
rightSwitch=self.addSwitch(‘s2’)
self.addLink(h1,leftSwitch)
self.addLink(h2,leftSwitch)
self.addLink(leftSwitch,rightSwitch)
self.addLink(rightSwitch,h3)
self.addLink(rightSwitch,h4)
Consequently, we have to save the code along with the file name of NewTopology.py.
Run Network Topologies in Mininet
To run the network topologies in Mininet, we have to execute the commands which are highlighted below in the Ubuntu terminal.
cd /home/research/mininet/Network_Topology
sudo python NewTopology.py