tags:

views:

319

answers:

3

We have Win CE IPv6/IPv4 devices installed in a room and connected to a network. Every now and then a person would come with a laptop, plug it into the network and run a diagnostics program.
This program should be able to somehow auto find or discover all those devices. The catch is that device IPs are unknown to the diag program.

I've been looking into the IPv6 link-local discovery but i'm not quite sure how to test this.

In our local LAN if i ping a known IPv6 address of another computer it pings ok, but if i do ping -6 fe80::1 I get "Destination host unreachable" and for ping -6 FF02::1 I get "Request timed out"

so i'm not sure how to even test link-local discover on windows.

So how can this be done?

+1  A: 

If the devices support zeroconf, then you should be able to use "net view" to get a list of local servers. You can then use the Windows dns implementation to resolve an IP address from the host name. The Ping.exe command would be a shortcut if you wanted to do all of this from a script, since it will take a hostname and display the IP address it is pinging.

There's probably a more elegant way using the zeroconf protocol directly, but the above should work fine too.

David Gladfelter
the devices aren't guaranted to have names. would that present a problem?
Mladen Prajdic
Yeah, this assumes unique names.
David Gladfelter
so i guess this is out of the question then... bummer.
Mladen Prajdic
+1  A: 

Try to use nmap to scan entire network and get the current connected devices with assigned ip address, for free you can get os and version detection.

Here you can get the windows binaries: http://nmap.org/download.html

Regards.

mdaguete
would this work even if the devices have different IP range than the network the laptop is plugged into? for example the LAN is 172.16.x.x but the devices IPs are 192.4.x.x?
Mladen Prajdic
Good luck with scanning all the IPs in an ipv6 /64 network...
John Burton
yeah that one bothers me too :) do you have a better idea JB?
Mladen Prajdic
Answer to question "different lans" .. if the networks are correctly routed it works.
mdaguete
A: 

For IPv4 use broadcast on 169.254.254.255 for non-configured devices, or you can DHCP request and broadcast to the discovered subnet, or I"m sure some applications just broadcast out to 255.255.255.255.

The IPv6 use multicast on the link-local scope for every adapter, there is no broadcast in IPv6 so you cannot use ICMP ping.

This would mean for IP version agnostic application you need to implement an application layer discovery service or use an existing technology such as ZeroConf.

Steve-o