From owner-freebsd-stable@FreeBSD.ORG Fri Jul 30 00:02:07 2004 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7D83816A4CE for ; Fri, 30 Jul 2004 00:02:07 +0000 (GMT) Received: from postal3.es.net (postal3.es.net [198.128.3.207]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2C9EC43D55 for ; Fri, 30 Jul 2004 00:02:07 +0000 (GMT) (envelope-from oberman@es.net) Received: from ptavv.es.net ([198.128.4.29]) by postal3.es.net (Postal Node 3) with ESMTP (SSL) id IBA74465; Thu, 29 Jul 2004 17:02:06 -0700 Received: from ptavv (localhost [127.0.0.1]) by ptavv.es.net (Tachyon Server) with ESMTP id E834A5D09; Thu, 29 Jul 2004 17:02:05 -0700 (PDT) To: Gregory Bond In-reply-to: Your message of "Fri, 30 Jul 2004 09:38:32 +1000." <200407292338.JAA18401@lightning.itga.com.au> Date: Thu, 29 Jul 2004 17:02:05 -0700 From: "Kevin Oberman" Message-Id: <20040730000205.E834A5D09@ptavv.es.net> cc: freebsd-stable@freebsd.org Subject: Re: Looking for ntp/PPS setup guide X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jul 2004 00:02:07 -0000 > From: Gregory Bond > Date: Fri, 30 Jul 2004 09:38:32 +1000 > Sender: owner-freebsd-stable@freebsd.org > > > We've got a GPS receiver to make an NTP server, and it has PPS output. > Is there a guide to how to set up PPS on recent (4.10-ish) FreeBSD > boxes? Or I can put it on a 5.x box if that is better. I've had a > look in all the obvious places but the only references I can find are > to old (load a line discipline or patch a kernel) solutions. I'd suggest the documentation at www.ntp.org, but it has a few errors and lacks a bit of FreeBSD specific bits. First off, you will need to rebuild ntpd with the appropriate reference clocks, pps and whatever type of GPS you have. The software is in /usr/src/contrib/ntp/ntpd. You can look at the list of clock drivers and pick the one you need. If you look at the driver source, you will see that REFCLOCK and a driver specific variable need to be defined. Go to /usr/src/usr.sbin/ntp/ntpd and rebuild ntpd with the clock driver: make clean make -DREFCLOCK -DCLOCK_yourclock make install You need to rebuild you kernel with "options PPS_SYNC". You can run PPS without this and the man page even says it's more accurate that way, but my experience is that it is much more accurate with the kernel option. I use CDMA clocks and they my time is stable within 10 microseconds. I did find that nptd 4.2 seemed to converge better than 4.1, so I built the ntp port instead of the standard one. I then just installed the ntpd from the port over the one in /usr/sbin. 4.2 is now the standard NTP in version 5 and I suspect it will be MFCed to STABLE soon. Read the manual pages for pps and your GPS clock driver for how to set up ntp.conf for that clock. You will need to set up kernel PPS there. -- R. Kevin Oberman, Network Engineer Energy Sciences Network (ESnet) Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab) E-mail: oberman@es.net Phone: +1 510 486-8634