English Ukrainian
~]#{nbsp}ptp4l -i em3 -m
selected em3 as PTP clock
port 1: INITIALIZING to LISTENING on INITIALIZE
port 0: INITIALIZING to LISTENING on INITIALIZE
port 1: new foreign master 00a069.fffe.0b552d-1
selected best master clock 00a069.fffe.0b552d
port 1: LISTENING to UNCALIBRATED on RS_SLAVE
master offset -23947 s0 freq +0 path delay 11350
master offset -28867 s0 freq +0 path delay 11236
master offset -32801 s0 freq +0 path delay 10841
master offset -37203 s1 freq +0 path delay 10583
master offset -7275 s2 freq -30575 path delay 10583
port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED
master offset -4552 s2 freq -30035 path delay 10385
The master offset value is the measured offset from the master in nanoseconds. The `s0`, `s1`, `s2` strings indicate the different clock servo states: `s0` is unlocked, `s1` is clock step and `s2` is locked. Once the servo is in the locked state (`s2`), the clock will not be stepped (only slowly adjusted) unless the [option]`pi_offset_const` option is set to a positive value in the configuration file (described in the `ptp4l(8)` man page). The `adj` value is the frequency adjustment of the clock in parts per billion (ppb). The path delay value is 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 `em3` interface (based on the example above.) INITIALIZING, LISTENING, UNCALIBRATED and SLAVE are some of possible port states which change on the INITIALIZE, RS_SLAVE, MASTER_CLOCK_SELECTED events. In the last state change message, the port state changed from UNCALIBRATED to SLAVE indicating successful synchronization with a `PTP` master clock.
The [application]*ptp4l* program can also be started as a service by running:
When running as a service, options are specified in the `/etc/sysconfig/ptp4l` file. More information on the different [application]*ptp4l* options and the configuration file settings can be found in the `ptp4l(8)` man page.
By default, messages are sent to `/var/log/messages`. However, specifying the [option]`-m` option enables logging to standard output which can be useful for debugging purposes.
To enable software time stamping, the [option]`-S` option needs to be used as follows:
~]#{nbsp}ptp4l -i em3 -m -S
Selecting a Delay Measurement Mechanism
There are two different delay measurement mechanisms and they can be selected by means of an option added to the [command]#ptp4l# command as follows:
[option]`-P`
The [option]`-P` selects the _peer-to-peer_ (*P2P*) delay measurement mechanism.
The *P2P* mechanism is preferred as it reacts to changes in the network topology faster, and may be more accurate in measuring the delay, than other mechanisms. The *P2P* mechanism can only be used in topologies where each port exchanges *PTP* messages with at most one other *P2P* port. It must be supported and used by all hardware, including transparent clocks, on the communication path.
[option]`-E`
The [option]`-E` selects the _end-to-end_ (*E2E*) delay measurement mechanism. This is the default.
The *E2E* mechanism is also referred to as the delay "request-response" mechanism.
[option]`-A`
The [option]`-A` enables automatic selection of the delay measurement mechanism.
The automatic option starts [application]*ptp4l* in *E2E* mode. It will change to *P2P* mode if a peer delay request is received.
All clocks on a single `PTP` communication path must use the same mechanism to measure the delay. Warnings will be printed in the following circumstances:
When a peer delay request is received on a port using the *E2E* mechanism.