[ntp:questions] Implementing NTP in a legacy system

unruh unruh at invalid.ca
Wed Dec 12 20:40:37 UTC 2012

On 2012-12-12, Chuck Swiger <cswiger at mac.com> wrote:
> Hi, Andreas--
> On Dec 12, 2012, at 10:12 AM, andreas.ames at de.transport.bombardier.com wrote:
> [ ... ]
>>> If you would be more forthcoming, people could probably give better
>>> advice. 
>> What I'm looking for is an API/other interface in NTPD to attach to a
>> currently non-supported reference clock (most probably by writing the
>> needed adapter code).  And this (adapted) NTPD shall run on the
>> gateway device to feed the ntp clients in the new subsystem. 
> There's a generic shared memory driver for NTPD documented here:
>   http://www.eecis.udel.edu/~mills/ntp/html/drivers/driver28.html
> Using this API is probably the easiest way to get time from some
> non-supported timesource into NTPD.  You can take a look at gpsd
> as an example of how to populate and update the SHM time.
> However, if you want to investigate writing a refclock driver, try:
>   http://www.eecis.udel.edu/~mills/ntp/html/refclock.html

I do not think any of these are an answer to his problem. He has two
computers A and B. A's clock is disciplined by some other program, but
he wants to use ntpd on B to discipline B's clock and to get the time
from A. Thus A has to act as an ntp server, but he cannot use ntpd to
discipline the system clock on A. 

There seem to me to be two options
a) use ntpd on A with only the local clock as refclock with no other
server. However I am not sure if this disables ntpd's clock discipline
algorithm. It should, but... If ntpd tried to discipline the clock there
is a danger that the two different discipline programs will interact

b) write a daemon which listens to the ntp port and delivers the local
time on A via ntp to any ntp queries coming from B. This would require
writing an ntp daemon to listen to the port and to deliver the time. 
Of course the other program might be using the ntp port for its own
purposes, in which case he could have to use a different port number for
his own ntp implimentation. 

More information about the questions mailing list