One Study on IEEE1588 clock synchronization algorithm based on Kalman filter

Kewang Zheng, Lei ZhangJournal of Physics Conference Series 2021

Abstract

Clock synchronization is a major indicator of the distributed network test and control system. The precise time synchronization is also one of the core technologies of the network communication of test and control system. The paper illustrates the fundamental principle for clock synchronization under IEEE1588 protocol and concludes that its synchronized accuracy is influenced by the accuracy of time stamp and transmission delay jitter through analysis. An autoregressive clock drift model has been put forward in the paper in an effort to improve the time synchronization accuracy. It makes use of the Kalman filter to estimate the deviation and drift of the master and slave clock so as to offset it. The results of simulation indicate that the method can effectively ease the impact on time synchronization for time stamp and improve its accuracy of the test and control system.

Introduction

In distributed network test and control systems, precise time synchronization across all terminals is a strict prerequisite for cooperative data processing. While the Network Time Protocol (NTP) is widely used, its millisecond-level accuracy is often insufficient for modern industrial control requirements. The IEEE1588 Precision Time Protocol (PTP) was introduced to provide sub-microsecond accuracy, but achieving this typically requires specialized hardware for physical-layer timestamping. In standard Ethernet environments, software-level timestamping and network jitter degrade PTP performance. This paper proposes an algorithmic improvement using a Kalman filter to mitigate these effects without requiring hardware upgrades.

Methodology

The proposed approach enhances the standard PTP mechanism by incorporating state-space modeling and Kalman filtering.

Standard PTP Baseline

Traditional IEEE1588 PTP relies on a four-timestamp message exchange between a master and slave node. As shown in Figure 1, timestamps $t_1, t_2, t_3,$ and $t_4$ are collected during the exchange of Sync, Follow_up, Delay_req, and Delay_rsp messages. These are used to calculate the clock offset and network delay, assuming symmetric transmission paths.

IEEE1588 PTP message exchange mechanism.

Kalman Filter Enhancement

To improve accuracy, the authors model the local clock's physical behavior more precisely. Crystal oscillators naturally drift due to environmental factors. The authors define a state vector comprising clock deviation (immediate offset) and clock skew (drift rate), modeling the latter as an autoregressive (AR) process.

The Kalman filter is then applied to treat standard PTP offset calculations as noisy observations. By balancing process noise (clock instability) against observation noise (timestamp errors and jitter), the filter iteratively estimates the true state of the slave clock relative to the master.

Results and Discussion

The algorithm was validated through MATLAB simulations, comparing the enhanced Kalman filter approach against the traditional IEEE1588 calculation. The simulation parameters included a time synchronization period ($T$) of 0.1s and varying levels of observation noise to simulate different network conditions.

Comparison of clock deviation estimation error with and without Kalman filtering.

As illustrated in Figure 2, the Kalman filter-enhanced algorithm significantly outperforms the traditional method as observation noise increases. While both methods perform similarly at extremely low noise levels ($10^{-8}$), the error in the traditional method grows rapidly. In contrast, the Kalman filter acts as a mathematical "shock absorber," maintaining significantly lower mean error for both clock deviation and skew even under high network jitter. This demonstrates that algorithmic compensation can effectively substitute for expensive hardware timestamping in standard network environments.

Conclusion

This study demonstrates that an autoregressive clock model combined with Kalman filtering can substantially improve the accuracy of IEEE1588 PTP in distributed systems. By mathematically compensating for software-level timestamping inaccuracies and network jitter, the proposed method achieves high-precision synchronization on standard hardware. Future work should involve empirical validation on physical network testbeds to confirm these simulation results under real-world, non-Gaussian noise conditions.

Summary updated

BibTeX
@article{zheng2021one,
  author = {Kewang Zheng and Lei Zhang},
  title = {{One Study on IEEE1588 clock synchronization algorithm based on Kalman filter}},
  journal = {Journal of Physics Conference Series},
  year = {2021},
  doi = {10.1088/1742-6596/1738/1/012059},
}
Figure