Hi everyone,
I am working with Mininet-WiFi integrated with SUMO, and I would like to clarify how to correctly update the positions of stations.
What I need is quite simple: if my stations (e.g., sta1, sta2) move in SUMO according to the mobility defined in the .rou.xml and .net.xml files, I want their positions to be automatically updated in Mininet-WiFi
Here is what I did:
I configured a SUMO GUI simulation with 4 stations moving along a straight road (defined in road.sumocfg).
I launched Mininet-WiFi with the following script (simplified example below).
The SUMO GUI works fine and I can clearly see the stations moving but then I tried to check the stations’ positions from the Mininet CLI using sta1 position, but the position did not seem to update at all. In fact, the CLI sometimes tells me the position is not even defined.
My question is:
Am I missing some step to correctly synchronize SUMO mobility with the Mininet-WiFi stations’ positions?
Do I need to explicitly match the station IDs in Mininet with the vehicle IDs in SUMO, or use clients=2 when launching SUMO?
Any minimal working example (e.g., 2 stations moving along a road and their positions updating in Mininet CLI) would be very helpful.
Thank you very much for your support!
Elena
--
You received this message because you are subscribed to the Google Groups "mininet-wifi-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mininet-wifi-dis...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mininet-wifi-discuss/6feeadb1-e015-4f9c-97d6-4e4ffaa6aaabn%40googlegroups.com.
Good morning,
I tried running the example you suggested, and it helped me a lot to develop my solution!
My goal was to implement a specific topology with moving stations that automatically associate and disassociate from the AP depending on whether they are inside or outside the AP’s coverage range.
I replaced the default map.sumocfg file in runner.py, so that the positions of my stations (cars) are tracked based on a simpler road network (a straight 100m line) crossing the AP’s coverage area.
I ran some experiments with ping to check how the stations would associate and disassociate depending on their position. However, I found that only entering the AP’s range worked correctly (the station associates). When the station leaves the coverage area, I get an error, and the AP still allows communication even though the station has already left its range.
BEFORE CROSSING THE RANGE
64 bytes from 10.0.0.10: icmp_seq=66 ttl=64 time=0.717 ms
64 bytes from 10.0.0.10: icmp_seq=67 ttl=64 time=0.841 ms
...
64 bytes from 10.0.0.10: icmp_seq=70 ttl=64 time=0.757 ms
WHILE CROSSING THE RANGE: Here is the error I get when the station goes out of range:
Exception in thread wifiParameters:64 bytes from 10.0.0.10: icmp_seq=71 ttl=64 time=0.773 ms
64 bytes from 10.0.0.10: icmp_seq=72 ttl=64 time=0.759 ms
So in short:
Association works fine when the station enters the AP range.
Disassociation when leaving the range fails with the above AssertionError.
After that, the AP still lets the station communicate, even though it should no longer be in range.
My question is: has anyone faced this issue before, and how can I properly fix it? Should I modify the ap_out_of_range function in mobility.py to handle the disconnection differently?
If so, what would be the correct approach?
Thank you for helping me,
Elena
I created a very simple topology where cars move along a 100m straight road in SUMO and associate/disassociate with one AP depending on coverage.
Here is the code I’m using:
#!/usr/bin/env python3
import sys
sys.path.insert(0, "/home/<my-username>/Progetti/mininet-wifi/mininet-wifi/mn_wifi/sumo")
from mininet.log import setLogLevel, info
from mn_wifi.cli import CLI
from mn_wifi.net import Mininet_wifi
from mn_wifi.node import OVSKernelAP
from mininet.node import RemoteController
from runner import sumo
from mn_wifi.link import wmediumd, ITSLink
from mn_wifi.wmediumdConnector import interference
from mn_wifi.wmediumdConnector import error_prob
def topology():
"Create a network with Ryu + SUMO cars"
net = Mininet_wifi(controller=RemoteController,
accessPoint=OVSKernelAP,link=wmediumd, wmediumd_mode=interference)
info("*** Adding Ryu controller\n")
c0 = net.addController('c0', controller=RemoteController,
ip='127.0.0.1', port=6633)
info("*** Creating nodes\n")
# Access Point connesso al controller
ap1 = net.addAccessPoint('ap1', ssid='new-ssid', mode='ac', channel='36',
position='50,20,0', range=40)
# Host
h1 = net.addHost('h1', ip='10.0.0.10/8')
# 4 cars controlled by sumo
for id in range(0, 4):
net.addCar('car%s' % (id+1), wlans=1, mode='ac') # wlans=1 basta
info("*** Configuring Propagation Model\n")
net.setPropagationModel(model="logDistance", exp=2.8)
net.configureNodes()
info("*** Creating links\n")
net.addLink(ap1, h1)
"""
for car in net.cars:
net.addLink(car, intf=car.wintfs[0].name,
cls=ITSLink, band=20, channel=181)
"""
info("*** Starting SUMO\n")
net.useExternalProgram(program=sumo, port=8813,
extra_params=["--start --delay 1000"],
clients=1, exec_order=0)
info("*** Starting network\n")
net.build()
c0.start()
ap1.start([c0])
# dinamic IP for cars
for id, car in enumerate(net.cars):
car.setIP('10.0.0.{}/8'.format(id+1),
intf=car.wintfs[0].name)
net.telemetry(nodes=net.cars + [ap1], data_type='position',
min_x=0, min_y=0, max_x=100, max_y=40)
info("*** Running CLI\n")
CLI(net)
info("*** Stopping network\n")
net.stop()
if __name__ == '__main__':
setLogLevel('info')
topology()
then i create a simple sumo map with a 100m street. I have attached some pictures that describe exactly how my test network works: one AP with a certain coverage range, and cars (stations) moving across it.
I ran two experiments:
Test 1 – Entering the AP range
I checked that a station which is still outside the AP range cannot communicate through it.
As soon as the station moves inside the AP coverage, it successfully associates and can reach the host via the AP.
This works correctly ( in the second image you can see that from "Destination Host Unreachable" it start sending package as the station enters in the range )
Test 2 – Leaving the AP range
I checked that a station which leaves the AP range should automatically disconnect and lose connectivity to the host.
However, this does not happen: instead, I get the previous error with that strange behaviour
Hi,
I tried your suggestion with xterm and it worked!
So the issue was exactly what you suspected: when I was running the ping directly from the Mininet CLI, the node’s shell was already busy. Since the disconnect function is not asynchronous, Mininet couldn’t send the command and raised the AssertionError.
Running the ping inside an xterm kept the Mininet shell free, and now the disconnect works correctly when the station leaves the AP range.
Thanks a lot for the advice, it really clarified what was going on!