[time-nuts] Cheap jitter measurements

Hal Murray hmurray at megapathdsl.net
Sun Apr 8 21:56:24 UTC 2018


kb8tq at n1k.org said:
> In both cases (pulse in and pulse out) the first step is to ask NTP “when
> was that?”. You still have a pretty big chunk of NTP in the  middle of the
> process …. If NTP only “knows” what is happening (or can control what is
> happening)  to +/- 300 ns. The guts of  your data will be limited to the
> same  300 ns.  

NTP itself doesn't actually do any timing measurements.  That is done by the 
OS.

I'm not familiar with Windows.  All my OS comments apply to Linux and *BSD.  
Windows is probably similar is most respects but may be missing details.

The system clock runs off the CPU crystal.  The kernel has a knob for fine 
tuning the clock speed.  There is another knob that says bump the clock speed 
a bit (500 PPM) long enough to adjust the time by X seconds.  ntpd uses both.

[Many years ago, most kernels used an interrupt from the battery backed clock 
(RTC or TOY) for the main timing and interpolated using the CPU clock.]


The kernel can capture a time stamp on a PPS pulse and on packet arrivals.  I 
don't know of anything similar for packet departure.

The kernel can support more than one PPS so you could feed a GPSDO in on one 
for NTP and use another for general timing measurements.  Those measurements 
are using the kernel clock as a reference.  You can turn ntpd off so the 
system time will have more long term drift but less short term wobble as ntpd 
corrects for errors.]


I don't know of a good way to get a pulse out at a specified time.  You can 
measure the time that user code sends a pulse out and setup a timer to go off 
every second.  I don't know how to adjust or specify the offset from 
timer-going-off to system clock ticking to another second.

The Linux kernel PPS code has an option to send a pulse out when one comes 
in.  I haven't played with it.  I think it could help with measuring the 
interrupt response delays.

tvb: If I send you some data, can you turn it into pretty graphs?





-- 
These are my opinions.  I hate spam.






More information about the Time-nuts_lists.febo.com mailing list