Should two-digit years be fatal to a refclock?

Eric S. Raymond esr at thyrsus.com
Mon Feb 4 13:10:58 UTC 2019


Hal Murray <hmurray at megapathdsl.net>:
> > If the zero date was in the last century and your local refclock only ships a
> > two-digit date, you have a problem. NTP will cheerfully "correct" the time
> > into the last century.  This is a real problem case with RasPis or
> > BeagleBones using a vanilla NMEA GPS.  So much for standalone operation,
> > which we now advertise as an NTPsec feature. 
> 
> Didn't we discuss this a year or 3 ago?  I thought the solution is to pivot 
> around the build date of ntpd.  There is a ntpcal_get_build_date() in 
> libntp/ntp_calendar.c
> 
> It's called by refclock_trimble, refclock_nmea, and libntp/systime.

But not by any of the five refclocks I called out.  Or the generic driver.

The failure cases are really hard to think about. There are all kinds
of potential interactions among century error due to two-digit years,
32-bit wraparound in peer timestamps, unknown pivot dates on peers,
GPS-era rollovers, unknown pivot dates in GPS firmware, and failures
near RTCs.

Now you've added another variable.  Some drivers renormalize to the
pivot date before the protocol machine gets to see the timestamp.

That's quite a thicket.  There could easily be a boojum in it.

My instinct in situations like this is to try to find a way to reduce
the combinatorial complexity of the problem.  Which is why I'm attracted
to disqualifying any time source that truncates years.

We probably did discuss this some time ago - not quite from the 2-digit-year
angle but because there is a similar pivoting problem for interpreting
32-bit peer timestamps.

(And dammit, if I get to design NTPv5 that 32-bit-length is a mistake
that will *not* be repeated.)

I meant to mention that one reason I'm a bit more worried about this
is that the rise of hobby SBCs has made RTCless sysyems actually more
common than they were a decade ago.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>

My work is funded by the Internet Civil Engineering Institute: https://icei.org
Please visit their site and donate: the civilization you save might be your own.




More information about the devel mailing list