NTP Server with Combo-PTM

CESNET technical report 14/2008
PDF format

Vladimír Smotlacha

Received 4.12.2008

Abstract

This paper describes a NTP server utilizing Combo-PTM card as a reference clock. We have proved that Combo-PTM card synchronized by the 1 pps signal is suitable for this role and allows to avoid poor PPS API implementation for Linux kernels family 2.6.x.

Keywords: time synchronization, NTP

1  Introduction

CESNET operates several primary (Stratum-1) NTP servers - in [2] we have described design of these highly accurate and stable NTP servers. Our solution profits from Linux nanokernel, where the clock with nanosecond resolution and a PLL synchronization loop is implemented. Unfortunately, the nanokernel is specific to 2.4.x kernels family and it has been not yet implemented in 2.6.x kernels. Although running on 2.4.x kernel brings no drawback for a NTP server, there are other applications requiring both PPS synchronized clock and 2.6.x kernel. We tried to overcome this issue and to find a solution. One of a few options is to utilize the Combo_PTM card which has an accurate, PPS (Pulse per Second) synchronized clock on the board. Typical example is a network monitoring workstation already equipped with other COMBO6 family monitoring card and Combo-PTM as its timebase.

The card Combo-PTM [1] has been designed and developed several years ago in scope of the SCAMPI project. The main goal was providing COMBO6 cards by an accurate clock for timestamping of packets at link speeds up to 10Gb/s. The clock is based on a free running, temperature compensated oscillator (TCXO) and a digital circuit that implements accurate clock using knowledge of actual TCXO frequency. In principle, this clock circuit is similar to DDS circuit (Direct Digital Synthesis). The clock is synchronized by the PPS signal which is provided by a GPS receiver or another source, for example an atomic clock. The synchronization algorithm has been recently updated and the new version is described in [3].

2  NTP driver implementation

We have written refclock_combo.c , the NTP driver for Combo-PTM which utilizes Combo libraries libcombo and libcommlbr. The driver allows to deal with the Combo-PTM card as with any other external reference clock.

The driver code source simple, as the card contains real-time clock readable by a library function. The essential code sequence is:

....
get_ptmtime(&ptmtime);
get_systime(&pp->lastrec);
refclock_process_offset(pp, ptmtime, pp->lastrec, pp->fudgetime1);
....

Where

We intended to integrate the Combo-PTM driver transparently into the pool of supported external clocks. It required to prepare a complex patch that updates several files of the NTP distribution package, for instance the configure script.

We have implemented two new options:

--enable-COMBO

--with-combo-libdir <path>

The first option instructs the configuration utility to enable the COMBO NTP driver (which is disabled by default). The second option specifies where the compiler should look for Combo libraries libcombo and libcommlbr - by default, the standard library directories are searched.

Each type of NTP driver is represented by a unique number. We decided to assign the Combo-PTM driver to not yet used number 23, i.e., the row:

server 127.127.23.0

in the configuration file /etc/ntp.conf instructs the NTP daemon ntpd to use the Combo-PTM driver as an external clock.

The driver currently supports NTP version 4.2.4p4 and is available online.

3  Performance evaluation

We have installed Combo-PTM card with described NTP driver into the primary NTP server ntp2.cesnet.cz which has the same hardware as all our new NTP servers: mother board VIA EPIA Mini-ITX with 800MHz VIA processor in 1U rack mountable case. The server runs on 2.6.18 Linux kernel.

The server is in continuous routine operation since June 2008. It is stable and required no operator intervention all that time.

Using the ntpq utility, we can check the NTP process. For example, the command ntpq -c pe shows all NTP peers - the master clock name is denoted by the symbol '*':

ntp-ptm:/root# ntpq -c pe
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*COMBO_PTM(0)    .GPS.            0 l    8   16  377    0.000   -0.002   0.002
+tik.cesnet.cz   .GPS.            1 u    3   64  377    0.137    0.002   0.004
+tak.cesnet.cz   .GPS.            1 u   37   64  377    0.153    0.005   0.001
+ripe-ttm.cesnet .GPS.            1 u   44   64  377    0.283    0.042   0.021
+time.ure.cas.cz .ATOM.           1 u   22   64  377    0.497    0.020   0.011

The command ntpq -c rl displays all run-time parameters, where time values are shown in milliseconds - server time offset is 3 microseconds in the following example:

ntp-ptm:/root# ntpq -c rl
assID=0 status=0644 leap_none, sync_ntp, 4 events, event_peer/strat_chg,
version="ntpd 4.2.4p4@1.1520 Tue Jun  3 12:31:23 UTC 2008 (2)",
processor="i686", system="Linux/2.6.18-6-686", leap=00, stratum=1,
precision=-20, rootdelay=0.000, rootdispersion=0.421, peer=51924,
refid=GPS, reftime=cce064ac.fc92aa81  Wed, Dec  3 2008  2:51:40.986,
poll=6, clock=cce064b7.7aedbaee  Wed, Dec  3 2008  2:51:51.480, state=4,
offset=0.003, frequency=-63.842, jitter=0.021, noise=0.002,
stability=0.000

We evaluated the accuracy of NTP server clock and compared it with the accuracy of utilized Combo-PTM clock. Figure 1 shows time offset of Combo_PTM clock (in NTP terminology, it is the reference clock accuracy) during one day measurement and Figure 2 shows time offset of NTP server clock disciplined by that Combo-PTM card.

[Image]

Figure 1. Time offset of the Combo-PTM clock

[Image]

Figure 2. Time offset NTP server

We also operate a system NTPMON [4] which continuously monitors our NTP servers and other workstations running NTP. Figures 3, 4 and 5 are generated by this system and display both reported parameters, i.e., time offset (Figure 3) and frequency offset (Figure 4) and parameters measured by a reference system, i.e., measured time offset (Figure 5). The measured time offset is generally higher than the reported time offset as in includes asymmetry in one-way delay between monitored and reference systems.

[Image]

Figure 3. NTPMON - ntp2.cesnet.cz time offset

[Image]

Figure 4. NTPMON - ntp2.cesnet.cz frequency offset

[Image]

Figure 5. NTPMON - ntp2.cesnet.cz measured offset

4  Conclusions

According to performance evaluation and our previous experience with many NTP servers, we can conclude that Combo-PTM is suitable as the NTP reference clock. Time accuracy of disciplined NTP server is typically less than 10 microseconds, as is shown in Figures 2 and 3.

The advantage of Combo-PTM card utilization is the on-board processing of the PPS signal. It eliminates the interrupt latency in case of PPS signal processing by the system CPU.

References

[1]  NOVOTNÝ, J.; SMOTLACHA V.; BARDAS R. Schematic of COMBO-PTM. Technical report 15/2003, Prague: CESNET, 2003.
[2]  SMOTLACHA, V. NTP Servers with a Stable Oscillator.. Technical report 7/2007, Prague: CESNET, 2007.
[3]  SMOTLACHA, V.; NOVOTNÝ, J.; MARTÍNEK, T. Hardware Supported Precise Timestamps Generation. Technical report 11/2008, Prague: CESNET, 2008.
[4]  SMOTLACHA, V. NTP Monitoring System. Technical report 23/2007, Prague: CESNET, 2007.
další weby:fond rozvojemetacentrumCzechLightpřenosyvideoservereduroameduID.cz