from mn_wifi.cli import CLI
from mn_wifi.net import Mininet_wifi
from mn_wifi.node import OVSKernelAP, UserAP
from mn_wifi.link import wmediumd, _4address
from mn_wifi.wmediumdConnector import interference
from mininet.log import setLogLevel, info
from mininet.term import makeTerm
from mininet.link import TCLink
from mininet.node import OVSKernelSwitch, RemoteController
import os, time
def topology():
net = Mininet_wifi (allAutoAssociation=True, controller= RemoteController, accessPoint=OVSKernelAP, link=wmediumd, wmediumd_mode=interference) #accessPoint= UserAP)
info ("Creating nodes ---- \n")
sta1 = net.addStation ("sta1", wlans=1, mac="00:00:00:00:00:01", ip="10.0.0.1/8", range=4)
net.setPropagationModel (model="logDistance", exp=4.3)
info ("**** Configuring Wifi Nodes \n")
net.configureWifiNodes()
#net.AssociationControl('ssf')
info ("**** Associating and Creating links \n")
net.plotGraph (max_x=200, max_y=80)
net.startMobility (time=0, seed=1, model='logDistance', ac_method='ssf')
net.mobility (sta1, 'start', time=10, position="2,40,0")
net.mobility (sta1, 'stop', time=40, position="180,40,0")
net.stopMobility (time=400)
info ("**** Starting network \n")
net.build ()
info ("**** Running CLI \n")
CLI(net)
info ("**** Stopping network \n")
net.stop ()
if __name__ == '__main__' :
setLogLevel ('info')
topology()
As per the above code, sta1 should move from (x1, y1) = (2, 40) to (x2, y2) = (180,40) in 30 seconds. This means speed of the sta1 is 178 m/ 30 sec = 6 m/sec. But when I check time it takes more than 120 seconds. Please help where I am going wrong.
I cannot confirm that issue. Sta1 takes 30sec to reach the destination. Please make sure you have a multi core system. Otherwise, python multiprocessing won´t work properly.
As per the above code, sta1 should move from (x1, y1) = (2, 40) to (x2, y2) = (180,40) in 30 seconds. This means speed of the sta1 is 178 m/ 30 sec = 6 m/sec. But when I check time it takes more than 120 seconds. Please help where I am going wrong.
Thanks.