Skip to main content
GameDev.net gamedev.net
🔒 Locked

Discovering network hosts?

Started by Toolmaker Dec 27, 2006 at 8:53 AM 1 replies 900+ views
Original Post
Toolmaker
Toolmaker
I'm looking for a way to detect network hosts in a network. I've considered trying to ping each network host by taking a starting and ending network adress, traverse each address and ping it. However, this would leave out any HUBs/Switches/non-IP based network hosts. I only want to know what type of host I'm dealing with(I can probably find switches by hop counting), and for some specific hosts I want to be able to connect to them(For instance, use SNMP for routers, RPC/WMI for Windows machines and a sort of remote shell for Unix/Linux based machines). Any ideas on this? Toolmaker
 
Muse
Muse
How about pinging the broadcast address and then, for each ping response you receive, iterate through your set of connection methods until one works?

As you say, that will leave out hubs and switches, but you can't connect to those anyway (unless it's a very fancy switch maybe...but in any case you definitely can't connect to a hub, it's a wire-level device, that'd just be silly :-) ). As for non-IP enabled hosts, they can't really be part of your local network if they're not IP-enabled, can they?
-david
hplus0603
hplus0603
This question should go into the Multiplayer and Networking forum.

The Forum FAQ has some information about this, when it comes to finding other instances of your game (but not network topology). You could also try sniffing for ARP requests to build a list of all network interfaces that are active.
enum Bool { True, False, FileNotFound };

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.