[ntp:questions] clockvar output from PPS

Dave Hart davehart at gmail.com
Mon Feb 20 10:21:59 UTC 2012

On Mon, Feb 20, 2012 at 09:19, A C <agcarver+ntp at acarver.net> wrote:
> Is this what you would expect from ntpq -c clockvar from a system that is
> synced on PPS:
> ntpq> clockvar
> associd=0 status=0000 no events, clk_unspec,
> device="PPS Clock Discipline", timecode=, poll=11425, noreply=0,
> badformat=0, baddata=0, stratum=16, refid=, flags=14
> rv shows:
> ntpq> rv
> associd=0 status=011d leap_none, sync_pps, 1 event, kern,
> version="ntpd 4.2.7p256 at 1.2483-o Thu Feb  9 01:02:23 UTC 2012 (1)",
> processor="sparc", system="NetBSD/5.1", leap=00, stratum=1,
> precision=-13, rootdelay=0.000, rootdisp=1.150, refid=PPS,
> reftime=d2ec8c38.8b4e0f18  Mon, Feb 20 2012  9:09:12.544,
> clock=d2ec8c42.e3f01a01  Mon, Feb 20 2012  9:09:22.890, peer=56093, tc=4,
> mintc=3, offset=-0.007, frequency=-78.483, sys_jitter=0.122,
> clk_jitter=0.014, clk_wander=0.001, tai=34, leapsec=201207010000,
> expire=201212280000
> I guess I'm confused because the stratum and the refid don't match.

The stratum shouldn't match -- I'd expect the clockvar stratum to be 0
and the system stratum to be 1.  On the wire in NTP packets, there are
4 bits for stratum, raw value 0-15.  0 is defined to be stratum
unspecified/not yet synched.  When a network peer's packets have
stratum=0, they show up in ntpq rv and peers billboard as stratum 16,
which is ntpd's convention for stratum unspecified.  However, other
refclocks do show stratum=0 in clockvar so that isn't a complete
explanation for what you see.

The refid you see is due to you fudging the refid in ntp.conf.
Translate each number according to your favorite ASCII chart or
descendent to decode.  When displaying refids ntpq's peers billboard
varies its behavior based on stratum associated -- 0 or 1 mean display
refid as text (up to 4 characters that fit in 32-bit refid), all
others mean display refid's numerically (dotted quads that look like
IPv4 address).  I suspect clockvar always displays refids numerically.

Dave Hart

More information about the questions mailing list