欢迎淘宝搜索 飞灵科技,我司相关新产品陆续上线。
PTP(Precision Time Protocol)报文使用 UDP/IP 传输机制封装在以太网帧中,或者直接封装在以太网帧中的第 2 层。
- PTP over IEEE 802.3/Ethernet(IEEE 1588v2协议附录F)
- PTP over UDP over IPv4(IEEE 1588v2协议附录D)
- PTP over UDP over IPv6(IEEE 1588v2协议附录E)
UDP/IP 封装
1588 的消息(v1 和 v2)可以使用 UDP/IP 多播(组播)消息进行传输。
下面的表格展示了为 PTP 定义的 IP 多播分组。该表还根据 RFC 1112(IP 的最后三个字节为固定值 01-00-5E)显示了他们各自的 MAC 层多播地址映射。
- IPv4 封装 PTP 报文格式
6 Bytes | 6 Bytes | 4 Bytes | 2 Bytes | 20 Bytes | 8 Bytes | 44~64 Bytes | 4 Bytes |
---|---|---|---|---|---|---|---|
DMAC | SMAC | VLAN Tag (Optional) | Type = 0x0800 | IP Header | UDP Header | 1588 Payload | FCS |
- UDP/IP 多播域
Name | IP Address | MAC Address mapping |
---|---|---|
DefaultPTPdomain | 224.0.1.129 | 01-00-5E-00-01-81 |
AlternatePTPdomain1 | 224.0.1.130 | 01-00-5E-00-01-82 |
AlternatePTPdomain2 | 224.0.1.131 | 01-00-5E-00-01-83 |
AlternatePTPdomain3 | 224.0.1.132 | 01-00-5E-00-01-84 |
- UDP 端口号
Message type | UDP port | Note |
---|---|---|
Event | 319 | Used for SYNC and DELAY_REQUEST messages |
General | 320 | All other messages (for example, follow-up, delay-response) |
以太网封装 (PTPv2)
除了使用 UDP/IP 帧,IEEE 1588v2 还定义了使用 ethertype = 0x88F7 的本地以太网帧格式。以太网帧的有效负载直接包含 PTP 数据包,以 PTPv2 报头开始。
除此之外,版本 2 还增加了一个对等的延迟机制,以允许沿多个节点上的路径测量单个点对点链接之间的延迟。以下组播域也在 PTPv2 中定义。
- 以太网封装 PTP 报文格式
6 Bytes | 6 Bytes | 4 Bytes | 2 Bytes | 44~64 Bytes | 4 Bytes |
---|---|---|---|---|---|
DMAC | SMAC | VLAN Tag (Optional) | Type = 0x88F7 | 1588 Payload | FCS |
- PTPv2 多播域
Name | MAC address |
---|---|
Normal messages | 01-1B-19-00-00-00 |
Peer delay messages | 01-80-C2-00-00-0E |