473,511 Members | 16,282 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

socket and DynDNS

Hi all,

I need an application that will duplicate an incoming stream of UDP
messages and send it on to some external server that has a dynamic DNS
address. I can use the dynamic name someserver.dyndns.org to get the
current IP address or to send data too.

The question I have is how to do this in the most elegant way. What
happens if I just use the tuple ("someserver.dyndns.org", someport) as
the address in socket.sendto()? Will the library do the right thing
every time? I.e. will it cache the IP address long enough, but not too
long?

I'm potentially sending off thousands of messages per second - almost
certainly hundreds. Will someone in the chain do a smart enough
caching that a) a change in the IP address will be noted and b) I
don't incur a full DNS resolution overhead for each packet?

My naive and ugly alternative is to periodically (e.g. every 5
minutes) do a manual lookup and use the last address. This may, of
course lead to a service outage if the address changes, but that is
supposed to be a rare event and is deemed acceptable.

Oh yes, the OS is Red Hat EL5, if that makes a difference with respect
to the underlying name resolution.

Thanks for any input!

Bye,

Stephan

--
-------------------------- It can be done! ---------------------------------
Please email me as sc****@eprover.org (Stephan Schulz)
----------------------------------------------------------------------------
Oct 22 '08 #1
2 2028
My naive and ugly alternative is to periodically (e.g. every 5
minutes) do a manual lookup and use the last address.
You should look at the TTL of the DNS record, and re-lookup when it
expires.

There will be *no* kind of protection for UDP messages. When
the machine loses its IP address, it will stop receiving your
messages, even if they are already in transit. If the provider
re-assigns the IP address to some other customer, that customer
will receive the UDP messages instead.

If you want safety, you need to implement it in your application,
e.g. by the receiver side sending heart beat messages, and the
sender side resending everything that might have been lost since
the last heart beat.

Regards,
Martin
Oct 22 '08 #2
In article <48**********************@news.freenet.de>, Martin v. Löwis wrote:
>
You should look at the TTL of the DNS record, and re-lookup when it
expires.
Sure. I can do that. But it would be so much nicer if a lower level
would already take care of that (i.e. by caching the lookup for the
lease time and then renewing the info).
>There will be *no* kind of protection for UDP messages. When
the machine loses its IP address, it will stop receiving your
messages, even if they are already in transit. If the provider
re-assigns the IP address to some other customer, that customer
will receive the UDP messages instead.
Indeed. I'm aware of that. The data is not particularly critical, so a
short outage or some misdirected data is not much of an issue
(although I'd like to avoid sending random packets to some
unsuspecting victim, if only to not scare some poor virus scanner).
>If you want safety, you need to implement it in your application,
e.g. by the receiver side sending heart beat messages, and the
sender side resending everything that might have been lost since
the last heart beat.
Right. We don't need that safety. Indeed, this is for an external
convenience feed. For the real application, we have a controlled
environment, and loosing the occasional packet is much less critical
than the overhead and delays of a safe protocol. But this is getting
off-topic.

Bye,

Stephan

--
-------------------------- It can be done! ---------------------------------
Please email me as sc****@eprover.org (Stephan Schulz)
----------------------------------------------------------------------------
Oct 22 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
9269
by: simon place | last post by:
Spent some very frustrating hours recoding to find a way of closing a server socket, i'd not thought it would be any problem, however, after complete failure and as a last resort, i looked at the...
4
8700
by: DreJoh | last post by:
I've read many articles on the subject and the majority of them give the same solution that's in article 821625 on the MSDN website. I'm using the following code and when a the client disconnects...
2
14924
by: André Heuer | last post by:
Hi, i want to write a .net class that can update my ip address at the dyndns service (http://www.dyndns.org). When I open the page...
4
18087
by: Chris Tanger | last post by:
Context: C# System.Net.Sockets Socket created with constructor prarmeters Internetwork, Stream and TCP everything else is left at the default parameters and options except linger may be changed...
0
4649
by: Macca | last post by:
Hi, I am writing an asychronous socket server to handle 20+ simulataneous connections. I have used the example in MSDN as a base. The code is shown at end of question. Each connection has a...
3
4264
by: BuddyWork | last post by:
Hello, Could someone please explain why the Socket.Send is slow to send to the same process it sending from. Eg. Process1 calls Socket.Send which sends to the same IP address and port, the...
5
12751
by: darthghandi | last post by:
I've created a class to listen to all interfaces and do a BeginAccept(). Once it gets a connection, it passes the connected socket off and stores it in a List. Next, it continues to listen for...
4
16053
by: O.B. | last post by:
I have a socket configured as TCP and running as a listener. When I close socket, it doesn't always free up the port immediately. Even when no connections have been made to it. So when I open...
0
201
by: Christian Heimes | last post by:
David York wrote: Most modern routers home routers support the IGD part of UPnP (http://en.wikipedia.org/wiki/Internet_Gateway_Device_Protocol). You can use an UPnP client software to query the...
0
7144
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7427
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7085
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3214
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1577
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
449
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.