Heterogeneous Network in Mininet-WiFi

156 views
Skip to first unread message

Lorenz Carvajal

unread,
Aug 4, 2023, 11:09:50 AM8/4/23
to mininet-wifi-discuss
Hello, I am creating a heterogeneous network for my undergraduate research program, and I am having trouble having a station be compatible with an IoT, mesh, and ad hoc network.

I am first trying to fix the adhoc/mesh connection.

Here I create Station0, which is meant to connect to a mesh or ad hoc network depending on where it is graphically:

sta0 = net.addStation( 'sta0', wlans=2, ip='10.0.0.8/8', position='350,375,0', range=80 )

I then create the networks and add these links:

net.addLink( sta0, cls=adhoc, ssid='adhocNet', intf='sta0-wlan0', mode='g', channel=5 )
net.addLink( sta0, cls=mesh,  ssid='meshNet', intf='sta0-wlan1', mode='g', channel=5 )


The station then is only compatible with the interface I add first, in this case the adhoc. When I switch those two lines around only the mesh works. When I try range='80,80' in addStation() to have ranges for both interfaces, I get a ValueError. Changing the channels for mesh nodes also did not work.

topo.PNG

For reference, sta1-3 are in the ad hoc, sta4-7 are mesh, ap1-3 are IoT, and ap4-6 are WiFi. I verified that each topology works in its own script. In the heterogeneous script, sta0 is moving around the various topologies.

Any help would be greatly appreciated. Thank you!

Ramon Fontes

unread,
Aug 4, 2023, 11:27:35 AM8/4/23
to Lorenz Carvajal, mininet-wifi-discuss
Hi,

> The station then is only compatible with the interface I add first

Could you please elaborate on that?

Lorenz Carvajal

unread,
Aug 4, 2023, 11:44:38 AM8/4/23
to mininet-wifi-discuss
Hello,

Sure. In my script, I have the following two lines:

net.addLink( sta0, cls=adhoc, ssid='adhocNet', intf='sta0-wlan0', mode='g', channel=5 ) # mobile station
net.addLink( sta0, cls=mesh,  ssid='meshNet', intf='sta0-wlan1', mode='g', channel=5 ) # mobile station

When I run the program with this, sta0 is able to ping nodes in the ad hoc network, but when I move it to the mesh, it cannot ping the nodes in the mesh network.

However, when I switch the two lines:

net.addLink( sta0, cls=mesh,  ssid='meshNet', intf='sta0-wlan1', mode='g', channel=5 ) # mobile station
net.addLink( sta0, cls=adhoc, ssid='adhocNet', intf='sta0-wlan0', mode='g', channel=5 ) # mobile station

Now sta0 operates successfully in the mesh network but not the ad hoc network.

Is there a better way to add multiple interfaces so that sta0 can ping both networks? I am attaching the code as a text file if you would like to see it.

Thank you!

hetnet.txt

Ramon Fontes

unread,
Aug 4, 2023, 11:48:41 AM8/4/23
to Lorenz Carvajal, mininet-wifi-discuss
Okay. Let's start with the most simple question: what is the ip address of the 2nd network card?

Lorenz Carvajal

unread,
Aug 4, 2023, 1:17:24 PM8/4/23
to mininet-wifi-discuss
I only set the IP address when using the addStation function when I added sta0. However, I did not set the IP address of sta0 for each network interface.

I will try that, and let you know if it works.

Thank you!

Lorenz Carvajal

unread,
Aug 4, 2023, 7:57:08 PM8/4/23
to mininet-wifi-discuss
Hello,

The IP address of each interface in sta0 seems to always match the IP address of sta0. So the IP address for both of them is 10.0.0.8, even after passing in different IPs as parameters in addLink and in the CLI. If I don't specify an IP address in addStation, it is assigned a default one and the interfaces still share the IP address.

Is there a better way to assign IP addresses to interfaces?

Thank you.

Ramon Fontes

unread,
Aug 4, 2023, 8:10:42 PM8/4/23
to Lorenz Carvajal, mininet-wifi-discuss

Lorenz Carvajal

unread,
Aug 4, 2023, 8:34:41 PM8/4/23
to mininet-wifi-discuss
Thank you, that example helped!

I added these lines of code:
sta0.setIP('10.0.0.9', intf="sta0-wlan0")
sta0.setIP('10.0.0.10', intf="sta0-mp1")

And now each interface of sta0 has its own IP address. 

However, it is still unable to connect to the stations in the mesh.

I really appreciate your time and answers to this discussion. Thank you!

Ramon Fontes

unread,
Aug 4, 2023, 8:39:34 PM8/4/23
to Lorenz Carvajal, mininet-wifi-discuss
Please double check the setup and provide more details.

Lorenz Carvajal

unread,
Aug 5, 2023, 1:16:35 AM8/5/23
to mininet-wifi-discuss
I can only get sta0 to work with either the ad hoc stations or the mesh stations, but I can't have both interfaces working in one script. I am testing it by changing its position from one network to another, and then pinging its in-range stations. When I use sta0 iwconfig, I see that the SSID and mode for wlan0 is correct, but wlan1 is in Managed Mode and mp1 is in Auto Mode. Sometimes when I change around the IP addresses of each sta0 interface I can sometimes get a different interface to work.

I believe the issue is with the IP addressing scheme or with sta0-mp1. I am attaching my code, with only ad hoc and mesh networks. I believe it will provide a more complete and helpful understanding of the issue.
simple_hetnet.py

Ramon Fontes

unread,
Aug 5, 2023, 5:56:38 AM8/5/23
to Lorenz Carvajal, mininet-wifi-discuss
You have set the same subnet for both interfaces :(

Please make sure you have a working setup or double check that at least before opening new threads.

Sent from my mobile

--
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 on the web visit https://groups.google.com/d/msgid/mininet-wifi-discuss/1fbac2f9-c587-4ba9-876c-547dbf17d188n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages