0

i don't know if it's the right community to ask (i think so, by the way) so excuse me in advance if this is off topic. I was thinking about a project in android that involves knowing how many devices are in the surroundings. Is there a way to "discover" it? My idea is something like this:

  1. my device sends some sort of broadcast ping via ARP (or some Data Link protocol)
  2. Every device answers to that ping
  3. My device counts how many response pings are and this is how many surrounding devices are.

I'm saying ARP or some Data Link Protocol because it should be "beyond wifi connection", knowing not "how many devices are connected to my network" but "how many devices surround me"

Thank you in advance!

magicleon94
  • 4,887
  • 2
  • 24
  • 53
  • 1
    Networking questions need to involve programming. If you don't have any code, it's off topic. – Laurel May 22 '16 at 19:15
  • data link protocolls will not go "beyond wifi connection", because beyond this is a different link. i don't think this is generally possible with wifi. I would try to figure out if bluetooth can be used for something like this. This requires having bluetooth on, but tbf, you should not allow to discover devices that don't want to be discovered. – Effie Oct 12 '21 at 17:48

1 Answers1

0

IPv4 ARP requests are broadcasts, but they contain the specific IPv4 address of the host for which you are requesting the layer-2 address. All hosts on the layer-2 domain will receive the ARP request, but only the host with the specific IP address will respond to the ARP request.

There are many ways in which LAN discovery tools work, but none of the methods are foolproof because the network protocols were not built with LAN discovery in mind. Also, there are ways in which to configure some LAN devices so that it is difficult to impossible for the hosts to be discovered, e.g. private VLANs, where hosts on the private VLAN cannot communicate with any other host on the same VLAN, except for the gateway.

Ron Maupin
  • 6,180
  • 4
  • 29
  • 36
  • I didn't undestand if you're saying that it can't be done or can be – magicleon94 May 08 '16 at 19:30
  • It can't be done with ARP. There is no foolproof way to do this. nmap can use a variety of methods to try to achieve this, but, in the end, it can miss things, too, or be completely stymied by things like private VLANs. – Ron Maupin May 08 '16 at 19:33