3.2. Enabling hardware timestamping


You can enable the hardware timestamping on one or multiple interfaces by using the hwtimestamp directive in the /etc/chrony.conf file. The directive can either specify a single interface, or a wildcard character can be used to enable hardware timestamping on all interfaces that support it.

Procedure

  1. Edit the /etc/chrony.conf file and make the following changes:

    1. Add the hwtimestamp setting for interfaces which support hardware timestamping. For example:

      hwtimestamp enp1s0
      hwtimestamp eno*

      You can use the * wildcard if no other application, such as ptp4l uses hardware timestamping.

    2. Configure a short client polling interval by appending the minpoll and maxpoll options to the server setting, for example:

      server ntp.example.comlocal minpoll 0 maxpoll 0

      For hardware timestamping, you must configure a shorter polling interval than the default range (64-1024 seconds) to minimize the offset of the system clock.

    3. Enable the NTP interleaved mode by appending the xleave option to the server setting:

      server ntp.example.comlocal minpoll 0 maxpoll 0 xleave

      With this setting, chrony gets the hardware transmit timestamp only after sending a packet. This behavior prevents the serever from saving the timestamp in packets to which it responds. With the xleave option, chrony can receive transmit timestamps that were generated after the transmission.

    4. Optional: Increase the maximum size of memory allocated for logging of client’s access on the server, for example:

      clientloglimit 100000000

      The default server configuration allows a few thousands of clients to use the interleaved mode concurrently. By increasing the value of the clientloglimit setting, you can configure the server for a large number of clients.

  2. Restart the chronyd service:

    # systemctl restart chronyd

Verification

  1. Optional: Verify in the /var/log/messages log file that hardware timesamping is enabled:

    chronyd[4081]: Enabled HW timestamping on enp1s0
    chronyd[4081]: Enabled HW timestamping on eno1
  2. If chronyd is configured as an NTP client or peer, display the transmit and receive timestamping modes and the interleaved mode:

    # chronyc ntpdata
    
    Remote address  : 203.0.113.15 (CB00710F)
    Remote port     : 123
    Local address   : 203.0.113.74 (CB00714A)
    Leap status     : Normal
    Version         : 4
    Mode            : Server
    Stratum         : 1
    Poll interval   : 0 (1 seconds)
    Precision       : -24 (0.000000060 seconds)
    Root delay      : 0.000015 seconds
    Root dispersion : 0.000015 seconds
    Reference ID    : 47505300 (GPS)
    Reference time  : Wed May 03 13:47:45 2017
    Offset          : -0.000000134 seconds
    Peer delay      : 0.000005396 seconds
    Peer dispersion : 0.000002329 seconds
    Response time   : 0.000152073 seconds
    Jitter asymmetry: +0.00
    NTP tests       : 111 111 1111
    Interleaved     : Yes
    Authenticated   : No
    TX timestamping : Hardware
    RX timestamping : Hardware
    Total TX        : 27
    Total RX        : 27
    Total valid RX  : 27
  3. Report the stability of NTP measurements:

    # chronyc sourcestats
    ....
    
    210 Number of sources = 1
    Name/IP Address            NP  NR  Span  Frequency  Freq Skew  Offset  Std Dev
    ntp.local                  12   7    11     +0.000      0.019     +0ns    49ns
    ....

This stability is reported in the Std Dev column. With hardware timestamping enabled, stability of NTP measurements should be in tens or hundreds of nanoseconds, under normal load.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部