[go: up one dir, main page]

CN102006157B - Time synchronization method and system - Google Patents

Time synchronization method and system Download PDF

Info

Publication number
CN102006157B
CN102006157B CN201010561070.6A CN201010561070A CN102006157B CN 102006157 B CN102006157 B CN 102006157B CN 201010561070 A CN201010561070 A CN 201010561070A CN 102006157 B CN102006157 B CN 102006157B
Authority
CN
China
Prior art keywords
physical internet
internet ports
equipment
speed
rate information
Prior art date
Legal status (The legal status 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 status listed.)
Expired - Fee Related
Application number
CN201010561070.6A
Other languages
Chinese (zh)
Other versions
CN102006157A (en
Inventor
罗丽
彭勇
傅小明
唐雄
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201010561070.6A priority Critical patent/CN102006157B/en
Publication of CN102006157A publication Critical patent/CN102006157A/en
Priority to PCT/CN2011/074301 priority patent/WO2012068845A1/en
Application granted granted Critical
Publication of CN102006157B publication Critical patent/CN102006157B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

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

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

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

The present invention discloses a method and system for time synchronization, wherein the method includes: the master device notifies the slave device of its own physical network port rate information; Compare the network port rates, if they are not the same, then compensate the calculated average line transmission delay, otherwise, do not compensate. By adopting the technical scheme of the invention, in the delay request response mechanism, the delay asymmetry caused by the inconsistency of the master-slave physical network port speed can be solved, resulting in the phase asynchronous problem.

Description

一种时间同步的方法和系统A method and system for time synchronization

技术领域 technical field

本发明涉及时钟同步领域,尤其涉及一种时间同步的方法和系统。The present invention relates to the field of clock synchronization, in particular to a time synchronization method and system.

背景技术 Background technique

在通信系统中,随着数据业务和多媒体业务的不断发展,基于IP的分组网络传送数据已是发展的主流。这时,一方面新的业务和新的应用对网络的同步性能提出更高的要求,另一方面对传统TDM(Time Division Multiplexing,时分复用)业务的兼容等都需要分组网络提供高质量的同步与定时性能。In the communication system, with the continuous development of data services and multimedia services, IP-based packet network transmission of data has become the mainstream of development. At this time, on the one hand, new services and new applications put forward higher requirements on the synchronization performance of the network; on the other hand, the compatibility of traditional TDM (Time Division Multiplexing) services requires the packet network to provide high-quality Synchronization and timing performance.

IEEE1588 PTP(Precision Time Synchronization Protocol,精密时钟同步协议)是为克服以太网实时性不足而规定的一种对时机制,它的出现给我们带来了希望,它的主要原理是对网络中所有节点进行对时同步,由一个精确的时间源周期性地对网络中所有节点的时钟进行校正同步。IEEE1588 PTP (Precision Time Synchronization Protocol) is a time synchronization mechanism stipulated to overcome the lack of real-time performance of Ethernet. Its appearance has brought us hope. Its main principle is that all nodes in the network For time synchronization, an accurate time source periodically corrects and synchronizes the clocks of all nodes in the network.

IEEE 1588 PTP是一种以太网时钟同步协议,通过同步报文实现主从同步。PTP标准协议可以承载在Ethernet 802.3、UDP/IPv4和UDP/IPv6,802.3帧结构的形式如表1所示。IEEE 1588 PTP is an Ethernet clock synchronization protocol, which realizes master-slave synchronization through synchronization messages. The PTP standard protocol can be carried on Ethernet 802.3, UDP/IPv4 and UDP/IPv6, and the form of the 802.3 frame structure is shown in Table 1.

表1Table 1

IEEE 1588v2系统作为一种主从同步系统,在系统的同步过程中,主时钟按照预定的时间间隔发送PTP时间信息,从时钟端口接收主时钟端口发来的时间戳信息,系统据此计算出主从线路时间延迟及主从时间差,并利用该时间差调整本地时间,使从设备时间保持与主设备时间一致的频率与相位。具体方案如图1所示。主设备(Master)发送Sync(同步)报文,并记录时间t1。从设备(Slave)在接收到Sync报文时,记录t2。从设备根据主设备发送的Follow_up(跟踪)报文,获知t1。从设备相应的发起Delay_Req(延迟请求)报文,同时记录时间t3,主设备收到Delay_Req报文后,记录时间t4,并填入Delay_Resp(延时响应)报文。从设备根据主设备发送的Delay_Resp(延迟响应)报文,获知t4。The IEEE 1588v2 system is a master-slave synchronization system. During the synchronization process of the system, the master clock sends PTP time information according to the predetermined time interval, and the slave clock port receives the time stamp information sent by the master clock port, and the system calculates the master clock time information accordingly. Slave line time delay and master-slave time difference, and use the time difference to adjust the local time, so that the slave device time maintains the same frequency and phase as the master device time. The specific scheme is shown in Figure 1. The master device (Master) sends a Sync (synchronization) message and records the time t1. When the slave device (Slave) receives the Sync message, it records t2. The slave device learns t1 according to the Follow_up (tracking) message sent by the master device. The slave device correspondingly initiates a Delay_Req (delay request) message, and records the time t3 at the same time. After the master device receives the Delay_Req message, it records the time t4 and fills in the Delay_Resp (delay response) message. The slave device learns t4 according to the Delay_Resp (delayed response) message sent by the master device.

图1中t1和t2分别为Sync报文的发送和接收时间戳,即t1是Sync报文出主设备时的时间,t2为Sync报文到从设备时的时间。t3和t4分别为Delay_Req报文的发送和接收时间戳,即t3为Delay_Req报文出从设备的时间,t4为Delay_Req报文到主设备的时间。In FIG. 1 , t1 and t2 are the sending and receiving timestamps of the Sync message respectively, that is, t1 is the time when the Sync message leaves the master device, and t2 is the time when the Sync message arrives at the slave device. t3 and t4 are the sending and receiving timestamps of the Delay_Req message respectively, that is, t3 is the time when the Delay_Req message leaves the slave device, and t4 is the time when the Delay_Req message arrives at the master device.

平均线路传输延时mean_path_delay=[(t2-t1)+(t4-t3)]/2=[(t2-t3)+(t4-t1)]/2            (式1)Average line transmission delay mean_path_delay=[(t2-t1)+(t4-t3)]/2=[(t2-t3)+(t4-t1)]/2 (Formula 1)

从设备的时间与主设备的时间之差为offset=[(t1-t2)+(t4-t3)]/2(式2)The difference between the time of the slave device and the time of the master device is offset=[(t1-t2)+(t4-t3)]/2 (Formula 2)

通过上面两式,可以把从设备的时间同步于主设备。Through the above two formulas, the time of the slave device can be synchronized with the master device.

目前同步设备厂商们正在试图用IEEE1588网络时钟代替GPS(Global Positioning System,全球定位系统)时钟源,但是发布的IEEE1588-2008在实现时还存在一些问题。At present, synchronization equipment manufacturers are trying to replace the GPS (Global Positioning System, Global Positioning System) clock source with the IEEE1588 network clock, but there are still some problems in the implementation of the released IEEE1588-2008.

发明内容 Contents of the invention

现有的IEEE1588-2008标准没有明确描述主与从物理连接网口是否速率匹配,如果主从物理连接网口速率不一致,会导致主到从的延迟时间与从到主的延迟时间不同,从而产生时间同步误差,导致同步时相位不对称问题。The existing IEEE1588-2008 standard does not clearly describe whether the rates of the master and slave physical connection ports match. If the rates of the master and slave physical connection ports are inconsistent, the delay time from the master to the slave will be different from that from the slave to the master, resulting in Time synchronization error, resulting in phase asymmetry during synchronization.

本发明要解决的技术问题提出一种时间同步的方法和系统,解决主从间由于时间戳接口物理速率不一致,导致主从间时间不同步问题。The technical problem to be solved by the present invention proposes a time synchronization method and system to solve the problem of time asynchrony between the master and the slave due to the inconsistency of the physical rate of the time stamp interface between the master and the slave.

为了解决上述问题,本发明提供一种时间同步的方法,包括:In order to solve the above problems, the present invention provides a method for time synchronization, including:

主设备将自身的物理网口速率信息告知从设备;The master device informs the slave device of its own physical network port rate information;

从设备获知主设备的物理网口速率后,与自身的物理网口速率进行比较,如果不相同,则对计算得到的平均线路传输延时进行补偿,否则,不进行补偿。After learning the physical network port rate of the master device, the slave device compares it with its own physical network port rate. If they are not the same, the calculated average line transmission delay is compensated; otherwise, no compensation is performed.

优选地,上述方法具有以下特点:Preferably, the above method has the following characteristics:

所述主设备将自身的物理网口速率告知从设备的步骤包括:The steps of the master device notifying the slave device of its own physical network port rate include:

主设备向从设备发送通知报文,所述通知报文中携带自身的物理网口速率信息。The master device sends a notification message to the slave device, and the notification message carries the rate information of its own physical network port.

优选地,上述方法具有以下特点:Preferably, the above method has the following characteristics:

所述主设备向从设备发送通知报文之前,所述主设备将自身的物理网口速率信息写入所述通知报文的域号和标识域之间的保留字节中。Before the master device sends the notification message to the slave device, the master device writes its own physical network port rate information into the reserved byte between the domain number and the identification field of the notification message.

优选地,上述方法具有以下特点:Preferably, the above method has the following characteristics:

所述物理网口速率信息中,采用0001表示10M的物理网口速率、0010表示100M物理网口速率、0100表示1000M物理网口速率、1000表示10000M物理网口速率。In the physical network port speed information, 0001 represents the physical network port speed of 10M, 0010 represents the physical network port speed of 100M, 0100 represents the physical network port speed of 1000M, and 1000 represents the physical network port speed of 10000M.

优选地,上述方法具有以下特点:Preferably, the above method has the following characteristics:

所述从设备通过将计算得到的平均线路传输延时减去延时误差,对所述时钟偏差进行补偿,其中,The slave device compensates the clock deviation by subtracting the delay error from the calculated average line transmission delay, wherein,

所述延时误差为: The delay error is:

L1表示除帧前导和校验位外整个帧长,L2表示检验位长度,L3表示帧前导长度,Sm表示主设备的物理网口转发每比特数据的时间,Ss表示从设备的物理网口转发每比特数据的时间。L 1 indicates the length of the entire frame except the frame preamble and check digit, L 2 indicates the length of the check bit, L 3 indicates the length of the frame preamble, Sm indicates the time for the physical network port of the master device to forward each bit of data, and Ss indicates the physical network port of the slave device The time for the network port to forward each bit of data.

为了解决上述问题,本发明提供一种时间同步的系统,包括主设备和一个或多个从设备,In order to solve the above problems, the present invention provides a time synchronization system, including a master device and one or more slave devices,

主设备用于将自身的物理网口速率信息告知从设备;The master device is used to inform the slave device of its own physical network port rate information;

从设备用于获知主设备的物理网口速率后,与自身的物理网口速率进行比较,如果不相同,则对计算得到的平均线路传输延时进行补偿,否则,不进行补偿。After the slave device is used to learn the physical network port rate of the master device, it compares it with its own physical network port rate. If they are not the same, the calculated average line transmission delay is compensated, otherwise, no compensation is performed.

优选地,上述系统具有以下特点:Preferably, the above system has the following characteristics:

主设备进一步用于通过向从设备发送通知报文,所述通知报文中携带自身的物理网口速率信息,将自身的物理网口速率信息告知从设备。The master device is further configured to notify the slave device of its own physical network port rate information by sending a notification message to the slave device, the notification message carrying its own physical network port rate information.

优选地,上述系统具有以下特点:Preferably, the above system has the following characteristics:

所述主设备进一步用于向从设备发送通知报文之前,将自身的物理网口速率信息写入所述通知报文的域号和标识域之间的保留字节中。The master device is further configured to write its own physical network port rate information into the reserved byte between the domain number and the identification field of the notification message before sending the notification message to the slave device.

优选地,上述系统具有以下特点:Preferably, the above system has the following characteristics:

所述物理网口速率信息中,采用0001表示10M的物理网口速率、0010表示100M物理网口速率、0100表示1000M物理网口速率、1000表示10000M物理网口速率。In the physical network port speed information, 0001 represents the physical network port speed of 10M, 0010 represents the physical network port speed of 100M, 0100 represents the physical network port speed of 1000M, and 1000 represents the physical network port speed of 10000M.

优选地,上述系统具有以下特点:Preferably, the above system has the following characteristics:

所述从设备进一步用于通过将计算得到的平均线路传输延时减去延时误差,对所述时钟偏差进行补偿,其中,The slave device is further configured to compensate the clock deviation by subtracting the delay error from the calculated average line transmission delay, wherein,

所述延时误差为: The delay error is:

L1表示除帧前导和校验位外整个帧长,L2表示检验位长度,L3表示帧前导长度,Sm表示主设备的物理网口转发每比特数据的时间,Ss表示从设备的物理网口转发每比特数据的时间。L 1 indicates the length of the entire frame except the frame preamble and check digit, L 2 indicates the length of the check bit, L 3 indicates the length of the frame preamble, Sm indicates the time for the physical network port of the master device to forward each bit of data, and Ss indicates the physical network port of the slave device The time for the network port to forward each bit of data.

采用本发明的技术方案,在延时请求响应机制中将可以解决由于主从物理网口速率不一致引起的延迟不对称,导致相位不同步问题。By adopting the technical solution of the present invention, in the delay request response mechanism, the delay asymmetry caused by the inconsistency of the master-slave physical network port speed can be solved, resulting in the phase asynchronous problem.

附图说明 Description of drawings

图1是延时请求响应机制示意图;Figure 1 is a schematic diagram of a delayed request response mechanism;

图2是组网示意图;Figure 2 is a schematic diagram of networking;

图3是本发明应用示例的流程图。Fig. 3 is a flowchart of an application example of the present invention.

具体实施方式 Detailed ways

首先,对现有技术出现的问题进行分析:First, analyze the problems in the prior art:

如图2所示的组网方式中,主设备与从设备之间物理接口速率不匹配的情况下,会带来非对称延时问题。对于图2,我们在如下条件下进行分析:In the networking mode shown in Figure 2, if the rate of the physical interface between the master device and the slave device does not match, it will bring about an asymmetric delay problem. For Figure 2, we analyze under the following conditions:

1、两个方向的线路传输延时相等;1. Line transmission delays in both directions are equal;

2、中间未知网络(云网络)延时相同;2. The unknown network (cloud network) in the middle has the same delay;

3、在帧前导(preamble)与目的MAC之间打时间戳;3. Timestamp between the frame preamble and the destination MAC;

为了分析问题需要,同时做如下假设:In order to analyze the problem, the following assumptions are made at the same time:

(1)采用UDP/IPv4/Ethernet报头,包括校验位,整个包长为86比特;(1) UDP/IPv4/Ethernet header is adopted, including the check digit, and the entire packet length is 86 bits;

(2)报文帧由交换机完全读入缓存后再开始转发;(2) The message frame is completely read into the cache by the switch and then forwarded;

(3)帧前导为8比特;(3) The frame leader is 8 bits;

(4)校验位为4比特;(4) The check digit is 4 bits;

(5)主设备的物理网口速率为千兆以太网;(5) The rate of the physical network port of the master device is Gigabit Ethernet;

(6)从设备的物理网口速率为百兆以太网;(6) The speed of the physical network port of the slave device is 100M Ethernet;

在主设备到从设备的方向上,事件报文的延时为:In the direction from the master device to the slave device, the delay of the event message is:

t2-t1=(L1+L2)bytes×8bits/byte×GEns/bit+DPSN+(L3)bytes×8bits/byte×FEns/bit  (式3)t2-t1=(L 1 +L 2 ) bytes ×8 bits/byte ×GE ns/bit +D PSN +(L 3 ) bytes ×8 bits/byte ×FE ns/bit (Formula 3)

其中,L1表示除帧前导(pre-amble)和校验位(FCS)外整个帧长;Wherein, L 1 represents the entire frame length except the frame preamble (pre-amble) and the parity bit (FCS);

L2表示检验位(FCS)长度;L 2 represents the length of the check bit (FCS);

L3表示帧前导(pre-amble)长度;L 3 represents the frame preamble (pre-amble) length;

GEns/bit表示1000M物理网口转发每bit数据的时间;GE ns/bit indicates the time for the 1000M physical network port to forward each bit of data;

FEns/bit表示100M物理网口转发每bit数据的时间;FE ns/bit indicates the time for the 100M physical network port to forward each bit of data;

DPSN表示数据包经过未知网络的延迟时间;D PSN indicates the delay time of the data packet passing through the unknown network;

在从设备到主设备的方向上,事件报文的延时为:In the direction from the slave device to the master device, the delay of the event message is:

t4-t3=(L1+L2)bytes×8bits/byte×FEns/bit+DPSN+(L3)bytes×8bits/byte×GEns/bit  (式4)t4-t3=(L 1 +L 2 ) bytes ×8 bits/byte ×FE ns/bit +D PSN +(L 3 ) bytes ×8 bits/byte ×GE ns/bit (Formula 4)

其中L1、L2、L3、GEns/bit、FEns/bit、DPSN与式3表示相同。Among them, L 1 , L 2 , L 3 , GE ns/bit , FE ns/bit , and D PSN are the same as formula 3.

平均线路传输延时如下式:The average line transmission delay is as follows:

N meanPathDelay = [ ( t 2 - t 1 ) + ( t 4 - t 3 ) ] 2 (式5) N meanPathDelay = [ ( t 2 - t 1 ) + ( t 4 - t 3 ) ] 2 (Formula 5)

将式(3)和式(4)代入式(5)为:Substituting formula (3) and formula (4) into formula (5) is:

N meanPathDealy = ( L 1 + L 2 + L 3 ) × 8 × ( GE + FE ) ns 2 + D PSN (式6) N meanPathDealy = ( L 1 + L 2 + L 3 ) × 8 × ( GE + FE ) ns 2 + D. PSN (Formula 6)

上面的计算结果是在主从两个方向的延迟认为是对称的基础上的,也就是认为The above calculation results are based on the fact that the delay in the two directions of the master and slave is considered to be symmetrical, that is, it is considered

(t2-t1)=(t4-t3)            (式7)(t2-t1)=(t4-t3) (Formula 7)

而实际上这二者是不相等的。In fact, the two are not equal.

式3减式6计算Master到Slave与Slave到Master延时误差为:Equation 3 minus Equation 6 calculates the delay error from Master to Slave and Slave to Master as follows:

N meanPathDelayAssymmetry = ( L 1 + L 2 ) × 8 × GE - FE 2 + L 3 × 8 × FE - GE 2 (式8) N meanPathDelayAssymmetry = ( L 1 + L 2 ) × 8 × GE - FE 2 + L 3 × 8 × FE - GE 2 (Formula 8)

式6减式4计算Master到Slave与Slave到Master延时误差为:Equation 6 minus Equation 4 calculates the delay error from Master to Slave and Slave to Master as follows:

N meanPathDelayAssymmetry = ( L 1 + L 2 ) × 8 × GE - FE 2 + L 3 × 8 × FE - GE 2 (式9) N meanPathDelayAssymmetry = ( L 1 + L 2 ) × 8 × GE - FE 2 + L 3 × 8 × FE - GE 2 (Formula 9)

对于1000M物理网口,传一位数据所需要的时间为1ns,对于100M物理网口,传一位数据所需要的时间为10ns。代入式8或式9可以得到,For a 1000M physical network port, the time required to transmit a bit of data is 1ns, and for a 100M physical network port, the time required to transmit a bit of data is 10ns. Substituting into formula 8 or formula 9 can get,

N meanPathDelayAssymmetry = ( 86 + 4 ) × 8 × 1 - 10 2 + 8 × 8 × 10 - 1 2 = - 2952 ns (式10) N meanPathDelayAssymmetry = ( 86 + 4 ) × 8 × 1 - 10 2 + 8 × 8 × 10 - 1 2 = - 2952 ns (Formula 10)

从理论上推导,对于主从之间,由于1000M物理网口与100M物理网口速率不匹配的情况下,导致-2.952us的误差,这个误差将被误认为是由于主从间的偏差造成的,调整后将会引起主从间相位不同的问题。It is theoretically deduced that for the master-slave, due to the mismatch between the speed of the 1000M physical network port and the 100M physical network port, an error of -2.952us will be caused, which will be mistaken for the deviation between the master and the slave. , the adjustment will cause the phase difference between master and slave.

为了证明这个理论的正确性,做了如下实验,主设备为1000M物理网口速率,从设备为100M物理网口速率,分别经过一级交换和九级交换。实验结果如下表所示。从表2中看出,交换级数的增加,对非对称性没有影响,该非对称性是由主从物理网口速率不匹配导致。In order to prove the correctness of this theory, the following experiment was done. The master device has a physical network port speed of 1000M, and the slave device has a physical network port speed of 100M. They have undergone one-level switching and nine-level switching respectively. The experimental results are shown in the table below. It can be seen from Table 2 that the increase in the number of switching stages has no effect on the asymmetry, which is caused by the rate mismatch between the master and slave physical network ports.

表2Table 2

说明:“-”表示Slave的相位超前于Master的相位Explanation: "-" indicates that the phase of the Slave is ahead of the phase of the Master

无论PTP报文承载在Ethernet 802.3上,还是承载在UDP/IPv4和UDP/IPv6上均存在同样的问题。只要主从之间物理网口速率不一致,则会导致主到从的延时间与从到主报文延迟时间不同,从而导致同步后主从间相位不同步问题。The same problem exists no matter whether the PTP message is carried on Ethernet 802.3 or on UDP/IPv4 and UDP/IPv6. As long as the rates of the physical network ports between the master and the slave are inconsistent, the delay time from the master to the slave will be different from the delay time from the slave to the master message, which will lead to the phase out of synchronization between the master and the slave after synchronization.

本发明提出解决主从之间物理网口速率不一致导致延迟非对称性问题。方法如下:主设备将自身的物理网口速率信息告知从设备;从设备获知主设备的物理网口速率后,与自身的物理网口速率进行比较,如果不相同,则对计算得到的平均线路传输延时进行补偿,否则,不进行补偿。The present invention proposes to solve the problem of delay asymmetry caused by the inconsistency of the speed of the physical network ports between the master and the slave. The method is as follows: the master device informs the slave device of its own physical network port rate information; after the slave device learns the master device's physical network port rate, it compares it with its own physical network port rate. If they are not the same, the calculated average line The transmission delay is compensated, otherwise, no compensation is performed.

具体地,主设备可通过向从设备发送Announce(通知)报文,所述通知报文中携带自身的物理网口速率信息。Specifically, the master device may send an Announce (notification) message to the slave device, and the notification message carries the rate information of its own physical network port.

该物理网口速率信息可位于domainNumber(域号)和flagField(标识域)之间的reserved(保留)字节中,也即:所述主设备向从设备发送通知报文之前,所述主设备可将自身的物理网口速率信息写入所述通知报文的domainNumber和flagField之间的reserved字节中。The physical network port rate information can be located in the reserved (reserved) byte between domainNumber (domain number) and flagField (identification field), that is: before the master device sends a notification message to the slave device, the master device It can write its own physical network port rate information into the reserved byte between domainNumber and flagField of the notification message.

所述物理网口速率信息中,可采用0001表示10M的物理网口速率、0010表示100M物理网口速率、0100表示1000M物理网口速率、1000表示10000M物理网口速率。In the physical network port rate information, 0001 can be used to represent the 10M physical network port rate, 0010 can be used to represent the 100M physical network port rate, 0100 can be used to represent the 1000M physical network port rate, and 1000 can be used to represent the 10000M physical network port rate.

所述从设备通过将计算得到的平均线路传输延时减去延时误差,对所述时钟偏差进行补偿,其中,The slave device compensates the clock deviation by subtracting the delay error from the calculated average line transmission delay, wherein,

所述延时误差为:(式11)The delay error is: (Formula 11)

L1表示除帧前导和校验位外整个帧长,L2表示检验位长度,L3表示帧前导长度,Sm表示主设备的物理网口转发每比特数据的时间,Ss表示从设备的物理网口转发每比特数据的时间。L 1 indicates the length of the entire frame except the frame preamble and check digit, L 2 indicates the length of the check bit, L 3 indicates the length of the frame preamble, Sm indicates the time for the physical network port of the master device to forward each bit of data, and Ss indicates the physical network port of the slave device The time for the network port to forward each bit of data.

相应地,本发明实施例的时间同步的系统,包括主设备和一个或多个从设备,其中,Correspondingly, 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 its own physical network port rate information while implementing its master device function;

从设备在实施其主设备功能的同时,通过Announce报文获知主设备的物理网口速率后,与自身的物理网口速率进行比较,如果不相同,则对计算得到的平均线路传输延时进行补偿,否则,不进行补偿。While the slave device is implementing its master device function, after knowing the physical network port rate of the master device through the Announce message, compare it with its own physical network port rate. If they are not the same, then calculate the average line transmission delay Compensation, otherwise, no compensation.

主设备可进一步用于通过向从设备发送通知报文,所述通知报文中携带自身的物理网口速率信息,将自身的物理网口速率信息告知从设备。The master device may be further configured to notify the slave device of its own physical network port rate information by sending a notification message to the slave device, the notification message carrying its own physical network port rate information.

所述主设备进一步用于向从设备发送通知报文之前,可将自身的物理网口速率信息写入所述通知报文的域数目和领域标识之间的保留字节中。The master device is further configured to write its own physical network port rate information into the reserved byte between the domain number and domain identifier of the notification message before sending the notification message to the slave device.

所述从设备可进一步用于通过将计算得到的平均线路传输延时减去延时误差,对所述时钟偏差进行补偿,其中,The slave device may be further used to compensate the clock deviation by subtracting the delay error from the calculated average line transmission delay, wherein,

所述延时误差为: The delay error is:

L1表示除帧前导和校验位外整个帧长,L2表示检验位长度,L3表示帧前导长度,Sm表示主设备的物理网口转发每比特数据的时间,Ss表示从设备的物理网口转发每比特数据的时间。L 1 indicates the length of the entire frame except the frame preamble and check digit, L 2 indicates the length of the check bit, L 3 indicates the length of the frame preamble, Sm indicates the time for the physical network port of the master device to forward each bit of data, and Ss indicates the physical network port of the slave device The time for the network port to forward each bit of data.

下面通过一个在Announce报文报头增加表示主设备物理网口速率应用示例进一步说明本发明。In the following, the present invention is further described by adding an application example indicating the rate of the master device's physical network port in the header of the Announce message.

应用1588进行时间同步的模型如图2所示,中间可能经过多个交换机、路由器等。The model of applying 1588 for time synchronization is shown in Figure 2, which may pass through multiple switches and routers.

如图3所示,本示例包括如下步骤:As shown in Figure 3, this example includes the following steps:

步骤301,主设备将自身的物理网口速率信息写入Announce报文的domainNumber和flagField之间的reserved字节中,其中,0001表示10M、0010表示100M、0100表示1000M、1000表示10000M;Step 301, the master device writes its own physical network port rate information into the reserved byte between the domainNumber and flagField of the Announce message, where 0001 means 10M, 0010 means 100M, 0100 means 1000M, and 1000 means 10000M;

原Announce报文报头可参见表3,本示例的新Announce报文报头可参见表4;Refer to Table 3 for the header of the original Announce packet, and refer to Table 4 for the header of the new Announce packet in this example;

步骤302,主设备将该Announce报文发送给从设备;Step 302, the master device sends the Announce message to the slave device;

步骤303,从设备接收到Announce报文后,解析出主设备的物理网口速率;Step 303, after receiving the Announce message from the device, analyze the physical network port rate of the master device;

步骤304,从设备把解析出来的主设备的物理网口速率与从设备的物理网口速率比较,如果相同,则不进行补偿,如果不相同,解析出报文的长度,然后按照式11的计算出来的值进行补偿。Step 304, the slave device compares the parsed physical network port rate of the master device with the physical network port rate of the slave device, if they are the same, no compensation is performed, if not, the length of the message is parsed, and then according to formula 11 The calculated value is compensated.

按照上述步骤,就可以保证主从之间物理网口速率不一致情况下,不会产生由于线路不对称引起同步后相位不对称的问题。By following the above steps, it can be ensured that when the speeds of the physical network ports between the master and the slave are inconsistent, there will be no problem of phase asymmetry after synchronization due to line asymmetry.

表3  现有技术的Announce报文报头Table 3 Announce message header of the prior art

表4  本应用示例的Announce报文报头Table 4 Announce message header of this application example

本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序来指令相关硬件完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现,相应地,上述实施例中的各模块/单元可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。本发明不限制于任何特定形式的硬件和软件的结合。Those skilled in the art can understand that all or part of the steps in the above method can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium, such as a read-only memory, a magnetic disk or an optical disk, and the like. Optionally, all or part of the steps in the above embodiments can also be implemented using one or more integrated circuits. Correspondingly, each module/unit in the above embodiments can be implemented in the form of hardware, or can be implemented in the form of software function modules. The form is realized. The present invention is not limited to any specific combination of hardware and software.

以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims (8)

1. a method for time synchronized, comprising:
The physical internet ports rate information of self is informed from equipment by main equipment;
Know the physical internet ports speed of main equipment from equipment after, compare with the physical internet ports speed of self, if not identical, then the average line transmission delay calculated is compensated, otherwise, do not compensate;
Described from equipment by the average line transmission delay calculated is deducted delay time error, clock jitter is compensated, wherein,
Described delay time error is: N meanPathDelayAssymmetry = ( L 1 + L 2 ) × 8 × Sm - Ss 2 + L 3 × 8 × Ss - Sm 2
L 1represent whole frame length except frame preamble and check digit, L 2represent check bit length, L 3represent frame preamble length, Sm represents that the physical internet ports of main equipment forwards the time of every Bit data, and Ss represents the time forwarding every Bit data from the physical internet ports of equipment.
2. the method for claim 1, is characterized in that,
The physical internet ports speed of self is informed from the step of equipment and is comprised by described main equipment:
Main equipment, to from equipment dispatch order message, carries the physical internet ports rate information of self in described notice message.
3. method as claimed in claim 2, is characterized in that,
Described main equipment is to before equipment dispatch order message, and the physical internet ports rate information of self writes in the reserve bytes between the territory number of described notice message and identification field by described main equipment.
4., as the method in claims 1 to 3 as described in any one, it is characterized in that,
In described physical internet ports rate information, the physical internet ports speed, 0010 of 10M represents that 100M physical internet ports speed, 0100 represents that 1000M physical internet ports speed, 1000 represents 10000M physical internet ports speed to adopt 0001 to represent.
5. a system for time synchronized, comprises main equipment and one or more from equipment, it is characterized in that,
Main equipment is used for the physical internet ports rate information of self to inform from equipment;
From equipment for know main equipment physical internet ports speed after, compare with the physical internet ports speed of self, if not identical, then the average line transmission delay calculated compensated, otherwise, do not compensate;
Describedly be further used for, by the average line calculated transmission delay is deducted delay time error, compensating clock jitter from equipment, wherein,
Described delay time error is: N meanPathDelayAssymmetry = ( L 1 + L 2 ) × 8 × Sm - Ss 2 + L 3 × 8 × Ss - Sm 2
L 1represent whole frame length except frame preamble and check digit, L 2represent check bit length, L 3represent frame preamble length, Sm represents that the physical internet ports of main equipment forwards the time of every Bit data, and Ss represents the time forwarding every Bit data from the physical internet ports of equipment.
6. system as claimed in claim 5, is characterized in that,
Main equipment is further used for, by from equipment dispatch order message, carrying the physical internet ports rate information of self, inform the physical internet ports rate information of self from equipment in described notice message.
7. system as claimed in claim 6, is characterized in that,
Described main equipment is further used for before equipment dispatch order message, is write by the physical internet ports rate information of self in the reserve bytes between the territory number of described notice message and identification field.
8., as the system in claim 5 ~ 7 as described in any one, it is characterized in that,
In described physical internet ports rate information, the physical internet ports speed, 0010 of 10M represents that 100M physical internet ports speed, 0100 represents that 1000M physical internet ports speed, 1000 represents 10000M physical internet ports speed to adopt 0001 to represent.
CN201010561070.6A 2010-11-26 2010-11-26 Time synchronization method and system Expired - Fee Related CN102006157B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201010561070.6A CN102006157B (en) 2010-11-26 2010-11-26 Time synchronization method and system
PCT/CN2011/074301 WO2012068845A1 (en) 2010-11-26 2011-05-19 Method and system for time synchronization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010561070.6A CN102006157B (en) 2010-11-26 2010-11-26 Time synchronization method and system

Publications (2)

Publication Number Publication Date
CN102006157A CN102006157A (en) 2011-04-06
CN102006157B true CN102006157B (en) 2015-01-28

Family

ID=43813252

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010561070.6A Expired - Fee Related CN102006157B (en) 2010-11-26 2010-11-26 Time synchronization method and system

Country Status (2)

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

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102006157B (en) * 2010-11-26 2015-01-28 中兴通讯股份有限公司 Time synchronization method and system
CN102932905B (en) 2011-08-10 2017-06-16 中兴通讯股份有限公司 The realization method and system of 1588 link asymmetry time delays of automatic compensation
CN102549951A (en) * 2011-12-23 2012-07-04 华为技术有限公司 Method, device and system for data synchronization treatment of external clock
CN102843293B (en) * 2012-08-20 2018-01-26 中兴通讯股份有限公司 A kind of method and network element device for handling message
CN102833062B (en) * 2012-09-25 2015-08-12 广东电网公司珠海供电局 Intelligent substation IEEE1588 master-salve clock synchronization message setting means and system
CN103067113B (en) * 2012-12-24 2015-08-12 中兴通讯股份有限公司 Method and the device of PTP time synchronized is realized based on aggregated links
CN103118029A (en) * 2013-02-18 2013-05-22 中兴通讯股份有限公司 Synchronized method and device of encrypted messages between each other
CN103457715A (en) * 2013-08-20 2013-12-18 上海奇微通讯技术有限公司 Automatic delay compensation device and method based on network link status changes
CN104506268B (en) * 2014-12-15 2017-07-14 飞天诚信科技股份有限公司 A kind of method for realizing time calibration
US20170093560A1 (en) * 2015-09-29 2017-03-30 Tektronix, Inc. Adaptive compensation for internal asymmetric delay in network based timing systems
CN105939243B (en) * 2016-04-14 2019-02-15 烽火通信科技股份有限公司 The processing system of multiport PTP message
CN110149257A (en) * 2018-12-20 2019-08-20 中铁十四局集团房桥有限公司 The locally applied synchronous method of Ethernet bus master-salve station and device
CN110061796B (en) * 2019-04-25 2024-05-14 广东优力普物联科技有限公司 Method and system for realizing remote POE transmission
CN112636861A (en) * 2020-12-31 2021-04-09 深圳市英特瑞半导体科技有限公司 Clock synchronization method, device, equipment and storage medium
GB2627879B (en) * 2021-05-04 2025-04-16 Canon Kk Controlling time synchronisation in a wireless network
CN116300693B (en) * 2023-02-17 2023-10-20 上海铼钠克数控科技有限公司 Synchronization method and application of numerical control servo system
CN116915670B (en) * 2023-09-14 2023-12-05 浙江国利信安科技有限公司 Methods, equipment and media for determining network recovery time

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227246A (en) * 2008-01-28 2008-07-23 中兴通讯股份有限公司 A method and device for master-slave clock synchronization
CN101399653A (en) * 2007-09-25 2009-04-01 普然通讯技术(上海)有限公司 Time clock synchronization implementation method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE3227849A1 (en) * 1982-07-26 1984-01-26 Siemens AG, 1000 Berlin und 8000 München CIRCUIT FOR CLOCK GENERATION IN TELECOMMUNICATION SYSTEMS, IN PARTICULAR TIME MULTIPLEX-DIGITAL SWITCHING SYSTEMS
US7483448B2 (en) * 2004-03-10 2009-01-27 Alcatel-Lucent Usa Inc. Method and system for the clock synchronization of network terminals
CN101867431B (en) * 2010-05-27 2013-10-30 同济大学 Network clock synchronization method
CN102006157B (en) * 2010-11-26 2015-01-28 中兴通讯股份有限公司 Time synchronization method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101399653A (en) * 2007-09-25 2009-04-01 普然通讯技术(上海)有限公司 Time clock synchronization implementation method
CN101227246A (en) * 2008-01-28 2008-07-23 中兴通讯股份有限公司 A method and device for master-slave clock synchronization

Also Published As

Publication number Publication date
CN102006157A (en) 2011-04-06
WO2012068845A1 (en) 2012-05-31

Similar Documents

Publication Publication Date Title
CN102006157B (en) Time synchronization method and system
CN111385048B (en) A time synchronization method and system
CN102577194B (en) System and method for synchronizing clocks within a distributed network
CN106921456B (en) Multi-hop wireless backhaul network time synchronization error compensation method based on PTP protocol
CN102111380B (en) Time synchronization method, device and system
CN102013931B (en) Time synchronization method and system, salve timing device and main timing device
JP6596084B2 (en) Sending residence time information in the network
CN101834712B (en) Method for realizing accurate time synchronization by utilizing IEEE1588 protocol
US8873588B2 (en) Network distributed packet-based synchronization
CN101494613B (en) Clock message tunnel transmission method, network node and communication system
US10355799B2 (en) Pseudowire clock recovery
CN102013969B (en) Method and device for realizing time synchronization
CN103166792B (en) Line asymmetrical compensation method, equipment and system
JP2015531216A (en) Method for synchronizing distribution clocks with a high precision time protocol in a communication network
CN104798326A (en) Method for managing and maintaining an accurate distribution of time in a network when a failure occurs
CN104754722B (en) A kind of method for synchronizing time towards stratification heterogeneous network
CN103168440B (en) Time path compensation method and device
WO2017071521A1 (en) Method, node and system for detecting clock synchronization path
CN102342051B (en) For coming the method for synchronised clock and relevant system and module by separating transmission first and second data via at least one time distribution protocol
CN111416751A (en) Method and device for calculating port forwarding time delay
CN104836654B (en) A kind of clock synchronizing method based on Ethernet POWERLINK
CN103026646B (en) For distributing the method for time in synchronous ethernet and SONET/SDH territory
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
CN101902291B (en) Method, equipment and system for precise time synchronization
CN108683472A (en) A kind of clock synchronizing method based on Time delay measurement

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20150128