intrig-unicamp / mininet-wifi

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

Is 6LowPan compatible with mobility? #308

Closed ckampi closed 4 years ago

ckampi commented 4 years ago

So I'm testing this scenario, is 6LowPan.py example with the simplest mobility option I found, but when I run it the graph shows up empty and for example if I try to get position of sensor1 from CLI:

mininet-wifi> py sensor1.position 'LowPANNode' object has no attribute 'position'

from mininet.log import setLogLevel, info
from mn_wifi.cli import CLI
from mn_wifi.net import Mininet_wifi

def topology():
    "Create a network."
    net = Mininet_wifi(iot_module='mac802154_hwsim')
    # iot_module: fakelb or mac802154_hwsim
    # mac802154_hwsim is only supported from kernel 4.18

    info("*** Creating nodes\n")
    sensor1 = net.addSensor('sensor1', ip6='2001::1/64', panid='0xbeef')
    sensor2 = net.addSensor('sensor2', ip6='2001::2/64', panid='0xbeef')
    sensor3 = net.addSensor('sensor3', ip6='2001::3/64', panid='0xbeef', position='10,150,0')

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

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

    net.setMobilityModel(time=0, model='RandomDirection',max_x=100, max_y=100, seed=20)

    info("*** Starting network\n")
    net.build()

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

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

if __name__ == '__main__':
    setLogLevel('info')
    topology()

So I guess sensors are not compatible with mobility? On the normal scenario I'm able to move them around from the cli with the py sensor1.setPosition('10,10,0') command

ramonfontes commented 4 years ago

https://github.com/intrig-unicamp/mininet-wifi/commit/04fdc6166f6675721c65cd03b0edfa88811f4c77 fixes the issue

ckampi commented 4 years ago

WoW that was amazing fast, thank you Ramon for fixing it, now it works fine.

I'm still learning about mininet-wifi and 6lowpan, when using the script of the topic I run from the cli sensor1 ping6 2001::2 and the ping always work, even when the sensors are far away. I tried the example 6lowpan.py changing the position from cli and had the same result as well. is this normal?

ramonfontes commented 4 years ago

Yes. This is still "normal" because there is no solution for fakelb (neither mac802154_hwsim) that simulates the wireless medium. It works fine with Wi-Fi thanks to wmediumd that simulates the wireless medium created by mac80211_hwsim.

ckampi commented 4 years ago

Ok tank you!