Chris Gray's blog

I'm a Development Lead on Windows Home Server

Discovering a nameless device -- kind of an interesting problem

One common problems we've encountered while making home gateways (wireless access points) is how do you discover the silly thing?  Most solutions end up shipping a preconfigured IP address or hostname on the device, some people query the DHCP server and I've even heard of people using netmon!  :P

Each of these solutions has its own pro's and con's -- with a gateway its okay to have a user manual where 192.168.1.1 is the preconfigured IP address.  The user just plugs in and uses their browser to navigate to http://192.168.1.1 for configuration.  Other solutions will give a preconfigured hostname so the end user will configure by going to http://hostname.    I think querying the DHCP server is totally acceptable, but my mom didnt send me to college to get that kind of answer ;)

Other solutions are to have a value burnt into the ROM/flash -- this either requires each device to be configured before it leaves the factory or for the device name to be built off something like a MAC address.  Nothing bad here, but it makes for slightly confusing documentation.  “go to http://device_XYZ.. XYZ can be found on a sticker on the back of the device”  its not bad, but its clunky and requires printing a little sticker.

My solution to this problem was to make a little discovery utility that uses UPNP's SSDP (service descovery protocol).  the idea here is when the device boots up it sends out a little UDP packet that announces its presence to the world.  Because both WindowsCE and WindowsXP come with UPNP implementations this wasnt that tricky to setup.  I've included a little sample in WindowsCE 5.0 in the directory %_WINCEROOT%\public\servers\oak\samples\upnp\discoverservice. This utility isnt exactally rocket science, in fact its kind of a joke.  All it does is broadcast a little GUID that corresponds to the service that it supports with a URL for a configration webpage (known as a presentation page).   You can find a little C# util that I wrote to listen for this here http://chrisgray.members.winisp.net/files/discoverapp.zip  -- please note that “My Network Places” will also listen for it if you've got UPNP installed on XP.

The idea of this util is that it would be included in a CD or something that would have an autorun.inf to launch it.  The user would plug in their totally nameless device, it would DHCP, and then it would begin broadcasting UPNP messages announcing its presence.  The XP utility would then pick up the announcment and give the option to configure the device.


Published Thursday, July 29, 2004 10:55 PM by chrisgray

Comments

 

Larry Osterman said:

So which registered UPnP document type did you use for this device? You know you're not allowed to ship a non-registered schema, right?

July 30, 2004 8:27 AM
 

Chris Gray said:

Because all I needed was a presentation page all that was required was the UPNP "Basic" schema. The program looks for a "serviceType" and then uses the "presentationURL" field to get to the webpage configuration page.
July 30, 2004 10:18 AM
 

Chris Gray said:

you can find the "Basic Device" schema here if you're interested http://www.upnp.org/standardizeddcps/basic.asp
July 30, 2004 10:27 AM
 

Niclas Lindgren said:

What about those that aren't running Windows or .Net compliant OSes? They still use the old fashion way of querying the DHCP or using netmon?
July 30, 2004 11:37 AM
 

Chris Gray said:

unfortuantly I guess they do :( I'm not 100% but I think Windows98 and above have UPNP?

other solutions I've heard people use are really really simple and should work on every OS that supports UDP -- the basic idea is to send a broadcast packet on a known port that contains your IP address. When the client picks that packet up it can connect back. At its core this is what UPNP is doing, there is just more XML goodness packed in there.

If your running other OS's (Linux, Mac, etc) I'm sure there are UPNP implementations that should be used to listen for the device. most UPNP implementations should be able to handle the Basic Device schema, so that could be a solution for you?
July 30, 2004 11:43 AM
 

elijah wright said:

On non-windows platforms, folks are pretty prone to the use of Rendezvous (aka Zeroconf, Howl, etc) instead of uPNP. Rendezvous and its kindred protocols have basically the same functionality that you're using here.

[If I remember correctly there may be a royalty fee involved in significant use (enough to distribute a library) of uPNP - not so for rendezvous/OpenTalk/etc.]
August 2, 2004 3:49 PM
 

Thomas Lee said:

An interesting problem, and one solved before in a variety of ways. I've just taken delivery of 2 wireless access hubs and a pair of bridges. ALL of them have MAC address stickers on them.

One WAP(CICSO) has a utilty where you type in the MAC, and you can then configure the IP address, and from there get to the configuration web server (as in the vid).

The Buffalo bridges and the other bridge have a utility (akin to what you are suggesting here). I've not sniffed to see how it's working (but I will if anyone really is interested).

UPNP works, and it would certainly be in the spirit of universal plug and play.

My .02€ worth
August 3, 2004 5:00 PM
Anonymous comments are disabled

© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker