[PTP][1588v2] Delay_Resp消息

一、报文格式

bash 复制代码
+0------3--------7--------11--------15--------------------------------31
|TranSpec|MsgType|Reserved1| VerPTP |              MsgLength          |
+----------------|------------------|---------------------------------|
|  DomainNumber  |      Reserved2   |              FlagField          |
+---------------------------------------------------------------------|
|                             CorrectionField                         |
|                                                                     |
+---------------------------------------------------------------------|
|                                Reserved3                            |
+---------------------------------------------------------------------|
|                          SourcePortIdentity                         |
|                                                                     |
|                                   +---------------------------------|
|                                   |        SequenceID               |
+----------------|------------------|---------------------------------|
|  ControlField  |  LogMsgInterval  |                                 |
+---------------------------------------------------------------------|
|                            ReceiveTimestamp                         |
|                                                                     |
|                                   |                                 |
+---------------------------------------------------------------------|
|                         RequestingPortIdentity                      |
|                                                                     |
|                                   |                                 |
字段 长度 含义
TranSpec 4 bits 传送相关。 0--表示PTP消息由1588协议使用 1--表示PTP消息由802.1as协议使用
MsgType 4 bits 0x00: Sync 0x01: Delay_Req
Reserved1 4 bits 保留字段。
VerPTP 4 bits 表示1588协议的版本。
MsgLength 2 bytes PTP消息的长度,即PTP消息的全部字节数目。 计入字节始于报头的第一个字节,同时包含并收尾于任何尾标的最后一个字节,或是无尾标成员时收尾于消息的最后一个字节。
DomainNumber 1 byte 域编号,表示发送该消息时钟所属的域
Reserved2 1 byte 保留字段。
FlagField 2 bytes 标志域。
CorrectionField CorrectionField 修正域,各报文都有,主要用在Sync报文中,用于补偿网络中的传输时延,E2E的频率同步。
Reserved3 4 bytes 保留字段。
SourcePortIdentity 10 bytes 源端口标识符,发送该消息时钟的ID和端口号。
SequenceID 2 bytes 序列号ID,表示消息的序列号,以及关联消息的对应关系。
ControlField 1 byte 控制域,由消息类型决定。
LogMsgInterval 1 byte 录入消息周期,PTP消息的发送时间间隔
receiveTimestamp 10 bytes 接收时间戳。
requestingPortIdentity 10 bytes 请求端口标识。

二、报文示例

(1) 基于UDP的Delay_Resp消息

bash 复制代码
Frame 1: 104 bytes on wire (832 bits), 104 bytes captured (832 bits)
Ethernet II, Src: HuaweiTe_92:27:fe (28:6e:d4:92:27:fe), Dst: HuaweiTe_00:00:11 (00:18:82:00:00:11)
Internet Protocol Version 4, Src: 10.1.1.20 (10.0.1.50), Dst: 10.0.1.2 (10.0.1.2)
User Datagram Protocol, Src Port: ptp-general (320), Dst Port: ptp-general (320)
Precision Time Protocol (IEEE1588)
    0001 .... = transportSpecific: 0x01
    .... 1001 = messageId: Delay_Resp Message (0x09)
    .... 0010 = versionPTP: 2
    messageLength: 54
    subdomainNumber: 0
    flags: 0x0400
        0... .... .... .... = PTP_SECURITY: False
        .0.. .... .... .... = PTP profile Specific 2: False
        ..0. .... .... .... = PTP profile Specific 1: False
        .... .1.. .... .... = PTP_UNICAST: True
        .... ..0. .... .... = PTP_TWO_STEP: False
        .... ...0 .... .... = PTP_ALTERNATE_MASTER: False
        .... .... ..0. .... = FREQUENCY_TRACEABLE: False
        .... .... ...0 .... = TIME_TRACEABLE: False
        .... .... .... 0... = PTP_TIMESCALE: False
        .... .... .... .0.. = PTP_UTC_REASONABLE: False
        .... .... .... ..0. = PTP_LI_59: False
        .... .... .... ...0 = PTP_LI_61: False
    correction: 0.000000 nanoseconds
        correction: Ns: 0 nanoseconds
        SubNs: 0.000000 nanoseconds
    ClockIdentity: 0x00188200000085ba
    SourcePortID: 1
    sequenceId: 48672
    control: Delay_Resp Message (3)
    logMessagePeriod: -7
    receiveTimestamp (seconds): 7760
    receiveTimestamp (nanoseconds): 764820450
    requestingSourcePortIdentity: 0x704433fffe297564
    requestingSourcePortId: 4363

(2) 基于以太的Delay_Resp消息

bash 复制代码
Frame 1: 76 bytes on wire (608 bits), 76 bytes captured (608 bits)
Ethernet II, Src: HuaweiTe_92:27:fe (28:6e:d4:92:27:fe), Dst: HuaweiTe_00:00:11 (00:18:82:00:00:11)
    Destination: HuaweiTe_00:00:11 (00:18:82:00:00:11)
    Source: HuaweiTe_92:27:fe (28:6e:d4:92:27:fe)
    Type: 802.1Q Virtual LAN (0x8100)
Precision Time Protocol (IEEE1588)
    0001 .... = transportSpecific: 0x01
    .... 1001 = messageId: Delay_Resp Message (0x09)
    .... 0010 = versionPTP: 2
    messageLength: 54
    subdomainNumber: 0
    flags: 0x0400
        0... .... .... .... = PTP_SECURITY: False
        .0.. .... .... .... = PTP profile Specific 2: False
        ..0. .... .... .... = PTP profile Specific 1: False
        .... .1.. .... .... = PTP_UNICAST: True
        .... ..0. .... .... = PTP_TWO_STEP: False
        .... ...0 .... .... = PTP_ALTERNATE_MASTER: False
        .... .... ..0. .... = FREQUENCY_TRACEABLE: False
        .... .... ...0 .... = TIME_TRACEABLE: False
        .... .... .... 0... = PTP_TIMESCALE: False
        .... .... .... .0.. = PTP_UTC_REASONABLE: False
        .... .... .... ..0. = PTP_LI_59: False
        .... .... .... ...0 = PTP_LI_61: False
    correction: 0.000000 nanoseconds
        correction: Ns: 0 nanoseconds
        SubNs: 0.000000 nanoseconds
    ClockIdentity: 0x00188200000085ba
    SourcePortID: 1
    sequenceId: 48672
    control: Delay_Resp Message (3)
    logMessagePeriod: -7
    receiveTimestamp (seconds): 7760
    receiveTimestamp (nanoseconds): 764820450
    requestingSourcePortIdentity: 0x704433fffe297564
    requestingSourcePortId: 4363

三、参考标准

标准 描述
IEEE 1588 V2 面向网络测控系统的精密时钟同步协议
IEEE P1588™ D2.2 网络测控系统精密时钟同步协议标准草案
相关推荐
星融元asterfusion2 天前
如何为您的网络选择正确的PTP配置文件:一份实用指南
网络·ptp·时间同步
lularible5 天前
PTP协议精讲(3.8):硬件时间戳详解——纳秒级精度的魔法
网络·网络协议·开源·嵌入式·ptp
lularible7 天前
PTP协议精讲(3.7):传输层实现——PTP报文的“高速公路“
网络·网络协议·开源·嵌入式·ptp
lularible10 天前
PTP协议精讲(2.18):遵循规则的艺术——Profile与一致性要求深度解析
网络·网络协议·开源·嵌入式·ptp
lularible10 天前
PTP协议精讲(3.1):走进开源PTP世界——LinuxPTP项目全景
网络·网络协议·开源·嵌入式·ptp
lularible11 天前
PTP协议精讲(2.17):追踪光速的脚步——White Rabbit与亚纳秒同步
网络·网络协议·开源·嵌入式·ptp
芯片和软件研究所15 天前
【tinyGTC】北斗授时授频 GPSDO 驯服钟的PPS和10M时钟测量
单片机·嵌入式硬件·北斗·时间同步·时频技术·授时·信号测量
lularible18 天前
PTP协议精讲(2.8):逐链路精准测量——P2P延迟测量机制详解
网络·网络协议·开源·嵌入式·ptp
2601_9540437220 天前
200K极致轻量化:勇芳自动校时工具的技术与应用探析
时间同步·系统工具·轻量级软件·ntp校时
aFakeProgramer2 个月前
时间同步,TSN Qbv ,都涉及到base-time,这三者的关系
tsn·时间同步