Hello everyone,
I am currently working on an SDN/IoT simulation using Mininet-WiFi with an Edge–Fog–Cloud architecture. I created several IoT stations connected via WiFi to Access Points, and the APs are connected to switches and routers.
However, I am facing a connectivity issue. Although the stations appear to be properly associated with the Access Point, they cannot reach hosts in the same subnet.
For example, station iot2 is connected to AP1 (SSID: iotnet1), but it cannot ping other hosts in the same network such as the edge gateway.
Here are some details from the Mininet CLI:
mininet> iot2 iwconfig iot2-wlan0 IEEE 802.11 ESSID:"iotnet1" Mode:Managed Access Point: 02:00:00:00:0A:00 Link Quality=70/70 Signal level=-36 dBmSo the station seems correctly associated with the AP.
However, connectivity fails:
mininet> iot2 ping 192.168.10.100 Destination Host UnreachableRouting table on the station:
mininet> iot2 route -n Kernel IP routing table Destination Gateway Genmask Iface 192.168.10.0 0.0.0.0 255.255.255.0 iot2-wlan0Even the gateway is unreachable:
mininet> iot2 ping 192.168.10.1 Destination Host UnreachableTopology summary:
IoT stations (192.168.10.0/24) connected via WiFi
Access Points connected to Open vSwitch switches
Router r1 (192.168.10.1 / 192.168.20.1)
Fog node (192.168.20.10)
Cloud node (172.16.0.10)
The stations are associated with the APs, but packets do not seem to reach the wired network through the AP/switch.
My questions:
Is there something missing in the AP-to-switch bridging configuration?
Do APs require additional OpenFlow or forwarding configuration in this case?
Could this be related to default routing on the stations?
Any suggestions would be greatly appreciated.
you can find the script of the topologie below :
#!/usr/bin/python3
"""
Topologie SDN IoMT – Wi-Fi – Edge – Fog – Cloud
Correction finale : DPID corrigé, Routage et Management
"""
from mininet.node import RemoteController, OVSSwitch, Node
from mn_wifi.net import Mininet_wifi
from mininet.link import TCLink
from mininet.cli import CLI
from mininet.log import setLogLevel, info
class LinuxRouter(Node):
def config(self, **params):
super(LinuxRouter, self).config(**params)
self.cmd('sysctl -w net.ipv4.ip_forward=1')
def terminate(self):
self.cmd('sysctl -w net.ipv4.ip_forward=0')
super(LinuxRouter, self).terminate()
def createTopology():
net = Mininet_wifi(controller=None, link=TCLink, switch=OVSSwitch)
info("*** Ajout du contrôleur SDN distant\n")
# c0 est le controleur externe (ODL)
c0 = net.addController('c0', controller=RemoteController, ip='10.42.255.38', port=6653)
info("*** Création des routeurs et switches\n")
r1 = net.addHost('r1', cls=LinuxRouter)
r2 = net.addHost('r2', cls=LinuxRouter)
# Note: On utilise des noms sX pour eviter l'erreur de DPID
sw1 = net.addSwitch('s1', failMode='standalone')
sw2 = net.addSwitch('s2', failMode='standalone')
sw3 = net.addSwitch('s3', failMode='standalone')
sw6 = net.addSwitch('s6', failMode='standalone')
sw8 = net.addSwitch('s8', failMode='standalone')
info("*** Création des Access Points\n")
ap1 = net.addAccessPoint('ap1', ssid='iotnet1', mode='g', channel='1', position='10,20,0')
ap2 = net.addAccessPoint('ap2', ssid='iotnet2', mode='g', channel='6', position='30,20,0')
ap3 = net.addAccessPoint('ap3', ssid='iotnet3', mode='g', channel='11', position='50,20,0')
ap4 = net.addAccessPoint('ap4', ssid='iotnet4', mode='g', channel='1', position='70,20,0')
net.setPropagationModel(model="logDistance", exp=3)
info("*** Création des hôtes IoMT\n")
for i in range(2, 12):
x = 10 + (i % 4) * 20
net.addStation(f'iot{i}', ip=f'192.168.10.{i}/24',
position=f'{x},25,0', range=20,
defaultRoute='via 192.168.10.1')
info("*** Edge, Fog et Cloud\n")
gw1 = net.addHost('gw1', ip='192.168.10.100/24', defaultRoute='via 192.168.10.1')
fog1 = net.addHost('fog1', ip='192.168.20.10/24', defaultRoute='via 192.168.20.254')
cloud = net.addHost('cloud', ip='172.16.0.10/24', defaultRoute='via 172.16.0.1')
info("*** Création des liens\n")
# WiFi -> Edge
net.addLink(ap1, sw1)
net.addLink(ap2, sw1)
net.addLink(ap3, sw2)
net.addLink(ap4, sw2)
net.addLink(gw1, sw1)
net.addLink(sw3, sw1)
net.addLink(sw3, sw2)
# R1 : eth0 -> Edge, eth1 -> Fog
net.addLink(r1, sw3) # r1-eth0
net.addLink(r1, sw6) # r1-eth1
# R2 : eth0 -> Fog, eth1 -> Cloud, eth2 -> Management
net.addLink(r2, sw6) # r2-eth0
net.addLink(r2, sw8) # r2-eth1
net.addLink(cloud, sw8)
net.addLink(fog1, sw6)
info("*** Démarrage du réseau\n")
net.configureWifiNodes()
net.build()
#net.start()
c0.start()
for ap in [ap1, ap2, ap3, ap4]:
ap.start([c0])
for sw in [sw1, sw2, sw3, sw6, sw8]:
sw.start([c0])
info("*** Configuration IP et Routage\n")
# Configuration R1 (Passerelle Edge .10.1)
r1.cmd('ifconfig r1-eth0 192.168.10.1 netmask 255.255.255.0')
r1.cmd('ifconfig r1-eth1 192.168.20.1 netmask 255.255.255.0')
r1.cmd('ip route add 172.16.0.0/24 via 192.168.20.254')
# Configuration R2 (Passerelle Fog .20.254 et Cloud .1)
r2.cmd('ifconfig r2-eth0 192.168.20.254 netmask 255.255.255.0')
r2.cmd('ifconfig r2-eth1 172.16.0.1 netmask 255.255.255.0')
r2.cmd('ip route add 192.168.10.0/24 via 192.168.20.1')
info("*** Activation du mode NORMAL sur switches\n")
for sw in [sw1, sw2, sw3, sw6, sw8]:
sw.cmd(f'ovs-ofctl add-flow {sw.name} action=normal')
CLI(net)
net.stop()
if __name__ == '__main__':
setLogLevel('info')
createTopology()
controller ODL 4.4.8
Thank you!