[ntp:questions] Implementing NTP in a legacy system

Steve Kostecke kostecke at ntp.org
Wed Dec 12 19:18:42 UTC 2012


On 2012-12-12, andreas.ames at de.transport.bombardier.com <andreas.ames at de.transport.bombardier.com> wrote:

> I'm rather new to NTP so please forgive me, if my question is trivial.
>
> I'm maintaining a legacy system with its own proprietary time 
> synchronisation protocols.  Now I want to add a new subsystem which 
> requires a NTP daemon to be available.

The answer depends on what this "new subsystem" is. Is it a process
running on the legacy system? Is is a discrete piece of hardware? Is is
a Virtual Machine? 

> I have added a gateway device which will be used to run an NTP
> daemon to provide NTP based time synchronisation to the newly added
> subsystem.

The answer depends on what this "gateway device" is. Is is a process
running on the legacy system? Is it a discrete piece of hardware? Is it
a Virtual Machine?

Among the details not presented in your request is a statement of your
error budget and synchronization requirements.

> My questions are:
>
> 1. I want to use my legacy time synchronisation protocol/mechanism as the 
> reference clock of the NTP daemon on the gateway device.  In my limited 
> understanding this means that the NTP daemon on the gateway would become a 
> stratum 1 server, right?

That depends on how the solution is implemented (which depends on the
nature of this "gateway device".

If your legacy time synchronisation protocol/mechanism functions as a
locally attached refclock then you may set the stratum to whatever you
wish.

If your your legacy time synchronisation protocol/mechanism functions as
a remote NTP server than the stratum will be N+1 (where N is the stratum
of the legacy time synchronisation protocol/mechanism). 

Your question would be easier to understand if you could better explain
the system architecture.

> Are there ways to "easily" add new reference clocks in popular
> implementations like ntpd preferably without setting the system time
> on the gateway?

The source code for NTP is liberally licensed and is available from
http://www.ntp.org/downloads.html or http://support.ntp.org/download.
You could write your own custom reference clock driver based on one of
the existing drivers.

Or you could use the SHM driver. This driver allows a userland process
to feed timestamps to ntpd via a Shared Memory Segment. Please see
http://www.eecis.udel.edu/~mills/ntp/html/drivers/driver28.html for more
information about the Shared Memory Driver

Or if your legacy system can output ASCII time stamps via a serial
port at a reliable interval AND your "gateway" is able to read
those timestamps you might be able to use the Dumb Clock driver
to allow the legacy system to function as a reference clock. Keep
in mind that the hardware used in this serial link will have a
substantial effect on quality of the time stamps. Please see
http://www.eecis.udel.edu/~mills/ntp/html/drivers/driver33.html for more
information about the Dumb Clock driver.

Or you could have a bespoke driver written for you. Joining the Network
Time Foundation (http://www.networktimefoundation.org/) is the best way
to make this happen.

> 2. Is it possible to prevent ntpd on the gateway from setting the system 
> time on the gateway?

The only way to do so is to use the Undisciplined Local Clock driver as
your "time source" and have some other process discipline (i.e. set) the
system time on the "gateway".

-- 
Steve Kostecke <kostecke at ntp.org>
NTP Public Services Project - http://support.ntp.org/



More information about the questions mailing list