[ntp:questions] Synchronize distributed PCs with GPS 1 PPS and NTPd for OWD measurements

Charles Swiger cswiger at mac.com
Fri Sep 11 20:25:53 UTC 2015


Hi, Sandip--

On Sep 11, 2015, at 8:05 AM, sandip gangakhedkar <sandipfloyd at gmail.com> wrote:
> Hello,
> 
> I am trying to sync the system clocks of two desktop/laptop computers
> within sub millisecond accuracy.
> 
> The goal is to have a setup for measuring One Way Delay of UDP packets
> between two moving nodes, over a long-range wireless network.

OK.

> My plan is to set up the two machines as Stratum-1 NTP servers using 1PPS
> GPS output over RS-232 and NTP.
> 
> Specifically, I want to:
> - Use an external GPS receiver with 1 PPS output and interface it via
> RS-232/USB port to the desktop/laptop

RS-232 serial port and USB are very different things when it comes to
timekeeping.  A real serial port has hardware flow control via signals
like RTS/CTS which cause an interrupt and result in fast processing of PPS.

USB ports are unable to deliver the same level of timekeeping quality.

> - Use LinuxPPS or some other Kernel-level PPS interfacing library to
> receive the pulses from the Serial port.
> - Compile ntpd to use the PPS source for sync.
> - Patch the Linux kernel if needed (RT_PREEMPT and PPS related stuff)

Yes.

> The main problem I am facing is how to choose a GPS receiver that will give
> the required acuracy and fit my budget (< EUR 150 a piece). From the foll.
> resources, it seems that GPS-based disciplining for NTP is possible in both
> Windows and Linux:
> http://www.satsignal.eu/ntp/NTP-on-Windows-serial-port.html
> http://www.satsignal.eu/ntp/FreeBSD-GPS-PPS.htm <http://www.satsignal.eu/ntp/FreeBSD-GPS-PPS.htm>

Note that FreeBSD isn't Linux.  The BSD family tree predates Linux by quite a bit;
FreeBSD also has outstanding timekeeping and kernel PPS support already available
by default.

> Ideally I would prefer to use a receiver that provides an accurate 1PPS
> pulse over USB that can enable absolute accuracy of the computer system
> clock under 1ms.

Switch over to a real serial port and you should have no problems getting
better than ~1ms group synchronization.  Heck, if you choose your upstream
NTP servers well, you can even get a stratum-2 server without a refclock
to maintain ~1ms accuracy, but that depends on having a decent net link also.

Regards,
-- 
-Chuck



More information about the questions mailing list