[ntp:questions] NTP Hardware Support

Harlan Stenn stenn at ntp.org
Mon Jun 22 18:13:20 UTC 2015

David Garijo writes:
> Hello,
> I've been thinking of the possibility of adding hardware support for
> NTP so that it can timestamp the packets sent and received more
> acurately.
> An example of this would be to overwrite the timestamp of the packets
> (by hardware) right before sending/receiving them with the actual time
> of departure/arrival if a "hardware support" option is enabled (like
> some kind of timestamp unit).
> It sounds as if I would need to modify the project heavily, so I
> suppose the best and most realistic approach would be to add a new
> option to the (Linux) kernel instead of rewriting the ntp programs
> offered.
> The code for the NTP daemon (ntpd) is quite complex, so I'm not quite
> sure how nor when the packets are sent/received/timestamped. On the
> other hand, as far as I've noticed, sntp uses libevent and
> recvfrom/sendto to handl e the packets, so I tend to think that maybe
> I should start by taking a look at sys/socket.h instead of worrying
> about anything ntp related. Any suggestions? Do you know of an ideal
> file/function that I should edit?

Changing the timestamps as the packet leaves is not a good general
solution, as there can be checksums involved.

NTP already has some hardware timestamping support in it.

I think the better approach is to track the actual hardware timestamps
and use "interleave" mode.

Is this a project you are doing "for fun"?


More information about the questions mailing list