EmbeddedRelated.com
Forums

IP addresses for embedded device with ethernet

Started by David Brown October 26, 2005
If I build an embedded system with an ethernet port and a little 
embedded web server, what is the best way of identifying its IP address? 
  It is easy enough to get an address on most networks with DHCP, but 
how does the user know so that they can type in the address in their 
browser?  Any ideas would be appreciated.

TIA.,

David
"David Brown" <david@westcontrol.removethisbit.com> a &#4294967295;crit dans le message 
de news: 435f66da@news.wineasy.se...
> If I build an embedded system with an ethernet port and a little embedded > web server, what is the best way of identifying its IP address? It is easy > enough to get an address on most networks with DHCP, but how does the user > know so that they can type in the address in their browser? Any ideas > would be appreciated. >
Usually these kind of devices (for example network printers, etc) are supplied with a "discovery" software, that use broadcasts to find the avaiblade devices : Your system will answer to the broadcast and give its IP adress. Cheers, Robert
Robert Lacoste wrote:
> "David Brown" <david@westcontrol.removethisbit.com> a &#4294967295;crit dans le message > de news: 435f66da@news.wineasy.se... > >>If I build an embedded system with an ethernet port and a little embedded >>web server, what is the best way of identifying its IP address? It is easy >>enough to get an address on most networks with DHCP, but how does the user >>know so that they can type in the address in their browser? Any ideas >>would be appreciated. >> > > > Usually these kind of devices (for example network printers, etc) are > supplied with a "discovery" software, that use broadcasts to find the > avaiblade devices : Your system will answer to the broadcast and give its IP > adress. > > Cheers, > Robert > >
Yes, that's one way I'd already thought of, and I suspect it will be the best method. As far as I can see, UPnP works in this way (though it has a great deal of overhead that I would not need, including the overhead of a bad reputation). Writing such software would not be a great problem, but is there any way to achieve this effect using a normal browser? mvh., David
> Yes, that's one way I'd already thought of, and I suspect it will be the > best method. As far as I can see, UPnP works in this way (though it has
The UPnP boondoggle is a lot more than that, and sane persons run with it disabled in any case due to security issues. There are other technologies such as Apple's Rendezvous, but really all it boils down to is some "standardized" discovery mechanism (plus a load of overhead in the form of required metadata).
> problem, but is there any way to achieve this effect using a normal browser?
If you can assume: a) your device HAS a valid IP address, b) there is a working Internet connection reachable by your device, you can use one of a number of various dynamic DNS services to locate it. The unit would need a unique ID printed on the label, possibly derived from the MAC. It would publish its IP address to a DDNS service - not necessarily anything standards-compliant, it could be something you run on your own web server. The user would read the ID off the label, go to your web site, and use the ID to look up his IP address.
You will have to build your own discovery application for the host
computer.  To do this you'll use a UDP broadcast packet on a dynamic
port.   The application will know the first half of the MAC address
which hopefully is under your control (You bought the MACS from IEEE)
or perhaps you just use the explicit MAC address as an input to the
discovery program.  Put some data in the packet payload such as
"DavesZippyIPUnitDiscovery".  If the unit sees the broadcast with its
MAC or OUI portion of the MAC, and identifies the packet data, it can
send a response packet with it's IP address...

JMHO,
-D

> You will have to build your own discovery application for the host > computer. To do this you'll use a UDP broadcast packet on a dynamic
Perhaps you missed the part where the OP said he'd studied this and wanted to know of solutions that would work WITHOUT custom software on the end-user's network.
David Brown wrote:
> If I build an embedded system with an ethernet port and a little > embedded web server, what is the best way of identifying its IP address? > It is easy enough to get an address on most networks with DHCP, but > how does the user know so that they can type in the address in their > browser? Any ideas would be appreciated.
You could have a default IP address. My home DSL router comes configured like that, as do some other networking boxes I'm aware of. The user can plug a PC/laptop directly into the device, set their own IP to the same subnet and browse in. They can then enable DHCP or set a fixed IP address on the device and plug it in to their local network. If you use DHCP you should make sure you can bind it to a local DNS name. If your DNS and DHCP servers don't talk to each other (mine don't) then you can tell DHCP to give out a fixed IP address for that device and then configure that into your DNS server (or use the address directly if you don't have access to a local DNS server). We had a network printer here that simply used DHCP and discovery software on the PC. All was fine until the power went out and the device came back with a different IP address (the discovery software didn't rerun automatically). Paul.
"Perhaps you missed the part..."

I missed it because it wasn't stated ...

-D

packer44@hotmail.com wrote:
> "Perhaps you missed the part..." > > I missed it because it wasn't stated ...
Read the message I was replying to.
On 2005-10-26, David Brown <david@westcontrol.removethisbit.com> wrote:

> If I build an embedded system with an ethernet port and a > little embedded web server, what is the best way of > identifying its IP address?
Ship it with a known, default IP address.
> It is easy enough to get an address on most networks with > DHCP, but how does the user know so that they can type in the > address in their browser?
They configure the DHCP server so that it gives a known IP address to the device in question. -- Grant Edwards grante Yow! I smell like a wet at reducing clinic on Columbus visi.com Day!