WO2012068845A1 - 一种时间同步的方法和*** - Google Patents

一种时间同步的方法和*** Download PDF

Info

Publication number
WO2012068845A1
WO2012068845A1 PCT/CN2011/074301 CN2011074301W WO2012068845A1 WO 2012068845 A1 WO2012068845 A1 WO 2012068845A1 CN 2011074301 W CN2011074301 W CN 2011074301W WO 2012068845 A1 WO2012068845 A1 WO 2012068845A1
Authority
WO
WIPO (PCT)
Prior art keywords
physical network
network port
indicates
port rate
slave device
Prior art date
Application number
PCT/CN2011/074301
Other languages
English (en)
French (fr)
Inventor
罗丽
彭勇
傅小明
唐雄
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012068845A1 publication Critical patent/WO2012068845A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays

Definitions

  • the present invention relates to the field of clock synchronization, and in particular, to a method and system for time synchronization.
  • IP-based packet network transmission data has been the mainstream of development.
  • new services and new applications impose higher requirements on the synchronization of the network, and on the other hand, traditional time division multiplexing
  • TDM Time Division Multiplexing
  • the Precision Time Synchronization Protocol (1588-2008) is a timing mechanism for overcoming the lack of real-time Ethernet. Its emergence has brought us hope. Its main principle is to all the network. The node performs time synchronization, and the clock of all nodes in the network is periodically synchronized and corrected by an accurate time source.
  • IEEE 1588 PTP is an Ethernet clock synchronization protocol that implements master-slave synchronization by synchronizing messages.
  • the PTP standard protocol can be carried over Ethernet 802.3, UDP/IPv4, and UDP/IPv6.
  • the format of the 802.3 frame structure is shown in Table 1.
  • the IEEE 1588v2 system is a master-slave synchronization system.
  • the master clock sends PTP time information according to a predetermined time interval
  • the clock port receives the timestamp information sent by the master clock port, and the system calculates the master according to the time.
  • the line time delay and the master-slave time difference are used, and the time difference is used to adjust the local time so that the slave time is kept at the same frequency and phase as the master time.
  • the body scheme is shown in Figure 1.
  • the master sends a Sync message and records the time tl.
  • the slave device receives the Sync message, it records t2.
  • the slave learns tl based on the Follow_up message sent by the master.
  • the slave device initiates a Delay_Req message and records the time t3.
  • the master device After receiving the Delay-Req message, the master device records the time t4 and fills in the Delay_Resp message.
  • the slave learns t4 based on the Delay_Resp message sent by the master.
  • tl and t2 are the timestamps for sending and receiving Sync messages, that is, t1 is the time when the Sync message is sent out to the master device, and t2 is the time when the Sync message arrives at the slave device.
  • T3 and t4 are the transmission and reception timestamps of the Delay-Req message respectively, that is, t3 is the time when the Delay-Req message is sent out from the device, and t4 is the time when the Delay-Req message is sent to the master device.
  • the difference between the time of the slave device and the time of the master device is the difference between the time of the slave device and the time of the master device.
  • the existing IEEE 1588-2008 standard does not explicitly describe whether the primary and secondary physical network ports are rate matched. If the rate of the primary and secondary physical network ports is inconsistent, the delay time from the master to the slave is different from the delay time from the master to the slave. Time synchronization error, resulting in phase asymmetry in synchronization.
  • the technical problem to be solved by the present invention is to provide a method and system for time synchronization, which solves the problem that the time between the master and the slave is inconsistent due to the inconsistent physical rate of the time stamp interface.
  • the present invention provides a method for time synchronization, including: The master device notifies the slave device of its physical network port rate information.
  • the device learns the physical network port rate of the master device, it compares it with its own physical network port rate. If it is not the same, it compensates the calculated average line transmission delay. Otherwise, no compensation is performed.
  • the above method has the following characteristics:
  • the step of the master device notifying the slave device of the physical network port rate includes:
  • the master device sends a notification packet to the slave device, where the notification packet carries its own physical network port rate information.
  • the above method has the following characteristics:
  • the master device Before the master device sends the notification packet to the slave device, the master device writes its own physical network port rate information into the reserved byte between the domain number of the notification packet and the identifier field.
  • the above method has the following characteristics:
  • 0001 indicates the physical network port rate of 10M
  • 0010 indicates the 100M physical network port rate
  • 0100 indicates the 1000M physical network port rate
  • 1000 indicates the 10000M physical network port rate.
  • the above method has the following characteristics:
  • the slave device compensates the clock offset by subtracting the delay error from the calculated average line transmission delay, where
  • J represents the entire frame length except the frame preamble and the check bit
  • J 2 represents the check bit length
  • represents the frame preamble length
  • Sm represents the time at which the physical network port of the master device forwards each bit of data
  • Ss represents the physical network port of the slave device. The time to forward each bit of data.
  • the present invention provides a time synchronization system including a master device and one or more slave devices.
  • the master device is configured to: notify the slave device of the physical network port rate information;
  • the slave device is set to: After the physical network port rate of the master device is learned, the physical network port rate is For comparison, if not the same, the calculated average line transmission delay is compensated, otherwise, no compensation is performed.
  • the above system has the following characteristics:
  • the master device is further configured to: notify the slave device by sending the notification message to the slave device, and the notification packet carries the rate information of the physical network port of the device.
  • the above system has the following characteristics:
  • the master device is further configured to: write the physical network port rate information of the notification message into the reserved byte between the domain number of the notification message and the identifier field before sending the notification message to the slave device.
  • the above system has the following characteristics:
  • 0001 indicates the physical network port rate of 10M
  • 0010 indicates the 100M physical network port rate
  • 0100 indicates the 1000M physical network port rate
  • 1000 indicates the 10000M physical network port rate.
  • the above system has the following characteristics:
  • the slave device is further configured to: compensate the clock offset by subtracting a delay error from the calculated average line transmission delay, where
  • indicates the entire frame length except the frame preamble and check digit
  • J 2 indicates the check bit length
  • indicates the frame preamble length
  • Sm indicates the time at which the physical network port of the master device forwards each bit of data
  • Ss indicates the physical network port of the slave device. The time to forward each bit of data.
  • the delay asymmetry caused by the inconsistent rate of the primary and secondary physical network ports can be solved in the delay request response mechanism, resulting in phase unsynchronization.
  • Figure 1 is a schematic diagram of a delay request response mechanism
  • FIG. 2 is a schematic diagram of networking
  • Fig. 3 is a flow chart showing an application example of the present invention. Preferred embodiment of the invention
  • the intermediate unknown network (cloud network) has the same delay
  • the check digit is 4 bits
  • the physical network port rate of the master device is Gigabit Ethernet
  • the physical network port rate of the slave device is 100 Mbps Ethernet
  • the delay of the event message is:
  • t2-tl (L l + L 2 ⁇ ytes x ltslbyte x GE nslbit + D PSN + (L 3) bytes x ltslbyte x FE mlbit ( Formula 3) wherein, A represents a frame preamble (pre-amble) and other checking The entire frame length outside the bit (FCS); J 2 represents the length of the check bit ( FCS );
  • J 3 represents the length of the frame preamble (re-amble).
  • FE m/bit indicates the time when the 100M physical network port forwards data per bit.
  • D PSN represents unknown time delay through the packet network
  • T4-t3 ⁇ L x + L 2 ) bytes x Usjbyte x FE nsjbu + D PSN + (L 3 ) bytes x ltslhyte x GE nsjbu (Formula 4) where A, 2 , L GE nslM , FE mlbtt , D layer and Equation 3 represents the same.
  • the average line transmission delay is as follows:
  • N meanPathDelayA (A + 2 ) X 8 X GE ⁇ FE + 3 ⁇ 8 x FE ⁇ GE (Equation 8) Equation 6
  • Subtraction 4 calculates the delay error from Master to Slave and Slave to Master: r _ (J ⁇ o GE ⁇ FE FE ⁇ GE ( - Q
  • the time required to transmit one bit of data is Ins.
  • the time required to transmit one bit of data is 10 ns. Substituting 8 or 9 can be obtained,
  • the primary device is the 1000M physical network port rate
  • the secondary device is the 100M physical network port rate, which is subjected to the primary switching and the nine-level switching respectively.
  • the experimental results are shown in the table below. It can be seen from Table 2 that the increase of the number of switching stages has no effect on the asymmetry, which is caused by the rate mismatch between the primary and secondary physical network ports.
  • the invention proposes to solve the problem of delay asymmetry caused by the inconsistent rate of the physical network port between the master and the slave.
  • the method is as follows: The master device informs the slave device of the physical network port rate information of the master device; after the slave device learns the rate of the physical network port of the master device, compares the rate with the physical network port of the master device, and if not, the calculated average route The transmission delay is compensated, otherwise, no compensation is performed.
  • the master device may send an Announce message to the slave device, where the notification packet carries its own physical network port rate information.
  • the physical network port rate information may be located in a reserved byte between the domainNumber and the flag field, that is, the master device sends the notification message to the slave device before the master device sends the notification message to the slave device.
  • the physical network port rate information can be written into the reserved byte between the domainNumber and the flagField of the notification message.
  • 0001 indicates the physical network port rate of 10M
  • 0010 indicates the 100M physical network port rate
  • 0100 indicates the 1000M physical network port rate
  • 1000 indicates the 10000M physical network port rate.
  • the slave device compensates the clock offset by subtracting the delay error from the calculated average line transmission delay, where
  • indicates the entire frame length except the frame preamble and check digit
  • J 2 indicates the check bit length
  • indicates the frame preamble length
  • Sm indicates the time at which the physical network port of the master device forwards each bit of data
  • Ss indicates the physical network port of the slave device. The time to forward each bit of data.
  • the time synchronization system of the embodiment of the present invention includes a master device and one or more slave devices, wherein
  • the master device notifies the slave device of the physical network port rate information while implementing the function of the master device;
  • the device After the device performs the function of its master device, it learns the rate of the physical network port of the master device through the Announce packet and compares it with the rate of its physical network port. If not, the calculated average line transmission delay is performed. Compensation, otherwise, no compensation will be made.
  • the master device may be further configured to notify the slave device of the physical network port rate information by sending the notification message to the slave device, where the notification message carries its own physical network port rate information.
  • the master device is further configured to write the physical network port rate information of the notification message into the reserved byte between the domain number of the notification message and the domain identifier before sending the notification message to the slave device.
  • the slave device may be further configured to compensate the clock offset by subtracting a delay error from the calculated average line transmission delay, where
  • indicates the entire frame length except the frame preamble and check digit
  • J 2 indicates the check bit length
  • indicates the frame preamble length
  • Sm indicates the time at which the physical network port of the master device forwards each bit of data
  • Ss indicates the physical network port of the slave device. The time to forward each bit of data.
  • the present invention is further illustrated by an application example in which the rate of the physical network port of the primary device is increased in the Announce message header.
  • the model for time synchronization using 1588 is shown in Figure 2. There may be multiple switches, routers, etc. in the middle.
  • this example includes the following steps:
  • Step 301 The master device writes its own physical network port rate information into the reserved bytes between the domainNumber and the flagField of the Announce message, where 0001 indicates 10M, 0010 indicates 100M, 0100 indicates 1000M, and 1000 indicates 10000M;
  • Step 302 The master device sends the Announce text to the slave device.
  • Step 303 After receiving the Announce message, the slave device parses the physical network port rate of the master device.
  • Step 304 The slave device compares the rate of the physical network port of the master device with the rate of the physical network port of the slave device. If they are the same, the device does not perform compensation. If not, the length of the packet is parsed. The calculated value is compensated.
  • the delay asymmetry caused by the inconsistent rate of the primary and secondary physical network ports can be solved in the delay request response mechanism, resulting in phase unsynchronization.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

本发明公开了一种时间同步的方法和***。所述方法包括:主设备将自身的物理网口速率信息告知从设备;从设备获知主设备的物理网口速率后,与自身的物理网口速率进行比较,如果不相同,则对计算得到的平均线路传输延时进行补偿,否则,不进行补偿。采用本发明的技术方案,在延时请求响应机制中将可以解决由于主从物理网口速率不一致引起的延迟不对称,导致相位不同步问题。

Description

一种时间同步的方法和***
技术领域
本发明涉及时钟同步领域, 尤其涉及一种时间同步的方法和***。
背景技术
在通信***中, 随着数据业务和多媒体业务的不断发展, 基于 IP的分组 网络传送数据已是发展的主流。 这时, 一方面新的业务和新的应用对网络的 同 步 性 能提 出 更 高 的 要求 , 另 一 方 面 对传 统 时分复用
( Time Division Multiplexing, TDM )业务的兼容等都需要分组网络提供高质 量的同步与定时性能。
精密时钟同步协议 ( Precision Time Synchronization Protocol, 1588-2008 ) 是为克服以太网实时性不足而规定的一种对时机制, 它的出现给我们带来了 希望, 它的主要原理是对网络中所有节点进行对时同步, 由一个精确的时间 源周期性地对网络中所有节点的时钟进行校正同步。
IEEE 1588 PTP是一种以太网时钟同步协议, 通过同步报文实现主从同 步。 PTP标准协议可以承载在 Ethernet 802.3、 UDP/IPv4和 UDP/IPv6 , 802.3 帧结构的形式如表 1所示。
表 1 preamble SFD Des MAC Sour MAC Data /Load FCS
Figure imgf000003_0001
7 bytes 1 byte 6 bytes 6 bytes 2 bytes 46-1500 bytes 4 bytes
IEEE 1588v2***作为一种主从同步***,在***的同步过程中,主时钟 按照预定的时间间隔发送 PTP时间信息, 从时钟端口接收主时钟端口发来的 时间戳信息, ***据此计算出主从线路时间延迟及主从时间差, 并利用该时 间差调整本地时间, 使从设备时间保持与主设备时间一致的频率与相位。 具 体方案如图 1所示。 主设备 ( Master )发送 Sync (同步)报文, 并记录时间 tl。 从设备(Slave )在接收到 Sync报文时, 记录 t2。 从设备根据主设备发送 的 Follow_up (跟踪 )报文, 获知 tl。 从设备相应的发起 Delay_Req (延迟请 求)报文, 同时记录时间 t3 , 主设备收到 Delay— Req报文后, 记录时间 t4, 并填入 Delay_Resp (延时响应 )报文。 从设备根据主设备发送的 Delay_Resp (延迟响应 )报文, 获知 t4。 图 1中 tl和 t2分别为 Sync报文的发送和接收时间戳,即 tl是 Sync报文 出主设备时的时间, t2 为 Sync报文到从设备时的时间。 t3 和 t4 分别为 Delay— Req报文的发送和接收时间戳, 即 t3为 Delay— Req报文出从设备的时 间, t4为 Delay— Req报文到主设备的时间。
平均线路传输延时
mean_path_delay = [(t2 - tl) + (t4 - 13)]/2 = [(t2 - 13) + (t4 - tl)]/2 (式
1 )
从设备的时间与主设备的时间之差为
offset=[(tl - 12) + (t4 - 13)]/2 (式 2 ) 通过上面两式, 可以把从设备的时间同步于主设备。
目前同步设备厂商们正在试图用 IEEE1588 网络时钟代替全球定位*** ( Global Positioning System, GPS )时钟源, 但是发布的 IEEE1588-2008在实 现时还存在一些问题。 发明内容
现有的 IEEE1588-2008标准没有明确描述主与从物理连接网口是否速率 匹配, 如果主从物理连接网口速率不一致, 会导致主到从的延迟时间与从到 主的延迟时间不同, 从而产生时间同步误差, 导致同步时相位不对称问题。
本发明要解决的技术问题提出一种时间同步的方法和***, 解决主从间 由于时间戳接口物理速率不一致, 导致主从间时间不同步问题。
为了解决上述问题, 本发明提供一种时间同步的方法, 包括: 主设备将自身的物理网口速率信息告知从设备;
从设备获知主设备的物理网口速率后,与自身的物理网口速率进行比较, 如果不相同, 则对计算得到的平均线路传输延时进行补偿, 否则, 不进行补 偿。
优选地, 上述方法具有以下特点:
所述主设备将自身的物理网口速率告知从设备的步骤包括:
主设备向从设备发送通知报文, 所述通知报文中携带自身的物理网口速 率信息。
优选地, 上述方法具有以下特点:
所述主设备向从设备发送通知报文之前, 所述主设备将自身的物理网口 速率信息写入所述通知报文的域号和标识域之间的保留字节中。
优选地, 上述方法具有以下特点:
所述物理网口速率信息中, 釆用 0001表示 10M的物理网口速率、 0010 表示 100M物理网口速率、0100表示 1000M物理网口速率、1000表示 10000M 物理网口速率。
优选地, 上述方法具有以下特点:
所述从设备通过将计算得到的平均线路传输延时减去延时误差, 对所述 时钟偏差进行补偿, 其中,
所述延时误差为: N匪一一 tiy = ( +J2) x 8 x ^^ + J3 x 8 x ^^
J表示除帧前导和校验位外整个帧长, J2表示检验位长度, ^表示帧前 导长度, Sm表示主设备的物理网口转发每比特数据的时间, Ss表示从设备 的物理网口转发每比特数据的时间。
为了解决上述问题, 本发明提供一种时间同步的***, 包括主设备和一 个或多个从设备,
主设备设置为: 将自身的物理网口速率信息告知从设备;
从设备设置为: 获知主设备的物理网口速率后, 与自身的物理网口速率 进行比较, 如果不相同, 则对计算得到的平均线路传输延时进行补偿, 否则, 不进行补偿。
优选地, 上述***具有以下特点:
主设备还设置为: 通过向从设备发送通知报文, 所述通知报文中携带自 身的物理网口速率信息, 将自身的物理网口速率信息告知从设备。
优选地, 上述***具有以下特点:
所述主设备还设置为: 向从设备发送通知报文之前, 将自身的物理网口 速率信息写入所述通知报文的域号和标识域之间的保留字节中。
优选地, 上述***具有以下特点:
所述物理网口速率信息中, 釆用 0001表示 10M的物理网口速率、 0010 表示 100M物理网口速率、0100表示 1000M物理网口速率、1000表示 10000M 物理网口速率。
优选地, 上述***具有以下特点:
所述从设备还设置为: 通过将计算得到的平均线路传输延时减去延时误 差, 对所述时钟偏差进行补偿, 其中,
所述延时误差为: N匪一一 tiy = ( +J2) x 8 x ^^ + J3 x 8 x ^^
^表示除帧前导和校验位外整个帧长, J2表示检验位长度, ^表示帧前 导长度, Sm表示主设备的物理网口转发每比特数据的时间, Ss表示从设备 的物理网口转发每比特数据的时间。
釆用本发明的技术方案, 在延时请求响应机制中将可以解决由于主从物 理网口速率不一致引起的延迟不对称, 导致相位不同步问题。
附图概述
图 1是延时请求响应机制示意图;
图 2是组网示意图; 图 3是本发明应用示例的流程图。 本发明的较佳实施方式
首先, 对现有技术出现的问题进行分析:
如图 2所示的组网方式中, 主设备与从设备之间物理接口速率不匹配的 情况下, 会带来非对称延时问题。 对于图 2, 我们在如下条件下进行分析:
1、 两个方向的线路传输延时相等;
2、 中间未知网络(云网络)延时相同;
3、 在帧前导(preamble)与目的 MAC之间打时间戳;
为了分析问题需要, 同时做如下假设:
( 1 )釆用 UDP/IPv4/Ethemet报头, 包括校验位, 整个包长为 86比特;
(2)报文帧由交换机完全读入緩存后再开始转发;
(3) 帧前导为 8比特;
(4)校验位为 4比特;
(5)主设备的物理网口速率为千兆以太网;
(6)从设备的物理网口速率为百兆以太网;
在主设备到从设备的方向上, 事件报文的延时为:
t2-tl = (Ll+ L2 \ytes x ltslbyte x GEnslbit + DPSN + (L3 )bytes x ltslbyte x FEmlbit (式 3 ) 其中, A表示除帧前导(pre-amble)和校验位 (FCS)外整个帧长; J2表示检验位 ( FCS )长度;
J3表示帧前导 ( re-amble )长度;
GE„s/blt表示 1000M物理网口转发每 bit数据的时间;
FEm/bit表示 100M物理网口转发每 bit数据的时间;
DPSN表示数据包经过未知网络的延迟时间;
在从设备到主设备的方向上, 事件报文的延时为: t4-t3 = {Lx + L2 )bytes x Usjbyte x FEnsjbu + DPSN + (L3 )bytes x ltslhyte x GEnsjbu (式 4 ) 其中 A、 2、 L GEnslM、 FEmlbtt、 D層与式 3表示相同。
平均线路传输延时如下式:
[(t2-tl) + (t4-t3)] (式 5 )
N 将式(3)和式(4)代入式(5)为:
_ (L1 +L2+L3)xSx(GE + FE)ns ( , ,
― 十"尸 、 U, 上面的计算结果是在主从两个方向的延迟认为是对称的基础上的, 也就 是认为
(t2-tl)=(t4-t3) (;式
而实际上这二者是不相等的。
式 3减式 6计算 Master到 Slave与 Slave到 Master延时误差为:
NmeanPathDelayAtry = (A + 2 ) X 8 X GE ^FE + 3 χ 8 x FE ^GE (式 8 ) 式 6减式 4计算 Master到 Slave与 Slave到 Master延时误差为: r _ (J τ o GE― FE FE― GE ( - Q
对于 1000M物理网口, 传一位数据所需要的时间为 Ins, 对于 100M物 理网口, 传一位数据所需要的时间为 10ns。 代入式 8或式 9可以得到,
N匪一— =(86 + = -2952ns (式 10 )
Figure imgf000008_0001
从理论上推导, 对于主从之间, 由于 1000M物理网口与 100M物理网口 速率不匹配的情况下, 导致 -2.952us 的误差, 这个误差将被误认为是由于主 从间的偏差造成的, 调整后将会引起主从间相位不同的问题。
为了证明这个理论的正确性, 做了如下实验, 主设备为 1000M物理网口 速率, 从设备为 100M物理网口速率, 分别经过一级交换和九级交换。 实验 结果如下表所示。 从表 2中看出, 交换级数的增加, 对非对称性没有影响, 该非对称性是由主从物理网口速率不匹配导致。 表 2
Figure imgf000009_0001
说明: "-"表示 Slave的相位超前于 Master的相位 无论 PTP 报文承载在 Ethernet 802.3 上, 还是承载在 UDP/IPv4 和 UDP/IPv6上均存在同样的问题。 只要主从之间物理网口速率不一致, 则会导 致主到从的延时间与从到主 ^艮文延迟时间不同, 从而导致同步后主从间相位 不同步问题。
本发明提出解决主从之间物理网口速率不一致导致延迟非对称性问题。 方法如下: 主设备将自身的物理网口速率信息告知从设备; 从设备获知主设 备的物理网口速率后, 与自身的物理网口速率进行比较, 如果不相同, 则对 计算得到的平均线路传输延时进行补偿, 否则, 不进行补偿。
具体地, 主设备可通过向从设备发送 Announce (通知)报文, 所述通知 报文中携带自身的物理网口速率信息。
该物理网口速率信息可位于 domainNumber (域号)和 flagField (标识域) 之间的 reserved (保留)字节中, 也即: 所述主设备向从设备发送通知报文之 前, 所述主设备可将自身的物理网口速率信息写入所述通知报文的 domainNumber和 flagField之间的 reserved字节中。
所述物理网口速率信息中,可采用 0001表示 10M的物理网口速率、 0010 表示 100M物理网口速率、0100表示 1000M物理网口速率、1000表示 10000M 物理网口速率。
所述从设备通过将计算得到的平均线路传输延时减去延时误差, 对所述 时钟偏差进行补偿, 其中, 所述延时误差为: N匪一— = ( +J2) x 8 x ^^ + J3 x 8 x ^^ (式
11 )
^表示除帧前导和校验位外整个帧长, J2表示检验位长度, ^表示帧前 导长度, Sm表示主设备的物理网口转发每比特数据的时间, Ss表示从设备 的物理网口转发每比特数据的时间。
相应地, 本发明实施例的时间同步的***, 包括主设备和一个或多个从 设备, 其中,
主设备在实施其主设备功能的同时, 将自身的物理网口速率信息告知从 设备;
从设备在实施其主设备功能的同时,通过 Announce报文获知主设备的物 理网口速率后, 与自身的物理网口速率进行比较, 如果不相同, 则对计算得 到的平均线路传输延时进行补偿, 否则, 不进行补偿。
主设备可进一步用于通过向从设备发送通知报文, 所述通知报文中携带 自身的物理网口速率信息, 将自身的物理网口速率信息告知从设备。
所述主设备进一步用于向从设备发送通知报文之前, 可将自身的物理网 口速率信息写入所述通知报文的域数目和领域标识之间的保留字节中。
所述从设备可进一步用于通过将计算得到的平均线路传输延时减去延时 误差, 对所述时钟偏差进行补偿, 其中,
所述延时误差为: N丽一 — =
Figure imgf000010_0001
^表示除帧前导和校验位外整个帧长, J2表示检验位长度, ^表示帧前 导长度, Sm表示主设备的物理网口转发每比特数据的时间, Ss表示从设备 的物理网口转发每比特数据的时间。
下面通过一个在 Announce报文报头增加表示主设备物理网口速率应用 示例进一步说明本发明。 应用 1588进行时间同步的模型如图 2所示, 中间可能经过多个交换机、 路由器等。
如图 3所示, 本示例包括如下步骤:
步骤 301 , 主设备将自身的物理网口速率信息写入 Announce报文的 domainNumber和 flagField之间的 reserved字节中,其中, 0001表示 10M、 0010 表示 100M、 0100表示 1000M、 1000表示 10000M;
原 Announce报文报头可参见表 3 , 本示例的新 Announce报文报头可参 见表 4;
步骤 302, 主设备将该 Announce 文发送给从设备;
步骤 303 , 从设备接收到 Announce报文后, 解析出主设备的物理网口速 率;
步骤 304 , 从设备把解析出来的主设备的物理网口速率与从设备的物理 网口速率比较, 如果相同, 则不进行补偿, 如果不相同, 解析出报文的长度, 然后按照式 11的计算出来的值进行补偿。
按照上述步骤, 就可以保证主从之间物理网口速率不一致情况下, 不会 产生由于线路不对称引起同步后相位不对称的问题。
表 3现有技术的 Announce报文报头
Bits (比特) Octets offset
7 6 5 4 3 2 1 0 (字节数) (偏移) transportSpecific 1 0 1 1 1 0
(传输特性)
Reserved (保留) versionPTP (版本 ) 1 1 messageLength (才艮文长度 ) 2 2 domainNumber (域号 ) 1 4
Reserved (保留) 1 5 flagField (标识域 ) 2 6 correctionField (糾正域) 8 8 reserved (保留) 4 16 sourcePortldentity (源端口号) 10 20 sequencelD (序歹 'J号) 2 30 controlField (控制域) 1 32 logMessagelnterval (才艮文时间间隔) 1 33
表 4 本应用示例的 Announce 4艮文才艮头
Figure imgf000012_0001
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序 来指令相关硬件完成, 所述程序可以存储于计算机可读存储介质中, 如只读 存储器、 磁盘或光盘等。 可选地, 上述实施例的全部或部分步骤也可以使用 一个或多个集成电路来实现, 相应地, 上述实施例中的各模块 /单元可以釆用 硬件的形式实现, 也可以釆用软件功能模块的形式实现。 本发明不限制于任 何特定形式的硬件和软件的结合。
以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本 领域的技术人员来说, 本发明可以有各种更改和变化。 凡在本发明的精神和 原则之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护 范围之内。
工业实用性
釆用本发明的技术方案, 在延时请求响应机制中将可以解决由于主从物 理网口速率不一致引起的延迟不对称, 导致相位不同步问题。

Claims

权 利 要 求 书
1、 一种时间同步的方法, 包括:
主设备将自身的物理网口速率信息告知从设备;
从设备获知主设备的物理网口速率后,与自身的物理网口速率进行比较, 如果不相同, 则对计算得到的平均线路传输延时进行补偿, 否则, 不进行补 偿。
2、 如权利要求 1所述的方法, 其中,
所述主设备将自身的物理网口速率告知从设备的步骤包括:
主设备向从设备发送通知报文, 所述通知报文中携带自身的物理网口速 率信息。
3、 如权利要求 2所述的方法, 其中,
所述主设备向从设备发送通知报文之前, 所述主设备将自身的物理网口 速率信息写入所述通知" ^艮文的域号和标识域之间的保留字节中。
4、 如权利要求 1 ~ 3中任意一项所述的方法, 其中,
所述物理网口速率信息中, 釆用 0001表示 10M的物理网口速率、 0010 表示 100M物理网口速率、0100表示 1000M物理网口速率、1000表示 10000M 物理网口速率。
5、 如权利要求 1 ~ 3中任意一项所述的方法, 其中,
所述从设备通过将计算得到的平均线路传输延时减去延时误差, 对所述 时钟偏差进行补偿, 其中,
所述延时误差为: N画一— try = ( +J2)x8x^* + x8x^^
J,表示除帧前导和校验位外整个帧长, J2表示检验位长度, ^表示帧前 导长度, Sm表示主设备的物理网口转发每比特数据的时间, Ss表示从设备 的物理网口转发每比特数据的时间。
6、 一种时间同步的***, 包括主设备和一个或多个从设备, 其中, 主设备设置为: 将自身的物理网口速率信息告知从设备; 从设备设置为: 获知主设备的物理网口速率后, 与自身的物理网口速率 进行比较, 如果不相同, 则对计算得到的平均线路传输延时进行补偿, 否则, 不进行补偿。
7、 如权利要求 6所述的***, 其中,
主设备还设置为: 通过向从设备发送通知报文, 所述通知报文中携带自 身的物理网口速率信息, 将自身的物理网口速率信息告知从设备。
8、 如权利要求 7所述的***, 其中,
所述主设备还设置为: 向从设备发送通知报文之前, 将自身的物理网口 速率信息写入所述通知" ^艮文的域号和标识域之间的保留字节中。
9、 如权利要求 6 ~ 8中任意一项所述的***, 其中,
所述物理网口速率信息中, 釆用 0001表示 10M的物理网口速率、 0010 表示 100M物理网口速率、0100表示 1000M物理网口速率、1000表示 10000M 物理网口速率。
10、 如权利要求 6 ~ 8中任意一项所述的***, 其中,
所述从设备还设置为: 通过将计算得到的平均线路传输延时减去延时误 差, 对所述时钟偏差进行补偿, 其中, 所述延时误差为: N画一— try = ( +J2)x8x^* + x8x^^
J,表示除帧前导和校验位外整个帧长, J2表示检验位长度, ^表示帧前 导长度, Sm表示主设备的物理网口转发每比特数据的时间, Ss表示从设备 的物理网口转发每比特数据的时间。
PCT/CN2011/074301 2010-11-26 2011-05-19 一种时间同步的方法和*** WO2012068845A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010561070.6A CN102006157B (zh) 2010-11-26 2010-11-26 一种时间同步的方法和***
CN201010561070.6 2010-11-26

Publications (1)

Publication Number Publication Date
WO2012068845A1 true WO2012068845A1 (zh) 2012-05-31

Family

ID=43813252

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/074301 WO2012068845A1 (zh) 2010-11-26 2011-05-19 一种时间同步的方法和***

Country Status (2)

Country Link
CN (1) CN102006157B (zh)
WO (1) WO2012068845A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3151471A1 (en) * 2015-09-29 2017-04-05 Tektronix, Inc. Adaptive compensation for internal asymmetric delay in network based timing systems
CN116915670A (zh) * 2023-09-14 2023-10-20 浙江国利信安科技有限公司 用于确定网络恢复时间的方法、设备和介质

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102006157B (zh) * 2010-11-26 2015-01-28 中兴通讯股份有限公司 一种时间同步的方法和***
CN102932905B (zh) 2011-08-10 2017-06-16 中兴通讯股份有限公司 自动补偿1588链路非对称性时延的实现方法及***
CN102549951A (zh) * 2011-12-23 2012-07-04 华为技术有限公司 外时钟数据同步处理方法、设备和***
CN102843293B (zh) * 2012-08-20 2018-01-26 中兴通讯股份有限公司 一种处理报文的方法和网元设备
CN102833062B (zh) * 2012-09-25 2015-08-12 广东电网公司珠海供电局 智能变电站ieee1588主从时钟同步报文对时方法及***
CN103067113B (zh) * 2012-12-24 2015-08-12 中兴通讯股份有限公司 基于聚合链路实现ptp时间同步的方法及装置
CN103118029A (zh) * 2013-02-18 2013-05-22 中兴通讯股份有限公司 一种加密报文互传时间同步方法及装置
CN103457715A (zh) * 2013-08-20 2013-12-18 上海奇微通讯技术有限公司 一种基于网络链路状态变化的自动延时补偿装置及方法
CN104506268B (zh) * 2014-12-15 2017-07-14 飞天诚信科技股份有限公司 一种实现时间校准的方法
CN105939243B (zh) * 2016-04-14 2019-02-15 烽火通信科技股份有限公司 多端口ptp报文的处理***
CN110149257A (zh) * 2018-12-20 2019-08-20 中铁十四局集团房桥有限公司 实时以太网总线主从站本地应用同步方法及装置
CN110061796B (zh) * 2019-04-25 2024-05-14 广东优力普物联科技有限公司 一种用于实现远距离poe传输的方法及***
CN112636861A (zh) * 2020-12-31 2021-04-09 深圳市英特瑞半导体科技有限公司 一种时钟同步方法、装置、设备及存储介质
CN116300693B (zh) * 2023-02-17 2023-10-20 上海铼钠克数控科技有限公司 数控伺服***的同步方法及应用

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0100077B1 (de) * 1982-07-26 1988-06-22 Siemens Aktiengesellschaft Schaltungsanordnung zur Takterzeugung in Fernmeldeanlagen, insbesondere Zeitmultiplex-Digital-Vermittlungsanlagen
CN101399653A (zh) * 2007-09-25 2009-04-01 普然通讯技术(上海)有限公司 一种时钟同步的实现方法
CN101867431A (zh) * 2010-05-27 2010-10-20 同济大学 一种网络时钟同步方法
CN102006157A (zh) * 2010-11-26 2011-04-06 中兴通讯股份有限公司 一种时间同步的方法和***

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7483448B2 (en) * 2004-03-10 2009-01-27 Alcatel-Lucent Usa Inc. Method and system for the clock synchronization of network terminals
CN101227246A (zh) * 2008-01-28 2008-07-23 中兴通讯股份有限公司 一种主从时钟同步的方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0100077B1 (de) * 1982-07-26 1988-06-22 Siemens Aktiengesellschaft Schaltungsanordnung zur Takterzeugung in Fernmeldeanlagen, insbesondere Zeitmultiplex-Digital-Vermittlungsanlagen
CN101399653A (zh) * 2007-09-25 2009-04-01 普然通讯技术(上海)有限公司 一种时钟同步的实现方法
CN101867431A (zh) * 2010-05-27 2010-10-20 同济大学 一种网络时钟同步方法
CN102006157A (zh) * 2010-11-26 2011-04-06 中兴通讯股份有限公司 一种时间同步的方法和***

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3151471A1 (en) * 2015-09-29 2017-04-05 Tektronix, Inc. Adaptive compensation for internal asymmetric delay in network based timing systems
CN116915670A (zh) * 2023-09-14 2023-10-20 浙江国利信安科技有限公司 用于确定网络恢复时间的方法、设备和介质
CN116915670B (zh) * 2023-09-14 2023-12-05 浙江国利信安科技有限公司 用于确定网络恢复时间的方法、设备和介质

Also Published As

Publication number Publication date
CN102006157B (zh) 2015-01-28
CN102006157A (zh) 2011-04-06

Similar Documents

Publication Publication Date Title
WO2012068845A1 (zh) 一种时间同步的方法和***
JP6931376B2 (ja) ネットワーク内の滞留時間情報の送信
US8923346B2 (en) Time synchronization method, device and system
JP6032824B2 (ja) パケット交換通信網におけるスケジューリング方法、エンドノード及びコアネットワークスイッチ
WO2010097035A1 (zh) 时钟报文隧道传输的方法、网络节点和通信***
WO2012003746A1 (zh) 一种实现边界时钟的方法和装置
WO2007031005A1 (fr) Procede, dispositif ethernet et ethernet permettant la synchronisation d'horloge
WO2011120262A1 (zh) 时间同步的处理方法及装置
WO2010111963A1 (zh) 时间同步装置、方法和***
WO2012065334A1 (zh) 在时分复用网络中实现时间同步的方法、设备和***
CN111385048A (zh) 一种时间同步方法及***
JP2013187766A (ja) データブロック出力装置、通信システム、データブロック出力方法、及び通信方法
WO2007025452A1 (fr) Methode de transmission de donnees de service et appareil correspondant
JP5373185B2 (ja) Ntpオンパスサポートのためのアドおよびドロップエレメント、およびntpドメインとieee−1588プロトコルドメインの間の相互運用方法
US20190097744A1 (en) Pseudowire clock recovery
WO2012068848A1 (zh) 一种时间同步的方法和***
WO2011032494A1 (zh) 精确时间协议报文处理方法和时钟设备
WO2012071910A1 (zh) 一种实现时间同步的方法及装置
WO2014117489A1 (zh) 时钟同步方法及设备
WO2012065402A1 (zh) 一种epon***以及***中实现端到端透明时钟的方法
Simanic et al. Compensation of asymmetrical latency for ethernet clock synchronization
JP5653518B2 (ja) 同期イーサネットおよびsonet/sdhドメイン内で時間を分配するための方法
WO2013189361A2 (zh) 一种处理报文的方法和网元设备
EP2458757B1 (en) A method for transmitting IEEE 1588V2 synchronization packets over ethernet in link-by-link mode, via network elements having a transparent clock, and associated help device
WO2020103540A1 (zh) 同步的方法和装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11843488

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11843488

Country of ref document: EP

Kind code of ref document: A1