[ntp:questions] Resolving Hostnames

Danny Mayer mayer at ntp.isc.org
Sun Dec 23 16:29:41 UTC 2007


David Woolley wrote:
>> allowing the load to evenly distribute among the servers in the pool.
>> In this case the client will send NTP requests to the same host but
>> get NTP responses from physically different servers. All servers in
>> the pool peer with one another.
> 
> If you can make this sort of change to ntpd, adding re-resolving should
> be child's play.  I really don't see how this could possibly be more
> efficient than simply replying directly.  To make it work, the times on
> the receiving and sending machines will have to be in lock step, not
> just synchronised by NTP, as you will need to time stamp the receipt of
> the packet on the first machine with a clock that is running identical
> to the clock that is used to timestamp the packet when it is transmitted
> back.  You will also need to ensure that the IP address from which the
> response returns is the same as that to which it was sent.
> 

This cannot work. Physically different servers will have different
clocks and the association must be set up to work with just that one
clock or the algorithms in the code will end up rejecting the entire set
as the jitter and delays will be way off. Not only are the clocks
different, their frequencies will be different, their refid's will be
different and the round-trip delays will be different. You cannot do
anycasting with NTP. This kind of thing works well with DNS but DNS
doesn't care about what the server is doing, or how long it takes. NTP does.

>> The way it is working right now, each client may surely get a
>> different server in the pool but I have no way to ensure that each of
>> potentially millions of clients select the server in a way which will
>> balance the load on my servers. Also note that the server pool (at
> 
> Pure statistics will get you close.  If you want better, you could
> do tricks like making the DNS hash the source address to chose between
> the servers.  It might be possible to do this in a router as well, as 
> long as the router handles this completely within its routing processor and
> doesn't require control processor involvement.
> 

I did get a request recently which suggested picking servers at random
from the list of addresses returned from DNS. This is probably worth
doing. It will need code also to disable the behavior.

Danny



More information about the questions mailing list