we connect some embedded devices in a network. What i am looking for now, is a way to find the devices IP and identify them. We work with Windows PC´s and i am about to write a C# tool that should do this.

  1. I thought about send a udp broadcast and in the ack i.e. is the device´s ip, which would mean the device needs a daemon runnig to assign an ip itself.

  2. Running a service (like a printer) on the device, and on the PC just lookup for the service.
    I read about some things like apipa, zeroconf, ipv4 local link, bonjour, dns-sd, mdns, bonjour; They can automatically assign ip´s and publish services in a network.

My Question is, can someone recommend me what would be good for my task? -The protocol or Service should be low on ressource (memory/cpu usage) use.
-Are there some standard protocolls to use?
-Is DNS a good idea or would it be to ressource consumpting just for finding a device´s IP?
-Should also work when no dhcp servers are around.

edit: To clarify a bit: The IP configuration is automatic. The problem to focus is how to tell the PC which IP in the network (or a direct connection in this vase there would only be one) belongs to the device (identity).

  • What kind of devices are you talking about. How are they configured? Do you know their MAC addresses? What do you mean by "find and identifying" them? – Sven Sep 26 '12 at 10:49
  • hi, the devices are similar to a camera. They arenormally configured as DHCP Client but thi is not always the case. So when connected i first know nothing about the device (config, ip, mac) – Gobliins Sep 26 '12 at 11:10
  • if i search the network after IP adresses i can firstly not see if the ip belongs to a device or a pc – Gobliins Sep 26 '12 at 11:11
  • what do you mean? – Gobliins Sep 26 '12 at 11:17
  • Would you agree that your actual question is somehing like the following: We manufacture embedded devices that get connected to customers networks we know nothing about. They might or might not have DHCP enabled. What is the best way to detect and configure these devices, e.g. with a setup software we would ship with these devices? – Sven Sep 26 '12 at 11:38

My Question is, can someone recommend me what would be good for my task? -The protocol or Service should be low on ressource (memory/cpu usage) use. -Are there some standard protocolls to use?

The standard way to detect devices (and their attributes, such as management ip address) on an ethernet network is to use LLDP.

You can find a list of lldp daemons here

All hosts in an ethernet Vlan will see LLDP announcements, since they are sent to a multicast mac address; this also means LLDP announcements are scoped to a Vlan. If you need device registry and detection across Vlans, you'll need to build your own IP announcement protocol... UDP would be a good choice for the transport.

Is DNS a good idea or would it be to ressource consumpting just for finding a device´s IP?

If you are only looking for an IP address, and do not care whether you can tell whether the device is one of your embedded systems, you could use mDNS; however, this is more risky since you have no guarantee against namespace collisions in a customer LAN.

How should the OP's embedded systems get an IPv4 address, if the customer does not have a DHCP server?

RFC 3330 allocates for communication on a single link if a DHCP server is not available. Upon reflection, this is probably the safest block of addresses to use; however, your company should encourage your customers to allocate addresses themselves with DHCP instead of some form of auto-configuration in the subnet.

How you assign individual IP addresses within is a question that we can't decide for you... a couple of possibilities are:

  • Assign the specific addresses within by hashing your mac-address values such that it is unlikely to get collisions for the expected maximum number of your systems on any customer's vlan
  • Listen for some multiple of your systems' LLDP hello interval and allocate an address from that has not already been used
  • Hi the routine would be 1. step: get all Ip´s in network 2. step check which ip is device; The lldp does autoassign ip´s or has this to be done before? – Gobliins Sep 26 '12 at 11:06
  • LLDP doesn't assign IP addresses; it is quite useful for discovering the IP address assigned to your embedded systems though. Furthermore, you should not build an embedded system that auto-assigns IP addresses to itself... this will annoy customers. Assume almost everyone is using DHCP, because they pretty-much are... just get your device addresses from DHCP – Mike Pennington Sep 26 '12 at 11:08
  • @MikePennington: As far as I understand it, the OP doesn't really control the devices and what is installed on it, so he couldn't install an LLDP daemon. – Sven Sep 26 '12 at 11:16
  • I think the wording is an artifact of his english, it looks like he is a non-native speaker. I read this as his company builds embedded systems... it doesn't make sense to come here asking how you assign IP addresses to an embedded system when you could just call up the vendor and ask them how they designed their systems – Mike Pennington Sep 26 '12 at 11:20
  • Still the problem exists if no dhcp server is around this is the issue. Why is it not a good idea to auto assign the ip on the device itself? (The only other way would be, configuring the pc as a dchp server but i don´t know if this is possible or an option) – Gobliins Sep 26 '12 at 11:20

The nmap utility is very good at determining which IP addresses on a network (of your choice!) are occupied. If the host will reply to any request for verifying its presence, then nmap will show it.

Otherwise, you can fiddle with ARP. There are several utilities for all the major OSes that will do this (on Win32 look for Cain, on Linux there are many). These utilities will send out an ARP broadcast/"ping" to every address asking if there is a device connected and if so, what it's IP is.

  • i heard about nmap, but i think i would do part of its functionality on my own. – Gobliins Sep 26 '12 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.