socket and DynDNS

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stephan Schulz

    #1

    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.dynd ns.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.dy ndns.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 schulz@eprover. org (Stephan Schulz)
    ----------------------------------------------------------------------------
  • =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

    #2
    Re: socket and DynDNS

    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

    Comment

    • Stephan Schulz

      #3
      Re: socket and DynDNS

      In article <48ff6b61$0$160 5$9b622d9e@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 schulz@eprover. org (Stephan Schulz)
      ----------------------------------------------------------------------------

      Comment

      Working...