The nature of m_linkUp in wifi-net-device.{cc,h}

48 views
Skip to first unread message

Hugo Ledirach

unread,
Oct 4, 2024, 8:44:46 AM10/4/24
to ns-3-users
Hello,

I'm working on a custom module that aims to test the connection status between a given node and its neighbor but without using callbacks. The idea is not to use omniscient tools but to limit the usable information to what is embedded on the node and to separate the custom module from the network devices.

Currently, I'm using the WifiNetDevice::IsLinkUp() method, but I'm having trouble evaluating what information I'm getting. If the link is "Up", does that mean the connection is available, i.e. the device is switched on and configured correctly, or does it mean there's an information flow, or something else?

In the source code, the m_linkUp variable is set to True when the physical layer is set, but I was wondering if I'd missed something.

If there's a better way, I'm open to suggestions, any help is appreciated, thanks in advance for helping me better understand the inner workings of our beloved NS3.

BR

Tommaso Pecorella

unread,
Oct 4, 2024, 4:17:28 PM10/4/24
to ns-3-users
Actually you're right, this part of code is debatable.
From what I can read from the code, a WiFi link appears to be "up" as soon as the NetDevice is ready to be used - even if it's not connected to another device, which makes sense for an AP or an Ad-Hoc device, but makes less sense on a STA.

The problem is that, even if you have a NetDevice reporting that the link is "connected", you shouldn't really trust this because it depends on the beacons receptions, and these might be missing. This is kinda a common problem of wireless links: the link might appear to be "up", and then have a loss rate close to 100%.

The usual way to cope with this is to accept the "up" and "down" from the NetDevice as hints, but to trust only L3/L4 packet exchanges. That's why most (I'd say all) standard protocols rely on explicit neighbor probing - which also solves the issue of channel unbalances, where a device sees the other, but not the opposite.



Tom Henderson

unread,
Oct 4, 2024, 4:42:33 PM10/4/24
to ns-3-...@googlegroups.com, Hugo Ledirach
On 10/4/24 05:44, Hugo Ledirach wrote:
> Hello,
>
> I'm working on a custom module that aims to test the connection status
> between a given node and its neighbor but without using callbacks. The
> idea is not to use omniscient tools but to limit the usable information
> to what is embedded on the node and to separate the custom module from
> the network devices.
>
> Currently, I'm using the WifiNetDevice::IsLinkUp() method, but I'm
> having trouble evaluating what information I'm getting. If the link is
> "Up", does that mean the connection is available, i.e. the device is
> switched on and configured correctly, or does it mean there's an
> information flow, or something else?

If this is not a newer MLO model (for which I don't know the details),
the linkUp flag is set to true at time zero for APs and upon successful
reception of association response message for STAs.

For STAs, link down occurs if association is later lost.

>
> In the source code, the m_linkUp variable is set to True when the
> physical layer is set, but I was wondering if I'd missed something.
>
> If there's a better way, I'm open to suggestions, any help is
> appreciated, thanks in advance for helping me better understand the
> inner workings of our beloved NS3.
>
> BR
>
> --
> Posting to this group should follow these guidelines
> https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
> <https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting>
> ---
> You received this message because you are subscribed to the Google
> Groups "ns-3-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ns-3-users+...@googlegroups.com
> <mailto:ns-3-users+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ns-3-users/3dc721e7-c341-4a25-ae19-cdc2b36b1127n%40googlegroups.com <https://groups.google.com/d/msgid/ns-3-users/3dc721e7-c341-4a25-ae19-cdc2b36b1127n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Message has been deleted
Message has been deleted

Hugo Ledirach

unread,
Oct 8, 2024, 4:30:54 PM10/8/24
to ns-3-users
Hi,

Thank you both for those very useful insights,

Have a great day,

Hugo

Hugo Ledirach

unread,
Oct 8, 2024, 4:30:54 PM10/8/24
to ns-3-users
Hello,

Thank you fro those useful insights

Have a great day

Le vendredi 4 octobre 2024 à 22:42:33 UTC+2, Tom Henderson a écrit :
Reply all
Reply to author
Forward
0 new messages