We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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
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.
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...