By default, sfptpd
automatically selects the time source to use. The set of all configured sync instances represents a list of candidates available for selection.
A sync instance in the SLAVE state is considered before another instance in the LISTENING state.
A candidate is automatically selected using the following criteria, in descending order of priority:
-
State
A sync instance in the SLAVE state is considered before another in the LISTENING state.
-
No Alarms
A sync instance having no PTP alarms present is considered before others where alarms are active.
-
Instance priority
The value of the
priority
configuration option for the instance. Smaller values have higher priority. By default, all instances have priority 128, and so this criterion is ignored.Note: This is not related to the IEEE-1588 specification priority 1 and priority 2 properties of a PTP master clock. -
Clock class
Locked clocks are considered ahead those which are in holdover or are free-running.
-
Accuracy
This is the sum of:
-
Clock accuracy
Estimate of error between clock and primary reference source.
-
Sync module accuracy
Estimate of error implied by the synchronization mechanism that would be used to sync to the remote clock, such as NTP with software timestamping vs. PTP with hardware timestamping.
-
Clock accuracy
-
Allan variance
Estimate of stability of clock.
-
Identity of clock
If all other comparisons fail, the identity of the clock is used as a tie-breaker.
The source of the clock class and accuracy varies:
- For the PTP sync module, the clock class and clock accuracy are values conveyed in PTP messages from the upstream PTP master clock.
- For the PPS sync module, the clock class and clock accuracy have default values but can also be set by the user.
- For the NTP sync module, the clock class and clock accuracy come from the remote clock.
- For the Freerun sync module, the clock class and clock accuracy use default values.