How to Check if Dual-Sensor PTP Synchronization is Normal
Leave a message
In order to determine whether dual-sensor PTP synchronization is normal, it is essential to confirm that the master-slave status is as expected and that the time offset is stable within the microsecond range. Here are concrete, useful methods for verifying:
I. Synchronization offset viewing in real time (the most intuitive method)
Examine the logs after running the PTP service on the slave clock sensor. When evaluating synchronization precision, this is the gold standard.
Put the command into action:
Bash sudo ptp4l -i eth0 -m -q
Note: -m implies displaying extensive logs, -q eliminates redundant information, and eth0 must be substituted with the real network interface name linked to the PTP network.
Criteria for Judgment
Examine the output log's offset field:
Normal Synchronization: There is little variation in the offset value, which is stable within ±1~10 microseconds (µs).
Synchronization Anomaly: Offset values vary significantly (e.g., abruptly shifting from +50µs to -200µs) or are in the millisecond (ms) range.
Unsynchronized: The best master clock cannot be chosen, or the logs frequently show FAULTY statuses.
II. Confirm the Master-Slave Role Status
To prevent "dual-master" disputes or frequent switching, make sure the two sensors have properly established a master-slave relationship.
View the results of the BMCA election
Look for "selected best master clock" in the logs.
Normal: The slave clock log indicates that it has reached the SLAVE state after identifying the master clock.
Abnormal: A communication breakdown or improper priority arrangement is indicated by both sensors displaying themselves as MASTER.
Verify the Priority Settings
Verify that the slave sensor's priority1 value is higher than the master sensor's (e.g., slave set to 130, master set to 128) to make sure the role is fixed and doesn't change at random because of network jitter.
III. Verify the Effectiveness of the Hardware Timestamp
Inadequate accuracy is typically caused by hardware timestamps not being enabled if the offset is in the millisecond range.
Put the command into action:
TheBash ethtool -T eth0
Judgment Criteria: `SOF_TIMESTAMPING_TX_HARDWARE` and `SOF_TIMESTAMPING_RX_HARDWARE` must be present in the output.
The presence of merely `SOFTWARE` implies that software timestamps are being used, and the accuracy is insufficient for high-precision dual-sensor comparison. It is necessary to verify driver or hardware support.
IV. Monitoring Long-Term Stability
Long-term stability is not ensured by short-term normalcy. It is advised to do brief stress tests.
Rate of Record Drift
To synchronize the PTP hardware clock with the system clock and track the maximum offset over a 24-hour period, run `phc2sys`.
Normal: There is no cumulative deviation and long-term drift is regulated within one microsecond.
Abnormal: The offset grows linearly over time, suggesting either uneven network latency or ineffective crystal oscillator frequency adjustment.
Watch for packet loss. Look for peer_delay timeout or sync timeout alerts in the PTP logs. While occasional occurrences are acceptable, frequent occurrences need verifying firewall settings, switch load, or network cable quality (make sure UDP ports 319/320 are open).
V. Typical Troubleshooting Table
The phenomenon
Potential Reason
Suggestion for a Solution
Millisecond offset
Not enabled is the hardware timestamp.
Install the specific driver, check ethtool -T, and turn on hardware timestamp.
Regular rotation between masters and slaves
Priority configurations are comparable or identical.
Increase the slave and master's Priority1 difference (e.g., 128 vs. 130).
Not able to synchronize at all
Firewall blocking or network unavailability
Ping connectivity test, turn down the firewall, or permit UDP ports 319 and 320.
Significant offset variations
High load or network jitter
To prioritize PTP packets, isolate PTP traffic and activate QoS on the switch.
In order to determine whether dual-sensor PTP synchronization is normal, it is essential to confirm that the master-slave status is as expected and that the time offset is stable within the microsecond range. Here are concrete, useful methods for verifying:
I. Synchronization offset viewing in real time (the most intuitive method)
Examine the logs after running the PTP service on the slave clock sensor. When evaluating synchronization precision, this is the gold standard.
Put the command into action:
Bash sudo ptp4l -i eth0 -m -q
Note: -m implies displaying extensive logs, -q eliminates redundant information, and eth0 must be substituted with the real network interface name linked to the PTP network.
Criteria for Judgment
Examine the output log's offset field:
Normal Synchronization: There is little variation in the offset value, which is stable within ±1~10 microseconds (µs).
Synchronization Anomaly: Offset values vary significantly (e.g., abruptly shifting from +50µs to -200µs) or are in the millisecond (ms) range.
Unsynchronized: The best master clock cannot be chosen, or the logs frequently show FAULTY statuses.
II. Confirm the Master-Slave Role Status
To prevent "dual-master" disputes or frequent switching, make sure the two sensors have properly established a master-slave relationship.
View the results of the BMCA election
Look for "selected best master clock" in the logs.
Normal: The slave clock log indicates that it has reached the SLAVE state after identifying the master clock.
Abnormal: A communication breakdown or improper priority arrangement is indicated by both sensors displaying themselves as MASTER.
Verify the Priority Settings
Verify that the slave sensor's priority1 value is higher than the master sensor's (e.g., slave set to 130, master set to 128) to make sure the role is fixed and doesn't change at random because of network jitter.
III. Verify the Effectiveness of the Hardware Timestamp
Inadequate accuracy is typically caused by hardware timestamps not being enabled if the offset is in the millisecond range.
Put the command into action:
TheBash ethtool -T eth0
Judgment Criteria: `SOF_TIMESTAMPING_TX_HARDWARE` and `SOF_TIMESTAMPING_RX_HARDWARE` must be present in the output.
The presence of merely `SOFTWARE` implies that software timestamps are being used, and the accuracy is insufficient for high-precision dual-sensor comparison. It is necessary to verify driver or hardware support.
IV. Monitoring Long-Term Stability
Long-term stability is not ensured by short-term normalcy. It is advised to do brief stress tests.
Rate of Record Drift
To synchronize the PTP hardware clock with the system clock and track the maximum offset over a 24-hour period, run `phc2sys`.
Normal: There is no cumulative deviation and long-term drift is regulated within one microsecond.
Abnormal: The offset grows linearly over time, suggesting either uneven network latency or ineffective crystal oscillator frequency adjustment.
Watch for packet loss. Look for peer_delay timeout or sync timeout alerts in the PTP logs. While occasional occurrences are acceptable, frequent occurrences need verifying firewall settings, switch load, or network cable quality (make sure UDP ports 319/320 are open).
V. Typical Troubleshooting Table
The phenomenon
Potential Reason
Suggestion for a Solution
Millisecond offset
Not enabled is the hardware timestamp.
Install the specific driver, check ethtool -T, and turn on hardware timestamp.
Regular rotation between masters and slaves
Priority configurations are comparable or identical.
Increase the slave and master's Priority1 difference (e.g., 128 vs. 130).
Not able to synchronize at all
Firewall blocking or network unavailability
Ping connectivity test, turn down the firewall, or permit UDP ports 319 and 320.
Significant offset variations
High load or network jitter
To prioritize PTP packets, isolate PTP traffic and activate QoS on the switch.







