开发者

Other than UDP Broadcast or Multicast, what other methods can I use on a WiFI network to discover computers?

I've implemented a simple UDP ping/pong protocol to discover other computers connected to the same WiFI router. This works fine on many WiFI开发者_如何学Go and Ethernet routers, but when I go out on the street to give it a try, many public WiFI networks seem to have either UDP Broadcasts/Multicast disabled, or UDP disabled completely.

What other options do I have to discover the computers connected to the WiFI router? (I'd love to create an Ad-Hoc network between the members of my network but this is not possible)

I was thinking of brute forcing TCP attempts (trying to open connections to all possible IPs on my subnetwork) but this would be very costly and I would have to cycle several times and still not find every machine that's recently connected to the network.


There is no easy way to discover only "computers". You can however find almost all network devices using ARP requests.

The steps would be:

  1. Connect to the network
  2. Get the network IP address range (for example: "192.168.0.0/24")
  3. Send an ARP request for every possible address in this range ("192.168.0.1" => "192.168.0.254")
  4. Wait for the replies

Usually, network devices respond to ARP requests because ARP is needed for IPv4 to work.

You may find additional resources here.

Note: you'll problably need to have Administrator privileges (root on UNIX) in order to do that. Sending forged ARP requests usually requires elevated privileges.

Another way could be to send broadcast pings (ping -b 192.168.0.255 on UNIX OSes). But Windows computers (and some other devices) usually don't respond to such pings.


you could try bonjour, perhaps.

also, on many access points, it is possible to disable client to client communication. it's possible this is what you are running into during your testing.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜