Commits (34)
......@@ -52,7 +52,7 @@ The following NTP Classic CVEs announced in February 2018 do not affect NTPsec:
We have dropped support for Broadcast servers. We had kept it for
older desktop operating systems listening on the local network
broadcast domain, a use case that is now no longer in use at sane
enviroments, and no longer necessary for modern desktop OSs.
environments, and no longer necessary for modern desktop OSs.
It is now possible to unpeer refclocks using a type/unit specification
rather than a magic IP address. This was the last obligatory use of
......
/*
/*
* digest.c - Hack to test various digest types.
*
* Fedora mentions blake2b and friends. They are in the man page
......
/*
/*
* sht.c - Testprogram for shared memory refclock
* read/write shared memory segment; see usage
*/
......@@ -20,11 +20,11 @@ char *progname;
struct shmTime {
int mode; /* 0 - if valid set
* use values,
* use values,
* clear valid
* 1 - if valid set
* 1 - if valid set
* if count before and after read of values is equal,
* use values
* use values
* clear valid
*/
volatile int count;
......@@ -113,7 +113,7 @@ main (
case 'r': {
int clear=0;
int loop=0;
printf ("reader\n");
printf ("reader\n");
while (*++argp) {
switch (*argp) {
case 'l': loop=1; break;
......@@ -182,7 +182,7 @@ again:
* to deal with the time stamps in general; changing the
* behaviour for cases where the fraction of the
* clock time is zero should be trivial.
*/
*/
printf ("writer\n");
p->mode=0;
if (!p->valid) {
......
......@@ -25,6 +25,9 @@ of the current startup logic gets discussed.
=== Future plans ===
* Implement Google's proposed standard smear?
See https://developers.google.com/time/smear
* Add .tar.xz tarball.
* Fix ntpq retransmissions.
......
......@@ -101,10 +101,11 @@ def main(argv=None): # pylint: disable=too-many-locals
this_file.close()
result = PythonCommands(['ssh', '-T', argv[1], 'python'], this_script)
if result and result[-1]:
result += [''] # Add trailing EOL if needed
result += [''] # Add trailing EOL if needed
sys.stdout.write('\n'.join(result))
return 0
python_list = ExeFilter(FileList(MakePatterns(GetPaths(), PYTHON_PATTERNS)))
python_list = ExeFilter(FileList(MakePatterns(GetPaths(),
PYTHON_PATTERNS)))
done = set()
unique = total = 0
for python in python_list:
......@@ -141,7 +142,8 @@ def main(argv=None): # pylint: disable=too-many-locals
_print(' Prefix(sys): %s' % valdict['sys-prefix'])
_print(' Prefix(std): %s' % valdict['std-prefix'])
_print(' Prefix(exec): %s' % valdict['exec-prefix'])
plural = unique != 1 and 's' or '' # pylint: disable=consider-using-ternary
plural = unique != 1 and 's' or ''
# pylint: disable=consider-using-ternary
print('Found %d unique Python installation%s out of %d total'
% (unique, plural, total))
return 0
......
......@@ -31,7 +31,8 @@ have a mis-configured Python and need to investigate that.
Load paths may be more likely to be an issue after rootspace installation.
The script should install the Python library in the directory specified by
Python itself, which is reported as PYTHONDIR near the end of the configure
Python itself (unless overridden by command line options or environment
variables), which is reported as PYTHONARCHDIR near the end of the configure
phase. This directory should be on your Python's sys.path, in which case all
will proceed normally. If it's not, you will get the same ntpq failure to
launch ./ntpq from anywhere *outside* the source tree. If this is the case,
......
......@@ -54,7 +54,7 @@ discarded. Authentication doesn't prevent replays.
[[symm]]
=== Symmetric-Key Cryptography ===
NTP allows any one of possibly 65,534 keys, each distinguished by a
NTP allows any one of possibly 65,535 keys, each distinguished by a
32-bit key identifier, to authenticate an association. The servers and
clients involved must agree on the key and key identifier to
authenticate NTP packets. Keys and related information are specified
......@@ -134,7 +134,7 @@ access to all but correctly authenticated clients.
[[formats]]
== Data Formats ==
The NTPv4 specification (RFC 5905) allows any one of possibly 65,534
The NTPv4 specification (RFC 5905) allows any one of possibly 65,535
message digest keys (excluding zero), each distinguished by a 32-bit key
ID, to authenticate an association. The servers and clients involved
must agree on the key ID, key type and key to authenticate NTP packets.
......
......@@ -18,8 +18,8 @@ parameter, hybrid phase/frequency-lock feedback loop. It is an
intricately crafted algorithm that automatically adapts for optimum
performance while minimizing network overhead. Operation is in two
modes, phase-lock loop (PLL), which is used at poll intervals below the
Allan intercept, by default 2048 s, and frequency-lock loop (FLL), which
is used above that.
Allan intercept - by default 2048 s - and frequency-lock loop (FLL),
which is used above that.
image::pic/discipline.gif[align="center"]
......@@ -70,7 +70,7 @@ intervals are expressed as exponents of 2. By construction, the time
constant exponent is five times the poll interval exponent. Thus, the
default poll exponent of 6 corresponds to a poll interval of 64 s and a
time constant of 2048 s. A change in the poll interval changes the time
constant by a corresponding amount.. The Nyquist criterion requires the
constant by a corresponding amount. The Nyquist criterion requires the
sample interval to be not more than half the time constant or 1024 s.
The clock filter guarantees at least one sample in eight poll intervals,
so the sample interval is not more than 512 s. This would be described
......@@ -133,8 +133,9 @@ If left running continuously, an NTP client on a fast LAN in a home or
office environment can maintain synchronization nominally within one
millisecond. When the ambient temperature variations are less than a
degree Celsius, the clock oscillator frequency is disciplined to within
one part per million (PPM), even when the clock oscillator native
frequency offset is 100 PPM or more.
one part per million (PPM), even when the clock oscillator native frequency
offset is 100 PPM or more. A temperature-compensated crystal oscillator,
if available, will be even less affected by thermal influences.
For laptops and portable devices when the power is turned off, the
battery backup clock offset error can increase as much as one second per
......@@ -143,7 +144,7 @@ offset and oscillator frequency errors must be resolved by the clock
discipline algorithm, but this can take several hours without specific
provisions.
The provisions described in this section insure that, in all but
The provisions described in this section ensure that, in all but
pathological situations, the startup transient is suppressed to within
nominal levels in no more than five minutes after a warm start or ten
minutes after a cold start. Following is a summary of these provisions.
......@@ -180,7 +181,7 @@ clock. The +iburst+ option of the link:assoc.html#burst[+server+]
command changes the behavior at restart and is recommended for
client/server configurations. When this option is enabled, the client
sends a volley of six requests at intervals of two seconds. This usually
insures a reliable estimate is available in about ten seconds before
ensures a reliable estimate is available in about ten seconds before
setting the clock. Once this initial volley is complete, the procedures
described above are executed.
......
......@@ -33,7 +33,7 @@
+key+ _key_::
All packets sent to and received from the server or peer are to
include authentication fields encrypted using the specified _key_
identifier with values from 1 to 65534, inclusive. The default is to
identifier with values from 1 to 65535, inclusive. The default is to
include no encryption field.
+minpoll+ _minpoll_::
......
......@@ -5,7 +5,7 @@
Specifies the key identifier to use with the
{ntpqman} utility, which uses the standard protocol defined in
RFC 5905. The _key_ argument is the key identifier for a trusted key,
where the value can be in the range 1 to 65,534, inclusive.
where the value can be in the range 1 to 65,535, inclusive.
[[keys]]
+keys+ _keyfile_::
......@@ -28,6 +28,6 @@ The authentication procedures require that both the local and remote
servers share the same key and key identifier for this purpose,
although different keys can be used with different servers.
The _key_ arguments are 32-bit unsigned integers with values from 1 to
65,534.
65,535.
// end
......@@ -7,7 +7,7 @@ Support" page of the Web documentation.
{ntpdman} reads its keys from a file specified using the -k command line
option or the 'keys' statement in the configuration file. While key
number 0 is fixed by the NTP standard (as 56 zero bits) and may not be
changed, one or more keys numbered between 1 and 65534 may be
changed, one or more keys numbered between 1 and 65535 may be
arbitrarily set in the keys file.
The key file uses the same comment conventions as the configuration
......@@ -17,7 +17,7 @@ file. Key entries use a fixed format of the form
keyno type key
--------------
where `keyno` is a positive integer (between 1 and 65534),
where `keyno` is a positive integer (between 1 and 65535),
`type` is the message digest algorithm, and
`key` is the key itself.
......
......@@ -25,6 +25,10 @@ utilities.
Bump the clock by a specified number of microseconds.
+-c+::
Compute and display clock jitter.
+-d+::
display values extracted via adjtimex(2).
+-D+::
display values extracted via adjtimex(2) forcibly including PPS.
+-e+::
Measure clock precision.
+-j+::
......
......@@ -386,7 +386,10 @@ displayed.
Display operational summary.
+sysstats+::
Print statistics counters maintained in the protocol module.
Print statistics counters maintained in the protocol module. Note
that the relationships among these counters can look unlikely because
packets can get flagged for inclusion in exception statistics in more
than one way, for example by having both a bad length and an old version.
[[auth]]
== Authentication ==
......
......@@ -35,7 +35,7 @@ Figure 1. Typical Symmetric Key File
Figure 1 shows a typical symmetric keys file used by the reference
implementation. Each line of the file contains three fields, first
keyno an integer between 1 and 65534, inclusive, representing the
keyno an integer between 1 and 65535, inclusive, representing the
key identifier used in the `server` configuration commands. Next
is the key type for the message digest algorithm, which can be any
message digest algorithm supported by the OpenSSL library.
......
......@@ -10,7 +10,7 @@
[[ACTS]] ACTS::
https://www.nist.gov/pml/time-and-frequency-division/services/automated-computer-time-service-acts[NIST
Automated Computer Time Service]. NIST provides a civil time reference for
computers equipped with analog modems that can dial to its phone
computers equipped with analog modems that can dial in to its phone
lines. Due to variability of delays in the analog phone network
accuracy is not very good, around 4 milliseconds compared to
around a microsecond for <<PPS>>. But the service is still
......@@ -45,14 +45,14 @@
nominal frequency. It changes, slowly, in response to environmental
factors (mainly ambient temperature). ntpd measures drift by
sampling the clock and performing clock recovery against a
phase-locked loop. The drift measurement is occasionally stored
phase-locked loop. The drift measurement can be stored and updated
locally to a drift file so that when ntpd is stopped and restarted
it doesn't have to go through the entire resampling and resynchronization
process before providing reliable time.
[[falseticker]] falseticker::
<<Mills-speak>> for a timeserver identified as not
reliable by statistical filtering. Usually this does not imply any
reliable by statistical filtering. Usually this does not imply a
problem with the timeserver itself but rather with highly variable
and asymmetric network delays between server and client, but firmware
bugs in GPS receivers have produced falsetickers.
......@@ -64,7 +64,7 @@
definitions; notably, the Unix epoch is 1970-00-00T00:00:00.
[[era]] era::
One complete revolution of a 64-bit NTP 64-bit timestamp; approximately
One complete revolution of an NTP 64-bit timestamp; approximately
136 years. Eras are numbered from 0, but this era number is not
represented internally in NTP code because modular-arithmetic
trickery is used to deduce the nearest time that could fit a given
......@@ -87,13 +87,13 @@
now long gone, but have left a few traces in the NTP codebase.
[[GPS]] GPS::
Global Positioning System; also, "a GPS" is a radio receiver
Global Positioning System; in common parlance "a GPS" is a radio receiver
designed to get position and time fixes from the system. GPS fixes
are derived from spherical trigonometry using the precisely known
positions of satellites in a geocentric coordinate system. GPS
also provides time service; those that emit <<PPS>> are suitable
as clock sources for Stratum 1 timeservers. In timekeeping, the
term is used to refer not only to the US original GPS system,
term is used to refer not only to the original U.S. GPS system,
but newer constellations that work on the same principles, such
as ГЛОНАСС (the Russian GLONASS), 北斗 (the Chinese BeiDou-2),
and the EU's Galileo.
......@@ -108,7 +108,7 @@
GPS antenna.
[[GPSD]] GPSD::
The http://www.catb.org/gpsd/[GPS Daemon], an open-source device
The http://www.catb.org/gpsd[GPS Daemon], an open-source device
manager for GPSes and other geodetic sensors. Frequently used as
a clock source by Stratum 1 sites via the link:driver_shm.html[SHM]
interface.
......@@ -140,16 +140,16 @@
serial link is called "in-band time" to contrast it with the
out-of-band <<PPS>> signal. Abbreviated IBT. Seldom useful
by itself as it tends to have a large random wander from top
of second. It is however, useful as a count of seconds.
of second. However, it is useful as a count of seconds.
[[leap second]] leap second::
Because the earth's rotation varies in irregular ways (gradually
slowing due to tidal drag) and the second is now defined in
absolute terms rather than as a fraction of day length, keeping
slowing due to tidal drag among other forces) and the second is now defined
in absolute terms rather than as a fraction of day length, keeping
time of day synchronized with mean solar time requires occasional,
unpredictable insertions of a standard second in the calendar. Leap
second notifications are issued as Bulletin C by the
http://www.iers.org/IERS/EN/Home/home_node.html[International
https://www.iers.org/IERS/EN/Home/home_node.html[International
Earth Rotation Service] when required, and obeyed by national time
authorities. The current leap-second offset is automatically
propagated through the <<GPS>> system.
......@@ -169,17 +169,17 @@
include <<falseticker>>, <<proventic>>, and <<truechimer>>. The
close-to-definitive reference is
https://lists.ntp.org/pipermail/questions/2007-December/016592.html[The
NTP dictionary], though not all those terms are still in use.
NTP dictionary], though not all of those terms are still in use.
[[mode 6]] mode 6::
Mode 6 is a control protocol used to get various kinds of
status information from a running ntpd and configure it on
the fly. So called from the value 6 (0110) in the packet mode
the fly. So-called from the value 6 (0110) in the packet mode
field. It is described in detail mode6.html[here].
[[NIST]] NIST::
http://www.nist.gov/[National Institute of Standards and
Technology]. The civilian national time authority of the USA;
https://www.nist.gov[National Institute of Standards and
Technology]. The civilian national time authority of the U.S.;
runs <<WWVB>>. Responsible for keeping U.S. civil time
coordinated with UTC. Civil <<NIST>> and military <<USNO>>
time agree to within nanoseconds.
......@@ -187,7 +187,7 @@
[[NTP-classic]] NTP Classic::
The original reference implementation of NTP by Dave Mills, later
maintained by the Network Time Foundation. It is available at
http://www.ntp.org/ . NTPsec forked from it on June 6th, 2015.
http://www.ntp.org . NTPsec forked from it on June 6th, 2015.
[[nonce]] nonce::
An arbitrary number that may only be used once. A random or
......@@ -229,10 +229,16 @@
[[pool]] pool::
In an NTP context, "the pool" is usually the
http://www.pool.ntp.org/en/[NTP Pool Project], a collection of
thousands of NTP servers accessible through DNS servers that hand
out "nearby" server addresses from the pool. These servers are
usually run by volunteers, and available via well-known DNS names.
https://www.ntppool.org/en[NTP Pool Project], a collection of
thousands of NTP servers around the world that you can use to keep
time. The DNS names are designed to keep the timeservers you select
relatively "close" to you on the internet, with varying degrees of
specificity, e.g. using north-america.pool.ntp.org may connect you
to timeservers from Canada to Panama, while us.pool.ntp.org is more
likely to connect you to timeservers within the continental U.S..
These pool timeservers are usually run by volunteers. See
the https://docs.ntpsec.org/latest/quick.html#pool[Quick Start for
Client Configurations] for a more in-depth discussion of pools.
[[proventic]] proventic:: <<Mills-speak>> for "the transitive
completion of the authentication relationship", defined in RFC 5906.
......@@ -247,14 +253,13 @@
[[stratum]] stratum::
A "stratum" is a layer in the hierarchy of time servers. A
<<refclock>> is considered stratum 0; a computer directly attached to
<<refclock>> is stratum 0; a computer directly attached to
a refclock is stratum 1; and a client served by a stratum N is
stratum N+1. Often capitalized, especially when referring to all
members of a stratum. While strata up to 15 are defined, it is
unusual to see a public timeserver with stratum greater than 3,
and thus almost all NTP clients are at Stratum 4 or lower.
Notice that a 'lower' stratum is closer to the reference clock than
a 'higher'.
members of a stratum. The larger the number, the further away from
the source clock, thus the less accurate. Stratum 16 is the maximum, and
indicates a device that is unreachable and unsynchronized. The majority
of public timeservers are Stratum 1 and Stratum 2.
[[time-radio]] time radio::
A radio receiver specialized for picking up accurate time reference
......@@ -275,7 +280,7 @@
the server itself than it is of favorable network topology.
[[USNO]] USNO::
http://www.usno.navy.mil/USNO[The United States Naval Observatory],
https://www.usno.navy.mil/USNO[The United States Naval Observatory],
one of the two U.S. national time authorities and the source of the
U.S. military time reference, now delivered primarily by GPS
signals. U.S. civil <<NIST>> and military <<USNO>> time agree to
......
......@@ -17,6 +17,7 @@ include::includes/hand.txt[]
* link:#introduction[Introduction]
* link:#wireshark[Wireshark]
* link:#nagios[Nagios]
* link:#netdata[Netdata]
'''''
......@@ -42,6 +43,13 @@ The https://www.nagios.org/[Nagios] monitoring suite has native
support for querying NTP servers. The 'check_ntp_peer' and
'check_ntp_time' programs may be of particular interest.
[[netdata]]
== Netdata ==
The https://github.com/firehol/netdata/wiki[Netdata] monitoring
solution has native support for realtime monitoring of ntpd,
among a vast number of other system metrics.
'''''
include::includes/footer.txt[]
......@@ -67,24 +67,24 @@ driver, and may be added to other drivers in future. Alternatively,
the PPS driver described on the link:driver_pps.html[PPS Clock
Discipline] page can be used. It operates in conjunction with another
source that provides seconds numbering. The selected source is
designate a prefer peer, as using the +prefer+ option, as described on
designated as a 'prefer peer' using the +prefer+ option, as described on
the link:prefer.html[Mitigation Rules and the +prefer+ Keyword]
page. The prefer peer is ordinarily the radio clock that provides the
PPS signal, but in principle another radio clock or even a remote
Internet server could be designated preferred Note that the +pps+
Internet server could be designated preferred. Note that the +pps+
configuration command has been obsoleted by this driver.
[[use]]
== Using the Pulse-per-Second (PPS) Signal ==
The PPS signal can be used in either of two ways, one using the NTP
grooming and mitigation algorithms and the other using the kernel PPS
The PPS signal can be used in three ways: using the NTP
grooming and mitigation algorithms, or using the kernel PPS
signal support described in the link:kern.html[Kernel Model for
Precision Timekeeping] page. The presence of kernel support is
automatically detected during the NTP build process and supporting code
automatically compiled. In either case, the PPS signal must be present
and within nominal jitter and wander tolerances. In addition, the prefer
peer must be a truechimer; that is, survive the sanity checks and
Precision Timekeeping] page, or via the shared-memory interface. The presence
of kernel support is automatically detected during the NTP build process and
supporting code automatically compiled. Regardles of mechanism, the PPS signal
must be present and within nominal jitter and wander tolerances. Additionally,
the prefer peer must be a truechimer; that is, survive the sanity checks and
intersection algorithm. Finally, the offset of the system clock relative
to the prefer peer must be within ±0.5 s. The kernel maintains a
watchdog timer for the PPS signal; if the signal has not been heard or
......@@ -92,11 +92,12 @@ is out of tolerance for more than some interval, currently two minutes,
the kernel discipline is disabled and operation continues as if it were
not present.
An option flag in the driver determines whether the NTP algorithms or
kernel support is enabled (if available). For historical reasons, the
NTP algorithms are selected by default, since performance is
generally better using older, slower systems. However, performance is
generally better with kernel support using newer, faster systems.
An option flag in the driver determines whether the NTP algorithms, the
kernel support, or the shared-memory interface is enabled (depending upon
availability). For historical reasons, the NTP algorithms are selected by
default, since performance is generally better when using older, slower
systems. However, performance is generally better with kernel support or
shared-memory support when using newer, faster systems.
'''''
......
......@@ -51,7 +51,7 @@ address-allocation time to use the NTP servers provided by DHCP.
NTPsec, unlike legacy versions, can also be configured using an
Apache-style directory /etc/ntp.d of configuration-file segments.
This is intended to make like easier for software configurators, which
This is intended to make life easier for software configurators, which
can write independent segments rather than having to do the kind of
edit-in-place on a flat ntp.conf that comes naturally to a human.
......@@ -127,8 +127,8 @@ server 2.ubuntu.pool.ntp.org
server 3.ubuntu.pool.ntp.org
------------------------------------------------------------------
Multiple declarations of individual pool servers are not the best you can
do; they're a workaround for a historical bug in NTP Classic. It's
Multiple declarations of individual pool servers is not the best
method; they're a workaround for a historical bug in NTP Classic. It's
better to say
------------------------------------------------------------------
......@@ -227,7 +227,7 @@ accurate time, provided it has link:ntpspeak.html[PPS] capability.
want check servers from the pool.)
The easiest way to arrange this is by installing
http://catb.org/gpsd/[GPSD] to watch the GPS, and configuring your
http://catb.org/gpsd[GPSD] to watch the GPS, and configuring your
+ntpd+ to accept time from it. It is also possible to do this with
native +ntpd+ drivers (nmea, trimble, oncore), though these are less
flexible and a bit more difficult to configure.
......
......@@ -22,26 +22,26 @@ lifetime of the universe (or whatever portion of it concerns you).
On real-world hardware you will seldom be that lucky.
This page discusses calendar cycles related to NTP, the ways they
interact, the consequences of rollover, and common workarounds for
interact, the consequences of rollover and common workarounds for
rollover problems.
[[terminology]]
== Terminology ==
Every calendar cycle has at least three basic properties: a start date
(usually referred to a solar astronomical date in the Gregorian
(usually referenced to a solar astronomical date in the Gregorian
calendar), a unit (such as seconds) and a rollover time or cycle
length in that unit. It also matters what the calendar does about
leap seconds.
As an important example, the basic time representation used on
computers running Unix has a start date of 1970-01-01T00:00:00
(midnight of Janary 1st 1970), a unit of seconds, and a rollover time
(midnight of January 1st 1970), a unit of seconds and a rollover time
of either 2^31^ seconds or 2^63^ seconds, depending on the word size
of the hardware. Negative times represent seconds before the start
date.
The start date is often called the "epoch", and a rollover period may
The start date is often called the "epoch" and a rollover period may
be called an "era". Beware that eras are often numbered zero-origin;
it is likely that Unix software will refer to dates immediately before
the 2038 rollover as "era 0", not "era 1".
......@@ -65,7 +65,7 @@ are so often used as primary time sources).
A well-known historical rollover problem was "Y2K", which derived from
the use of two-digit decimal year counters in mainframe software
(written when storage was so extensive that longer counters would have
(written when storage was so limited that longer counters would have
been dramatically more expensive). Expensive preparation and
mitigation work prevented any major disasters in the year 2000, but
this was in part because there were many fewer vulnerable systems than
......@@ -91,7 +91,7 @@ such as Spectracom's "Type 2".
There is an internal workaround to deal with two-digit dates in
{ntpdman}, but it relies on the system clock being at least roughly
correct - it won't work (for example) at boot time if the clock
has been trashed or zeroed due to a failed battery backup, and
has been trashed or zeroed due to a failed battery backup and
you have no remote check peers yet.
Warnings have been attached to the documentation of NTP clock drivers
......@@ -118,7 +118,7 @@ The possibility of stutter or skip also means that in order to compute
elapsed time in seconds between two Unix times, you need to know
the leap-second offset at each time. It is not guaranteed that
these offsets are the same if the interval crosses midnight at the
end of any calendar month. To date in 2017, IERS (the International
end of any calendar month. To date in 2018, IERS (the International
Earth Rotation service) has performed all corrections just after
midnight of June 31 and December 31 respectively.
......@@ -183,8 +183,8 @@ to compose this with message data to report time at subsecond
precision. Many, however, do not, and those that do are often
inaccurate; consumer-grade hardware often has jitter of over a tenth
of a second (100ms). On the other hand, carefully designed GPSes
easily deliver 1ms accuracy, and some do 20 times better than that. A
more detailed discussion of accuracy budgets see the
easily deliver 1ms accuracy, and some do 1000 times better than that. For
a more detailed discussion of accuracy budgets see the
http://www.catb.org/gpsd/time-service-intro.html[Introduction to Time
Service].
......@@ -212,11 +212,11 @@ but rather the behavior near GPS and century rollovers.
To yield a UTC date, the weeks+second information from the GPS satellites
has to be used as an offset to a base date.
The most naive way to do this would to simply use the zero date of the
The most naive way to do this would be to simply use the zero date of the
current GPS era (1024-week cycle) as the base. Some very early GPS
equipment seems to have worked this way, but it has the drawback that
the device time-warps at the next GPS era rollover - which, if your
device first ship is only a few years before that rollover, is a
device first shipped only a few years before that rollover - is a
serious drawback.
There is a relatively simple way to extend the useful life of a GPS
......@@ -224,7 +224,7 @@ used as a clock. That is to choose a pivot date in GPS weeks. When
your device reports a week number *before* the pivot, you assume that
a GPS rollover has occurred and add 1024 weeks to the base date.
This technique will postpones time-warping to a full 1024 weeks after
This technique will postpone time-warping to a full 1024 weeks after
the pivot date - which the vendor typically makes the release date
of the device firmware. But it won't do any better than that; without the
ability to change the base date, the device will ship incorrect
......@@ -233,7 +233,7 @@ have that ability; most do not.
This is where careless, low-budget design begins to matter. GPS vendors
do not document even the fact that they use base or pivot dates, let
alone what the base and pivot dates for their devices are. As of 2017,
alone what the base and pivot dates for their devices are. As of 2018,
NTP's developers do not know of any devices for which you can even
query these parameters, let alone set them. The best you can generally
do (and on only some devices) is get the firmware release date; from this,
......@@ -250,7 +250,7 @@ manager daemon that shares some developers with NTPsec, works around a
lot of the general messiness, but can't solve this problem
because the device capabilities to address it are simply absent.
Finally, when you buy a GPS you do not know - and often will not be
Finally, when you buy a GPS device, you do not know - and often will not be
able to discover - how far in the past its hidden pivot date is. This
means that time service operators using a GPS as a local Stratum 0
need to be aware of the possibility that their device could roll over
......@@ -274,9 +274,9 @@ For purposes of this discussion, a 'resolved' timestamp is one that
has been mapped from a 32-bit seconds offset in some era to a full
64-bit timestamp implicitly based in some known era.
When {ntpdman} receives a unresolved timestamp from an upstream server
When {ntpdman} receives an unresolved timestamp from an upstream server,
that timestamp could be based in any era prior to the current
wall-clock date - but, by definition, we may not know the wall-clock
wall-clock date - but by definition we may not know the wall-clock
date with confidence yet (not having achieved sync).
To resolve this ambiguity, NTP also uses an internal pivot date. It
......@@ -289,7 +289,7 @@ is within a half-cycle of a rollover time resolve to either the
previous or the next era.
An {ntpdman} instance's pivot date will be the date it was compiled
and built.
and built.
It is fairly easy to see that this guarantees correct resolution if the
pivot dates of the communicating ntpds are within a half-cycle
......
......@@ -15,7 +15,7 @@
*
* fmt is the location of the format string parameter.
* args is the location of the first argument (or 0 for no argument checking).
*
*
* Note:
* The first parameter is 1, not 0.
*/
......