views:

55

answers:

1

I have the case where I have a public facing service sitting out on the internet and I would like the ability for the server to contact specifically design embedded devices that are sitting in normal home networks when required.

I know that the devices can poll the server to get updates etc but 1) There will be a lag between when server does something, and device polls for update and 2) There will be a lot of useless traffic (over time) generated.

Does anyone have any suggestions on how to do this? My initial though is to have the embedded devices use UPNP to try and generate a port forward rule in the home router, and then register that port to the server. The server can then generate a HTTP request to that address (http so that it will get routed etc without being blocked by firewalls etc along the way). If the device cant create the forward rule then it will resourt back to the polling method.

Does this sound about right? Anyone have any experience they could share with this sort of thing? (Client will be c++ on embedded linux, server .NET).

A: 

A lot depends on how many devices / networks you think this going to be used with and what control you have over their software/configuration.

Since you're talking about UPNP, it implies that there will be lots of client networks - unless you have control over the router config / hardware, you're going to have lots of problems getting the UPNP solution to work reliably.

Also, you mention portforwarding which rather suggests that the embedded devices will not have real IP addresses.

You say that you want to use HTTP to avoid it being blocked however the majority of firewalls/routers etc aren't that smart - blocking is done purely on port numbers. If you've got multiple devices behind a NAT router, then you'll have to use non-standard ports to address the devices unless you implement a controller to relay requests based on the HTTP content.

The only practical solution I can see is having the embedded devices connect to the server and wait for an event to occur.

C.

symcbean
Cheers. I'll scrap the UPNP for this then - still implement the functionality on device it but leave it as an 'advanced option' for users\admins to configure the port forwarding on router etc manually.
RM