intrig-unicamp / mininet-wifi

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

OVSAP can ping each other when they are out of range, and it does't have flows in AP #529

Closed cnetboy closed 6 months ago

cnetboy commented 6 months ago

from mininet.log import setLogLevel, info from mininet.node import RemoteController from mn_wifi.node import OVSKernelAP from mn_wifi.link import wmediumd, mesh from mn_wifi.cli import CLI from mn_wifi.net import Mininet_wifi from mn_wifi.wmediumdConnector import interference

def topology(): "Create a network." net = Mininet_wifi(link=wmediumd, wmediumd_mode=interference)

info("*** Creating nodes\n")
c0 = net.addController('c0')
# c0 = net.addController('c0', controller=RemoteController, ip='127.0.0.1', port=6653)

info("*** Configuring Propagation Model\n")

sta1 = net.addStation('sta1', mac='00:00:00:00:00:11', position='20,250,0')
sta2 = net.addStation('sta2', mac='00:00:00:00:00:12', position='2050,250,0')

opt_params = {}
opt_params['cls'] = OVSKernelAP
opt_params['protocols']='OpenFlow13'
ap1 = net.addAccessPoint('ap1', wlans=2, ssid='ssid1', position='100,250,0', **opt_params)
ap2 = net.addAccessPoint('ap2', wlans=2, ssid='ssid2', position='300,250,0', **opt_params)
ap3 = net.addAccessPoint('ap3', wlans=2, ssid='ssid3', position='500,250,0', **opt_params)
ap4 = net.addAccessPoint('ap4', wlans=2, ssid='ssid4', position='700,250,0', **opt_params)
ap5 = net.addAccessPoint('ap5', wlans=2, ssid='ssid5', position='900,250,0', **opt_params)
ap6 = net.addAccessPoint('ap6', wlans=2, ssid='ssid6', position='1100,250,0', **opt_params)
ap7 = net.addAccessPoint('ap7', wlans=2, ssid='ssid7', position='1300,250,0', **opt_params)
ap8 = net.addAccessPoint('ap8', wlans=2, ssid='ssid8', position='1500,250,0', **opt_params)
ap9 = net.addAccessPoint('ap9', wlans=2, ssid='ssid9', position='1700,250,0', **opt_params)
ap10 = net.addAccessPoint('ap10', wlans=2, ssid='ssid10', position='1900,250,0', **opt_params)

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

info("*** Configuring nodes\n")
net.configureNodes()

info("*** Associating Stations\n")
net.addLink(sta1, ap1)
net.addLink(sta2, ap2)
net.addLink(ap1, intf='ap1-wlan2', cls=mesh, ssid='mesh-ssid', channel=5)
net.addLink(ap2, intf='ap2-wlan2', cls=mesh, ssid='mesh-ssid', channel=5)
net.addLink(ap3, intf='ap3-wlan2', cls=mesh, ssid='mesh-ssid', channel=5)
net.addLink(ap4, intf='ap4-wlan2', cls=mesh, ssid='mesh-ssid', channel=5)
net.addLink(ap5, intf='ap5-wlan2', cls=mesh, ssid='mesh-ssid', channel=5)
net.addLink(ap6, intf='ap6-wlan2', cls=mesh, ssid='mesh-ssid', channel=5)
net.addLink(ap7, intf='ap7-wlan2', cls=mesh, ssid='mesh-ssid', channel=5)
net.addLink(ap8, intf='ap8-wlan2', cls=mesh, ssid='mesh-ssid', channel=5)
net.addLink(ap9, intf='ap9-wlan2', cls=mesh, ssid='mesh-ssid', channel=5)
net.addLink(ap10, intf='ap10-wlan2', cls=mesh, ssid='mesh-ssid', channel=5)

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

info("*** Starting network\n")
net.build()
c0.start()
ap1.start([c0])
ap2.start([c0])
ap3.start([c0])
ap4.start([c0])
ap5.start([c0])
ap6.start([c0])
ap7.start([c0])
ap8.start([c0])
ap9.start([c0])
ap10.start([c0])

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

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

if name == 'main': setLogLevel('info') topology()

image image

ramonfontes commented 6 months ago

This is an expected behavior since OVSs are running at root NS. Please make sure you have visited the mailing list before opening issues.

cnetboy commented 6 months ago

This is an expected behavior since OVSs are running at root NS. Please make sure you have visited the mailing list before opening issues.

Thanks very much, sir. I have checked the maillist and not find the similar results yet. In this scenairo, the transmit range of each AP that with LogDistance propagationmodel (exp=3) is 313.9, and the distance between two APs is 200. When a packet from sta1 to sta2 should be transmited to ap1 by sta1 first and forwards by ap2, ap3,....,ap9, and finally ap10 tansmits the packet to sta2 in the scenario. I think that ap2, ap3, ..., ap9 also should have flow items that matched and have actions the forward the packet to next AP. But the simulation reults show that ap2, ap3, ..., ap9, do not have flow items in the flow table.

In my simulations, I want to select the transmit path among many APs, so how can I set the accesspoint parameters to make sure that there is only one link between two APs when they are in the tansmit range each other, and not have a link if two aps are out of the transmit range.

"This is an expected behavior since OVSs are running at root NS. " you mean that all APs set as OVSKernelAP are in the root namespace, and they can connect directly to each other regardless of transmit range?

this is the network topology showed by ONOS image

I want to get the network topology in ONOS that image

ramonfontes commented 6 months ago

What do you think about the threads below (just to cite three)? [1] https://groups.google.com/g/mininet-wifi-discuss/c/utE1Q9QIcok/m/JOQVZbRIAAAJ [2] https://groups.google.com/g/mininet-wifi-discuss/c/Q0ZvI1gJkQ4/m/Kc5WKnvNAQAJ [3] https://groups.google.com/g/mininet-wifi-discuss/c/2RdeNxypLZA/m/iOEMFe4cDwAJ