[ntp:hackers] FW: FreeBSD: ntpd PPS vs. kernel PPS

Jeff Schmidt jschmidt at jschmidt.org
Thu Sep 10 02:10:56 UTC 2009



-----Original Message-----
From: Jeff Schmidt [mailto:jschmidt at jschmidt.org] 
Sent: Wednesday, September 09, 2009 8:18 PM
To: 'time-nuts at febo.com'
Subject: FreeBSD: ntpd PPS vs. kernel PPS

So, I have been running a FreeBSD GPS disciplined NTP server for some time.
While there is a lot of guidance out there about how to do-it-yourself with
a Garmin LVC 18 and  FreeBSD, I was unable to find any quantitative data
about whether the PPS was best handled in the FreeBSD kernel or in the ntpd
driver.  So, here is some data:

FreeBSD tick.jschmidt.org 7.2-RELEASE

Kernel PPS discipline was enabled as follows:

   Kernel built with "options PPS_SYNC" (GENERIC + PPS_SYNC)

   Relevant portions of ntp.conf:

   # GPS NMEA (numbers seconds only)
   server 127.127.20.0 prefer minpoll 4 maxpoll 4
   #flag3 Controls the kernel PPS discipline: 0 for disable (default), 1 for
enable.
   fudge  127.127.20.0 flag3 1

   # GPS PPS
   server 127.127.22.0 minpoll 4 maxpoll 4
   #flag3 Controls the kernel PPS discipline: 0 for disable (default), 1 for
enable.
   fudge  127.127.22.0 flag3 1
   fudge  127.127.22.0 refid GPS

Similarly, ntpd PPS discipline was enabled as follows:

   No "options PPS_SYNC" (just a GENERIC kernel)

   ntp.conf:

      fudge  127.127.20.0 flag3 0
      fudge  127.127.22.0 flag3 0

No other changes - software, environmental, etc.  See the graphs here:

http://www.jschmidt.org/loops.jpg

http://www.jschmidt.org/loops2.jpg

The box was running the ntpd PPS discipline from approximately 14260 thru
14445.  It was running kernel PPS discipline prior to 14260 and after 14445.
Visually, you can clearly see that the kernel PPS discipline is superior to
the ntpd PPS discipline.

# ntpdc -c version
ntpdc 4.2.4p7 at 1.1607-o Sat Jul 18 14:35:11 UTC 2009 (1)

# ntptime
ntp_gettime() returns code 0 (OK)
  time ce52bc08.62922d70  Wed, Sep  9 2009 19:43:04.385, (.385043152),
  maximum error 995 us, estimated error 1 us, TAI offset 34
ntp_adjtime() returns code 0 (OK)
  modes 0x0 (),
  offset 5.788 us, frequency -11.256 ppm, interval 256 s,
  maximum error 995 us, estimated error 1 us,
  status 0x2107 (PLL,PPSFREQ,PPSTIME,PPSSIGNAL,NANO),
  time constant 4, precision 0.001 us, tolerance 496 ppm,
  pps frequency -11.256 ppm, stability 0.027 ppm, jitter 0.933 us,
  intervals 17651, jitter exceeded 13839, stability exceeded 0, errors 5.

Hope this is interesting/helpful, thx,
Jeff Schmidt




______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________


More information about the hackers mailing list