nav emailalert searchbtn searchbox tablepage yinyongbenwen piczone journalimg journalInfo searchdiv qikanlogo popupnotification paper paperNew
2025, 02, v.39 113-123
基于PTPv2协议的回波模拟器加密时钟同步系统设计
基金项目(Foundation):
邮箱(Email):
DOI: 10.20189/j.cnki.CN/61-1527/E.202502012
摘要:

为满足雷达回波模拟器对时钟同步与同步时间安全性的需求,在现场可编程门阵列(Field Programmable Gate Array, FPGA)上采用精确时间协议(Precision Time Protocol,PTP)与SM4加密算法,实现回波模拟器之间的系统时钟同步,精确时间协议采用PTPv2协议版本实现。在FPGA上设计PTP主时钟与从时钟模块,使回波模拟器在组网时可以通过实际需求由软件配置为PTP主时钟或从时钟;PTP主时钟控制引擎采用超时控制机制,防止PTP主时钟在时钟同步的交互过程中由于延迟请求报文异常,导致状态机卡死;时钟偏移的计算采用归一到纳秒的方式,提高时钟偏移的计算精度;采用SystemVerilog语言设计SM4加密算法的加密模块、解密模块,实现对时间戳信息的加密、解密,解决时间戳信息传输的安全性需求;采用“PTP over UDP over IPv4”方式在传输层对PTP协议报文进行封装,实现PTP报文通过以太网进行接收与发送。将时钟同步系统在AMD XC7K325TFFG676 FPGA芯片上进行设计实现,测试结果表明:该时钟同步系统性能稳定,且在直连情况下同步误差均小于500 ns,满足设计指标要求。

Abstract:

To satisfy the requirements of clock synchronization and synchronization time security for radar echo simulators, a PTP(Precision Time Protocol)and the SM4 encryption algorithm were implemented on a FPGA(Field Programmable Gate Array)to achieve system clock synchronization between echo simulators. The PTPv2 protocol version was adopted for implementation of the PTP. The PTP master clock and slave clock modules were designed on the FPGA, enabling echo simulators to be configured as PTP master clocks or slave clocks according to the actual demands during networking. In the design of the PTP master clock control engine,overtime control was adopted to prevent the PTP master clock from receiving abnormal delay request messages during clock synchronization interaction, which resulted in the freezing of the state machine. Normalization to nanoseconds was used to improve the calculation accuracy of the clock offset. The encryption and decryption modules of the SM4 encryption algorithm were designed using the System Verilog language to encrypt and decrypt the timestamp information, and meet the security requirements of timestamp information transmission. The PTP protocol messages were encapsulated at the transport layer by using the “PTP over UDP over IPv4”method to enable the reception and transmission of PTP messages through Ethernet. Finally, a clock synchronization system was designed and implemented on the AMD XC7K325TFFG676 FPGA chip. The test results show that the clock synchronization system is stable in terms of performance, and the synchronization error was less than 500 ns in the direct connection, meet ing the design specifications.

参考文献

[1]张巍然,侯艳红.自适应卡尔曼滤波的精密时钟同步方法[J].单片机与嵌入式系统应用,2023,23(5):59-64.ZHANG W R, HOU Y H. Precision clock synchronization method based on adaptive Kalman filter[J]. Microcontroller&Embedded System, 2023,23(5):59-64.

[2]孙攀,陈贻骜,李培宜,等.北斗、GPS卫星授时在电力系统时间同步装置中的应用[J].电工技术,2024(15):218-220.SUN P,CHEN Y A,LI P Y,et al.The application of BeiDou and GPS satellite timing in power system time synchronizers[J].Electric Engineering,2024(15):218-220.

[3]于合理,孙晓东,贾赞杰,等.限制环境下的GNSS精密授时方法研究综述[J].海洋测绘,2024, 44(2):46-50.YU H L,SUN X D,JIA Z J,et al.A review of GNSS precision timing method in restricted environments[J]. Hydrographic Surveying and Charting,2024,44(2):46-50.

[4]徐卓汀,商艳娟,王成群.基于FPGA的IEEE 1588时钟同步系统的设计与实现[J].智能计算机与应用,2023,13(5):64-69.XU Z T, SHANG Y J, WANG C Q. Design and implementation of IEEE 1588 protocol based on FPGA[J]. Intelligent Computer and Applications,2023,13(5):64-69.

[5]单飞桥,王照伟,沈跃.基于精确时间协议的工业无线传感器网络时间同步方法[J].计算机应用,2023,43(7):2255-2260.SHAN F Q,WANG Z W,SHEN Y.Time synchronization method based on precision time protocol in industrial wireless sensor networks[J]. Journal of Computer Applications,2023,43(7):2255-2260.

[6]朱炎平,陆俊,徐志强,等.智能变电站IEEE 1588同步时延优化方法[J].电力系统自动化,2018,42(12):148-153.ZHU Y P, LU J, XU Z Q, et al. Optimization method of IEEE 1588 synchronization time delay for smart substation[J]. Automation of Electric Power Systems,2018,42(12):148-153.

[7]冀崇傑,赵刚,王立珂,等.无人战车中时钟同步技术的研究[J].火力与指挥控制,2024,49(4):95-100.JI C J,ZHAO G,WANG L K,et al.Research on clock synchronization technology in unmanned combat vehicles[J].Fire Control&Command Control,2024,49(4):95-100.

[8]景金荣,范正吉,洪应平.基于IEEE 1588精密时钟同步系统的设计[J].电子器件,2022,45(1):27-32.JING J R, FAN Z J, HONG Y P. The design of a precision clock synchronization system based on IEEE 1588[J].Chinese Journal of Electron Devices,2022,45(1):27-32.

[9]赵永成,陈健,张俊杰,等.基于IEEE 1588的多路可调同步时钟板设计与实现[J].工业控制计算机,2024,37(2):4-7.ZHAO Y C,CHEN J,ZHANG J J,et al.High precision adjustable synchronous clock board based on IEEE 1588 protocol[J].Industrial Control Computer,2024,37(2):4-7.

[10]许万,余磊涛,夏瑞东.基于无迹卡尔曼滤波的精密时钟同步算法[J].湖北工业大学学报,2024,39(1):8-11,27.XU W, YU L T, XIA R D. A precision clock synchronization algorithm based on unscented Kalman filtering[J]. Journal of Hubei University of Technology,2024,39(1):8-11,27.

[11]杨媛媛,王晓华,武健.一种提高FC网络时间同步精度的方法[J].中国新通信,2021,23(8):61-62.

[12]卢灏,余修武,刘永.基于节点自补偿的IEEE 1588时钟同步算法[J].传感技术学报,2023, 36(1):53-59.LU H,YU X W,LIU Y.IEEE 1588 clock synchronization algorithm based on node self-compensation[J]. Chinese Journal of Sensors and Actuators,2023,36(1):53-59.

[13]黄广舟.基于FPGA的高精度时钟同步技术的研究与实现[D].武汉:华中科技大学,2018:8-12.HUANG G Z. Research and implementation of high-precision clock synchronization technology based on FPGA[D]. Wuhan:Huazhong University of Science and Technology,2018:8-12.

[14]陶征亮.基于IEEE 1588协议的高精度时钟同步技术研究[D].赣州:江西理工大学,2022:10-15.TAO Z L. Research on high-precision clock synchronization technology based on IEEE 1588 protocol[D]. Ganzhou:Jiangxi University of Science and Technology,2022:10-15.

[15]韩一德.基于IEEE 1588协议的高精度时钟同步系统研究与实现[D].太原:中北大学,2021:15-20.HAN Y D. Research and implementation of high precision clock synchronization system based on IEEE 1588 protocol[D]. Taiyuan:North University of China,2021:15-20.

[16]魏小寒.基于IEEE 1588协议的时钟同步技术研究[D].自贡:四川轻化工大学,2021:16-17.WEI X H.Research on clock synchronization technology based on IEEE 1588 protocol[D]. Zigong:Sichuan University of Science&Engineering,2021:16-17.

[17]刘畅.IEEE 1588透明时钟原理研究及其应用设计[D].哈尔滨:哈尔滨工业大学,2021:19-22.LIU C. Research on the principles of IEEE 1588transparent clock and its application design[D].Harbin:Harbin Institute of Technology,2021:19-22.

[18]王存粮.分布式系统高精度时钟同步的设计与实现[D].太原:中北大学,2023:7-10.WANG C L. Design and implementation of high precision clock synchronization in distributed systems[D]. Taiyuan:North University of China, 2023:7-10.

[19]王泽芳,唐中剑.SM4算法CTR模式的高吞吐率ASIC实现[J].电子器件,2019,42(1):173-177.WANG Z F, TANG Z J. A high-throughput ASIC implementation of SM4 algorithm CTR mode[J]. Chinese Journal of Electron Devices, 2019,42(1):173-177.

[20]袁天柱.基于SM4算法的RFID高频数字基带控制器的设计[D].武汉:华中科技大学,2017:7-11.YUAN T Z.Design of the HF RFID digital baseband controller based on SM4 algorithm[D]. Wuhan:Huazhong University of Science and Technology,2017:7-11.

[21]李建立,莫燕南,粟涛,等.基于国密算法SM2、SM3、SM4的高速混合加密系统硬件设计[J].计算机应用研究,2022,39(9):2818-2825,2831.LI J L, MO Y N, SU T, et al. Hardware design of high-speed hybrid encryption system based on SM2,SM3 and SM4 algorithm[J].Application Research of Computers,2022,39(9):2818-2825,2831.

[22]窦玉超.SM4算法优化及其密钥扩展算法的设计与实现[D].哈尔滨:哈尔滨工业大学,2021:7-11.DOU Y C.Design and implementation of SM4 algorithm optimization and key extension algorithm[D]. Harbin:Harbin Institute of Technology,2021:7-11.

[23]何诗洋,李晖,李凤华.SM4算法的FPGA优化实现方法[J].西安电子科技大学学报,2021,48(3):155-162.HE S Y,LI H,LI F H.Optimization and implementation of the SM4 on FPGA[J]. Journal of Xidian University,2021,48(3):155-162.

[24]王文静,陈青华,张龙云.国产SM4密码算法的蓝绿激光通信系统设计[J].单片机与嵌入式系统应用,2019,19(11):44-46,52.WANG W J, CHEN Q H, ZHANG L Y. Design of blue-green laser communication system based on domestic SM4 encryption algorithm[J].Integrated Circuits and Embedded Systems, 2019,19(11):44-46,52.

[25]李森.基于PSOC的测控计算机加密存储卡PL端设计[J].火控雷达技术,2024,53(1):53-60.LI S. Design of PL side of encrypted memory card for measurement and control computer based on PSOC[J]. Fire Control Radar Technology,2024,53(1):53-60.

基本信息:

DOI:10.20189/j.cnki.CN/61-1527/E.202502012

中图分类号:TN957.51;TN918.4

引用信息:

[1]李森.基于PTPv2协议的回波模拟器加密时钟同步系统设计[J].火箭军工程大学学报,2025,39(02):113-123.DOI:10.20189/j.cnki.CN/61-1527/E.202502012.

基金信息:

引用

GB/T 7714-2015 格式引文
MLA格式引文
APA格式引文