[chrony-users] Relation between hwtimestamp and PTP clocks |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-users Archives
]
- To: "chrony-users@xxxxxxxxxxxxxxxxxxxx" <chrony-users@xxxxxxxxxxxxxxxxxxxx>
- Subject: [chrony-users] Relation between hwtimestamp and PTP clocks
- From: Linas Zvirblis <lzv@xxxxxxxxxxxx>
- Date: Fri, 23 Jun 2023 11:11:21 +0000
- Accept-language: da-DK, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=trackman.com; dmarc=pass action=none header.from=trackman.com; dkim=pass header.d=trackman.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QcDg6lMoclwoGpNbumOt/E1V3x76z4aZx6riW53yRqk=; b=N0bgIb9k7nHGFg/0XEejt/pqGe/yY2QJBdbsAibPf/VJRmgM6uqrkENfKC1YDKpt8gBe/zAJ7GHGVQhmKxJGvKUQ+T775HqkPVC8xjMyegpUTWNFduMiBSW1Rty2AXA67++EdY7rKE2VkUdj0JFfhvUsC5+0lD630Btpb9AkitkW+1fZXiIXDSnNbJzkYjXdBuTQvmIwqHf+l/r6kYWY8JIvQPb410EqXp0mOeFdybOM5FcVcvNM1WS3Ht0IeztAmMcZ5exmw5X7+EWVorWIcq5GshmHT1yVtPgGvmM2GoPFmGXRXi3QHY2AahMA/YnKE+oSL+m5Y+rVxWJ9h4kPmw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dNJXJYuwg3hqdi23n22o79Mjn3CuAmSm9bEv4hApqbN8A0jvnUy3841Vi2fmFKqZB0Xcavb2JOUFLPYxJ+MRlpgriXx0jpQsDdrXTkAvTBxgSY0rGyFFgvFN8+vF1+wuAYlBeGy21/hKdXwM/LGbnZ9ofbicW49VC7fQzf4dnctCSBWyRskArMNgHyhUDjm2KodsoRlYb87BlFaQAp0v8iNBhcyPeEd/XZ1skYPDRRmL/bdUEa5dOb2eU8HVHNDaApyPg5GtT8ROGXtAoWD92Mc3vy58qxOfMXvsUtHlVql8H5UeBUA+Q9B+F8BsDmoJfoccFIGBsGt8kKafRqtsCA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=trackman.com;
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trackman.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QcDg6lMoclwoGpNbumOt/E1V3x76z4aZx6riW53yRqk=; b=TfOmXbPEAVqxI9xrv8ukCq853TJVwjlfwkdOWBbMxIK8YOl4iVs3PUqpRChwd6NBNntNOYsKAPEc0ppZNt5cb94mD6aI3iFsxvtf6u0Jn7zfaQMDnYUaXFktPVxmlo2xNYTorPBnu1z/BuUeNun1h599IL2r07LZK228fKRwuQc=
- Thread-index: AQHZpcNw3DKLffCcY0mw/MeIPj5LlA==
- Thread-topic: Relation between hwtimestamp and PTP clocks
Hello everyone,
I am writing because I am having hard time finding any definitive
answer on how to use 'hwtimestamp' with chrony correctly.
The manual for hwtimestamp states the following:
> The network interface controller (NIC) uses its own clock to
> accurately timestamp the actual transmissions and receptions, [...]
> This can significantly improve the accuracy of the timestamps and the
> measured offset, [...] In order to get the best results, both sides
> receiving and sending NTP packets (i.e. server and client, or two
> peers) need to use HW timestamping.
But the PTP Hardware Clock (PHC) is free running, and can be wildly
different between the client and the server.
> When chronyd is running, no other process (e.g. a PTP daemon) should
> be working with the NIC clock.
Does that mean that chrony is adjusting the PHC by itself? Is
'hwtimestamp' for PHC equivalent to 'rtcsync' for RTC? My experience
says no.
Then how can 2 unsynchronized PTP clocks be used for timestamping
between the client and the server?
To make things even more interesting, I have some devices on the
network that only understand PTP, but I only have NTP time source. To
keep the devices in sync, I would let chrony set the system clock, then
use phc2sys to set the PTP clock, and run ptp4l pretending to be the
grandmaster to serve PTP from the same server as NTP. Basically as
described in [1].
My question is, would running with 'hwtimestamp eth0' in chrony and
'phc2sys -O 37 -s CLOCK_REALTIME -c eth0' interfere with each other?
Can I run multiple processes (chrony and ptp4l) using hardware
timestamping on the same network interface, or does one of them have to
use software timestamping?
I may be completely misunderstanding some of the finer points of how
this works, so I can only hope that my questions are clear. Would
really appreciate some guidance here.
Kind regards,
Linas
[1] https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/s0-serving_ntp_time_with_ptp