# 精确时间协议

**精确时间协议**（Precision Time Protocol，PTP）是由IEEE 1588定义的一种网络协议，用于在分组网络上同步分布式设备的时钟，将时间从指定的源时钟经由交换机和路由器传递到每一个端点，使整个网络运行在同一个时间尺度上。<sup>[1](https://sagroups.ieee.org/1588/news/ieee-1588-2019-evolves-to-better-serve-its-wide-variety-of-applications/)</sup> 其标准全称是《网络化测量与控制系统用精确时钟同步协议IEEE标准》，不过PTP这一协议名称是更常用的叫法。<sup>[1](https://sagroups.ieee.org/1588/news/ieee-1588-2019-evolves-to-better-serve-its-wide-variety-of-applications/)</sup> 以太网是最常见的底层网络技术，但Wi-Fi、5G等其他网络同样适用。<sup>[1](https://sagroups.ieee.org/1588/news/ieee-1588-2019-evolves-to-better-serve-its-wide-variety-of-applications/)</sup>

| 关键事实 | 详情 |
|---|---|
| 标准版本 | IEEE 1588-2002规定了PTP v1，IEEE 1588-2008规定了PTP v2，IEEE 1588-2019规定的是PTP v2.1，向后兼容v2.0<sup>[2](https://sagroups.ieee.org/1588/2020/08/27/what-is-the-current-version-of-ptp/)</sup> |
| 国际地位 | 2019年12月获批；2021年6月被IEC采纳为IEC/IEEE 61588:2021<sup>[3](https://www.nist.gov/el/intelligent-systems-division-73500/introduction-ieee-1588)</sup> |
| 精度目标 | PTP同步时钟的精度预期在100纳秒量级，主要由专用时钟振荡器和计数器的分辨率与稳定性决定<sup>[4](https://www.ntp.org/reflib/ptp/)</sup> |
| 核心机制 | 通过Sync/Follow_Up与Delay_Req/Delay_Resp交换得到的四个时间戳（t1至t4），可算出时钟偏移与平均路径延迟<sup>[5](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9500/software/release/16-12/configuration_guide/lyr2/b_1612_lyr2_9500_cg/configuring_precision_time_protocol__ptp_.html)</sup> |
| 不对称性规则 | 时间偏移误差等于路径不对称性的一半；PTP本身无法检测不对称性，但在已知不对称性时可加以补偿<sup>[6](https://tf.nist.gov/seminars/WSTS/PDFs/5_5_Symmetricom_Zampetti_Gateway_Clocks.pdf)</sup> |
| 时钟类型 | 普通时钟（单个PTP端口）、边界时钟（多个端口，终结并再生PTP）、透传时钟（修正自身的驻留时间）<sup>[7](https://www.nist.gov/el/intelligent-systems-division-73500/meanings-common-terms-used-ieee-1588)</sup><sup> • </sup><sup>[5](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9500/software/release/16-12/configuration_guide/lyr2/b_1612_lyr2_9500_cg/configuring_precision_time_protocol__ptp_.html)</sup> |
| 主要配置文件 | ITU-T G.8265.1（频率，单播）、ITU-T G.8275.1（相位/时间，全网支持）、IEEE C37.238（电力系统）、SMPTE ST 2059-2（广播）、RFC 9760（企业网）<sup>[8](https://www.itu.int/epublications/publication/itu-t-g-8275-1-y-1369-1-2022-amd-2-2024-08)</sup><sup> • </sup><sup>[9](https://standards.ieee.org/ieee/C37.238/6650/)</sup><sup> • </sup><sup>[10](https://pub.smpte.org/pub/st2059-2/st2059-2-2021.pdf)</sup><sup> • </sup><sup>[11](https://www.rfc-editor.org/info/rfc9760/)</sup> |

## 目的与运行

PTP通过网络将时间从一个充当时间源的端点传递出去，经由交换机和路由器送到其他端点，使网络中的一切设备都以相同的时间运行。<sup>[1](https://sagroups.ieee.org/1588/news/ieee-1588-2019-evolves-to-better-serve-its-wide-variety-of-applications/)</sup> 由此形成的层级结构中，位于根部的时钟称为主时钟（grandmaster clock），是所有其他时钟最终同步到的首要时间源；在没有边界时钟的系统中，协议会从普通时钟中选出一台作为主时钟（master），并默认将其作为主时钟（grandmaster）。<sup>[7](https://www.nist.gov/el/intelligent-systems-division-73500/meanings-common-terms-used-ieee-1588)</sup><sup> • </sup><sup>[12](https://www.nist.gov/el/intelligent-systems-division-73500/utc-source-1588)</sup>

**报文交换。** 在端到端（E2E）延迟机制中，主时钟发送Sync报文并记录其发送时刻t1；从时钟记录接收时刻t2；主时钟通过Follow_Up报文传递t1（在单步时钟模式下则直接将其嵌入Sync报文）；随后从时钟发送Delay_Req并记录t3，主时钟在Delay_Resp中返回t4。有了全部四个时间戳，从时钟便可计算自身相对于主时钟的偏移以及两台时钟之间的平均传播时间。<sup>[5](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9500/software/release/16-12/configuration_guide/lyr2/b_1612_lyr2_9500_cg/configuring_precision_time_protocol__ptp_.html)</sup><sup> • </sup><sup>[13](https://documentation.extremenetworks.com/exos_22.5/GUID-7692EE3A-A74D-48E9-B43B-4BE085E3E6CF.shtml)</sup> 偏移计算假定传播时间在两个方向上相同，而在以太网上由于分组延迟的不对称性，这一假定并不总是成立。<sup>[5](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9500/software/release/16-12/configuration_guide/lyr2/b_1612_lyr2_9500_cg/configuring_precision_time_protocol__ptp_.html)</sup>

**延迟机制。** E2E机制利用四时间戳交换测量主时钟与成员时钟之间的平均路径延迟。对等（P2P）机制则通过Pdelay_Req、Pdelay_Resp和Pdelay_Resp_Follow_Up报文测量每一条单独链路的延迟，因此要求路径上的每个节点都支持PTP；对等透传时钟会把报文驻留时间和上游链路延迟都累加到每条Sync或Follow_Up报文的修正域中。<sup>[5](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9500/software/release/16-12/configuration_guide/lyr2/b_1612_lyr2_9500_cg/configuring_precision_time_protocol__ptp_.html)</sup><sup> • </sup><sup>[14](https://chronos.uk/wordpress/wp-content/uploads/TechnicalBrief-IEEE1588v2PTP.pdf)</sup>

**时钟选择。** 最佳主时钟算法（Best Master Clock Algorithm，BMCA）是PTP功能的基础：每台时钟利用通告时钟属性的Announce报文，在其子域内它能看到的时钟（包括自身）中确定最佳主时钟。比较标准包括Priority1（用户指定，0至255，默认128）、时钟等级、精度、方差、Priority2以及唯一标识符。<sup>[5](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9500/software/release/16-12/configuration_guide/lyr2/b_1612_lyr2_9500_cg/configuring_precision_time_protocol__ptp_.html)</sup>

## 时间戳与精度

PTP的精度取决于时间戳在何处被捕获。PTP通常在服务器、客户端和交换机中设有硬件机制，在以太网帧经过物理层时捕获时间戳；PTP时间戳由网卡硬件在媒体独立接口处相对于专用振荡器和计数器捕获，通常在100纳秒以内。<sup>[4](https://www.ntp.org/reflib/ptp/)</sup> 这种硬件时间戳绕过了报文经过操作系统网络协议栈时所引入的抖动，这也是支持PTP的网卡在报文即将发往物理层之前、在最底层的硬件层面为其打时间戳的原因。<sup>[15](https://arxiv.org/abs/1603.00707)</sup>

正向与反向路径的不对称性是精度的根本限制。与所有基于报文的时间传递协议一样，PTP的精度会因事件报文所经路径的不对称性而下降，时间偏移误差为不对称性的一半；不对称性可能产生于物理层，可能由网桥和路由器引入，也可能因为正向与反向路径在网络中走了不同路由而造成。<sup>[6](https://tf.nist.gov/seminars/WSTS/PDFs/5_5_Symmetricom_Zampetti_Gateway_Clocks.pdf)</sup> 当单子网跨度只有几米、目标时间精度为几十纳秒或更粗时，不对称性很少成为问题。<sup>[6](https://tf.nist.gov/seminars/WSTS/PDFs/5_5_Symmetricom_Zampetti_Gateway_Clocks.pdf)</sup> 当由接口速率不匹配等原因造成的静态不对称性已知时，时间接收方可以利用IEEE 1588第11.6条定义的非对称延迟补偿机制加以补偿。<sup>[16](https://www.itu.int/epublications/publication/itu-t-g-8271-y-1366-2020-amd-1-2024-08)</sup>

## 与NTP的比较

PTP与网络时间协议（Network Time Protocol，NTP）在用户群体、精度预期和硬件要求上存在很大差异。PTP最常用于在专用高速以太网局域网段上同步专用工业自动化和测量网络中的设备时钟，而NTP则用于在全球互联网上同步通用工作站和服务器的系统时钟。<sup>[4](https://www.ntp.org/reflib/ptp/)</sup> NTP的精度预期从PPS辅助的主服务器上的几微秒到广域分散的互联网网络中的几十毫秒不等，而PTP的精度在100纳秒量级。<sup>[4](https://www.ntp.org/reflib/ptp/)</sup>

两种协议都测量往返延迟并假定单向延迟为其一半，但它们的部署环境截然不同。由于PTP几乎只部署在路由受到严格控制、流量有限的局域网中，它通常能提供比NTP更低的不确定度；NTP通常运行在公共互联网等广域网上，那里的分组路由和流量不断变化。<sup>[17](https://tf.nist.gov/general/pdf/2868.pdf)</sup> 配备额外硬件且配置得当的PTP客户端计算机可以实现亚微秒级的时间戳同步，而纯软件的PTP方案可能给出与NTP相似的结果，并随操作系统负载而变化。<sup>[17](https://tf.nist.gov/general/pdf/2868.pdf)</sup> PTP比NTP消耗更多带宽，但能收集更多关于网络延迟的信息，而且通常采用更好的时钟硬件和专门设计的网卡，使客户端具备更好的保持（在同步信号丢失时仍维持准确时间）能力。<sup>[17](https://tf.nist.gov/general/pdf/2868.pdf)</sup>

## 配置文件

PTP配置文件是适用于某一设备的允许PTP特性的集合，通常针对特定应用或环境；它定义BMCA选项、配置管理选项、路径延迟机制、可配置属性的取值范围与默认值，以及必需的、允许的或禁止的传输机制、节点类型和选项。<sup>[5](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9500/software/release/16-12/configuration_guide/lyr2/b_1612_lyr2_9500_cg/configuring_precision_time_protocol__ptp_.html)</sup> 配置文件概念是该标准取得成功的主要原因之一，因为各种各样的应用都恰好按自身需求对PTP作了适配。<sup>[1](https://sagroups.ieee.org/1588/news/ieee-1588-2019-evolves-to-better-serve-its-wide-variety-of-applications/)</sup>

- **电信。** ITU-T G.8265.1定义了一个在无网络定时支持条件下以单播模式进行频率分配的PTP配置文件，同时支持IEEE 1588-2008和IEEE 1588-2019。<sup>[18](https://www.itu.int/ITU-T/recommendations/rec.aspx?rec=15129)</sup> ITU-T G.8275.1定义了一个面向电信应用的配置文件，要求在全网络定时支持下实现精确的相位与时间同步。<sup>[8](https://www.itu.int/epublications/publication/itu-t-g-8275-1-y-1369-1-2022-amd-2-2024-08)</sup>
- **电力系统。** IEEE C37.238-2017规定了一个扩展配置文件，用于在以太网上运行的电力系统保护、控制、自动化和数据通信应用中使用PTP（IEEE Std 1588-2008）；IEEE合格评定计划认证使供应商能够证明其时钟满足C37.238-2017和IEC/IEEE 61850-9-3（2016）的电力配置文件要求。<sup>[9](https://standards.ieee.org/ieee/C37.238/6650/)</sup><sup> • </sup><sup>[19](https://standards.ieee.org/products-programs/icap/programs/ptp-power-profile/)</sup>
- **广播媒体。** SMPTE ST 2059-2定义了SMPTE PTP配置文件，用于专业广播环境中的时间与频率同步，基于IEEE Std 1588-2008，并拟与SMPTE ST 2059-1配合使用，后者定义了用于实时信号对齐的SMPTE纪元。<sup>[10](https://pub.smpte.org/pub/st2059-2/st2059-2-2021.pdf)</sup>
- **企业网络。** RFC 9760（2025年5月）描述了基于IEEE 1588-2019标准、面向IPv4或IPv6企业环境的PTP配置文件，采用端到端延迟机制，并同时使用组播和单播的Delay_Req与Delay_Resp报文。<sup>[11](https://www.rfc-editor.org/info/rfc9760/)</sup>

## 标准历史与版本

最初的IEEE 1588委员会于2001年4月首次开会，由仪器与测量学会的IEEE传感器技术技术委员会发起。草案于2002年9月12日获批为IEEE标准，并于2002年11月作为IEEE 1588-2002发布。<sup>[3](https://www.nist.gov/el/intelligent-systems-division-73500/introduction-ieee-1588)</sup> 其后修订为IEEE 1588-2008，业界通常称之为版本2。2013年6月14日，一项项目授权请求获批，目的是修订2008年版标准，使其成为更安全的协议，同时适用于IPv4和IPv6，并适合亚纳秒量级的更高速应用；IEEE 1588-2019在2019年12月IEEE-SA标准委员会会议上获批发布，并于2021年6月被IEC采纳为IEC 61588:2021。<sup>[3](https://www.nist.gov/el/intelligent-systems-division-73500/introduction-ieee-1588)</sup>

2019年版规定的是PTP v2.1，向后兼容v2.0；次版本号是在这一版中引入的，报文头携带的协议版本与标准版的编号相互独立。<sup>[2](https://sagroups.ieee.org/1588/2020/08/27/what-is-the-current-version-of-ptp/)</sup> IEEE 1588-2019不再支持与IEEE 1588-2002的兼容。<sup>[20](https://sagroups.ieee.org/1588/wp-content/uploads/sites/144/2020/04/IEEE-1588-2019-changes.pdf)</sup> 对2019年基础标准的现行修正案包括IEEE 1588a-2023（BMCA增强）、1588b-2022（OTN传输）、1588c-2024（术语澄清）、1588d-2023（GDOI密钥管理）、1588e-2024（MIB与YANG模块），以及1588g-2022，后者确定了用timeTransmitter和timeReceiver作为主时钟和从时钟的替代术语。<sup>[21](https://sagroups.ieee.org/1588/public-documents/)</sup><sup> • </sup><sup>[22](https://standards.ieee.org/ieee/1588g/10478/)</sup>

## 安全性

IEEE 1588在附录K中定义了一个实验性安全扩展，依赖对称密钥保密机制，提供组源认证、报文完整性和防重放功能；它从未被业界广泛采用。<sup>[15](https://arxiv.org/abs/1603.00707)</sup> 研究分析表明，PTP虽然是双向同步协议，却不满足安全时钟同步基础理论的条件，因此在那些模型下无法抵御基于延迟的攻击。<sup>[23](https://arxiv.org/abs/1710.05798)</sup> 延迟攻击是一个公认的研究热点：即使同步流量已用IPsec、MACsec或TLS加密，统计流量分析仍可识别出支持选择性报文延迟攻击的特征，而已提出的防御手段包括循环路径不对称性分析，用以揭示并缓解同步路径上的恶意不对称。<sup>[24](https://arxiv.org/abs/1811.08569)</sup><sup> • </sup><sup>[25](https://arxiv.org/abs/2401.10664)</sup> 更近的研究表明，在运行PTP协议栈的主机内部活动的内核级攻击者可以悄无声息地破坏时钟同步，绕过现有的PTP安全扩展，针对广泛使用的ptp4l和phc2sys守护进程使用恒定偏移、渐进偏斜和随机抖动等攻击原语。<sup>[26](https://arxiv.org/abs/2510.06421)</sup>

## 实现

在Linux上，参考开源实现是linuxptp的`ptp4l`守护进程，它按IEEE 1588实现边界时钟、普通时钟和透传时钟。其默认传输方式是UDP IPv4，默认时间戳方式是经由网卡暴露的PTP硬件时钟（PTP hardware clock，PHC）进行硬件时间戳；它还支持软件时间戳、IEEE 802.3二层传输以及电信配置文件的备用BMCA。<sup>[27](https://www.linuxptp.org/documentation/ptp4l/)</sup> Linux内核提供PTP硬件时钟基础设施，与SO_TIMESTAMPING套接字选项配合，为开发PTP用户空间程序和让Linux与外部时钟同步提供了标准化方法。<sup>[28](https://cdn.kernel.org/doc/html/latest/driver-api/ptp.html)</sup>

## References

1. [IEEE 1588-2019 Evolves to Better Serve its Wide Variety of Applications, IEEE 1588 Working Group](https://sagroups.ieee.org/1588/news/ieee-1588-2019-evolves-to-better-serve-its-wide-variety-of-applications/)
2. [What is the current version of PTP?, IEEE 1588 Working Group](https://sagroups.ieee.org/1588/2020/08/27/what-is-the-current-version-of-ptp/)
3. [Introduction to IEEE 1588, NIST](https://www.nist.gov/el/intelligent-systems-division-73500/introduction-ieee-1588)
4. [IEEE 1588 Precision Time Protocol (PTP), NTP.org](https://www.ntp.org/reflib/ptp/)
5. [Configuring Precision Time Protocol (PTP), Cisco Catalyst 9500 Layer 2 Configuration Guide](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9500/software/release/16-12/configuration_guide/lyr2/b_1612_lyr2_9500_cg/configuring_precision_time_protocol__ptp_.html)
6. [Gateway Clocks, Symmetricom/NIST WSTS presentation](https://tf.nist.gov/seminars/WSTS/PDFs/5_5_Symmetricom_Zampetti_Gateway_Clocks.pdf)
7. [Meanings of common terms used in IEEE 1588, NIST](https://www.nist.gov/el/intelligent-systems-division-73500/meanings-common-terms-used-ieee-1588)
8. [Rec. ITU-T G.8275.1/Y.1369.1 (2022) Amd. 2 (08/2024)](https://www.itu.int/epublications/publication/itu-t-g-8275-1-y-1369-1-2022-amd-2-2024-08)
9. [IEEE C37.238-2017, IEEE SA](https://standards.ieee.org/ieee/C37.238/6650/)
10. [SMPTE ST 2059-2:2021, SMPTE Profile for Use of IEEE-1588 PTP in Professional Broadcast Applications](https://pub.smpte.org/pub/st2059-2/st2059-2-2021.pdf)
11. [RFC 9760: Enterprise Profile for the Precision Time Protocol with Mixed Multicast and Unicast Messages, RFC Editor](https://www.rfc-editor.org/info/rfc9760/)
12. [UTC Source 1588, NIST](https://www.nist.gov/el/intelligent-systems-division-73500/utc-source-1588)
13. [ExtremeXOS User Guide, Extreme Networks](https://documentation.extremenetworks.com/exos_22.5/GUID-7692EE3A-A74D-48E9-B43B-4BE085E3E6CF.shtml)
14. [Tech Brief - IEEE 1588v2 PTP, Chronos Technology](https://chronos.uk/wordpress/wp-content/uploads/TechnicalBrief-IEEE1588v2PTP.pdf)
15. [Itkin, E., Wool, A. (2016). A Security Analysis and Revised Security Extension for the Precision Time Protocol. arXiv.](https://arxiv.org/abs/1603.00707)
16. [ITU-T G.8271/Y.1366 (2020) Amd. 1 (08/2024)](https://www.itu.int/epublications/publication/itu-t-g-8271-y-1366-2020-amd-1-2024-08)
17. [Accurate, Traceable, and Verifiable Time Synchronization for World Financial Markets, NIST Journal of Research 121 (2016)](https://tf.nist.gov/general/pdf/2868.pdf)
18. [ITU-T Recommendation G.8265.1/Y.1365.1 database entry](https://www.itu.int/ITU-T/recommendations/rec.aspx?rec=15129)
19. [IEEE SA - Precision Time Protocol (PTP) Power Profile certification program](https://standards.ieee.org/products-programs/icap/programs/ptp-power-profile/)
20. [Changes to IEEE 1588 in the 2019 edition compared to the 2008 edition, IEEE 1588 Working Group](https://sagroups.ieee.org/1588/wp-content/uploads/sites/144/2020/04/IEEE-1588-2019-changes.pdf)
21. [IEEE 1588 Working Group - Documents](https://sagroups.ieee.org/1588/public-documents/)
22. [IEEE 1588g-2022, IEEE SA](https://standards.ieee.org/ieee/1588g/10478/)
23. [Requirements for Secure Clock Synchronization. arXiv.](https://arxiv.org/abs/1710.05798)
24. [Encryption is Futile: Delay Attacks on High-Precision Clock Synchronization. arXiv.](https://arxiv.org/abs/1811.08569)
25. [PTPsec: Securing the Precision Time Protocol Against Time Delay Attacks Using Cyclic Path Asymmetry Analysis. arXiv.](https://arxiv.org/abs/2401.10664)
26. [Breaking Precision Time: OS Vulnerability Exploits Against IEEE 1588. arXiv.](https://arxiv.org/abs/2510.06421)
27. [ptp4l(8): PTP Boundary/Ordinary/Transparent Clock, linuxptp documentation](https://www.linuxptp.org/documentation/ptp4l/)
28. [PTP hardware clock infrastructure for Linux, The Linux Kernel documentation](https://cdn.kernel.org/doc/html/latest/driver-api/ptp.html)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 测量与时间 › 计时与时间标准 › Time standards, precision, and technical time › Precision time protocols and synchronized networks

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/precision-time-protocol

English original: https://www.edgepedia.org/precision-time-protocol
