Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 May 2007 13:08:24 +0200 (CEST)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-stable@FreeBSD.ORG, imp@bsdimp.com
Subject:   Re: clock problem
Message-ID:  <200705121108.l4CB8OfE031932@lurza.secnetix.de>
In-Reply-To: <20070511.085109.1387159931.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
M. Warner Losh wrote:
 > Oliver Fromme wrote:
 > : M. Warner Losh wrote:
 > :  > Peter Jeremy wrote:
 > :  > : There seems to be a bug in ntpd where the PLL can saturate at
 > :  > : +/-500ppm and will not recover.  This problem seems too occur mostly
 > :  > : where the reference servers have lots of jitter (ie a fairly congested
 > :  > : link to them).
 > :  > 
 > :  > Yes.  This is a rather interesting misfeature of ntpd.  Its rails are
 > :  > at +/- 500ppm, and when it hits the rail it assumes that things are
 > :  > too bad to continue and it stops.
 > : 
 > : I think it is related to the maximum slew rate of 1/2000,
 > : which is equivalent to 500 ppm.  The ntpd(8) manpage says:
 > : 
 > : "Since the slew rate of typical Unix kernels is limited to
 > : 0.5 ms/s, each second of adjustment requires an amortization
 > : interval of 2000 s."
 > : 
 > : And a bit further down:
 > : 
 > : "The maximum slew rate possible is limited to 500 parts-per-
 > : million (PPM) as a consequence of the correctness principles
 > : on which the NTP protocol and algorithm design are based.
 > : As a result, the local clock can take a long time to converge
 > : to an acceptable offset, about 2,000 s for each second the
 > : clock is outside the acceptable range."
 > 
 > I think you are confusing two things here.  One is the maximum
 > frequency error of the system clock that ntpd can tolerate.  The other
 > is the maximum slew rate of the system clock.

I'm aware of that.  It just caught my eye that both of
those values are the same.

 > : Of course, the best solution is to buy a GPS or DCF radio
 > : receiver and set up a startum-1 yourself.  But last time
 > : I tried to do that with a cheap DCF plug, it wasn't very
 > : well supported on FreeBSD.  Even an expensive Mainberg
 > : receiver ( http://www.meinberg.de/english/ ) with an RS232
 > : output worked much more accurately with a Solaris machine
 > : than with FreeBSD.  (Unfortunately, the Mainberg model
 > : availbale to us did not have NTP support via ethernet
 > : itself, only serial output.)  I have to admit that that
 > : was in FreeBSD 4.x days.  The situation might have
 > : improved in the meantime (I don't know).
 > 
 > My company has used FreeBSD's ntpd since 3.x with a small, custom
 > driver that I wrote.  It turns out to work very well in practice.  I'd
 > suggest that it is well supported, even in FreeBSD 4.x.  It isn't well
 > documented.

I guess you're talking about the kernel part.  That's
probably true.  However, we had two problems (with that
Meinberg receiver in particular):

First, there was no working driver.  I had to hack one
of the existing drivers so it would work with the
signals sent from the Meinberg clock.  And I agree that
it isn't well documented.

Second, the serial port code of FreeBSD was a problem.
It caused terrible jitter, and I wasn't able to fix it.
It was completely unusable.  I'm afraid I don't have
exact numbers anymore, it has been a few years ago, but
when we connected the same receiver to a Solaris machine,
the jitter went away.

On a related note, some time ago I got a cheap DCF radio
receiver for my private use (~ EUR 50).  It has a parallel
port connector, I think.  I was unable to find a driver
that would work under FreeBSD.  It caused me to do a bit
of research about what receivers are actually supported
under FreeBSD, and which can be bought without too much
trouble (without paying EUR 1000 like those Meinberg boxes
cost).  I couldn't find any.  The ntp docs mention some
devices that seemingly could be bought 10 years ago, but
they're not available anymore today.

Well, so now I'm back to using a bunch of public NTP
servers in my ntp.conf, and the DCF receivers catches
dust in some cardboard box in the attic.  :-)

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"I have stopped reading Stephen King novels.
Now I just read C code instead."
        -- Richard A. O'Keefe



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705121108.l4CB8OfE031932>