Re: [chrony-users] Relationship Between Chrony and NIC Clocks |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-users Archives
]
- To: chrony-users@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [chrony-users] Relationship Between Chrony and NIC Clocks
- From: Miroslav Lichvar <mlichvar@xxxxxxxxxx>
- Date: Wed, 21 Oct 2020 10:14:11 +0200
- Authentication-results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mlichvar@xxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603268057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=flQd0Yia2XwE7OWgTQHh6TSfYCyZ21O3vigivHf5ae4=; b=RN7kO1mL0FThbrMu/aOYd+Yl0FsaMsLlK0d9w0RYjKhedvqkjTDqayIOXLsYUlsD/cBJ8w RHWM5OsIkLdknPAXWML54xyLlVIg8ccJI5FRtIiOhww4iw3USkQNIZjZIfCxJe4hhGiNkG DqEda0yTt27zrFokEraRM3V44rZ61bA=
On Tue, Oct 20, 2020 at 08:31:36PM -0500, Scott Stephens wrote:
> I'm trying to understand the use of hardware timestamps in Chrony and I
> feel like I'm missing something. I understand how user space timestamps and
> kernel software timestamps will have errors relative to the time the packet
> leaves the NIC due to thread scheduling, interrupt coalescing, and whatnot,
> and why it would be desirable to avoid those errors. But it seems to me
> that when you hardware timestamp a packet, that timestamp will reflect the
> state of the NIC's clock, not the state of the system clock, which would
> seem to be a problem if your goal is to synchronize the system clock.
chronyd tracks the time and frequency offset of the hardware clocks
relative to the system clock, so it can convert timestamps between
them without having to synchronize one clock to another.
> With PTP, you control the relationship explicitly, with ptp4l syncing the
> NIC clock to the PTP master clock, and phc2sys syncing the system clock to
> the NIC clock.
With PTP there is only one time source active at a time, so that's
easy. With NTP, there can be multiple time sources, on the same
interface or different interfaces, which can have different hardware
clocks, and they can all be combined for synchronization of the system
clock. That requires a different approach.
> I haven't found any mention of something similar in the Chrony docs, so I'm
> wondering what if anything Chrony does to NIC clocks.
Nothing. They should be free running. This has some advantages and
disadvantages.
One issue is that if you have a stratum-1 server using PPS input on a
NIC and that NIC is serving NTP to clients, the conversion between NIC
time and system time is unnecessary. It just adds jitter. There was a
patch posted on this list, or the devel list, that can configure
chronyd to use the NIC clock as the main clock, which basically makes
it work like phc2sys and ptp4l, but it's a hack. I'd like to implement
it properly, but I'm not sure how exactly yet.
--
Miroslav Lichvar
--
To unsubscribe email chrony-users-request@xxxxxxxxxxxxxxxxxxxx
with "unsubscribe" in the subject.
For help email chrony-users-request@xxxxxxxxxxxxxxxxxxxx
with "help" in the subject.
Trouble? Email listmaster@xxxxxxxxxxxxxxxxxxxx.