WO2011120262A1 - 时间同步的处理方法及装置 - Google Patents

时间同步的处理方法及装置 Download PDF

Info

Publication number
WO2011120262A1
WO2011120262A1 PCT/CN2010/074587 CN2010074587W WO2011120262A1 WO 2011120262 A1 WO2011120262 A1 WO 2011120262A1 CN 2010074587 W CN2010074587 W CN 2010074587W WO 2011120262 A1 WO2011120262 A1 WO 2011120262A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
value
protocol message
timestamp
time protocol
Prior art date
Application number
PCT/CN2010/074587
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 WO2011120262A1 publication Critical patent/WO2011120262A1/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/0673Clock or time synchronisation among packet nodes using intermediate nodes, e.g. modification of a received timestamp before further transmission to the next packet node, e.g. including internal delay time or residence time into the packet
    • 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 communications, and in particular to a method and apparatus for processing time synchronization.
  • PTP Precision Time Protocol
  • IEEE 1588 Institute for Electrical and Electronic Engineers 1588
  • Passive optical network for example, Ethernet Passive Optical Network (EPON), Gigabit Passive Optical Network (GPON), etc.
  • Packet Transfer Network Packet Transfer Network, Referred to as ⁇
  • sensor networks and other networks that use packet switching technology, synchronize the clocks of devices or sensors.
  • IEEE 1588 uses the master-slave mode to synchronize time information.
  • the master clock (Principal Clock) uses PTP packets to periodically release time information.
  • the slave clock (Slave Clock) measures the network delay according to the receiving time of the received PTP packets.
  • the time offset (Offset, the deviation between the local time and the time the master clock is released) is used to adjust the local clock based on this time offset.
  • IEEE1588 supports accurate time stamping when PTP packets are exported through the device through hardware to obtain more accurate time synchronization.
  • the IEEE1588 Precision Time Protocol supports two sync modes: One Step sync mode and Two Step sync mode.
  • the IEEE1588 clock node In the one-step synchronization mode, the IEEE1588 clock node only carries the transmission time of the message in the sent synchronization Sync message; in the two-step synchronization mode, the IEEE1588 clock node also issues a synchronization Sync message after issuing the synchronization Sync message.
  • the IEEE1588 clock node follows the Follow_Up message, and carry the corresponding synchronization Sync message transmission time in the following Follow_Up message.
  • each clock In a time-synchronized network, each clock is connected through a network, and there may be multiple network devices and communication cables between their ports between the clocks.
  • the network device may identify, process, and forward the message, which may add new to the transmission of the PTP event message. of delay.
  • the delay of the IEEE1588 measurement includes two parts: one is the delay caused by the processing of the PTP message inside the network device experienced, and the other is the transmission delay of the PTP message transmitted on the line.
  • the propagation delay of the communication medium is fixed and the two-way delay is almost the same.
  • the delay time for the network device to process and forward PTP messages is not fixed. Not only the delay time of each network device may be different, but the delay time in the uplink and downlink directions of the same network device may also be different. If the delay time of the network device cannot be accurately measured, time synchronization cannot be performed effectively.
  • Transparent Clock (TC) is proposed in the IEEE1588v2 standard.
  • a transparent clock is implemented between the ingress port and the egress port of the network device, and is used to learn the delay time between the ingress port and the egress port on the network device of the PTP event message, and the slave clock (Slave Clock) delays in calculating the transmission. Deducting the dwell time, the delay jitter caused by processing the message on the network device is removed, so that the time synchronization accuracy can be improved.
  • the specific method is to use the Correction Field in the PTP event message to record and accumulate the dwell time of the PTP message in the transparent clock. It can be seen that in the time synchronization network using the IEEE1588v2 standard, if the camp time of the PTP message in the transparent clock can be accurately learned, the transmission delay of the message can be calculated more accurately, and finally the slave clock is improved. The accuracy of the time synchronization of the master clock.
  • the method of recording and accumulating the camp time of the PTP message in the transparent clock is to record the reception time of the PTP event message such as Sync or Delay_Req at the ingress port, and record the message at the out port.
  • the sending time when the subsequent PTP message associated with the above message (for example, a Follow Up message associated with Sync, and a Delay Resp message associated with Delay_Req), when arriving, the difference between the sending time and the receiving time is resident.
  • the time is added to the Correction Field field of the current Follow_Up or Delay_Resp message.
  • this method needs to query and match the related message, and requires a central processing unit (CPU) for processing, and the processing efficiency is not high.
  • This method does not support the one-step (One Step) synchronization of IEEE1588 above. Transponders PTP message to the subsequent node, nor achieve a transparent support on the distributed device clock.
  • the main object of the present invention is to provide time synchronization of the processing scheme, in order to solve the above problems at least one.
  • a time synchronization processing method comprising: receiving, according to a precise time protocol message, a receiving time of a device at an ingress port and a precise time protocol message at the device The arrival time of the port, the value of the predetermined field in the precise time protocol message is adjusted at the egress port of the device, so that the predetermined field is used to record the delivery time of the precise time protocol message between the ingress port of the device and the egress port of the device.
  • a time synchronization processing apparatus comprising: an adjustment module, configured to receive a time and a precise time protocol message at an ingress port of a device according to a precise time protocol message.
  • the value of the predetermined field in the precise time protocol message is adjusted, so that the predetermined field is used to record the delivery time of the precise time protocol message between the ingress port of the device and the egress port of the device.
  • the time synchronization message is used to adjust the value of the predetermined field in the precise time protocol message according to the delivery time of the precise time protocol message in the device, and the related technology is not given in the transparent clock.
  • FIG. 1 is a schematic diagram showing an implementation mechanism of the IEEE 1588 ten protocol according to the technology of FIG. 2;
  • FIG. 2 is a flowchart of a method for processing time synchronization according to an embodiment of the present invention;
  • FIG. 4 is a schematic diagram of a flow of processing a PTP event message by an egress port according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of a time synchronization process of an embodiment of the present invention
  • FIG. 6 is a structural block diagram of a transparent clock composed of an OLT and an ONU according to an embodiment of the present invention
  • FIG. 7 is a structural block diagram of a time synchronization processing apparatus according to an embodiment of the present invention
  • 8 is a structural block diagram of an adjustment module according to another embodiment of the present invention
  • FIG. 9 is another structural block diagram of a time synchronization processing apparatus according to an embodiment of the present invention.
  • a time synchronization processing method comprising: receiving time at an ingress port of a device according to a precise time protocol message and an arrival time of a precise time protocol message at an egress port of the device, The value of the predetermined field in the precise time protocol message is adjusted at the egress port of the device, thereby using the predetermined field to record the delivery time of the precise time protocol message between the ingress port and the egress port of the device.
  • the method for adjusting the value of the predetermined field in the precise time protocol message according to the delivery time of the precise time protocol message in the device is solved, and the related art does not provide how to calculate the message resident in the transparent clock.
  • the problem of the method of staying time achieves the effect of effectively knowing the time the message resides in the device.
  • the precise time protocol message is a synchronous Sync message, a Follow_Up message, or a delayed request Delay_Req message.
  • the device only adjusts the value of the predetermined field of one of the Sync message and the Follow_Up message.
  • the embodiment has a corresponding Sync message or a FollowJJp message, and the ingress terminal processes the predetermined field only by using the above method to ensure that the dwell time in the downlink direction is only accumulated once.
  • the method further includes: receiving, by the ingress port of the device, the precise time protocol message, and acquiring the current local timestamp as the first timestamp value; A timestamp value is carried in the precise time protocol message and sent to the outbound port of the device; when the outbound port receives the precise time protocol message, the current local timestamp is obtained as the second timestamp, and the second time is calculated.
  • the difference between the timestamp and the first timestamp is the delivery time of the precise time protocol message within the device.
  • the calculation of the delivery time is performed at the egress port, so that the message can be accurately obtained. Delivery time in the backup.
  • the value of the predetermined field in the outbound port adjustment precision time protocol message of the device comprises: the device adjusts the value of the predetermined field to the sum of the current value of the predetermined field and the delivery time. This embodiment adjusts the value of the predetermined field at the egress port to accurately record the delivery time of the message in the device. 2 is a flowchart of a method for processing time synchronization according to an embodiment of the present invention.
  • the value of the predetermined field in the outbound port adjustment precision time protocol message of the device includes: Step S202: The ingress port of the device receives the precise time a protocol message, obtaining a current local timestamp as the first timestamp value, and setting a value of the predetermined field to a difference between a current value of the predetermined field and the first timestamp value; Step S204, the ingress port sends the precise time protocol message to the device And the outbound port; in step S206, when the outbound port of the device receives the precise time protocol message, obtain the current local timestamp as the second timestamp value, and set the value of the predetermined field to the current value of the predetermined field and the second timestamp value. Sum.
  • the ingress port and the egress port are located on different network devices.
  • the embodiment sets the predetermined field in the ingress port of the device to be the difference between the current value of the predetermined field and the timestamp value at the ingress port, and sets the predetermined field in the egress port to be the sum of the current value of the predetermined field and the timestamp value at the egress port.
  • the delay time of the precise time protocol message in the device is recorded, and the effect of effectively knowing the residence time of the precise time protocol message in the device is achieved.
  • setting the value of the predetermined field in the precise time protocol message to the difference between the current value of the predetermined field and the first timestamp value includes : Set the value of the predetermined field in the Sync message or its corresponding Follow_Up message to the difference between the current value of the predetermined field and the first timestamp value.
  • the embodiment has a corresponding Sync message or a Follow_Up message, and the ingress side processes only one of the messages by using the above method to ensure that the dwell time in the downlink direction is only accumulated once.
  • setting the value of the predetermined field in the precise time protocol message to the sum of the current value of the predetermined field and the second timestamp value includes : Set the value of the predetermined field in the Sync message or the Follow_Up message to Pre The sum of the current value of the field and the second timestamp value.
  • the embodiment has a corresponding Sync message or a Follow_Up message, and the egress end uses a processing principle consistent with the ingress end, and only one of the messages is processed by the predetermined method to ensure the dwell time in the downlink direction. It is accumulated once.
  • the processing principles of the ingress and egress are the same: Only one of the messages is processed as described above, that is, the Follow_Up message is forwarded only by processing the Sync message, or only The Follow_Up message is processed to forward the Sync directly.
  • the ingress port and the egress port are located on different network devices.
  • a transparent clock can be implemented between two ports distributed on two network devices, which simplifies the processing of time synchronization messages on the device.
  • the method for obtaining the first timestamp value and the second timestamp value comprises: starting from the least significant bit of the current local timestamp, extracting a value that does not exceed the length of the predetermined field.
  • the receiving, by the device, the message on the ingress port includes: the device receiving the message by using the ingress port; determining that the received message is a precise time protocol message. After receiving the message, the embodiment determines that the message is a precise time protocol message, and ensures that the precise time protocol message is processed at the ingress port, thereby obtaining the first timestamp of the accurate time protocol message in the device. Preferably, if the device determines that the received message is not a precise time protocol message, the received message is forwarded to the port.
  • the embodiment does not perform processing of the predetermined field on the message, but only forwards the given port, thereby avoiding unnecessary operations.
  • the device receives the message through the egress port; and determines that the message received by the port is a “true time protocol message.” This embodiment determines that the message is a precise time protocol after the egress port receives the message. The message ensures that the precise time protocol message is processed at the egress port, thereby effectively knowing the precise time protocol message on the device The second timestamp.
  • the device processes the precise time protocol message using a CPU or chip.
  • the device may be a network device that processes the precise time protocol message by the CPU in software, or may be a network device that processes the precise time protocol message by using the chip. In order to ensure the calculation accuracy of the delay time to a greater extent, it is preferred to use a chip in the network device to process the precise time protocol message.
  • This embodiment uses a CPU or chip to process the precise time protocol message, and achieves the use of software or hardware to process the precise time protocol message, and achieves the effect of being able to effectively know the time of residence of the precise time protocol message in the device.
  • the predetermined field is a correction field Correction Field
  • the embodiment utilizes a Correction Field as a predetermined field, thereby being able to effectively know the effect of the precise time protocol message residence time in the device in IEEE1588v2. Further preferred embodiments of the present invention will now be described with reference to examples.
  • Preferred Example 1 This embodiment illustrates the process of processing a message at an ingress port of a network device.
  • FIG. 3 is a schematic diagram of a process of processing an inbound port according to an embodiment of the present invention.
  • Step S301 A device receives a message at an ingress port.
  • Step S302 Determine, according to the message type, whether the message is a predetermined PTP event message, where the predetermined PTP event message is a Sync message, a Follow_Up message, or a Delay_Req message; if the determination result is yes, proceed to step S303, otherwise, the message is Do not process, transparent forwarding transmission.
  • Step S303 The device acquires a timestamp value from the local clock module. Since the length of the timestamp specified in IEEE 1588v2 is 10 bytes, which exceeds the length of the Correction Field field by 6 bytes, it takes 6 bytes from the least significant bit of the current time stamp of the local clock module.
  • Step S304 the device reads the current value of the Correction Field field in the PTP event message, subtracts the timestamp value obtained in step S303 from the value, and writes the calculation result into the Correction Field field. Then, the device forwards the PTP event message to the egress port according to the normal forwarding process.
  • FIG. 4 is a schematic diagram of a flow of an egress port processing message according to an embodiment of the present invention. The method includes: Step S401: A device receives a message at an egress port.
  • Step S402 determining whether the message is a predetermined PTP event message according to the message type, wherein the predetermined PTP event message is a Sync message, a Follow_Up message, or a Delay_Req message; if the determination result is yes, proceeding to step S403, otherwise, the message is Do not process, transparent forwarding transmission.
  • Step S403 The device acquires a timestamp value from a clock module of the local machine.
  • the length of the timestamp specified in IEEE1588v2 is 10 bytes, which exceeds the length of the Correction Field field by 6 bytes. Therefore, the current time from the local clock module
  • the least significant bit of the stamp begins, taking a value of 6 bytes as the timestamp value.
  • Step S404 reading the current value of the Correction Field field in the PTP message, ⁇ !
  • the timestamp value obtained in step S403 on the value port is captured, and the calculation result is written in the field.
  • the message is then sent over the outgoing port.
  • the above preferred example one and the preferred example two may be used in combination, and may be combined for the same device, or the preferred example one may be used for the in port of one device, and the preferred example two may be used for the egress port of the other device.
  • Preferred Example 3 This embodiment implements a transparent clock on two ports on the same device.
  • FIG. 5 is a specific flowchart of a method for processing time synchronization according to an embodiment of the present invention.
  • Step S501 A primary clock sends a PTP event message Sync at time T1, where The current value of the Field field is 0.
  • Step S502 the Sync message may be processed and forwarded by multiple network devices to reach an ingress port of the network device implementing the present invention.
  • the ingress port recognizes that the message is a PTP Sync event message and obtains the current timestamp Ta of the device.
  • Step S504 After the device processes the forwarding process normally, the message arrives at the egress port of the device. The device obtains the current timestamp Tb.
  • Step S505 Modify the CF field value of the message to CF+Tb, and send the message to the next device by using a normal sending process.
  • the reverse Delay_Req message processing procedure is the same as the above, except that the outgoing and incoming ports are converted; the network device does not process other messages such as Follow_Up and Delay_Rsp, and performs transparent forwarding transmission. The above process can also be applied to the Follow_Up message. At this time, the network device does not process the Sync message and performs transparent forwarding.
  • the ingress port and the egress port are on different devices.
  • the PON-based ranging mechanism between the optical line terminal (OLT) and the Optical Network Unit (ONU) realizes time synchronization between the OLT and the ONU.
  • the synchronization process can use the existing synchronization method, and the specific implementation manner is not described here.
  • the uplink Ethernet interface of the OLT is used as the ingress port, and the downlink Ethernet interface of the ONU is used as the egress port.
  • the uplink Ethernet interface of the OLT is used as the egress port, and the ONU is connected.
  • the Ethernet interface acts as an ingress port, which together form a transparent clock on the OLT and the ONU.
  • FIG. 6 is a structural block diagram of a transparent clock composed of an OLT and an ONU according to an embodiment of the present invention.
  • the PTP message from the OLT uplink interface passes through the lower link of the ONU, and the PTP message in the Correction Field field has been forced to stay in the transparent clock.
  • the PTP packet from the ONU's lower link is already in the Correction Field field of the PTP message.
  • the PTP message has been stuck in the transparent clock.
  • the Slave of the lower-level device deducts the delay characterized by the Correction Field field according to the 1588v2 standard algorithm, and can remove the delay and jitter caused by the transmission and processing of the PTP message inside the PON device.
  • a transparent clock can be implemented between two ports on one network device, but also a transparent clock can be realized between two ports distributed on two network devices, and one-step synchronization of IEEE1588v2 is supported (One Step) mode and two step (Two Step) sync mode.
  • the adjustment operation can be performed uniformly on the egress port.
  • This embodiment provides a method for calculating the dwell time at the egress port of the device.
  • the method includes: the ingress port of the device receives the precise time protocol message, and obtains the current local timestamp as the first timestamp value; the ingress port sends the precise time protocol message and the first timestamp value to the egress port of the device, where The first timestamp value can be used as the content of the new extended field of the PTP message.
  • the bearer is sent in the PTP message and sent to the port. Of course, the port can be sent separately.
  • the outbound port receives the precise time protocol message, the current local timestamp is obtained.
  • the second timestamp calculates the difference between the second timestamp and the first timestamp as the delivery time of the precise time protocol message within the device.
  • the device After calculating the delivery time, the device adjusts the value of the predetermined field to the sum of the current value of the predetermined field and the delivery time, and then the egress port sends the PTP message, wherein the predetermined field may be a correction field.
  • the egress port and the ingress port can be located on the same network device or on different network devices.
  • the embodiment of the present invention further provides a time synchronization processing device, and FIG. 7 is a structural block diagram of a time synchronization processing device according to an embodiment of the present invention.
  • the adjusting module 714 is configured to adjust a value of a predetermined field in the precise time protocol message according to the receiving time of the inbound port of the device and the arrival time of the precise time protocol message at the egress port of the device according to the precise time protocol message, thereby using the predetermined
  • the field records the delivery time of the precise time protocol message between the ingress and egress ports of the device.
  • the device may further include: a first receiving module 702, located at the ingress port, configured to receive the precise time protocol message, where the first obtaining module 704 is coupled to the first receiving module 702, located at the ingress port, configured to obtain the current local timestamp as the first a timestamp value; the first sending module 706 is coupled to the first obtaining module 704, located at the ingress port, carrying the first timestamp value in the precise time protocol message and sending the precise time protocol message to the egress port of the device; The second receiving module 708 is coupled to the first sending module 706, located at the egress port, for receiving the precise time protocol message, and the second obtaining module 710 is coupled to the second receiving module 708, located at the egress port, for obtaining the current local timestamp.
  • a first receiving module 702 located at the ingress port, configured to receive the precise time protocol message
  • the first obtaining module 704 is coupled to the first receiving module 702, located at the ingress port, configured to obtain the current local timestamp as the first a
  • the second time stamp, the calculation module 712 is coupled to the second acquisition module 710, located at the egress port, for calculating the difference between the second timestamp and the first timestamp as the delivery time of the precise time protocol message in the device; the adjustment module 714 is coupled To the calculation module 712, the value of the predetermined field is adjusted to be the sum of the current value of the predetermined field and the delivery time.
  • FIG. 8 is a structural block diagram of an adjustment module according to another embodiment of the present invention.
  • the adjustment module 800 includes: a third receiving module 802, located at an ingress port, configured to receive a precise time protocol message, and a third obtaining module 804 to receive a third receiving
  • the module 802 is located at the ingress port, and is configured to obtain the current local timestamp as the first timestamp value.
  • the first setting module 806 is coupled to the third obtaining module 804, and is located at the ingress port, and configured to set the value of the predetermined field to a predetermined field.
  • the third sending module 808 is coupled to the first setting module 806, located at the ingress port, for sending the precise time protocol message to the egress port of the device;
  • the fourth receiving module 810 is coupled to the The third sending module 808 is located at the egress port for receiving the "true time protocol message", and the fourth obtaining module 812 is coupled to the fourth receiving module 810 for obtaining the current local timestamp as the second timestamp value, and the second setting module 814 is coupled to the fourth obtaining module 812, configured to set a value of the predetermined field to a sum of a current value of the predetermined field and a second timestamp value.
  • the device only needs to include the adjustment module 800 to implement the residence time of the recorded message between the ingress port and the egress port of the device, without the need for the first receiving module 702 and the like in the previous embodiment.
  • the device includes: a message receiving processing module 902, a message sending processing module 904. wherein the message receiving processing module 902 corresponds to one or more devices located at the ingress port Combination, when the ingress port of the network device receives a message, the message receiving processing module 902 is called to process the message, and the processing is processed.
  • the method of the preferred example 1 can be used.
  • the message sending processing module 904 corresponds to a combination of one or more devices located at the egress port.
  • the message sending processing module 904 When the device wants to send a message through the egress port, the message sending processing module 904 is called.
  • the message is processed, and the method of processing can use the method of the preferred example.
  • the message receiving processing module 902 and the message sending processing module 904 may be in one network device or in two network devices.
  • the message receiving processing module 902 and the message sending The processing module 904 can be located at the uplink Ethernet interface of the OLT and the downlink Ethernet interface of the ONU; in the uplink direction, the message receiving processing module 902 and the message sending processing module 904 can be located in the downlink Ethernet interface of the ONU and the uplink Ethernet of the OLT. interface.
  • the present invention solves the problem in the related art that does not give a method of calculating the dwell time in the transparent clock, thereby achieving the effect of effectively knowing the dwell time of the message in the device.
  • modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices.
  • they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps are fabricated as a single integrated circuit module.

Landscapes

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

Abstract

本发明提供了一种时间同步的处理方法及装置,该方法包括:根据精确时间协议消息在设备的入端口的接收时间和精确时间协议消息在设备的出端口的到达时间,在设备的出端口调整精确时间协议消息中预定字段的值,从而使用预定字段记录精确时间协议消息在设备的入端口和设备的出端口之间的传递时间。通过本发明,达到了有效获知消息在设备中驻留时间的效果。

Description

时间同步的处理方法 ^^置 技术领域 本发明涉及通信领域,具体而言, 涉及一种时间同步的处理方法及装置。 背景技术 随着网络技术的发展, 在分布式通信系统或数据处理系统中, 对系统中 设备的时间同步精度的要求越来越高。 奇确时间十办议 ( Precision Time Protocol , 简称为 PTP ) 是电气和电子工 程师十办会 1588 ( Institute for Electrical and Electronic Engineers 1588, 简称为 IEEE 1588 )标准定义的时间同步协议, 用在以太网、 无源光网络(例如, 以 太无源光网络 ( Ethernet Passive Optical Network, 简称为 EPON ), 千兆无源 光网络 ( Gigabit Passive Optical Network, 简称为 GPON ) 等)、 分组传送网 ( Packet Transfer Network , 简称为 ΡΤΝ ), 传感器网络、 以及其他釆用包交 换技术的网络中, 对其中的设备或传感器的时钟进行同步。
IEEE 1588釆用主从模式进行时间信息同步, 主时钟 ( Master Clock ) 釆 用 PTP数据包周期性发布时间信息, 从时钟( Slave Clock )根据收到 PTP数 据包的接收时间测算网络延迟 ( Delay ) 和时间偏差 ( Offset , 本地时间与主 时钟发布的时间之间的偏差), 才艮据此时间偏差来调整本地时钟。 IEEE1588 支持通过硬件获取 PTP数据包通过设备出口时的准确时间戳, 以此来获得更 为精确的时间同步。 IEEE1588精确时间协议支持两种同步模式: 一步 (One Step )同步模式和两步( Two Step )同步模式。 在一步同步模式中, IEEE1588 时钟节点仅在发出的同步 Sync 消息中携带该消息的发送时间; 在两步同步 模式中, IEEE1588时钟节点在发出同步 Sync消息后,还会发出与该同步 Sync 消息对应的跟随 Follow_Up消息, 在该跟随 Follow_Up消息中携带对应的同 步 Sync消息的发送时间。 在时间同步的网络中, 各时钟通过网络连接起来, 在时钟之间可能会有 多台网络设备以及他们的端口之间的通讯电缆。 在每一个网络设备上, 在一 个 PTP事件消息进入该网络设备的端口之后,该网络设备可能会对该消息进 行识别、 处理和转发等诸多的操作, 这会对该 PTP事件消息的传送增添新的 延迟时间。 IEEE1588测算的时延包括两部分: 一是 PTP消息在所经历的网 络设备内部处理而导致的时延, 二是 PTP消息在线路上传递的传输时延。 通 信介质的传输延时是固定的, 并且双向延时几乎是相同的。 但是, 网络设备 处理和转发 PTP消息的延迟时间却是不固定的, 不但每一台网络设备的延迟 时间可能不同, 就连同一网络设备上行和下行方向上的延迟时间也可能是不 同的。 如果不能准确测量网络设备的延迟时间, 时间同步就不能有效进行。 因此, 在测算网络时延时, 为了精确获知 PTP事件消息的传输时延, 必须精 确获知 PTP事件消息在所经历的网络设备上因处理该消息而导致的处理延迟 时间。 在 IEEE1588v2标准中提出了透明时钟 ( Transparent Clock, 简称为 TC ) 的概念。 在网络设备的入端口和出端口之间实现透明时钟, 用于获知 PTP事 件消息在网络设备上从入端口到出端口之间的延迟时间, 从时钟 ( Slave Clock )在计算传输时延时会扣除该驻留时间, 去除网络设备上因处理消息而 导致的时延抖动, 从而可以提高时间同步精度。 其具体的做法是利用 PTP事 件消息中的校正域 ( Correction Field ) 来记录和累计 PTP消息在透明时钟内 的驻留时间。 由此可见, 在釆用 IEEE1588v2标准的时间同步网络中, 如果 能够准确获知 PTP消息在透明时钟内的驻留时间, 则可以更^"确地计算消息 的传输时延, 并最终提高从时钟与主时钟的时间同步的精度。 在相关技术中, 记录和累计 PTP消息在透明时钟内的驻留时间的方法是 在入端口记录 Sync或 Delay_Req等 PTP事件消息的接收时间, 在出端口记 录该消息的发送时间, 当后续与上述消息关联的 PTP 消息 (例如, 与 Sync 关联的是 Follow Up消息, 与 Delay_Req关联的是 Delay Resp消息) 到达 时, 就把发送时间和接收时间的差值作为驻留时间累加到当前的 Follow_Up 或 Delay_Resp消息的 Correction Field字段中。 但是, 这种方法需要对上述 关联消息进行查询、 匹配, 需要中央处理单元 (Central Processing Unit, 简 称为 CPU ) 处理, 且处理效率不高。 这种方法不支持以上述 IEEE1588的一 步 ( One Step ) 同步模式向后续节点转发 PTP消息, 也不支持在分布式设备 上实现一个透明时钟。 发明内容 本发明的主要目的在于提供一种时间同步的处理方案, 以解决上述问题 至少之一。 为了实现上述目的, 才艮据本发明的一个方面, 提供了一种时间同步的处 理方法, 该方法包括: 根据精确时间协议消息在设备的入端口的接收时间和 精确时间协议消息在设备的出端口的到达时间, 在设备的出端口调整精确时 间协议消息中预定字段的值, 从而使用预定字段记录精确时间协议消息在设 备的入端口和设备的出端口之间的传递时间。 为了实现上述目的, 居本发明的另一个方面, 提供了一种时间同步的 处理装置, 该装置包括: 调整模块, 用于根据精确时间协议消息在设备的入 端口的接收时间和精确时间协议消息在设备的出端口的到达时间, 调整精确 时间协议消息中预定字段的值, 从而使用预定字段记录精确时间协议消息在 设备的入端口和设备的出端口之间的传递时间。 通过本发明, 对有关时间同步消息, 釆用才艮据精确时间协议消息在设备 内的传递时间, 调整该精确时间协议消息中预定字段的值, 解决了相关技术 中并没有给出在透明时钟中如何计算消息驻留时间的方法的问题, 进而达到 了有效获知消息在设备中驻留时间的效果。 附图说明 此处所说明的附图用来提供对本发明的进一步理解, 构成本申请的一部 分, 本发明的示意性实施例及其说明用于解释本发明, 并不构成对本发明的 不当限定。 在附图中: 图 1是才艮据^!关技术的 IEEE1588十办议实现机理的示意图; 图 2是才艮据本发明实施例的时间同步的处理方法的流程图; 图 3是才艮据本发明实施例的入端口处理 PTP事件消息的流程的示意图; 图 4是才艮据本发明实施例的出端口处理 PTP事件消息的流程的示意图; 图 5是 居本发明实施例的时间同步的处理方法的具体的流程图; 图 6是才艮据本发明实施例的 OLT和 ONU组成透明时钟的结构框图; 图 7是 居本发明实施例的时间同步的处理装置的结构框图; 图 8是根据本发明另一实施例的调整模块的结构框图; 以及 图 9是 居本发明实施例的时间同步的处理装置的另一种结构框图。 具体实施方式 下文中将参考附图并结合实施例来详细说明本发明。 需要说明的是, 在 不冲突的情况下, 本申请中的实施例及实施例中的特征可以相互组合。 才艮据本发明的实施例, 提供了一种时间同步的处理方法, 该方法包括: 根据精确时间协议消息在设备的入端口的接收时间和精确时间协议消息在设 备的出端口的到达时间, 在设备的出端口调整精确时间协议消息中预定字段 的值, 从而使用该预定字段记录精确时间协议消息在设备的入端口和出端口 之间的传递时间。 该实施例釆用才艮据精确时间协议消息在设备内的传递时间, 调整该精确 时间协议消息中预定字段的值的方式, 解决了相关技术中并没有给出在透明 时钟中如何计算消息驻留时间的方法的问题, 进而达到了有效获知消息在设 备中驻留时间的效果。 优选地, 精确时间协议消息为同步 Sync消息、 跟随 Follow_Up消息或 延迟请求 Delay_Req消息。 优选地, 在 Sync消息和 Follow Up消息对应的情况下, 设备仅对 Sync 消息和 Follow_Up消息中的一个的预定字段的值进行调整。 该实施例具有对应的 Sync消息或 FollowJJp消息, 入口端仅对其中一 个消息釆用上述方法进行预定字段的处理, 保证下行方向的驻留时间仅被累 计一次。 优选地, 在设备的出端口调整精确时间协议消息中预定字段的值之前, 还包括: 设备的入端口接收精确时间协议消息, 并获取当前本地时间戳作为 第一时间戳值; 入端口将第一时间戳值承载在精确时间协议消息中并将该精 确时间协议消息发送给设备的出端口; 出端口接收到精确时间协议消息时, 获取当前本地时间戳作为第二时间戳, 并计算第二时间戳和第一时间戳之差 作为精确时间协议消息在设备内的传递时间。 该实施例在出端口进行传递时间的计算, 从而能够准确获得该消息在设 备中的传递时间。 优选地, 在设备的出端口调整精确时间协议消息中预定字段的值包括: 设备将调整预定字段的值为预定字段的当前值和传递时间之和。 该实施例在出端口调整预定字段的值, 从而准确记录了该消息在设备中 的传递时间。 图 2是才艮据本发明实施例的时间同步的处理方法的流程图, 优选地, 在 设备的出端口调整精确时间协议消息中预定字段的值包括: 步骤 S202, 设备的入端口接收精确时间协议消息, 获取当前本地时间戳 作为第一时间戳值, 并将预定字段的值设置为预定字段的当前值与第一时间 戳值之差; 步骤 S204 ,入端口将精确时间协议消息发送给设备的出端口;步骤 S206 , 设备的出端口接收到精确时间协议消息时, 获取当前本地时间戳作为第二时 间戳值, 并将预定字段的值设置为预定字段的当前值与第二时间戳值之和。 优选地, 入端口和出端口位于不同的网络设备。 该实施例在设备的入端口设置预定字段为预定字段的当前值与入端口处 的时间戳值之差, 在出端口设置预定字段为预定字段的当前值与出端口处的 时间戳值之和, 从而记录了精确时间协议消息在设备中的延迟时间, 达到了 有效获知精确时间协议消息在设备中驻留时间的效果。 优选地, 在上一跳时钟节点釆用两步 (Two Step ) 同步模式的情况下, 将精确时间协议消息中的预定字段的值设置为预定字段的当前值与第一时间 戳值之差包括: 将 Sync消息或与其对应的 Follow_Up消息中的预定字段的 值设置为预定字段的当前值与第一时间戳值之差。 优选地, 该实施例具有对应的 Sync消息或 Follow_Up消息, 入口端仅 对其中一个消息釆用上述方法进行预定字段的处理, 保证下行方向的驻留时 间仅被累计一次。 优选地, 在上一跳时钟节点釆用两步 (Two Step ) 同步模式的情况下, 将精确时间协议消息中的预定字段的值设置为预定字段的当前值与第二时间 戳值之和包括: 将 Sync消息或 Follow_Up消息中的预定字段的值设置为预 定字段的当前值与第二时间戳值之和。 优选地, 该实施例具有对应的 Sync消息或 Follow_Up消息, 出口端要 使用与入口端一致的处理原则, 仅对其中一个消息釆用上述方法进行预定字 段的处理, 保证下行方向的驻留时间仅被累计一次。 对于每次同步的 Sync和 Follow_Up这两个消息, 入口端和出口端的处 理原则要保持一致: 只对其中一个消息作上述处理, 即, 仅对 Sync 消息进 行处理而将 Follow_Up消息直接转发, 或仅对 Follow_Up消息进行处理而将 Sync直接转发。 优选地, 入端口和出端口位于不同的网络设备。 在该实施例中, 可以在分布在两个网络设备上的两个端口间实现一个透 明时钟, 简化了时间同步消息在设备上的处理环节。 优选地, 获取第一时间戳值和第二时间戳值的方法包括: 从当前本地时 间戳的最低有效位开始, 提取不超过上述预定字段的长度的值。 该实施例提取时间戳的部分值, 使其长度能够与预定字段的字节长度相 匹配。 优选地, 设备在入端口接收消息包括: 设备通过入端口接收消息; 判断 接收的消息为精确时间协议消息。 该实施例在接收消息后判断该消息是精确时间协议消息, 保证了在入端 口处理精确时间协议消息,从而获得精确时间协议消息在设备中第一时间戳。 优选地, 在设备判断接收的消息不是精确时间协议消息的情况下, 将接 收的消息转发给出端口。 该实施例在判断接收的消息不是精确时间协议消息的情况下, 不会对该 消息进行预定字段的处理, 而仅是转发给出端口, 避免了不必要的操作。 优选地, 在设备获取第二时间戳之前, 设备通过出端口接收消息; 判断 出端口接收的消息为 ^"确时间协议消息。 该实施例在出端口接收到消息后判断该消息是精确时间协议消息, 保证 了在出端口处理精确时间协议消息, 从而有效获知精确时间协议消息在设备 中第二时间戳。 优选地, 在判断出端口接收的消息不是精确时间协议消息的情况下, 通 过出端口发送出端口接收的消息。 该实施例在出端口判断接收的消息不是精确时间协议消息的情况下, 不 会对该消息进行预定字段的处理, 而仅是转发该消息,避免了不必要的操作。 优选地,设备使用 CPU或芯片处理精确时间协议消息。该设备可以是由 CPU用软件方式对精确时间协议消息进行处理的网络设备, 也可以是釆用芯 片对精确时间协议消息进行处理的网络设备。 为了更大限度的保证延迟时间 的计算精度, 优选在网络设备中釆用芯片对精确时间协议消息进行处理。 该实施例使用 CPU或芯片处理精确时间协议消息,达到了使用软件或硬 件处理精确时间协议消息, 并达到了能够有效获知精确时间协议消息在设备 中驻留时间的效果。 优选地, 预定字段是校正域 Correction Field, 该实施例利用 Correction Field作为预定字段, 从而能够在 IEEE1588v2 中有效获知精确时间协议消息在设备中驻留时间的效果。 下面结合实例对本发明的其他优选实例进行说明。 优选实例一 本实施例说明在网络设备的入端口处理消息的过程。 图 3是根据本发明 实施例的入端口处理消息的流程的示意图, 该方法包括: 步骤 S301 , 设备在入端口接收消息。 步骤 S302, 根据消息类型来判断该消息是否为预定的 PTP事件消息, 其中, 预定 PTP事件消息为 Sync消息、 Follow_Up消息或 Delay_Req消息; 如果判断结果为是, 则进入步骤 S303 , 否则, 对该消息不做处理, 进行透明 转发传送。 步骤 S303 , 设备从本地时钟模块获取时间戳值。 由于 IEEE 1588v2中规 定的时间戳的长度为 10个字节, 超过了 Correction Field字段 6个字节的长 度, 因此, 从本地时钟模块当前时间戳的最低有效位开始, 取 6个字节长度 的值作为时间戳值。 步骤 S304, 设备读取 PTP事件消息中 Correction Field字段的当前值, 将该值减去步骤 S303 中获得的时间戳值, 并将计算结果写入该 Correction Field字段中。 然后, 设备按正常的转发处理流程转发该 PTP事件消息到出 端口。 优选实例二 本实施例描述了在网络设备的出端口处理消息的过程。 图 4是根据本发 明实施例的出端口处理消息的流程的示意图, 该方法包括: 步骤 S401 , 设备在出端口接收消息。 步骤 S402, 根据消息类型来判断该消息是否为预定的 PTP事件消息, 其中, 预定 PTP事件消息为 Sync消息、 Follow_Up消息或 Delay_Req消息; 如果判断结果为是, 则进入步骤 S403 , 否则, 对该消息不做处理, 进行透明 转发传送。 步骤 S403 , 设备从本机的时钟模块获取时间戳值, 由于 IEEE1588v2中 规定的时间戳的长度为 10个字节, 超过了 Correction Field字段 6个字节的 长度, 因此, 从本地时钟模块当前时间戳的最低有效位开始, 取 6个字节长 度的值作为时间戳值。 步一骤 S404, 读取 PTP消息中 Correction Field字段的当前值, ^!夺该值力口 上步骤 S403 中获取的时间戳值, 并将计算结果写入该字段中。 然后通过出 端口发送该消息。 上述优选实例一和优选实例二可以结合使用, 可以将其结合用于同一设 备, 也可以将优选实例一用于一个设备的入端口, 而将优选实例二用于另一 个设备的出端口。 优选实例三 本实施例在同一个设备上的两个端口上实现透明时钟。 图 5是根据本发 明实施例的时间同步的处理方法的具体的流程图, 该方法包括: 步骤 S501 , 主时钟在 T1时刻发送 PTP事件消息 Sync, 其中, Correction Field字段的当前值为 0。 步骤 S502, 该 Sync消息可能经过多台网络设备的处理和转发到达实现 本发明的网络设备的入端口。入端口识别出该消息是 PTP的 Sync事件消息, 并获取本设备当前时间戳 Ta。 步骤 S503 , 将该消息的 Correction Field字段值 ( CF ) 修改为 CF-Ta。 步骤 S504,经过设备正常的处理转发流程,该消息到达设备的出端口处。 设备获取当前时间戳 Tb。 步骤 S505 , 将消息的 CF字段值修改为 CF+Tb, 通过正常的发送流程将 该消息发送到下一台设备。 反向的 Delay_Req消息处理过程和上述相同, 只是出、入端口发生转换; 网络设备对 Follow_Up和 Delay_Rsp等其他消息不做处理, 进行透明转发传 送。 上述流程也可应用到 Follow_Up消息中, 此时, 网络设备对 Sync消息 不作处理, 进行透明转发。 优选实例四 本实施例中入端口和出端口在不同的设备上。 在 EPON、 GPON等 PON 网络上, 在光纤线路终端 ( Optical Line Terminal, 简称为 OLT ) 与光纤网络 单元 ( Optical Network Unit, 简称为 ONU )之间基于 PON的测距机制实现 OLT与 ONU的时间同步, 该同步过程可以使用现有的同步方法, 具体实现 方式在此不再赘述。 在此基础上, 在下行方向, 以 OLT的上联以太网接口作 为入端口, ONU的下联以太网接口作为出端口, 在上行方向, 以 OLT的上 联以太网接口作为出端口, ONU的下联以太网接口作为入端口,从而在 OLT 和 ONU上共同形成一个透明时钟。这样可以不需要在 EPON/GPON的 MAC 芯片上支持 PTP数据包检测处理的情况下, 实现透明时钟。 在该透明时钟中 的入端口釆用优选实例一的方法对 PTP事件消息进行处理,在出端口使用优 选实例二的方法对 PTP事件消息进行处理。 其中如果存在 Sync消息和与其 对应的 Follow_Up消息, 则只对其中之一进行处理, 对另一个不做处理, 进 行透明转发传送; 对 Delay_Req消息进行处理, 而对与其对应的 Delay_Rsp 消息不故处理,进行透明转发传送。对除上述消息以外的其他消息不故处理, 进行透明转发传送。 图 6是才艮据本发明实施例的 OLT和 ONU组成透明时钟的结构框图。 利 用上述处理方法,在下行方向,来自 OLT上联接口的 PTP消息,在经过 ONU 的下联口时, PTP消息的 Correction Field字段中已经累力口了 PTP消息在这一 透明时钟中的驻留时间; 在上行方向, 来自 ONU下联口的 PTP数据包, 在 经过 OLT的上联口时, PTP消息的 Correction Field字段中已经累力口了 PTP 消息在这一透明时钟中的驻留时间。 然后, 下级设备的 Slave根据 1588v2标 准算法扣除 Correction Field字段表征的时延, 就可以去除 PTP消息在 PON 设备内部传输和处理导致的时延和抖动。 利用上述处理方法, 不仅可以在一个网络设备上的两个端口间实现一个 透明时钟,还可以在分布在两个网络设备上的两个端口间实现一个透明时钟, 并支持 IEEE1588v2的一步同步 ( One Step )模式和两步 ( Two Step ) 同步模 式。 优选实例五 在实际应用中, 调整运算可以统一在出端口进行, 本实施例提供了在设 备的出端口计算驻留时间的方法。 该方法包括: 设备的入端口接收精确时间协议消息, 并获取当前本地时间戳作为第一 时间戳值;入端口将精确时间协议消息和第一时间戳值发送给设备的出端口, 其中, 该第一时间戳值可以作为 PTP 消息的新扩充字段内容, 承载在 PTP 消息中发送给出端口, 当然也可以单独发送给出端口; 出端口接收到精确时 间协议消息时, 获取当前本地时间戳作为第二时间戳, 然后, 计算第二时间 戳和第一时间戳之差作为精确时间协议消息在设备内的传递时间。 在计算出传递时间之后, 设备将调整预定字段的值为预定字段的当前值 和传递时间之和, 然后, 出端口将该 PTP消息发送出去, 其中, 该预定字段 可以是 correction field。 调整运算统一在出端口进行时, 出端口和入端口可以位于同一个网络设 备, 也可以位于不同的网络设备。 对应于上述方法实施例, 本发明实施例还提供了一种时间同步的处理装 置, 图 7是才艮据本发明实施例的时间同步的处理装置的结构框图, 该装置包 括: 调整模块 714 , 用于根据精确时间协议消息在设备的入端口的接收时间 和精确时间协议消息在设备的出端口的到达时间, 调整精确时间协议消息中 预定字段的值, 从而使用该预定字段记录精确时间协议消息在设备的入端口 和出端口之间的传递时间。 该装置还可以包括: 第一接收模块 702 , 位于入端口, 用于接收精确时 间协议消息, 第一获取模块 704耦合至第一接收模块 702 , 位于入端口, 用 于获取当前本地时间戳作为第一时间戳值; 第一发送模块 706耦合至第一获 取模块 704 , 位于入端口, 将第一时间戳值承载在精确时间协议消息中并将 该精确时间协议消息发送给设备的出端口; 第二接收模块 708耦合至第一发 送模块 706 , 位于出端口, 用于接收到精确时间协议消息, 第二获取模块 710 耦合至第二接收模块 708 , 位于出端口, 用于获取当前本地时间戳作为第二 时间戳, 计算模块 712耦合至第二获取模块 710 , 位于出端口, 用于计算第 二时间戳和第一时间戳之差作为精确时间协议消息在设备内的传递时间; 调 整模块 714耦合至计算模块 712 , 用于调整预定字段的值为预定字段的当前 值和传递时间之和。 图 8是根据本发明另一实施例的调整模块的结构框图, 调整模块 800包 括: 第三接收模块 802 , 位于入端口, 用于接收精确时间协议消息, 第三获 取模块 804 合至第三接收模块 802 , 位于入端口, 用于获取当前本地时间 戳作为第一时间戳值, 第一设置模块 806耦合至第三获取模块 804 , 位于入 端口, 用于将预定字段的值设置为预定字段的当前值与第一时间戳值之差; 第三发送模块 808耦合至第一设置模块 806 , 位于入端口, 用于将精确时间 协议消息发送给设备的出端口; 第四接收模块 810耦合至第三发送模块 808 , 位于出端口, 用于接收 ^"确时间协议消息, 第四获取模块 812耦合至第四接 收模块 810 ,用于获取当前本地时间戳作为第二时间戳值, 第二设置模块 814 耦合至第四获取模块 812 , 用于将预定字段的值设置为预定字段的当前值与 第二时间戳值之和。 在本实施例中装置只需要包括调整模块 800即可实现记 录消息在设备的入端口和出端口之间的驻留时间, 而不需要上一实施例中的 第一接收模块 702等模块。 图 9是 居本发明实施例的时间同步的处理装置的另一种结构框图, 该 装置包括: 消息接收处理模块 902 , 消息发送处理模块 904。 其中, 消息接 收处理模块 902对应于位于入端口的一个或多个设备的组合, 当网络设备的 入端口收到一条消息会调用消息接收处理模块 902对该消息进行处理, 处理 的方法可以釆用优选实例一记载的方法; 消息发送处理模块 904对应于位于 出端口的一个或多个设备的组合, 当设备要通过出端口发送消息时, 会调用 消息发送处理模块 904对该消息进行处理, 处理的方法可以釆用优选实例二 ΐ己载的方法。 其中, 消息接收处理模块 902 , 消息发送处理模块 904可以在一个网络 设备中, 也可以在两个网络设备中, 例如, 在上述优选实例四中, 在下行方 向,消息接收处理模块 902和消息发送处理模块 904可位于 OLT的上联以太 网接口和 ONU的下联以太网接口; 在上行方向, 消息接收处理模块 902和 消息发送处理模块 904可位于 ONU的下联以太网接口和 OLT的上联以太网 接口。 综上所述, 釆用本发明, 解决了相关技术中并没有给出在透明时钟中如 何计算驻留时间的方法的问题, 进而达到了有效获知 ΡΤΡ消息在设备中驻留 时间的效果。 显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤可 以用通用的计算装置来实现, 它们可以集中在单个的计算装置上, 或者分布 在多个计算装置所组成的网络上, 可选地, 它们可以用计算装置可执行的程 序代码来实现, 从而, 可以将它们存储在存储装置中由计算装置来执行, 并 且在某些情况下, 可以以不同于此处的顺序执行所示出或描述的步骤, 或者 将它们分别制作成各个集成电路模块, 或者将它们中的多个模块或步骤制作 成单个集成电路模块来实现。 这样, 本发明不限制于任何特定的硬件和软件 结合。 以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本 领域的技术人员来说, 本发明可以有各种更改和变化。 凡在本发明的 ^"神和 原则之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护 范围之内。

Claims

权 利 要 求 书
1. 一种时间同步的处理方法, 其特征在于, 包括:
根据精确时间协议消息在设备的入端口的接收时间和所述精确时间 协议消息在所述设备的出端口的到达时间, 在所述设备的出端口调整所 述精确时间协议消息中预定字段的值, 从而使用所述预定字段记录所述 精确时间协议消息在所述设备的入端口和所述设备的出端口之间的传递 时间。
2. 根据权利要求 1所述的方法, 其特征在于, 所述精确时间协议消息为同 步 Sync消息、 跟随 Follow_Up消息或延迟请求 Delay_Req消息。
3. 居权利要求 2 所述的方法, 其特征在于, 在所述 Sync 消息和所述 Follow_Up 消息对应的情况下, 所述设备仅对所述 Sync 消息和所述 Follow_Up消息中的一个的所述预定字段的值进行调整。
4. 根据权利要求 1所述的方法, 其特征在于, 在所述设备的出端口调整所 述精确时间协议消息中预定字段的值之前, 还包括:
所述设备的入端口接收所述精确时间协议消息, 并获取当前本地时 间戳作为第一时间戳值;
所述入端口将所述第一时间戳值承载在所述精确时间协议消息中并 将所述精确时间协议消息发送给所述设备的出端口;
所述出端口接收到所述精确时间协议消息时, 获取当前本地时间戳 作为第二时间戳, 并计算所述第二时间戳和所述第一时间戳之差作为所 述精确时间协议消息的所述传递时间。
5. 根据权利要求 4所述的方法, 其特征在于, 在所述设备的出端口调整所 述精确时间协议消息中预定字段的值包括:
所述设备将所述预定字段的值调整为所述预定字段的当前值和所述 传递时间之和。
6. 居权利要求 1所述的方法, 其特征在于, 居所述接收时间和所述到 达时间, 所述设备的出端口调整所述精确时间协议消息中预定字段的值 包括: 所述设备的入端口接收所述精确时间协议消息, 获取当前本地时间 戳作为第一时间戳值, 并将所述预定字段的值设置为所述预定字段的当 前值与所述第一时间戳值之差;
所述入端口将所述精确时间协议消息发送给所述设备的出端口; 所述设备的出端口接收到所述精确时间协议消息时, 获取当前本地 时间戳作为第二时间戳值, 并将所述预定字段的值设置为所述预定字段 的当前值与所述第二时间戳值之和。
7. 根据权利要求 4至 6中任一项所述的方法, 其特征在于, 所述入端口和 所述出端口位于不同的网络设备。
8. 根据权利要求 4至 6中任一项所述的方法, 其特征在于, 获取所述第一 时间戳值和所述第二时间戳值的方法包括: 从所述当前本地时间戳的最 低有效位开始, 提取不超过所述预定字段的长度的值。
9. 根据权利要求 1至 6中任一项所述的方法, 其特征在于, 所述预定字段 是校正域 Correction Field。
10. —种时间同步的处理装置, 其特征在于, 包括:
调整模块, 用于根据精确时间协议消息在设备的入端口的接收时间 和所述精确时间协议消息在所述设备的出端口的到达时间, 调整所述精 确时间协议消息中预定字段的值, 从而使用所述预定字段记录所述 ^"确 时间协议消息在所述设备的入端口和所述设备的出端口之间的传递时 间。
11. 根据权利要求 10所述的装置, 其特征在于, 包括:
第一接收模块, 用于在设备的入端口接收所述精确时间协议消息; 第一获取模块, 用于在设备的入端口获取当前本地时间戳作为第一 时间戳值;
第一发送模块, 用于将所述第一时间戳值承载在所述精确时间协议 消息中并将所述精确时间协议消息发送给所述设备的出端口;
第二接收模块, 用于在设备的出端口接收所述精确时间协议消息; 第二获取模块, 用于在设备的出端口获取当前本地时间戳作为第二 时间戳;
PCT/CN2010/074587 2010-03-31 2010-06-28 时间同步的处理方法及装置 WO2011120262A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010145170.0 2010-03-31
CN 201010145170 CN101827098A (zh) 2010-03-31 2010-03-31 时间同步的处理方法及装置

Publications (1)

Publication Number Publication Date
WO2011120262A1 true WO2011120262A1 (zh) 2011-10-06

Family

ID=42690801

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/074587 WO2011120262A1 (zh) 2010-03-31 2010-06-28 时间同步的处理方法及装置

Country Status (2)

Country Link
CN (1) CN101827098A (zh)
WO (1) WO2011120262A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102724194A (zh) * 2012-06-18 2012-10-10 北京东土电信技术有限公司 一种精确时间同步协议报文的发送方法及装置
CN106357362A (zh) * 2016-11-07 2017-01-25 瑞斯康达科技发展股份有限公司 一种时间同步方法、装置及ptp系统
US11876884B2 (en) 2019-01-22 2024-01-16 Huawei Technologies Co., Ltd. Communication method and optical module

Families Citing this family (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102469377A (zh) * 2010-11-17 2012-05-23 中兴通讯股份有限公司 一种epon系统以及系统中实现端到端透明时钟的方法
EP2461501A1 (en) 2010-12-01 2012-06-06 Alcatel Lucent Tunnel follow-up message for transparent clock
US8861668B2 (en) * 2010-12-24 2014-10-14 Nec Corporation Transmission device, transmission method and computer program
EP2487836A1 (en) * 2011-02-01 2012-08-15 Alcatel Lucent Automatic capture of the network delay components
CN102195768B (zh) * 2011-05-30 2014-06-04 神州数码网络(北京)有限公司 一种纳秒级精度ptp实现方法
CN102938676B (zh) * 2011-08-16 2017-11-10 中兴通讯股份有限公司 时间同步处理方法、装置及系统
CN102427413A (zh) * 2011-08-30 2012-04-25 广东电网公司电力科学研究院 对等透明时钟校正域误差的测试方法、系统及时钟测试仪
CN102523067B (zh) * 2011-12-30 2015-04-15 重庆市电力公司电力科学研究院 一种工业级光传输系统
CN102447745B (zh) * 2012-01-11 2018-10-26 南京中兴新软件有限责任公司 Tc设备上的报文驻留时间的处理方法及装置
US8879552B2 (en) * 2012-02-22 2014-11-04 Telefonaktiebolaget L M Ericsson (Publ) Precision time protocol offloading in a PTP boundary clock
CN103378916A (zh) * 2012-04-19 2013-10-30 中兴通讯股份有限公司 一种时钟传输方法、边界时钟及透传时钟
CN102638339B (zh) * 2012-04-20 2014-12-24 杭州华三通信技术有限公司 一种用于实现精确时间同步的方法和装置
CN102833061B (zh) * 2012-08-31 2016-02-24 北京东土科技股份有限公司 基于无缝冗余环网的提高时钟精度的方法及节点
EP2712099B1 (en) * 2012-09-19 2015-04-01 Alcatel Lucent Method for managing and maintaining an accurate distribution of time in a network when a failure occurs
TWI485996B (zh) * 2012-12-17 2015-05-21 Ind Tech Res Inst 致能一被動光網路具備支援時間同步能力的裝置與方法
US9276831B2 (en) * 2013-07-18 2016-03-01 Airmagnet, Inc. Determining network latency with limited computing resources
CN105099593B (zh) * 2014-05-05 2018-03-30 深圳市中兴微电子技术有限公司 一种时间同步的方法、设备和系统
CN106301996B (zh) * 2015-06-26 2019-10-08 中国移动通信集团公司 一种ptp报文自动测试的方法及装置
US11201684B2 (en) 2016-07-06 2021-12-14 Telefonaktiebolaget Lm Ericsson (Publ) Transmission and reception of timestamp information
CN108023656A (zh) * 2016-10-31 2018-05-11 深圳市中兴微电子技术有限公司 一种时间同步方法和设备
CN108075935B (zh) 2016-11-15 2021-01-29 华为技术有限公司 测量时延的方法及设备
CN106685565A (zh) * 2016-12-30 2017-05-17 国网浙江省电力公司绍兴供电公司 一种实现通信网络透明时钟传递的方法及系统
CN106877967B (zh) * 2017-03-21 2019-07-16 中车株洲电力机车研究所有限公司 Ieee1588透明时钟驻留时间测量方法及其装置
CN115882991A (zh) * 2019-02-25 2023-03-31 华为技术有限公司 一种时间同步方法、装置及系统
CN109819512B (zh) * 2019-03-18 2020-12-08 云南航天工程物探检测股份有限公司 工程ct无线分布式多路adc高精度同步系统及方法
CN112787838A (zh) * 2019-11-08 2021-05-11 华为技术有限公司 一种通信方法、装置及系统

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1614939A (zh) * 2003-11-06 2005-05-11 华为技术有限公司 一种时延测试的实现方法
US20080075217A1 (en) * 2006-09-22 2008-03-27 Ilnicki Slawomir K Mechanism For Making Delay From Network Elements Transparent To IEEE 1588 Protocols
CN101615963A (zh) * 2008-06-23 2009-12-30 华为技术有限公司 修正域信息的处理方法及系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1614939A (zh) * 2003-11-06 2005-05-11 华为技术有限公司 一种时延测试的实现方法
US20080075217A1 (en) * 2006-09-22 2008-03-27 Ilnicki Slawomir K Mechanism For Making Delay From Network Elements Transparent To IEEE 1588 Protocols
CN101615963A (zh) * 2008-06-23 2009-12-30 华为技术有限公司 修正域信息的处理方法及系统

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SHU, BANGJIU ET AL.: "Research on the types of clock devices in IEEE 1588 standard", ELECTRONIC TECHNOLOGY, no. 12, 31 December 2009 (2009-12-31), pages 42 - 44 *
WANG, XUAN ET AL.: "Clock Synchronization and Its Implementation in CE/PTN", COMMUNICATIONS TECHNOLOGY, vol. 42, no. 02, 28 February 2009 (2009-02-28), pages 88 - 90 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102724194A (zh) * 2012-06-18 2012-10-10 北京东土电信技术有限公司 一种精确时间同步协议报文的发送方法及装置
CN106357362A (zh) * 2016-11-07 2017-01-25 瑞斯康达科技发展股份有限公司 一种时间同步方法、装置及ptp系统
CN106357362B (zh) * 2016-11-07 2019-05-17 瑞斯康达科技发展股份有限公司 一种时间同步方法、装置及ptp系统
US11876884B2 (en) 2019-01-22 2024-01-16 Huawei Technologies Co., Ltd. Communication method and optical module

Also Published As

Publication number Publication date
CN101827098A (zh) 2010-09-08

Similar Documents

Publication Publication Date Title
WO2011120262A1 (zh) 时间同步的处理方法及装置
US9391768B2 (en) Transparent clock for precision timing distribution
JP5595529B2 (ja) 通信システムの時刻同期方法、子局装置、親局装置、制御装置、並びにプログラム
US8768169B2 (en) Time synchronization method and system for a passive optical network system
US8126333B2 (en) Optical transmission system and synchronization method using time reference pulse
US8570874B2 (en) Method, system and optical network device for synchronizing time of a passive optical network
WO2012003746A1 (zh) 一种实现边界时钟的方法和装置
WO2010017762A1 (zh) 一种在无源光网络中时间同步的方法、装置及无源光网络
US20130145041A1 (en) Optimizing Timing Packet Transport
WO2010022607A1 (zh) 无源光网络中的时延控制方法、光线路终端和无源光网络
CN113612564B (zh) 一种报文处理的方法和网络设备
WO2011088727A1 (zh) 无源光网络的时间同步方法、装置及系统
WO2012151808A1 (zh) 基于精确时钟协议提高同步精度的方法及系统
WO2012065334A1 (zh) 在时分复用网络中实现时间同步的方法、设备和系统
WO2010000190A1 (zh) 无源光网络同步时间的计算方法、系统及光网络设备
WO2011017867A1 (zh) 光传送网承载时间同步协议的方法及系统
WO2011063727A1 (zh) 一种无源光网络中光网络单元的测距方法及系统
WO2013082901A1 (zh) 一种1588事件报文的处理方法及系统
WO2011131006A1 (zh) 一种精密时间同步协议的时间处理装置及方法
JP2009005070A (ja) 通信方式、通信方法および通信プログラム
WO2015089848A1 (zh) 精确时钟协议同步方法和节点
WO2013155944A1 (zh) 一种时钟传输方法、边界时钟及透传时钟
WO2016004645A1 (zh) 一种基于e1链路的ieee1588时钟同步方法、系统及装置
CN105323028B (zh) 一种时间同步方法、设备及系统
KR20100048124A (ko) 근거리 통신망에서의 시간 동기화 방법

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: 10848722

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: 10848722

Country of ref document: EP

Kind code of ref document: A1