[ntp:questions] Re: NTP looses connection

Brad Knowles brad at stop.mail-abuse.org
Sun Oct 31 14:51:25 UTC 2004

At 12:50 PM +0100 2004-10-31, Frank Dohrmann wrote:

>  However, although I don´t have a clue how ntpd is coded or how network
>  communication is done at all, I find this fairly strange. Why do I have
>  to restart the application if the underlying network connection gets
>  lost for some seconds? Aren´t we talking about different osi layers
>  that should be independent?

	The problem is a result of several factors.  Some applications 
will listen to a single socket that is set up in a way that it will 
receive all packets received by the machine, if they are sent to the 
specific port that it is listening to -- this special address is 
called INADDR_ANY.

	This is fine for TCP applications, but doesn't work well for UDP 
applications which need to send out a reply on the same interface/IP 
address on which the query was received.  For UDP, if you listen to 
INADDR_ANY then you don't know which interface/IP address a query 
came in on, and you can't send out the response on the correct 
interface/IP address.  TCP deals with this issue in a different way, 
and the application doesn't have to worry about which interface/IP 
address a query came in on and making sure that the response goes out 
on the same interface/IP address.

	The INADDR_ANY problem also has some negative impacts with 
authentication and multicast.

	There are some OS-specific ways you can solve the INADDR_ANY 
problem, but the only cross-platform method I know of is to change 
the application so that it explicitly listens to specific 
interfaces/IP addresses, usually all of the ones on the system.  This 
can cause other side-effect problems when the IP address of the 
machine changes underneath the program.

	We're working on trying to resolve this problem so that you won't 
need to restart ntpd in the future, but we've got some bigger 
problems we need to resolve before we can get to work on this.

>  Besides, I can hardly imagine to be the only guy using ntpd on a linux
>  box that works as a router to a dial-in network. In fact, if the changing
>  ip is the cause of my problem, I would expect this problem to be fairly
>  common.

	Yup, it's fairly common.  I believe that most vendors of 
equipment of this sort are familiar with this issue and build this 
solution into their systems.  If the various Linux distributions 
would also build this solution into their systems, then there should 
be a lot fewer confused users such as yourself.

Brad Knowles, <brad at stop.mail-abuse.org>

"Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety."

     -- Benjamin Franklin (1706-1790), reply of the Pennsylvania
     Assembly to the Governor, November 11, 1755

   SAGE member since 1995.  See <http://www.sage.org/> for more info.

More information about the questions mailing list