broadcastlan

How to detect all devices in a LAN?


I want to detect all devices in a LAN which have IP: 10.x.x.x Mask: 255.0.0.0. I first wrote a synchronous ping program to ping IPs one by one, but it's tooooo slow. Therefore I improved it by using asynchronous ping, then it's much faster. Now I can use it to detect 10.x.0~255.0~255 in an acceptable time. But it still use tooooooooooooo long time to detect all the IPs 10.0~255.0~255.0~255.

Is there any method/protocol that can just broadcast one message and let all devices in a LAN to respond, so I can detect all the devices? (either Ethernet broadcast or UDP/IP broadcast or any other broadcast.) (I've researched ARP & ICMP but haven't find suitable methods.)

Or any other method even don't need broadcast? I just need to detect all the devices, any method is OK.


Solution

  • I recommend "Angry IP Scanner" http://angryip.org/

    It is fast, detects all devices in a given ip/netmask.

    Angry IP scanner is a very fast IP address and port scanner.

    From site:

    It can scan IP addresses in any range as well as any their ports. It is cross-platform and lightweight. Not requiring any installations, it can be freely copied and used anywhere.

    Angry IP scanner simply pings each IP address to check if it’s alive, then optionally it is resolving its hostname, determines the MAC address, scans ports, etc. The amount of gathered data about each host can be extended with plugins.

    It also has additional features, like NetBIOS information (computer name, workgroup name, and currently logged in Windows user), favorite IP address ranges, web server detection, customizable openers, etc.