From owner-freebsd-stable@FreeBSD.ORG Sat May 12 11:08:36 2007 Return-Path: X-Original-To: freebsd-stable@FreeBSD.ORG Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1ECBF16A403 for ; Sat, 12 May 2007 11:08:36 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.freebsd.org (Postfix) with ESMTP id 903D413C4BD for ; Sat, 12 May 2007 11:08:35 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (uhupcr@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id l4CB8Oc1031933; Sat, 12 May 2007 13:08:30 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id l4CB8OfE031932; Sat, 12 May 2007 13:08:24 +0200 (CEST) (envelope-from olli) Date: Sat, 12 May 2007 13:08:24 +0200 (CEST) Message-Id: <200705121108.l4CB8OfE031932@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG, imp@bsdimp.com In-Reply-To: <20070511.085109.1387159931.imp@bsdimp.com> X-Newsgroups: list.freebsd-stable User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (FreeBSD/4.11-STABLE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Sat, 12 May 2007 13:08:30 +0200 (CEST) Cc: Subject: Re: clock problem X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-stable@FreeBSD.ORG, imp@bsdimp.com List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 May 2007 11:08:36 -0000 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