Request for code & logic review

Daniel Franke dfoxfranke at
Fri Nov 25 20:01:06 UTC 2016

On 11/25/16, Achim Gratz <Stromeko at> wrote:
> Daniel Franke writes:
>> The reference timestamp isn't really used for anything
> The server is supposed to return this value unchanged, so one of the BSD
> implementations of the ntp client uses this field to send random data in
> order to weed out replay and fake packets.  Checking for out-of-order
> replies may actually have been the original intention anyway.

You have a couple things mixed up here. The server copies the client's
*transmit* timestamp unchanged into the *origin* timestamp in its
response. All implementations, not just OpenNTPD, check for this
match. However, OpenNTPD randomizes the entire field rather than just
the low bits, a practice that I shortly plan to duplicate in NTPsec
and advocate in

The reference timestamp is supposed to be copied unchanged from
*upstream* in the hierarchy. So whatever reference a stratum 2
server's system peer is reporting to it, it will in turn report to its
stratum 3 clients. Stratum 1 servers will set the reference timestamp
to whatever time was mostly recently given to them by their reference

But despite this information being maintained, it isn't used for
anything except perhaps diagnostics. This may not always have been the
case; I suspect that in some point in the past the reference timestamp
was important in server selection, but I haven't verified this.

More information about the devel mailing list