This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Finding IP addresses

Hi all,

Im quite new to TCP/IP and have a question about finding other devices IP address.

For my application I will have a PC connected via ethernet to several devices running TCP/IP on arm Cortex M3 through a switch.

These devices will have to talk to eachother as well as the PC. I will probably use DCHP to assign IP addresses.

My question is, how is each device supposed to know other IP addresses in the system? I can think of a few ways but I wondered if there was a standard approach?

Thanx

  • Probably the easiest way is not to have any direct communication at all between the devices - thus obviating the need of finding and managing the other addresses!

    :-)

    Have a cetral "server" to manage all that stuff - then all the devices need to know is the server's address...

  • You have several options.

    Configure the DHCP server to always supply a fixed IP address depending on the MAC address of the different units. Then you can configure unit A to know what IP unit B will get when unit B is up and running.

    Use a name server and let your units perform a lookup to translate from name to IP. If the units gets dynamic IP addresses, then they can report in to a dynamic DNS server. You may use the serial number as hostname when registering them.

    Write your own magic server application where each unit reports in their connect information and requests back connect information for other units.

    Don't use DHCP at all, and instead configure fixed IP numbers in the units.

  • or

    use NBNS protocol. Each unit must have a unique host name then. Unit A, when needs to communicate with unit B, broadcasts NBNS request. The unit with the requested Host name responds with it's IP address and voila ...

  • Thanx for all your replies!!

    I was thinking it might be better to send out a UDP broadcast, I think on IP 255.255.255.255 as this has to be done anyway for some broadcasted messages.

    Do you think this would work ok?

  • A broadcast to address 255.255.255.255 on UDP is a workable solution.

    So long as all units are on the same logical subnet.

    We use a similar technique for finding all our devices on a subnet from a host PC application.

  • Do you think this would work ok?

    So the idea is for each device to announce its address using a broadcast? Sounds good. But you have to remember that packets can be lost. Without some kind of acknowledgement you cannot be sure that the packet reached its destination. Unless, of course, you have a controlled environment where you can guarantee that packets will never be lost.

  • If packets are lost, thats not actually a problem because it will be broadcasting this message quite frequently to check if any new devices have been connected.

    Thanks:)

  • limits the maximum number of devices on a network segment before it gets "flooded" with all these broadcasts.

    particularly if the network is shared with other stuff...