Understanding the sfptpd Startup Sequence

Enhanced PTP User Guide (UG1602)

Document ID
Release Date
1.0 English

When the sfptpd daemon is started it will generate several lines of output. A typical startup sequence is shown below. The PTP slave that graduates from startup to a listening state and finally to a slave state. Line numbers have been added.

[slave-server]# sfptpd -i enp1s0f0 -f config/sfptpd.conf
1   2016-12-05 10:26:16.158651: info: Solarflare Enhanced PTP Daemon,
2   2016-12-05 10:26:16.232403: info: no clock frequency correction file
3   2016-12-05 10:26:16.232669: info: ptp ptp1: creating sync-instanc
4   2016-12-05 10:26:16.235757: info: ptp: clock is phc0(enp1s0f0/
5   2016-12-05 10:26:16.236050: info: interface enp1s0f0: SO_TIMESTAMPING
6   2016-12-05 10:26:16.236281: info: using SO_TIMESTAMPING hardware
7   2016-12-05 10:26:16.336741: notice: ptp ptp1: Now in state:
8   2016-12-05 10:26:16.337149: info: selected sync instance ptp1
9   2016-12-05 10:26:18.837132: info: new best master selected:
10  2016-12-05 10:26:18.837146: notice: now in state: PTP_SLAVE,
    best master: 00a0:69ff:fe0c:2eb5(unknown)/1
11  2016-12-05 10:26:19.775070: info: received first Sync from Master
12  2016-12-05 10:26:20.774850: notice: slewing the clock with the maximum
    frequency adjustment
13  2016-12-05 10:26:20.774874: info: received first DelayResp from Master

Each line is described in the following table.

Table 1. sfptpd Startup Output
Line # Description
1 Version of sfptpd running.

A frequency correction file holds the frequency correction value (PPB) that is currently being used to discipline a clock:

  • On initial startup frequency correction files do not exist.
  • Once created by sfptpd for each clock, they are updated every 60 seconds.
  • Files are preserved over server reboot and sfptpd restart.
3 Create an instance of a PTP sync module named ptp1.

The Local Reference Clock:

  • On an X3 series, X2 series, 8000 series or 7000 series adapter this identifies the PTP hardware clock in the form: phc0(ethX/ethY) where ethX is the active clock interface and ethY the second adapter clock interface on this adapter. Dual-port adapters share the same clock.
5-6 If hardware timestamps cannot be initialized sfptpd will revert to software timestamping using the system clock.

The slave remains in a LISTENING state listening for Announce messages from any master clock on the network. The Best Master Clock algorithm is used to determine the most accurate master clock to which all slaves will synchronize. Any other master clock on the same network will go into passive mode and not send PTP messages once the best master has been selected. The Best Master Clock algorithm is implemented in such a way that all slaves will arrive at the same conclusion and select the same master clock.

Before the adapter clock can begin synchronization with an upstream PTP master clock, the slave must receive an Announce message followed by Sync and Follow_up messages.

8 The slave selects an initial sync module instance to use, as described in Sync Module Selection.

The slave moves to a SLAVE state once it has received an Announce message, and has selected the best master clock.

The best master is identified by the following:

  • the clock identity (a UUID derived from the MAC address)
  • the clock host
  • a forward slash ‘/’
  • the port number (in hex) of the upstream master (usually 1, because most Grandmasters have only one PTP port).

The slave accepts PTP Sync messages from the master and starts to synchronize the adapter clock(s) with the master clock.

As the slave begins to synchronize the adapter clock with the external master clock, the offset (master→slave), one-way-delay (slave→master), and frequency correction values are output. See Understanding sfptpd Output below.