I want to ping all possible IPs in my LAN, and I have the code for it, but right now, I've already cut the weight time from 5s to 2s, and it's still about 8 minutes to test them all. How long should it take to ping an IP on my same LAN?


  • You may get more answers by posting a question like this to the unix.stackexchange.com – Jeff Welling Aug 8 '11 at 7:00
  • I can do this with nmap in a few seconds. You have to do it in parallel. Take a loop at nmap here: nmap.org – Fake Name Aug 8 '11 at 7:44

It should take less than a millisecond to ping a host on the same physical network. In reality, networks get busy and hosts get slow - it might take 5 milliseconds.

Like UDP, there is no guarantee that you'll receive a reply at all.

| improve this answer | |
  • What's UDP? And why is there no guarantee? – JShoe Aug 8 '11 at 1:26
  • How do I choose a -W time under 1? 0.01? It still seems slow to me. Is there a minimum you can't go under? – JShoe Aug 8 '11 at 1:29
  • 1
    Both ICMP (ping) and UDP are protocols with no built-in reliability. Your ping packet might collide with another packet on the way to the host. The host might lose it before it gets answered. There's no recovery mechanism built into these protocols (unlike TCP, where the protocol will retransmit until the packet is answered). You might want to look at 'fping' which lets you ping more than one host at a time. – zzz Aug 8 '11 at 1:33

You can also try broadcast pings, but those are usually not routed. E.g. if you're on network, you can try ping and all hosts on same network will respond.

| improve this answer | |

I would suggest using Nmap instead. It's designed for doing this kind of thing and can scan very large networks quite quickly.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .