intrig-unicamp / mininet-wifi

Emulator for Software-Defined Wireless Networks
https://mn-wifi.readthedocs.io/
Other
431 stars 239 forks source link

Why i am unable to acheive the ping between two staions in mininet? #414

Closed Varadarajreddy closed 2 years ago

Varadarajreddy commented 2 years ago

I have added 6 APs and 3 stations and 1 UDPS server, I am trying to ping between the stations but I am unable to achieve the ping between them, I am getting a message that Destination Host is Unreachable. what would be the possible cause? please help me. Below is the code along with the network configuration. Thanks.

!/usr/bin/python

import sys from mininet.node import Controller from mininet.log import setLogLevel, info from mn_wifi.cli import CLI_wifi from mn_wifi.net import Mininet_wifi

def topology(plot): "Create a network." net=Mininet_wifi(controller=Controller)

info("*** Creating nodes\n")
    #TODO add stations and  access points
    STA1 = net.addStation('STA1', passwd='19056149', encrypt='wpa2', mac='00:00:00:10:11:08', ip='147.192.10.2/24', position ='50,25,0', range=30, min_v=5, max_v=5, antennaheight='3', antennagain='7', ipv6='fe80::10')
    STA2 = net.addStation('STA2', passwd='19056149', encrypt='wpa2', mac='00:00:00:10:11:09', ip='147.192.10.3/24', position ='50,25,0', range=30, min_v=5, max_v=10, antennaheight='3', antennagain='7', ipv6='fe80::11')
    STA3 = net.addStation('STA3', passwd='19056149', encrypt='wpa2', mac='00:00:00:10:11:10', ip='147.192.10.4/24', position ='50,140,0', range=30, min_v=2, max_v=7, antennaheight='3', antennagain='7', ipv6='fe80::12')
UDPS = net.addStation('UDPS', mac='00:00:00:10:01:01', ip='147.192.10.1/24', position ='50,140,0', range='30', antennaheight='3', antennagain='7',) 

AP1 = net.addAccessPoint('AP1', mac='00:00:00:00:10:02', ssid='ssid-ap1', passwd='19056149', encrypt='wpa2', mode='a', channel='1', failMode="standalone", position='50,75,0',  range=25, Model='DI524')
    AP2 = net.addAccessPoint('AP2', mac='00:00:00:00:10:03', ssid='ssid-ap2', passwd='19056149', encrypt='wpa2', mode='g', channel='6', failMode="standalone", position='50,125,0', range=25, Model='DI524')
    AP3 = net.addAccessPoint('AP3', mac='00:00:00:00:10:04', ssid='ssid-ap3', passwd='19056149', encrypt='wpa2', mode='b', channel='2', failMode="standalone", position='100,125,0', range=25, Model='DI524')
    AP4 = net.addAccessPoint('AP4', mac='00:00:00:00:10:05', ssid='ssid-ap4', passwd='19056149', encrypt='wpa2', mode='g', channel='3', failMode="standalone", position='150,125,0', range=25, Model='DI524')
    AP5 = net.addAccessPoint('AP5', mac='00:00:00:00:10:06', ssid='ssid-ap5', passwd='19056149', encrypt='wpa2', mode='b', channel='3', failMode="standalone", position='150,75,0',  range=25, Model='DI524')
    AP6 = net.addAccessPoint('AP6', mac='00:00:00:00:10:07', ssid='ssid-ap6', passwd='19056149', encrypt='wpa2', mode='g', channel='3', failMode="standalone", position='200,75,0', range=25, Model='DI524')

c1=net.addController('c1')

net.setPropagationModel(model="logDistance", exp=5)

info("*** Configuring wifi nodes\n")
net.configureWifiNodes()

net.addLink(AP1,AP2, bw=100, delay='3ms', loss=5)
net.addLink(AP2,AP3, bw=100, delay='3ms', loss=5)
    net.addLink(AP3,AP4, bw=100, delay='3ms', loss=5)
    net.addLink(AP3,AP5, bw=100, delay='3ms', loss=5)
    net.addLink(AP5,AP6, bw=100, delay='3ms', loss=5)

net.plotGraph(max_x=600, max_y=600)

net.startMobility(time=0)
    net.mobility(STA1,'start', time=10,  position='50,25,0')
    net.mobility(STA2,'start', time=15,  position='50,25,0')
    net.mobility(STA1,'stop',  time=20,  position='200,75,0')
    net.mobility(STA2,'stop',  time=21,  position='150,125,0')
    net.mobility(STA3,'start', time=16,  position='50,25,0')
    net.mobility(STA3,'stop',  time=22,  position='100,125,0')
    net.stopMobility(time=30)

info("*** Starting network\n")
net.build()
    #TODO start ap1
c1.start()
    AP1.start([c1])
    AP2.start([c1])
    AP3.start([c1])
    AP4.start([c1])
    AP5.start([c1])
    AP6.start([c1])

info("*** Running CLI\n")
    CLI_wifi(net)

    info("*** Stopping network\n")
    net.stop()

if name == 'main': setLogLevel('info') plot = False if '-p' in sys.argv else True topology(plot)

Varadarajreddy commented 2 years ago

Screenshot from 2021-12-02 18-51-28

ramonfontes commented 2 years ago

Firstly, you have to make sure that the signal range you have set work well with the propagation model. Then, you can run the code in debug level and see whether hostapd is working as expected. If the answer is no you may need to stop network manager. You can also use iw and scan the available APs.

Varadarajreddy commented 2 years ago

Hi Ramon,

Thanks for your response. I have tried them still no luck!. Could you please review my code and run it to test if it is working fine at your end?

Varadarajreddy commented 2 years ago

and as mentioned by you in the previous comment "make sure that the signal range you have set work well with the propagation model." This one I did not understand how to check. please tell me what to check and where i need to make the changes.

ramonfontes commented 2 years ago

I have tried them still no luck!.

Sorry, this doesn't answer the questions. Can you describe what you have tried, in details?

Could you please review my code and run it to test if it is working fine at your end?

I really appreciate if you provide more technical information about the issue.

This one I did not understand how to check

You can start with the propagation model formula.

Varadarajreddy commented 2 years ago

Hi Ramon, Screenshot from 2021-12-03 17-22-10 I found out the issue and now I am able to ping. Thanks for your continued support. Actually, I mistyped "model=DI525" I typed Model=DI525 when changed to small it worked.