SLES 15 SP2 | System Analysis and Tuning Guide | Precision Time Protocol
PTP requires that the used kernel network driver supports either software or hardware time stamping. Moreover, the NIC must support time stamping in the physical hardware. You can verify the driver and NIC time stamping capabilities with ethtool :
ptp4l
uses hardware time stamping by default. As
root
, you need to specify the network interface capable of hardware
time stamping with the -i
option. The -m
tells ptp4l
to print its output to the standard output
instead of the system’s logging facility:
>
sudo
ptp4l -m -i eth0 selected eth0 as PTP clock port 1: INITIALIZING to LISTENING on INITIALIZE port 0: INITIALIZING to LISTENING on INITIALIZE port 1: new foreign master 00a152.fffe.0b334d-1 selected best master clock 00a152.fffe.0b334d port 1: LISTENING to UNCALIBRATED on RS_SLAVE master offset -25937 s0 freq +0 path delay 12340 master offset -27887 s0 freq +0 path delay 14232 master offset -38802 s0 freq +0 path delay 13847 master offset -36205 s1 freq +0 path delay 10623 master offset -6975 s2 freq -30575 path delay 10286 port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED master offset -4284 s2 freq -30135 path delay 9892
The master offset
value represents the measured offset
from the master (in nanoseconds).
The s0
, s1
, s2
indicators show the different states of the clock servo:
s0
is unlocked, s1
is clock step, and
s2
is locked. If the servo is in the locked state
(s2
), the clock will not be stepped (only slowly
adjusted) if the pi_offset_const
option is set to a
negative value in the configuration file (see man 8
for more information).
ptp4l
The freq
value represents the frequency adjustment of
the clock (in parts per billion, ppb).
The path delay
value represents the estimated delay of
the synchronization messages sent from the master (in nanoseconds).
Port 0 is a Unix domain socket used for local PTP management. Port 1 is the
eth0
interface.
INITIALIZING
, LISTENING
,
UNCALIBRATED
and SLAVE
are examples
of port states which change on INITIALIZE
,
RS_SLAVE
, and MASTER_CLOCK_SELECTED
events. When the port state changes from UNCALIBRATED
to
SLAVE
, the computer has successfully synchronized with a
PTP master clock.
You can enable software time stamping with the -S
option.
>
sudo
ptp4l -m -S -i eth3
You can also run ptp4l
as a service:
>
sudo
systemctl start ptp4l
In this case, ptp4l
reads its options from the
/etc/sysconfig/ptp4l
file. By default, this file tells
ptp4l
to read the configuration options from
/etc/ptp4l.conf
. For more information on
ptp4l
options and the configuration file settings, see
man 8 ptp4l
.
To enable the ptp4l
service permanently, run the
following:
>
sudo
systemctl enable ptp4l
To disable it, run
>
sudo
systemctl disable ptp4l