Implementing DynDNS when acting as a server


#1

Hi all,

I am using the Q2686G acting as a server. (Programming in WIP using OpenAT). Assume that I am using a SIM card which has a public, dynamic IP address. If I receive a dynamic IP address given to me by the APN when connected and wish to connect to e.g. dyndns in order to update the IP address, how do I do this if I am a server? Do I have to do something like this:

  1. Get my IP address from the APN
  2. Change to being a client in order to connect to the dyndns server
  3. Update dyndns
  4. Change back to being a server

If I do the above, surely when changing back to being a server again I would be allocated a different IP address from the one that I just used to update dyndns? I would be most grateful for any clarification on how to go about performing the operation correctly.

Thanks.


#2

From posts that I have read, people seem to have used dyndns. Is there anyone out there who could explain the methodology?


#3

DynDNS publish the protocol - you just follow the instructions!

Your question is different: how to have both a DynDNS Client and your own Server on the same module.

AIUI, WIP should be able to support multiple connections over a single bearer, so there shouldn’t really be a problem - just like a PC can be running a DynDNS Client and also have some unrelated Server running simultaneously…

+--------+  +--------+
| DynDNS |  |  Your  |
| Client |  | Server |
+--------+--+--------+
|     IP Bearer      |
+--------------------+

That’s the beauty of IP - it is easily shared!


#4

It’s probably a mistake to think of it that way.

The Q26 is just a platform; on it, you can have a “processes” that act as Servers, and “processes” that act as Clients.

The Client (talker) or Server (listener) roles are specific to the Socket - not the bearer, or the module.


#5

Thanks, awneil. I now understand!


#6

Hiya,

I’ve done exactly this - I recall that it worked out to be around 100 lines of code.

DynDNS have an excellent tutorial on their website - in the end it’s just a HTTP request. They (DynDNS) will even give you a developer account for testing your client so it doesn’t get banned by their servers.

ciao, Dave


#7

Hi Davidc,

I believe it is true that in order to get the public IP address assigned to you from an APN (assuming you have a public, dynamic IP account), you have to use e.g. checkip.dyndns.com. If you use wip_bearerGetOpts and WIP_BOPT_IP_ADDR, the address given is a private address, i.e. from the private side of the APN. In my case it was 10.xxx.xxx.xxx.

According to Dyndns, if you use the checkip.dyndns.com, you can get your assigned public IP address. I assume only then can you update your dyndns account. Is my thinking correct? Is this the way that you did it?

Thanks,
Mike


#8

Correct: that’s the equivalent of doing ipconfig on a PC behind a router/firewall - it gives the local, private address

If you want to know the “public” address the other side of the router/firewall, you have to use a service like whatismyip.com


#9

On my experience - it’s not true. If your account really support public address, wip_bearerGetOpts() returns exactly that address.
“Whatismyip” services usage is for situation with your “private” server behind “public” router/firewall with port mapping.


#10

Is that with a Static Public address?

Yes - but isn’t that how (at least some) GPRS “Public IP” services work…?

Especially if it’s not a Static Public address?


#11

Hiya

All depends on your APN and how your ISP/Telco has implimented their GPRS network.

(continued…)


#12

(…continued)
In Oz on the Telstra Network, the default APN will give you a private IP (10.x.x.x) - that will probably change each time that the module connects to the network. This address is NATed by the ISP through one of their gateways, and thus (as far as I understand) is absolutely useless for trying to connect TO your module as the address is NON-ROUTABLE. All core routers are configured to drop (or at least not route to the internet) packets with private IP addresses - hence the need for NAT.

(continued…)


#13

(…continued)
I am not sure what’s the point of getting the IP address of the NAT gateway - unless there’s some reverse proxy/NAT going on that will let you create/establish inbound connections across the NAT gateway. I haven’t seen this - but that doesn’t mean that it doesn’t exist. Again, this will be a function of your ISPs core routers.

Some home routers let you forward all ports (port forwarding) on the Public IP across the NAT boundary to a single PC inside the network. This is routing or port forwarding (or sometimes DMZ) and is done by the router. This may be where the DynDN checkIP routine may be useful.

I can’t see the ISP fiddling with their NAT router to do this for you (sigh).

(continued…)


#14

(…continued)

It’s my understanding that this is only the IP address of the NAT gateway/router. My reading of the dyndns (brief) doco is that this is for testing purposes only. As mentioned above, this address won’t let you contact your devices inside the NAT boundary.

However, if you talk nicely to your ISP, you MAY be able to get access to an APN that will provide you with a real, routable IP address - which is what I did when I was using the DynDNS service to resolve a REAL IP address for serving data to the internet. Don’t expect too much from your ISP though - REAL IPV4 addresses are running out, and they may not have any set up against a mobile APN.

Good Luck.

ciao, Dave

(sorry about the multiple posts - but the forum wouldn’t let me post the reply in one message…)


#15

Yes, that’s the situation I was thinking of.

It works for me…


#16

Hiya,

But it’s unlikely to work for a GPRS modem on an ISP’s network - without some special setup by the ISP…

ciao, Dave


#17

Not in the general case of a private IP address, I agree - but we’re talking here about the specific case where the OP has paid-up for a Public (though not static) IP address.

Surely, the whole point of that is precisely so that you can make incoming connections to the device?!

I guess the OP really needs to contact his provider to get the full details of the service…


#18

We’re opening a channel to our server, and keeping it alive by sending a packet at least every 14 minutes.
that way we keep an open channel from the server -trough the nat-firewall of our isp- to our clients.
thus we can push events to them.

it still doesn’t give us a publicly available service, but would you really want that considering the sh*tload of data you will be getting if you have a public ip?


#19

Don’t you mean, "keep an open channel to the server" there?

Don’t you mean that the clients can pull events?


#20

Hiya,

Not in the general case of a private IP address, I agree - but we’re talking here about the specific case where the OP has paid-up for a Public (though not static) IP address.
This wasn’t clear from the OP’s postings. In fact, they indicated that their module was getting a 10.x.x.x address - which suggests that they had been assigned a private IP address by their ISP.

If they can get a public IP address - it’s not common to get one here in Oz - I was lucky to find out the right billing code to be applied to my SIM card - and even luckier to find someone at the telco who would do it. Apparently this service is only for a particular class of enterprise clients…

Exactly - the ISP is the only entity that can organize this.

Exactly - I’ve had reports of 20-40MB per month of unsolicited data being delivered to a mobile device…and what about the security implications. What happens when you port scan an IP enabled modem?

Good Luck!

ciao, Dave