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:
A sync instance in the SLAVE state is considered before another in the LISTENING state.
A sync instance having no PTP alarms present is considered before others where alarms are active.
The value of the
priorityconfiguration 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.
Locked clocks are considered ahead those which are in holdover or are free-running.
This is the sum of:
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
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.