On 2021-08-02, chris <
chris-...@tridac.net> wrote:
> On 08/02/21 18:05, David Woolley wrote:
>> On 02/08/2021 17:26, chris wrote:
>>> If it's working properly and has been running for a few hours,
>>> offset against UTC should be in the microsecond range, not
>>
>> ntpd doesn't provide that information. It only provides the offset
>> between the timing source and the PC's internal clock.
>
> Correct me if i'm wrong, but pps is traceable to UTC, so that would be
> used within ntpd to set the system clock. In the case of several
If one wants sub-microsecond accuracy, then how it is used within ntpd
becomes important. Lets assume that the gps module itself is good. The
hardware inside the receiver delivers a pps pulse at the UTC second (it
does not, it fluctuates a few 10s of nanoseconds from that). That pulse
then travels down the cable to the computer. If the impedance matching
between the receiver and the computer is not good, then that pulse gets
smeared out over many travel times down the cable. At a certain voltage
level, a trigger in the driver flips, and that raises and interrupt
voltage. The hardware watches for that flip, and tells the cpu to stop
(controllably) what it is doing, caches the currently running program,
loads the interrupt driver program, and branches to that program. If
that program is well written, it then calls a kernel subroutine, loading
it into memory if need be, and calls a program to convert the counter,
which is the system clock, reads out the count, and converts that count
to a time. It then returns that time to the interrupt driver routine.
All of that takes time. All of that takes a variable amount of time. For
example, if another interrupt service routine is running ( eg due to
disk reads) this one will wait for it to finish (in the sense of
signalling that it is OK for it to be interrupted )
> ntp server sources, ntpd will weed out the outliers, keep the best and
> use that to set local system time. ntpq then provides a list showing
> what it thinks are the timing relationships between them, with pps utc
> as the primary reference ?...
No. The PPS timing is simply one amongst the lot. It may well be the
chosen one, and its low stratum will mean that ntpd will be more likely
to choose it. But not necessarily.