Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Introduction
There could be a lot of simulators that could simulate network structures and even can build a virtual test bed to simulate Self
Defined Network. But there are a few simulates which are available for building wireless networks. Miniet-wifi is a small but
functional software for developers to simulate their own wireless networks with a Linux-installed laptop.
Most of the codes in mininet were written in Python language. Due to this, it might be much easier for developers to read them and
modify them. And I would explain most part of the codes for you to make sure you can get a quick start when you can access to it.
By the way, I have uploaded the zipped version.
Install Mininet-wifi
Step 1: git clone https://github.com/intrig-unicamp/mininet-wifi
Step 2: cd mininet-wifi
Step 3: sudo ./util/install.sh -Wnfv
Code a Topology
Topology file must be written in Python form.
#!/usr/bin/python
"""
Setting the position of Nodes (only for Stations and Access Points) and providing mobility.
"""
def topology():
"Create a network."
net = Mininet( controller=Controller, link=TCLink, switch=OVSKernelSwitch )
https://www.codeproject.com/Tips/1064353/Using-Mininet-wifi-to-Simulate-Software-Defined-Wi?display=PrintAll 1/5
8/7/2019 Using Mininet-wifi to Simulate Software-Defined-Wireless-Network - CodeProject
net.startMobility(startTime=0)
net.mobility('sta1', 'start', time=1, position='10.0,20.0,0.0')
net.mobility('sta2', 'start', time=2, position='30.0,30.0,0.0')
net.mobility('sta1', 'stop', time=12, position='70.0,0.0,0.0')
net.mobility('sta2', 'stop', time=56, position='80.0,100.0,0.0')
net.stopMobility(stopTime=23)
if __name__ == '__main__':
setLogLevel( 'info' )
topology()
The Graph
https://www.codeproject.com/Tips/1064353/Using-Mininet-wifi-to-Simulate-Software-Defined-Wi?display=PrintAll 2/5
8/7/2019 Using Mininet-wifi to Simulate Software-Defined-Wireless-Network - CodeProject
This graph shows how miminet-wifi would works. And if you have followed all the steps above, you could also see the 'sta' is
roaming in the graph. And now, you can do 'Ping Test', 'IPerf', etc.
Dependence
import os
import socket
import struct
import fcntl
import fileinput
import subprocess
import glob
import math
import time
import numpy as np
import scipy.spatial.distance as distance
import matplotlib.patches as patches
import matplotlib.pyplot as plt
Class
class checkNM ( object ) // To write mac addresses which were created for
// virtual aps into file /etc/NetworkManager/NetworkManager.conf
https://www.codeproject.com/Tips/1064353/Using-Mininet-wifi-to-Simulate-Software-Defined-Wi?display=PrintAll 3/5
8/7/2019 Using Mininet-wifi to Simulate Software-Defined-Wireless-Network - CodeProject
def physical(self)
def virtual(self)
class association( object ) //set wifi parameters to network interface and associate mobile
stations to aps
def parameters(self, sta, ap, distance, wlan) //define wifi interfaces and
parameters
addressingSta = {}
indexStaIface = {}
fixedPosition = []
apIface = []
printCon = True
list = []
number = 0
exists = False
manual_apRange = -10
https://www.codeproject.com/Tips/1064353/Using-Mininet-wifi-to-Simulate-Software-Defined-Wi?display=PrintAll 4/5
8/7/2019 Using Mininet-wifi to Simulate Software-Defined-Wireless-Network - CodeProject
MAX_X = 50
MAX_Y = 50
License
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
WenQiang Jin received his B.A in Information and Telecommunication Engineering from CQUPT, China. He is currently a Masters
student in Telecommunication at CQUPT. He received network engineering certificate from China Government. His research
interest is SDN, wireless network programming,Network Calculus,Network Computing,and software testing.
https://www.codeproject.com/Tips/1064353/Using-Mininet-wifi-to-Simulate-Software-Defined-Wi?display=PrintAll 5/5