IP addresses for embedded device with ethernet

Oct 26, 2005 25 Replies

David,

Someone else alluded to NetBEUI / NetBIOS. This is on the right track for a good solution in a Windows environment.

If one can assume that a) The environment supports Windows systems, and b) that DHCP is supported, you're a good distance there. While not always true, this will meet "98%" of your target environments.

1) Boot, get a DHCP, learn the WINS server address. 2) Register with WINS using a pre-defined name 2b) If WINS isn't supported, then use the Windows local subnet name resolution mechanism (local subnet broadcasts, I believe) 3) First device on the network wins the name. Additional devices register themselves with the winner. 4) Users address the pre-defined WINS/NetBEUI name in their ubiquitous Windows-based browser, the name resolves, and the user connects. 4b) User is presented with a list of devices currently online. Hyperlinks point the the current DHCP IP of the device. 5) Configure statically from there.

Or - label each widget with a unique random device name less than 16 characters long. That's the WINS name. (Hint: the MAC address is less than 16 characters.)

Between ZeroConf and local-subnet Windows name resolution, you should be able to handle just about any environment. Only the pure non-Windows shops would be an issue, and I'll bet there aren't many.

Richard

Hi Richard,

Do you have any good references to WINS or Windows local subnet name resolution mechanism ?

Regards Robert

In a Windows network without a router (they still exist), DHCP may not be available. Nearly all of these can be handled using a protocol named APIPA, which used to be documented at least on the MSDN site. It's been a while, but AFAIR it doesn't help with naing problems.

Stephen

Stephen Pelc, stephenXXX@mpeforth.com MicroProcessor Engineering Ltd - More Real, Less Time 133 Hill Lane, Southampton SO15 5AF, England tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691 web: http://www.mpeforth.com - free VFX Forth downloads

APIPA constrains the choice of IP addresses available to your device *and* the other devices on your subnet. I.e. *this* device "wags the dog".

--don

I think the solution depends on your target network. If your embedded server device will only work on one flavor, say winxp or Linux you can use their default capabilities.

When I did the Kitty USB analyzer I wanted universal access. Anything with a browser should be able to access it. This eliminates special dhcp hooks or network clients that try to find a server. Servers are special and need to be found by many different clients/browsers on many different operating systems.

The only universal way with an ip server is to have a fixed IP address. All other "finding" techniques will fail if the actual network or clients differs from yours. So I copied what Linksys routers and HP printers do as servers on an arbitrary network.

1) All of the devices start at a known default IP address. (There needs to be some "reset" button for the user to press to reset that device to the default IP address, so when the user forgets what he set it to he can find your server!) 2) The user needs to be able (via a web interface!) to change its IP address, IP netmask and IP gateway router address. It needs to permanently save the settings in flash or eeprom so power fails do not lose its IP address.

This does mean that a network administrator (AKA home user) has to change the IP address from the default to work on his network. But it means multiple devices can be on the same network and coexist happily. It is a shame that there is no universal server finding technique, but the original arpanet had everyone with a fixed IP and passed around a hosts.allow file with everyone on the arpanet named. This technique worked for awhile, but is not scalable and of course windows is not compatible with it! There is no "x" in my email address.

Steve Calfee wrote: ...

...

I am not recommending it's use but Windows does still support a host file.

In Win2K it is in C:\WINNT\system32\drivers\etc\hosts

kevin

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required