I’m trying to confirm a user a unplugged my embedded device from a network before performing some maintenance. I’m considering ‘ping’ing all IP address on my sub-net, but that sounds crude. Is there a broadcast/ARP method that might work better?
Share
If you can’t get reliable link state information from your Ethernet device (which most chipsets should support these days, BTW…), sending an ARP request for each IP on your local subnet is a decent substitute. The overhead is minimal, and as soon as you get a single response, you can be sure you’re still connected to a network.
The only possible problem I see here, is that if your device is on a /8 subnet, it can take quite a while to loop through all 4294967296 possible IPs. So, you may want to consider some optimization, such as only sending ARP requests for your default gateway, as well as all IPs currently in your ARP table.