How can I send a multicast ping in .NET ? So that all computers on the network respond ?
Asked
Active
Viewed 1,071 times
3

bdonlan
- 224,562
- 31
- 268
- 324

Stefan Steiger
- 78,642
- 66
- 377
- 442
-
1Do you want a _multicast_ or _broadcast_ ping? The difference is, for a machine to receive a multicast ping, it must register itself as part of a multicast group. Broadcast pings go to all machines in the subnet or network segment (depending on how they're addressed) – bdonlan Aug 24 '10 at 20:08
1 Answers
4
Assuming you mean "broadcast ping" (I get the two confused All The Time, myself):
Fetch the local network gateway IP, change the last byte to 255, ping that IP.
The main problem with your approach though is that the set of all devices on the network that will respond to a broadcast ping is typically much smaller than the set of all devices on the network. I've found that while most devices will respond to a direct ping, very few will respond to a broadcast ping. It's implementation dependant.

Task
- 3,668
- 1
- 21
- 32
-
Yes, I believe that a modern Windows operating system will detect but never respond to a broadcast ping. I believe that Microsoft decided it was a security risk. You're going to have to ping each machine individually if you want a reliable implementation. – Task Aug 25 '10 at 13:33