intrig-unicamp / mininet-wifi

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

Destination unreachable #360

Closed catherinenayer closed 3 years ago

catherinenayer commented 3 years ago

In the following code, I have many issues

  1. the stations created didn't appear in the figure
  2. when sta11 ping sta12 destination unreachable and also when sta11 ping sta21 all stations connected to different access point isn't reachable
  3. cars and stations can not ping to each other also the destination unreachable
  4. I have a question about how to add multiple running services to each car in the scenario
  5. I have tried to install VND using a web server and when trying to accessing it opens a blank page can you help me with this and thank you in advance

!/usr/bin/python

import sys from random import randint

from mininet.node import Controller, OVSKernelSwitch, Node from mininet.log import setLogLevel, info from mn_wifi.cli import CLI from mn_wifi.net import Mininet_wifi from mn_wifi.link import wmediumd, mesh, physicalMesh from mn_wifi.wmediumdConnector import interference

def topology(args):

"Create a network."
net = Mininet_wifi(controller=Controller, roads=10,link=wmediumd, wmediumd_mode=interference)

info("*** Creating nodes\n")
for id in range(0, 10):
    min_ = randint(1, 4)
    max_ = randint(11, 30)
    net.addCar('car%s' % (id+1), wlans=2, min_speed=min_, max_speed=max_)

rsu11 = net.addAccessPoint('RSU11', ssid='RSU11', mode='g', channel='1')
rsu12 = net.addAccessPoint('RSU12', ssid='RSU12', mode='g', channel='6')
rsu13 = net.addAccessPoint('RSU13', ssid='RSU13', mode='g', channel='6')
rsu14 = net.addAccessPoint('RSU14', ssid='RSU14', mode='g', channel='11')
c1 = net.addController(name='c1',controller=Controller,protocol='tcp',port=6653)
c2 = net.addController(name='c2',controller=Controller,protocol='tcp',port=6653)   
c3 = net.addController(name='c3',controller=Controller,protocol='tcp',port=6653)
c4 = net.addController(name='c4',controller=Controller,protocol='tcp',port=6653)  

info( '*** Add switches/APs\n')
s1 = net.addSwitch('s1', cls=OVSKernelSwitch)
s2 = net.addSwitch('s2', cls=OVSKernelSwitch) 

info( '*** Add hosts/stations\n')
sta11 = net.addStation('sta11', nvif=2)
sta12 = net.addStation('sta12', nvif=2)
sta13 = net.addStation('sta13', nvif=2)

sta21 = net.addStation('sta21', nvif=2)
sta22 = net.addStation('sta22', nvif=2)
sta23 = net.addStation('sta23', nvif=2)

sta31 = net.addStation('sta31', nvif=2)
sta32 = net.addStation('sta32', nvif=2)
sta33 = net.addStation('sta33', nvif=2)

sta41 = net.addStation('sta41', nvif=2)
sta42 = net.addStation('sta42', nvif=2)
sta43 = net.addStation('sta43', nvif=2)

info("*** Configuring Propagation Model\n")
net.setPropagationModel(model="logDistance", exp=3)

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

info("*** Associating and Creating links\n")
net.addLink(rsu11, rsu12)
net.addLink(rsu11, rsu13)
net.addLink(rsu11, rsu14)

net.addLink(rsu11, sta11)
net.addLink(rsu11, sta12)
net.addLink(rsu11, sta13)

net.addLink(rsu12, sta21)
net.addLink(rsu12, sta22)
net.addLink(rsu12, sta23)

net.addLink(rsu13, sta31)
net.addLink(rsu13, sta32)
net.addLink(rsu13, sta33)

net.addLink(rsu14, sta41)
net.addLink(rsu14, sta42)
net.addLink(rsu14, sta43)

net.addLink(s2, rsu11)
net.addLink(s2, rsu12)
net.addLink(s2, rsu13)
net.addLink(s2, rsu14)

net.addLink(c1, s2)
net.addLink(c2, s2)
net.addLink(c3, s2)

net.addLink(c1, s1)
net.addLink(c2, s1)
net.addLink(c3, s1)
net.addLink(c4, s1)

for car in net.cars:
    net.addLink(car, intf='%s-wlan1' % car,
                cls=mesh, ssid='mesh-ssid', channel=5)

if '-p' not in args:
    net.plotGraph(max_x=500, max_y=500)

net.startMobility(time=0)

info("*** Starting network\n")
net.build()
c1.start()
c2.start()
c3.start()
c4.start()
rsu11.start([c1,c2,c3,c4])
rsu12.start([c1,c2,c3,c4])
rsu13.start([c1,c2,c3,c4])
rsu14.start([c1,c2,c3,c4])
s1.start([c1,c2,c3,c4])
s2.start([c1,c2,c3])

for id, car in enumerate(net.cars):
    car.setIP('10.0.0.%s/24' % (id+1), intf='%s-wlan0' % car)
    car.setIP('10.0.0.%s/24' % (id+1), intf='%s-mp1' % car)

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

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

if name == 'main': setLogLevel('debug') topology(sys.argv)

ramonfontes commented 3 years ago

the stations created didn't appear in the figure

It seems that some basics of Python are missing here. Please provide more information about it.

when sta11 ping sta12 destination unreachable and also when sta11 ping sta21 all stations connected to different access point isn't reachable

What is the purpose of nvif=2. Moreover, who is the destination? Ok, sta12 and sta21 are the nodes. However, which network interface are you considering as destination??

cars and stations can not ping to each other also the destination unreachable

Very vague statement :(

I have a question about how to add multiple running services to each car in the scenario

node.cmd() does the work.

I have tried to install VND using a web server and when trying to accessing it opens a blank page can you help me with this and thank you in advance

This is not a repository about VND. VND is not being maintained anymore. Please consider using miniedit instead.

In the following code, I have many issues

Please provide as much information as possible about the issues (if this is an issue). You have opened a generic issue with so many vague questions

As far as I understood, this is not an issue related to the mininet-wifi code. It only concerns questions that can be easily answered with simple searches on the internet or even through the mailing list..