WO2015169045A1 - Time synchronization method, device and system, and storage medium - Google Patents
Time synchronization method, device and system, and storage medium Download PDFInfo
- Publication number
- WO2015169045A1 WO2015169045A1 PCT/CN2014/088008 CN2014088008W WO2015169045A1 WO 2015169045 A1 WO2015169045 A1 WO 2015169045A1 CN 2014088008 W CN2014088008 W CN 2014088008W WO 2015169045 A1 WO2015169045 A1 WO 2015169045A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data packet
- ptp data
- node
- network
- ptp
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/02—Details
- H04J3/06—Synchronising arrangements
Definitions
- the present invention relates to network communication technologies, and in particular, to a time synchronization method, device and system, and storage medium.
- each transmitting node device is treated as a transparent clock, and each node performs processing on a Precision Time Protocol (PTP) packet to calculate the dwell time of the node; then the network path is The dwell times of all the nodes in the middle are added to obtain the dwell time of the entire network, and finally the time synchronization is performed according to the obtained dwell time of the entire network.
- PTP Precision Time Protocol
- the cascading mode of multiple transmitting node devices in the network accumulates the error caused by the delay of the transmission path delay or the network jitter of each transmitting node device, thereby reducing the dwell time precision of the entire network;
- an embodiment of the present invention is to provide a time synchronization method, device, system, and storage medium, which can reduce network resource overhead when calculating the dwell time of the entire network; and improve the dwell time of the entire network. The accuracy of the calculations, as well as reducing the workload of the network.
- an embodiment of the present invention provides a method for time synchronization, where the method includes:
- the network access node records the first time value of the precise time protocol PTP data packet entering the network access node
- the network access node sends the first updated PTP data packet to a network, so that the network sends the first updated PTP data packet to an outgoing network node.
- the network access node updates, according to the first time value, a correction value of the modified domain field in the PTP data packet, including:
- the network access node extracts a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet;
- the network access node subtracts the correction value from the first time value to obtain a first correction value
- the network access node updates the first correction value to the correction domain field according to a format of the PTP data packet.
- the network access node records the first time value of the PTP data packet entering the network access node, including:
- the network access node records the first time value when the PTP data packet enters from an input interface of the network access node that is close to the physical layer.
- the method further includes:
- the network access node checks the PTP data packet to determine that the PTP data packet is incorrect, and ends the current processing.
- an embodiment of the present invention provides a method for time synchronization, where the method includes:
- the outbound network node records the precise time protocol PTP data packet to output the second time value of the outgoing network node; the PTP data packet is received by the outgoing network node from the network, and is sent by the network access node in the network;
- the egress node updates the correction value of the correction domain field in the PTP data packet according to the second time value to obtain a second update PTP data packet.
- the outgoing node updates the correction value of the modified domain field in the PTP data packet according to the second time value, including:
- the egress node extracts a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet;
- the egress node updates the second correction value to the correction domain field according to a format of the PTP data packet.
- the egress node records the second time value of the PTP data packet outputting the egress node, including:
- the egress node records the second time value when the PTP data packet is output from an output interface of the egress node near the physical layer.
- the PTP data packet is recorded at the outgoing network node, and the outgoing network is output After the second time value of the node, and before the network node updates the correction value of the correction domain field in the PTP data packet according to the second time value, the method further includes:
- the outgoing node checks the PTP data packet to determine that the PTP data packet is incorrect, and ends the current processing.
- an embodiment of the present invention provides a network access node, where the network access node includes: a first recording unit, a first update unit, and a sending unit, where
- the first recording unit is configured to record a first time value of the precise time protocol PTP data packet entering the network access node
- the first update unit is configured to update a correction value of the correction domain field in the PTP data packet according to the first time value obtained by the first recording unit, to obtain a first update PTP data packet;
- the sending unit is configured to send the first updated PTP data packet to a network, so that the network sends the first updated PTP data packet to an outgoing node.
- the first update unit includes: a first extraction module, a first calculation module, and a first update module, where
- the first extraction module is configured to extract a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet;
- the first calculating module is configured to subtract the first time value from the correction value to obtain a first correction value
- the first update module is configured to update the first correction value to the correction domain field in accordance with a format of the PTP data packet.
- the first recording unit is configured to record the first time value when the PTP data packet enters from an input interface of the network node close to the physical layer .
- the network access node further includes a first check unit, configured to When the PTP data packet is checked and it is determined that the PTP data packet is incorrect, the end processing is triggered.
- an embodiment of the present invention provides an outbound network node, where the outbound network node includes: a second recording unit and a second update unit, where
- the second recording unit is configured to: record a precise time protocol PTP data packet to output a second time value of the outgoing network node; the PTP data packet is received by the outgoing network node from the network, and the network is received by the network The network node sends;
- the second update unit is configured to update the correction value of the correction domain field in the PTP data packet according to the second time value to obtain a second update PTP data packet.
- the second update unit includes: a second extraction module, a second calculation module, and a second update module, where
- the second extraction module is configured to extract a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet;
- the second calculation module is configured to add the correction value to the second time value to obtain the second correction value
- the second update module is configured to update the second correction value to the correction domain field according to a format of the PTP data packet.
- the second recording unit is specifically configured to record the second when the PTP data packet is output from an output interface of the outbound network node close to the physical layer. Time value.
- the out network node further includes: a second verification unit, configured to When the PTP data packet is checked and it is determined that the PTP data packet is incorrect, the end processing is triggered.
- an embodiment of the present invention provides a system for time synchronization, where the system includes an ingress node and an egress node, where
- the network access node is configured to record a precise time protocol PTP data packet to enter the network access node. a first time value; updating a correction value of the correction domain field in the PTP data packet according to the first time value to obtain a first update PTP data packet; and sending the first update PTP data packet to the network So that the network sends the first updated PTP data packet to an outgoing node;
- the egress node is configured to record a second time value of the first update PTP data packet outputting the egress node, and update a correction domain field in the first update PTP data packet according to the second time value Correct the value to get the second update PTP packet.
- the network access node is further configured to check the PTP data packet, and when the PTP data packet is determined to be incorrect, the current processing ends.
- the out network node is further configured to check the first update PTP data packet, and determine that the first update PTP data packet is incorrect, and end the current deal with.
- the embodiment of the invention further provides a storage medium in which a computer program is stored, the computer program being configured to perform the aforementioned method of time synchronization.
- the method, device and system for time synchronization provided by the embodiments of the present invention calculate the dwell time of the transport network only by the network access node and the egress node of the transport network, so that each node in the transport network is not required to calculate each
- the dwell time reduces the resource overhead in the transport network; and it does not accumulate the computational errors caused by each node in the transport network calculating its own dwell time, and improves the calculation accuracy of the dwell time of the transport network; It is even more unnecessary to consider the asymmetry of the two-way transmission path of the transmission medium between each node in the transmission network, thereby reducing the workload of the network.
- FIG. 1 is a schematic diagram of an application scenario according to an embodiment of the present invention.
- FIG. 2 is a schematic flowchart of a method for time synchronization according to an embodiment of the present invention
- FIG. 3 is a schematic diagram of a method for updating a PTP according to a first time value according to an embodiment of the present invention. According to the flow chart of the correction value of the correction domain field in the package;
- FIG. 4 is a schematic flowchart diagram of another method for time synchronization according to an embodiment of the present invention.
- FIG. 5 is a schematic flowchart of a modified value of a modified domain field in a PTP data packet according to a second time value according to an embodiment of the present invention
- FIG. 6 is a schematic flowchart diagram of a method for time synchronization according to an embodiment of the present disclosure
- FIG. 7 is a schematic structural diagram of a network access node according to an embodiment of the present disclosure.
- FIG. 8 is a schematic structural diagram of another network access node according to an embodiment of the present disclosure.
- FIG. 9 is a schematic structural diagram of an outgoing network node according to an embodiment of the present disclosure.
- FIG. 10 is a schematic structural diagram of another network outlet node according to an embodiment of the present disclosure.
- FIG. 11 is a schematic structural diagram of hardware of a network access node according to an embodiment of the present disclosure.
- FIG. 12 is a schematic structural diagram of hardware of an outgoing network node according to an embodiment of the present disclosure.
- FIG. 13 is a schematic structural diagram of a system for time synchronization according to an embodiment of the present invention.
- the ingress network node and the egress node perform timestamp processing on the precise time protocol data packet, which is equivalent to treating the entire network as a transparent clock and using the ingress network node as a data packet.
- the entry, the outbound network node is used as the egress of the data packet, ignoring the processing of the network dwell time in the precise time protocol data packet by other nodes in the network, thereby avoiding the network resource caused by each node in the network calculating the network dwell time.
- FIG. 1 is an exemplary application scenario of an embodiment of the present invention.
- the scenario may include device A 110 and device B 120, and device A 110 and device, which need to perform time synchronization.
- the transport network 100 may be represented by a dashed box area, which may include, but is not limited to, an ingress node 101 that is connected to the device A 110, an outbound node 102 that is connected to the device B 120, and other nodes 103 in the transport network.
- other nodes 103 within the network are represented by cloud blocks.
- the transmission network in the scenario shown in FIG. 1 may be a wired network or a wireless network, or may be a mobile network, etc., which is not limited in this embodiment of the present invention.
- a method for time synchronization may be applied to an ingress node in a transmission network of the application scenario shown in FIG. 1. It can be understood that different network partitions may have corresponding entries. Nodes, therefore, the entry node is a relative concept.
- the method can include:
- the ingress network node records a first time value of the precise time protocol PTP data packet entering the network access node.
- the ingress network node can find the PTP data packet according to the feature field of the PTP data packet from the data stream sent by the device A, and can record the first time value of the PTP data packet entering the network access node, and specifically can use the network access time.
- the first time value is saved in the form of a stamp.
- the network access node may record the first time value at any one of the PTP data packets at the input end; preferably, in the embodiment of the present invention, the network access node may be in the PTP data packet from the network access node.
- the first time value is recorded when an input interface near the physical layer enters.
- S202 The network access node updates, according to the first time value, a correction value of the correction domain field in the PTP data packet, to obtain a first update PTP data packet.
- the network access node updates the correction value of the modified domain field in the PTP data packet according to the first time value, as shown in FIG. 3, which includes:
- the network access node extracts a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet.
- the network access node can extract the correction value from the modified domain field of the PTP data packet according to a fixed data format.
- the specific implementation method is a conventional implementation means of those skilled in the art, and details are not described herein again.
- S2022 The network access node subtracts the modified value from the first time value to obtain a first correction value.
- the first time value saved in the form of the timestamp of the network is obtained by using the S2021 to obtain the correction value, so that the modified value after the network node is updated can be obtained.
- the modified value of the network access node obtained by the network access node through S2022 is referred to as a first correction value, and those skilled in the art can understand that, in the following description, unless There is a special description, otherwise the first correction value is used to indicate the correction value of the network node obtained by the network node through S2022 after updating.
- the network access node updates the first correction value to the correction domain field according to the format of the PTP data packet.
- the network access node may change the original correction value in the correction domain field to the first correction value according to the format of the PTP data packet, thereby completing the update of the PTP data packet by the network access node, Thereby obtaining the first update PTP data packet.
- the method may further include: the ingress network node checks the PTP data packet, and determines whether the PTP data packet is correct: when the PTP data packet is correct, proceed to execute S202. When the PTP data packet is incorrect, the current processing is ended, for example, discarding the PTP data packet, and waiting for the arrival of the next PTP data packet;
- the network access node may be different according to the network layer where the PTP data packet is located. And the format of the data stream encapsulating the PTP data packet is different, and the corresponding verification technology may be used for verification, for example, when the PTP data packet is encapsulated in an Internet Protocol (IP, Internet Protocol) V6 or IPV4 data stream.
- IP Internet Protocol
- the access node may perform verification on the PTP data packet by using a user datagram protocol (UDP), an IP check, a CRC (Cyclical Redundancy Check), or the like. Determine if the PTP packet is correct.
- UDP user datagram protocol
- IP check IP check
- CRC Cyclical Redundancy Check
- S203 The ingress network node sends the first update PTP data packet to the network.
- the network may cause the network to send the first updated PTP data packet to an outgoing node by using S203.
- the first update PTP data packet since the first modified value is saved in the modified domain field of the first update PTP data packet, the first update PTP data packet includes time information of the data flow entering the transmission network;
- the network dwell time of the transport network may be obtained by using the time information output by the first update PTP data packet from the transport network; Time to achieve time synchronization between device A and device B.
- FIG. 4 is a method for time synchronization according to an embodiment of the present invention.
- the method can be applied to an egress node in a transmission network of the application scenario shown in FIG. 1. It can be understood that different network segments may appear correspondingly.
- the exit node, therefore, the exit node is a relative concept.
- the method can include:
- the outbound network node records a second time value of the outbound network node by the precise time protocol PTP data packet.
- the PTP data packet is a PTP data packet that is received by the outbound network node from the network and sent by the network access node of the network; specifically, in this embodiment.
- the outgoing node is from the network.
- the PTP data packet received in the network is actually the first update PTP data packet sent by the network access node, and the correction value saved in the modified domain field of the first update PTP data packet is the first modified value.
- the egress node can find the PTP data packet according to the feature field of the PTP data packet from the data stream sent by the network, and record the PTP data packet through the egress network.
- the second time value of the output end of the node specifically, the second time value may be saved in the form of a network timestamp;
- the egress node may record the second time value at any one of the PTP data packets at the output end; preferably, in the embodiment of the present invention, the egress node may be in the PTP data packet from the The second time value is recorded when the output interface of the outlet node is close to the physical layer.
- the network node updates the correction value of the correction domain field in the PTP data packet according to the second time value, to obtain a second update PTP data packet.
- S402 may be specifically as shown in FIG. 5, and includes:
- the egress node extracts a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet.
- the outgoing node can extract the correction value from the modified domain field of the PTP data packet according to a fixed data format.
- the specific implementation manners are conventional implementation means of those skilled in the art, and are not described herein again.
- the PTP data packet is the first updated PTP data packet sent by the network access node
- the PTP data packet is modified in the field field.
- the correction value is the first correction value.
- S4022 The network node adds the correction value to the second time value to obtain the second correction value.
- the outlet node can obtain the correction value obtained by the S4021 and the second time value saved in the form of the outgoing network timestamp, to obtain the corrected value after the network node is updated.
- the first correction value includes the network access time information of the PTP data packet
- the corrected value of the updated network node obtained after the first correction value plus the second time value includes the PTP data packet.
- the dwell time information of the entire transport network which can be used for time synchronization between device B and device A.
- the modified value of the outgoing node obtained by the outlet node through S4022 is referred to as a second correction value, which can be understood by those skilled in the art in the following description.
- the second correction value is used to indicate the correction value of the network node obtained by the network node through S4022 after updating.
- the egress node updates the second correction value to the correction domain field according to the format of the PTP data packet.
- the egress node may change the correction value in the correction domain field to the second correction value according to the format of the PTP data packet, thereby completing the update of the PTP data packet by the egress node. , thereby obtaining a second updated PTP data packet;
- the egress node actually changes the first correction value in the first update PTP data packet to the second correction value, thereby obtaining the second update PTP data packet.
- the method may further include: the out network node checks the PTP data packet, and determines whether the PTP data packet is correct: when the PTP data packet is correct, continue to execute S402. When the PTP data packet is incorrect, end the current processing, for example, discarding the PTP data packet, and waiting for the arrival of the next PTP data packet;
- the egress node may adopt a corresponding verification technology according to different network layers in which the PTP data packet is located, and a format of a data flow encapsulating the PTP data packet. Perform verification; the specific embodiment has been detailed in the foregoing embodiment. Description, no longer repeat here.
- the device B may correct the second correction in the domain field by using the second update PTP data packet.
- the value of the time of the entire transmission network is obtained, and the time synchronization of the time synchronization is performed by the device A.
- the implementation process of the specific time synchronization is a conventional technical means of those skilled in the art, and details are not described herein again.
- FIG. 6 is a schematic flowchart of a time synchronization method according to an embodiment of the present invention. The detailed process may be as follows:
- S601 Device A sends a PTP data packet to the network access node.
- the setting device A needs to perform time synchronization with the device B, and the transmission network 100 between the device A and the device B is represented by a dotted line frame area as shown in FIG.
- the network access node of the network is connected to device A, and the outbound network node of the transport network is connected to device B.
- Device A can encapsulate the PTP data packet in the data stream sent to the ingress network node.
- the ingress network node records a first time value of the PTP data packet entering the network access node.
- the PTP data packet may be searched from the data stream according to the feature field of the PTP data packet, and the PTP data packet is recorded to enter the first node of the network access node.
- the time value can be saved in the form of a network timestamp.
- the network access node may record the first time value at any one of the PTP data packets at the input end; preferably, in the embodiment of the present invention, the network access node may be in the PTP data packet from the network access node.
- the first time value is recorded when an input interface near the physical layer enters.
- S603 The network access node checks the PTP data packet to determine whether the PTP data packet is correct.
- the network access node may be different according to the network layer where the PTP data packet is located. And the format of the data stream encapsulating the PTP data packet is different, and the corresponding verification technology may be used for verification, for example, when the PTP data packet is encapsulated in an Internet Protocol (IP, Internet Protocol) V6 or IPV4 data stream.
- IP Internet Protocol
- the network access node may perform verification of the PTP data packet by using a User Datagram Protocol (UDP), IP check, or Cyclical Redundancy Check (CRC) check method. Determine if the PTP packet is correct.
- UDP User Datagram Protocol
- IP check IP check
- CRC Cyclical Redundancy Check
- the current processing ends, for example, discarding the PTP data packet, and waiting for the arrival of the next PTP data packet;
- the PTP data packet is correct, proceeding to S604: accessing the network
- the node updates the correction value of the correction domain field in the PTP data packet according to the first time value to obtain a first update PTP data packet;
- the network access node updates the correction value of the modified domain field in the PTP data packet according to the first time value, which may be specifically shown in FIG. 3, and details are not described herein again.
- S605 The ingress network node sends the first update PTP data packet to the network.
- the network may cause the network to send the first update PTP data packet to the egress node by using S605;
- the first updated PTP data packet includes time information of the data flow entering the transport network.
- the egress node receives the first update PTP data packet from the network.
- the network node after the network node sends the first update PTP data packet to the network, the network node transmits the first update PTP data packet from the network.
- S607 The outbound network node records, by the first update PTP data packet, a second time value of the outbound network node.
- the outgoing node can receive the data stream from the network according to the PTP.
- the feature field of the data packet finds the first update PTP data packet, and records the second time value of the first update PTP data packet through the output end of the outgoing network node, and specifically saves the second time value in the form of the outgoing network time stamp;
- the egress node can record the second time value at any one of the first update PTP data packets at the output end; preferably, in the embodiment of the present invention, the egress network node can update the PTP data packet from the first The second time value is recorded when the output interface of the outlet node is close to the physical layer.
- the egress node checks the first update PTP data packet to determine whether the first update PTP data packet is correct.
- the egress node may perform different verification according to a different network layer where the first update PTP data packet is located, and a format of the data flow encapsulating the first updated PTP data packet, and may be verified by using a corresponding verification technology;
- the specific implementation is described in detail in S603, and details are not described herein again.
- the current processing ends, for example, discarding the PTP data packet, and waiting for the arrival of the next PTP data packet;
- the PTP data packet is correct, proceeding to S609:
- the network node updates, according to the second time value, a correction value of the correction domain field in the first update PTP data packet, to obtain a second update PTP data packet;
- the egress node transmits the second update PTP data packet to the device B.
- the device B may obtain the dwell time of the entire transmission network by using the second correction value in the second update PTP packet correction domain field, and may perform time synchronization with the device A through the dwell time, and the specific time synchronization
- the implementation process is a conventional technical means for those skilled in the art and will not be described herein.
- the detailed process of the method for time synchronization provided by this embodiment only calculates the dwell time of the transport network by the network access node and the egress node of the transport network, so that no transmission is needed.
- Each node in the network calculates its own dwell time, reduces the resource overhead in the transport network, and does not accumulate the computational errors caused by each node in the transport network calculating its own dwell time.
- the calculation accuracy of the dwell time of the transmission network it is even more unnecessary to consider the asymmetry of the bidirectional transmission path of the transmission medium between each node in the transmission network, thereby reducing the workload of the network.
- FIG. 7 is a schematic structural diagram of a network access node 70 according to an embodiment of the present invention.
- the network access node 70 may include: a first recording unit 701, a first updating unit 702, and a sending unit 703, where
- the first recording unit 701 is configured to record a first time value of the precise time protocol PTP data packet entering the network access node 70;
- the first update unit 702 is configured to update the correction value of the correction domain field in the PTP data packet according to the first time value obtained by the first recording unit 701, to obtain a first update PTP data packet;
- the sending unit 703 is configured to send the first updated PTP data packet to the network, so that the network sends the first updated PTP data packet to an outgoing node.
- the first recording unit 701 may find the PTP data packet from the data field sent by the device A according to the feature field of the PTP data packet, and may record The PTP data packet enters a first time value of the network access node. Specifically, the first recording unit 701 may save the first time value in the form of a network timestamp;
- the first recording unit 701 can record the first time value at any one of the input ends of the PTP data packet; preferably, in the embodiment of the present invention, the first recording unit 701 can The first time value is recorded when the PTP data packet enters from the input interface of the access node 70 near the physical layer.
- the first update unit 702 may include: a first extraction module 7021, a first calculation module 7022, and a first update module 7023, where
- the first extraction module 7021 is configured to extract a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet;
- the first extraction module 7021 can extract the correction value from the correction domain field of the PTP data packet according to a fixed data format.
- the specific implementation method is a conventional implementation means of a person skilled in the art, and details are not described herein again;
- the first calculating module 7022 is configured to subtract the first time value from the correction value to obtain a first correction value
- the first calculating module 7022 can obtain the first time value saved by the first extraction module 7021 minus the time stamp in the network, so that the updated value of the network node 70 after updating can be obtained.
- the updated value of the network access node obtained by the first calculation module 7022 is referred to as a first correction value, and those skilled in the art can understand that, in the following description, Unless otherwise specified, the correction value after the update of the network access node obtained by the first calculation module 7022 is represented by the first correction value;
- the first update module 7023 is configured to update the first correction value to the correction domain field according to a format of the PTP data packet;
- the first update module 7023 may change the original correction value in the correction domain field to the first correction value according to the format of the PTP data packet, thus completing the first
- An update unit 702 updates the PTP data packet to obtain a first update PTP data packet.
- the network access node 70 may further include a first check unit 704 configured to check the PTP data packet, determine whether the PTP data packet is correct, and determine that the PTP data packet is correct. And triggering, by the first update unit 702, processing of the PTP data packet; when determining that the PTP data packet is incorrect, triggering end processing, for example, discarding the PTP data packet, and waiting for the next PTP data packet Coming
- the first check unit 704 may be configured according to different network layers in which the PTP data packet is located, and a format of a data flow encapsulating the PTP data packet, and may be verified by using a corresponding verification technology, for example,
- IP Internet Protocol
- the first check unit 704 may use a User Datagram Protocol (UDP) check, an IP check, and a loop.
- UDP User Datagram Protocol
- a verification method such as a CRC (Cyclical Redundancy Check) checks the PTP data packet to determine whether the PTP data packet is correct.
- CRC Cyclical Redundancy Check
- the first updated PTP data packet since the first modified value is stored in the modified domain field of the first updated PTP data packet, the first updated PTP data packet includes time information of the data flow entering the transmission network; And when the first update PTP data packet arrives at the egress node of the transport network, the network camp time of the transport network may be obtained by using the time information output by the first update PTP data packet from the transport network; Allow time to implement time synchronization between device A and device B.
- FIG. 9 is a schematic structural diagram of an egress node 90 according to an embodiment of the present invention.
- the egress node 90 may include: a second recording unit 901 and a second update unit 902, where
- the second recording unit 901 is configured to record a second time value of the precise time protocol PTP data packet output network node 90; the PTP data packet is received by the outbound network node 90 from the network, and is connected to the network node of the network. PTP packet sent;
- the second update unit 902 is configured to update the correction value of the correction domain field in the PTP data packet according to the second time value to obtain a second update PTP data packet.
- the PTP data packet received by the egress node 90 from the network is actually the first update PTP data packet sent by the ingress network node, where Correction saved in the modified domain field of the first update PTP packet The value is the first correction value.
- the second recording unit 901 can find the PTP data packet according to the feature field of the PTP data packet from the data stream sent by the network, and record the PTP data packet.
- the second time value of the output end of the outbound network node 90 specifically, the second time value may be saved in the form of a network timestamp;
- the second recording unit 901 can record the second time value at any one of the PTP data packets at the output end of the outlet node 90.
- the second recording unit 901 can be The second time value is recorded when the PTP data packet is output from the output interface of the outgoing node 90 near the physical layer.
- the second update unit 902 may include: a second extraction module 9021, a second calculation module 9022, and a second update module 9023, where
- the second extraction module 9021 is configured to extract a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet;
- the second extraction module 9021 can extract the correction value from the correction domain field of the PTP data packet according to a fixed data format.
- the specific implementation method is a conventional implementation means of those skilled in the art, and details are not described herein again.
- the PTP data packet is the first updated PTP data packet sent by the network access node
- the PTP data packet is modified in the field field.
- the correction value is the first correction value.
- the second calculation module 9022 is configured to add the correction value to the second time value to obtain the second correction value
- the second calculation module 9022 can add the correction value obtained by the second extraction module 9021.
- the second time value saved in the form of the outgoing timestamp, to obtain the outgoing node 90
- the new correction value since the first correction value includes the network access time information of the PTP data packet, the corrected value of the updated network node obtained after the first correction value plus the second time value includes the PTP data packet.
- the dwell time information of the entire transport network which can be used for time synchronization between device B and device A.
- the updated value of the network node obtained by the second calculation module 9022 is referred to as a second correction value, which can be understood by those skilled in the art in the following description.
- the correction value after the update of the outlet node obtained by the second calculation module 9022 is represented by the second correction value.
- the second update module 9023 is configured to update the second correction value to the correction domain field according to the format of the PTP data packet
- the second update module 9023 may change the correction value in the correction domain field to the second correction value according to the format of the PTP data packet, thus completing the outbound network node to the PTP data packet. Update to get the second update PTP packet;
- the second update unit 902 actually changes the first correction value in the first update PTP data packet to the second correction value, thereby obtaining the second update PTP data. package.
- the egress node 90 may further include a second check unit 903 configured to check the PTP data packet to determine whether the PTP data packet is correct, when determining the PTP data packet.
- a second check unit 903 configured to check the PTP data packet to determine whether the PTP data packet is correct, when determining the PTP data packet.
- the second updating unit 902 triggering the processing of the PTP data packet by the second updating unit 902; when it is determined that the PTP data packet is incorrect, triggering the end processing, for example, discarding the PTP data packet, and waiting for the arrival of the next PTP data packet ;
- the second check unit 903 may be different according to a network layer in which the PTP data packet is located, and a format of a data stream encapsulating the PTP data packet.
- the verification is performed by using the corresponding verification technology.
- the device B may correct the second correction in the domain field by using the second update PTP data packet.
- the value of the time of the entire transmission network is obtained, and the time synchronization of the time synchronization is performed by the device A.
- the implementation process of the specific time synchronization is a conventional technical means of those skilled in the art, and details are not described herein again.
- FIG. 11 is a schematic structural diagram of hardware of a network access node 70 according to an embodiment of the present invention.
- the network access node 70 may include at least one communication interface 1101, a processor 1102, a memory 1103, and a bus 1104: the at least one communication interface 1101 processes The memory 1102 and the memory 1103 are connected by a bus 1104 and complete communication with each other.
- the bus 1104 may be an Industrial Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus.
- ISA Industrial Standard Architecture
- PCI Peripheral Component
- EISA Extended Industry Standard Architecture
- the bus 1104 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 11, but it does not mean that there is only one bus or one type of bus. among them:
- the memory 1103 is configured to store executable program code, the program code including computer operating instructions.
- the memory 1103 may include a high speed RAM memory and may also include a non-volatile memory such as at least one disk memory.
- the operating system is configured to control and implement the processing functions performed by the processing unit.
- the application contains program code, such as word processing software, email software.
- the processor 1102 may be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
- CPU Central Processing Unit
- ASIC Application Specific Integrated Circuit
- a communication interface 1101 configured to communicate with an external device
- the processor 1102 is configured to record a first time value of the precise time protocol PTP data packet entering the network access node;
- the processor 1102 is further configured to extract a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet;
- the processor 1102 is further configured to record the first time value as the PTP data packet enters from an incoming interface of the physical layer adjacent to the physical layer.
- the processor 1102 is further configured to verify the PTP data packet to determine if the PTP data packet is correct.
- FIG. 12 is a schematic diagram showing the hardware structure of an outgoing node 90 according to an embodiment of the present invention.
- the outgoing node 90 includes at least one communication interface 1201, a processor 1202, a memory 1203, and a bus 1204: the at least one communication interface 1201
- the processor 1202 and the memory 1203 are connected by the bus 1204 and complete communication with each other.
- the bus 1204 may be an Industrial Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus.
- ISA Industrial Standard Architecture
- PCI Peripheral Component
- EISA Extended Industry Standard Architecture
- the bus 1204 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 12, but it does not mean that there is only one bus or one type of bus. among them:
- the memory 1203 is configured to store executable program code, the program code including computer operating instructions.
- the memory 1203 may include a high speed RAM memory and may also include a non-volatile memory such as at least one disk memory.
- the operating system is configured to control and implement the processing functions performed by the processing unit.
- the application contains program code, such as word processing software, email software.
- the processor 1202 may be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
- CPU Central Processing Unit
- ASIC Application Specific Integrated Circuit
- a communication interface 1201 configured to communicate with an external device
- the processor 1202 is configured to record a second time value of the outbound network node by using a precise time protocol PTP data packet; the PTP data packet is received by the outbound network node from the network, and is connected to the network by the network node PTP packet sent;
- processor 1202 is further configured to:
- the processor 1202 is further configured to: record the second time value when the PTP data packet is output from an output interface of the outgoing node adjacent to the physical layer.
- the processor 1202 is further configured to verify the PTP data packet to determine if the PTP data packet is correct.
- a time synchronization system may be used. Including the network access node 70 and the outgoing network node 90, wherein
- the network access node 70 is configured to record a first time value of the precise time protocol PTP data packet entering the network access node, and update a correction value of the modified domain field in the PTP data packet according to the first time value to obtain a first update PTP. Transmitting the first update PTP data packet to the network, so that the network sends the first update PTP data packet to an outgoing network node; the specific implementation process is as described in the foregoing embodiment, This will not be repeated here;
- the outbound node 90 is configured to record a second time value of the first update PTP data packet outputting the outbound network node, and to update a correction domain field in the first update PTP data packet according to the second time value The value is obtained, and the second update PTP data packet is obtained; the specific implementation process is as described in the foregoing embodiment, and details are not described herein again.
- the ingress network node 70 is further configured to verify the PTP data packet, and when the PTP data packet is determined to be incorrect, terminate the current process.
- the outbound node 90 is further configured to check the first updated PTP data packet to determine that the first update PTP data packet is incorrect, and end the current process.
- the embodiment of the invention also describes a time synchronization system, which calculates the dwell time of the transmission network only through the ingress node 70 and the outbound node 90 of the transmission network, so that no node in the transmission network needs to be transmitted.
- To calculate the respective dwell time reduce the resource overhead in the transmission network; and it does not accumulate the calculation error caused by calculating the respective dwell time of each node in the transmission network, and improves the dwell time of the transmission network.
- the calculation accuracy is not necessary to consider the asymmetry of the two-way transmission path of the transmission medium between each node in the transmission network, thereby reducing the workload of the network.
- Embodiments of the present invention also describe a storage medium in which a computer program is stored, the computer program being configured to perform the method of time synchronization of the foregoing embodiments.
- embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may employ hardware embodiments, software embodiments, or junctions. In the form of an embodiment of the software and hardware aspects. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
- the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
- the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
- These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
- the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
- the invention calculates the dwell time of the transmission network by the network access node and the egress node of the transmission network, so that each node in the transmission network is not required to calculate the respective dwell time, and the resource overhead in the transmission network is reduced; Moreover, the calculation error caused by calculating the respective dwell time of each node in the transmission network is not accumulated, and the calculation precision of the residence time of the transmission network is improved; and the transmission medium between each node in the transmission network is not required to be considered.
- the asymmetry of the two-way transmission path reduces the workload of the network.
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
A time synchronization method, device and system, and a storage medium. The method may comprise: a network entry node records a first time value at which a Precision Time Protocol (PTP) data packet enters the network entry node; the network entry node updates a correction value of a correction field in the PTP data packet according to the first time value, so as to obtain a first updated PTP data packet; and the network entry node sends the first updated PTP data packet to a network, so that the network sends the first updated PTP data packet to a network exit node.
Description
本发明涉及网络通信技术,尤其涉及一种时间同步的方法、设备和系统、存储介质。The present invention relates to network communication technologies, and in particular, to a time synchronization method, device and system, and storage medium.
在当前的移动通信网络中,各基站间要保持精确的时间同步,以保证用户在移动过程中不会出现掉线等故障。在现有通信设备中,广泛应用的是由电气和电子工程师协会(IEEE,Institute of Electrical and Electronics Engineers)于2002年提出并在2007年进行修改的网络测量和控制系统的精密时钟同步协议标准,又称为IEEE 1588协议。In the current mobile communication network, accurate time synchronization is maintained between the base stations to ensure that the user does not have a line drop or the like during the movement. Among the existing communication devices, the precision clock synchronization protocol standard of the network measurement and control system proposed by the Institute of Electrical and Electronics Engineers (IEEE) in 2002 and modified in 2007, is widely used. Also known as the IEEE 1588 protocol.
在该协议中,将每一个传送节点设备均作为一个透明时钟,并在每个节点对精确时间协议(PTP,Precision Time Protocol)数据包进行处理,计算该节点的驻留时间;然后将网络路径中所有节点的驻留时间相加得到整个网络的驻留时间,最后根据所得到的整个网络的驻留时间进行时间同步。In this protocol, each transmitting node device is treated as a transparent clock, and each node performs processing on a Precision Time Protocol (PTP) packet to calculate the dwell time of the node; then the network path is The dwell times of all the nodes in the middle are added to obtain the dwell time of the entire network, and finally the time synchronization is performed according to the obtained dwell time of the entire network.
在实现上述技术方案的过程中,存在以下问题:In the process of implementing the above technical solution, the following problems exist:
首先,网络中多个传送节点设备分别计算自身的驻留时间,会加大对网络资源的开销;First, multiple transit node devices in the network calculate their own dwell time, which will increase the overhead of network resources;
其次,网络中多个传送节点设备的级联方式会将每个传送节点设备由于传输路径延时不对称或网络抖动所产生的误差进行累积,降低整个网络的驻留时间精度;Secondly, the cascading mode of multiple transmitting node devices in the network accumulates the error caused by the delay of the transmission path delay or the network jitter of each transmitting node device, thereby reducing the dwell time precision of the entire network;
还有就是需要对网络中每对传送节点设备间传输介质的双向传输路径延时不对称的情况进行补偿,增加网络的工作量。
There is also a need to compensate for the asymmetry of the bidirectional transmission path of the transmission medium between each pair of transmission node devices in the network, thereby increasing the workload of the network.
发明内容Summary of the invention
为解决上述技术问题,本发明实施例期望提供一种时间同步的方法、设备和系统、存储介质,能够在计算整个网络的驻留时间时,降低网络资源开销;并且提高整个网络的驻留时间的计算精度,以及减少网络的工作量。To solve the above technical problem, an embodiment of the present invention is to provide a time synchronization method, device, system, and storage medium, which can reduce network resource overhead when calculating the dwell time of the entire network; and improve the dwell time of the entire network. The accuracy of the calculations, as well as reducing the workload of the network.
本发明实施例的技术方案是这样实现的:The technical solution of the embodiment of the present invention is implemented as follows:
第一方面,本发明实施例提供了一种时间同步的方法,所述方法包括:In a first aspect, an embodiment of the present invention provides a method for time synchronization, where the method includes:
入网节点记录精确时间协议PTP数据包进入所述入网节点的第一时间值;The network access node records the first time value of the precise time protocol PTP data packet entering the network access node;
所述入网节点根据所述第一时间值更新所述PTP数据包中的修正域字段的修正值,得到第一更新PTP数据包;Updating, by the network access node, a correction value of the modified domain field in the PTP data packet according to the first time value, to obtain a first updated PTP data packet;
所述入网节点将所述第一更新PTP数据包发送至网络,以使得所述网络将所述第一更新PTP数据包向出网节点发送。The network access node sends the first updated PTP data packet to a network, so that the network sends the first updated PTP data packet to an outgoing network node.
根据第一种可能的实现方式,结合第一方面,所述入网节点根据所述第一时间值更新所述PTP数据包中的修正域字段的修正值,包括:According to the first possible implementation, in combination with the first aspect, the network access node updates, according to the first time value, a correction value of the modified domain field in the PTP data packet, including:
所述入网节点按照所述PTP数据包的格式提取PTP数据包中修正域字段的修正值;The network access node extracts a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet;
所述入网节点将所述修正值减去所述第一时间值,得到第一修正值;The network access node subtracts the correction value from the first time value to obtain a first correction value;
所述入网节点按照所述PTP数据包的格式将所述第一修正值更新到所述修正域字段。The network access node updates the first correction value to the correction domain field according to a format of the PTP data packet.
根据第二种可能的实现方式,结合第一方面,所述入网节点记录所述PTP数据包进入所述入网节点的第一时间值,包括:According to the second possible implementation, in combination with the first aspect, the network access node records the first time value of the PTP data packet entering the network access node, including:
所述入网节点在所述PTP数据包从所述入网节点中靠近物理层的输入接口进入时记录所述第一时间值。The network access node records the first time value when the PTP data packet enters from an input interface of the network access node that is close to the physical layer.
根据第三种可能的实现方式,结合第一方面、第一种或第二种可能的
实现方式中的任一项,在所述入网节点记录所述PTP数据包进入所述入网节点的第一时间值之后,且在所述入网节点根据所述第一时间值更新所述PTP数据包中的修正域字段的修正值之前,所述方法还包括:According to a third possible implementation, combining the first aspect, the first or the second possible
In any one of the implementation manners, after the network access node records the first time value of the PTP data packet entering the network access node, and updating, at the network access node, the PTP data packet according to the first time value. Before modifying the correction value of the domain field, the method further includes:
所述入网节点对所述PTP数据包进行校验,确定所述PTP数据包不正确时,结束当前处理。The network access node checks the PTP data packet to determine that the PTP data packet is incorrect, and ends the current processing.
第二方面,本发明实施例提供了一种时间同步的方法,所述方法包括:In a second aspect, an embodiment of the present invention provides a method for time synchronization, where the method includes:
出网节点记录精确时间协议PTP数据包输出所述出网节点的第二时间值;所述PTP数据包由所述出网节点从网络中接收,且由所述网络中的入网节点发送;The outbound network node records the precise time protocol PTP data packet to output the second time value of the outgoing network node; the PTP data packet is received by the outgoing network node from the network, and is sent by the network access node in the network;
所述出网节点根据所述第二时间值更新所述PTP数据包中的修正域字段的修正值,得到第二更新PTP数据包。And the egress node updates the correction value of the correction domain field in the PTP data packet according to the second time value to obtain a second update PTP data packet.
根据第一种可能的实现方式,结合第二方面,所述出网节点根据所述第二时间值更新所述PTP数据包中的修正域字段的修正值,包括:According to the first possible implementation, in combination with the second aspect, the outgoing node updates the correction value of the modified domain field in the PTP data packet according to the second time value, including:
所述出网节点按照所述PTP数据包的格式提取PTP数据包中修正域字段的修正值;And the egress node extracts a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet;
所述出网节点将所述修正值加上所述第二时间值,得到所述第二修正值;And the outgoing node adds the correction value to the second time value to obtain the second correction value;
所述出网节点按照所述PTP数据包的格式将所述第二修正值更新到所述修正域字段。The egress node updates the second correction value to the correction domain field according to a format of the PTP data packet.
根据第二种可能的实现方式,结合第二方面,所述出网节点记录所述PTP数据包输出所述出网节点的第二时间值,包括:According to the second possible implementation, in combination with the second aspect, the egress node records the second time value of the PTP data packet outputting the egress node, including:
所述出网节点在所述PTP数据包从所述出网节点中靠近物理层的输出接口输出时记录所述第二时间值。The egress node records the second time value when the PTP data packet is output from an output interface of the egress node near the physical layer.
根据第三种可能的实现方式,结合第二方面、第一种或第二种可能的实现方式中的任一项,在所述出网节点记录所述PTP数据包输出所述出网
节点的第二时间值之后,且在所述出网节点根据所述第二时间值更新所述PTP数据包中的修正域字段的修正值之前,所述方法还包括:According to a third possible implementation manner, in combination with any one of the second aspect, the first or the second possible implementation manner, the PTP data packet is recorded at the outgoing network node, and the outgoing network is output
After the second time value of the node, and before the network node updates the correction value of the correction domain field in the PTP data packet according to the second time value, the method further includes:
所述出网节点对所述PTP数据包进行校验,确定所述PTP数据包不正确时,结束当前处理。The outgoing node checks the PTP data packet to determine that the PTP data packet is incorrect, and ends the current processing.
第三方面,本发明实施例提供了一种入网节点,所述入网节点包括:第一记录单元、第一更新单元和发送单元,其中,In a third aspect, an embodiment of the present invention provides a network access node, where the network access node includes: a first recording unit, a first update unit, and a sending unit, where
所述第一记录单元,配置为记录精确时间协议PTP数据包进入所述入网节点的第一时间值;The first recording unit is configured to record a first time value of the precise time protocol PTP data packet entering the network access node;
所述第一更新单元,配置为根据所述第一记录单元得到的第一时间值更新所述PTP数据包中的修正域字段的修正值,得到第一更新PTP数据包;The first update unit is configured to update a correction value of the correction domain field in the PTP data packet according to the first time value obtained by the first recording unit, to obtain a first update PTP data packet;
所述发送单元,配置为将所述第一更新PTP数据包发送至网络,以使得所述网络将所述第一更新PTP数据包向出网节点发送。The sending unit is configured to send the first updated PTP data packet to a network, so that the network sends the first updated PTP data packet to an outgoing node.
根据第一种可能的实现方式,结合第三方面,所述第一更新单元包括:第一提取模块、第一计算模块和第一更新模块,其中,According to the first possible implementation, in combination with the third aspect, the first update unit includes: a first extraction module, a first calculation module, and a first update module, where
所述第一提取模块配置为按照所述PTP数据包的格式提取PTP数据包中修正域字段的修正值;The first extraction module is configured to extract a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet;
所述第一计算模块配置为将所述修正值减去所述第一时间值,得到第一修正值;The first calculating module is configured to subtract the first time value from the correction value to obtain a first correction value;
所述第一更新模块配置为按照所述PTP数据包的格式将所述第一修正值更新到所述修正域字段。The first update module is configured to update the first correction value to the correction domain field in accordance with a format of the PTP data packet.
根据第二种可能的实现方式,结合第三方面,所述第一记录单元配置为,在所述PTP数据包从所述入网节点中靠近物理层的输入接口进入时记录所述第一时间值。According to a second possible implementation, in combination with the third aspect, the first recording unit is configured to record the first time value when the PTP data packet enters from an input interface of the network node close to the physical layer .
根据第三种可能的实现方式,结合第三方面、第一种或第二种可能的实现方式中的任一项,所述入网节点还包括第一校验单元,配置为对所述
PTP数据包进行校验,确定所述PTP数据包不正确时,触发结束处理。According to a third possible implementation, in combination with any one of the third aspect, the first or the second possible implementation, the network access node further includes a first check unit, configured to
When the PTP data packet is checked and it is determined that the PTP data packet is incorrect, the end processing is triggered.
第四方面,本发明实施例提供了一种出网节点,所述出网节点包括:第二记录单元和第二更新单元,其中,In a fourth aspect, an embodiment of the present invention provides an outbound network node, where the outbound network node includes: a second recording unit and a second update unit, where
所述第二记录单元配置为,记录精确时间协议PTP数据包输出所述出网节点的第二时间值;所述PTP数据包是所述出网节点从网络中接收的,且由所述网络的入网节点发送;The second recording unit is configured to: record a precise time protocol PTP data packet to output a second time value of the outgoing network node; the PTP data packet is received by the outgoing network node from the network, and the network is received by the network The network node sends;
所述第二更新单元配置为,根据所述第二时间值更新所述PTP数据包中的修正域字段的修正值,得到第二更新PTP数据包。The second update unit is configured to update the correction value of the correction domain field in the PTP data packet according to the second time value to obtain a second update PTP data packet.
根据第一种可能的实现方式,结合第四方面,所述第二更新单元包括:第二提取模块、第二计算模块和第二更新模块,其中,According to the first possible implementation, in combination with the fourth aspect, the second update unit includes: a second extraction module, a second calculation module, and a second update module, where
所述第二提取模块配置为按照所述PTP数据包的格式提取PTP数据包中修正域字段的修正值;The second extraction module is configured to extract a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet;
所述第二计算模块配置为,将所述修正值加上所述第二时间值,得到所述第二修正值;The second calculation module is configured to add the correction value to the second time value to obtain the second correction value;
所述第二更新模块配置为,按照所述PTP数据包的格式将所述第二修正值更新到所述修正域字段。The second update module is configured to update the second correction value to the correction domain field according to a format of the PTP data packet.
根据第二种可能的实现方式,结合第四方面,所述第二记录单元具体配置为,在所述PTP数据包从所述出网节点中靠近物理层的输出接口输出时记录所述第二时间值。According to the second possible implementation, in combination with the fourth aspect, the second recording unit is specifically configured to record the second when the PTP data packet is output from an output interface of the outbound network node close to the physical layer. Time value.
根据第三种可能的实现方式,结合第四方面、第一种或第二种可能的实现方式中的任一项,所述出网节点还包括:第二校验单元,配置为对所述PTP数据包进行校验,确定所述PTP数据包不正确时,触发结束处理。According to a third possible implementation manner, in combination with any one of the fourth aspect, the first or the second possible implementation manner, the out network node further includes: a second verification unit, configured to When the PTP data packet is checked and it is determined that the PTP data packet is incorrect, the end processing is triggered.
第五方面,本发明实施例提供了一种时间同步的系统,所述系统包括入网节点和出网节点,其中,In a fifth aspect, an embodiment of the present invention provides a system for time synchronization, where the system includes an ingress node and an egress node, where
所述入网节点配置为记录精确时间协议PTP数据包进入所述入网节点
的第一时间值;根据所述第一时间值更新所述PTP数据包中的修正域字段的修正值,得到第一更新PTP数据包;将所述第一更新PTP数据包发送至所述网络,以使得所述网络将所述第一更新PTP数据包向出网节点发送;The network access node is configured to record a precise time protocol PTP data packet to enter the network access node.
a first time value; updating a correction value of the correction domain field in the PTP data packet according to the first time value to obtain a first update PTP data packet; and sending the first update PTP data packet to the network So that the network sends the first updated PTP data packet to an outgoing node;
所述出网节点配置为记录所述第一更新PTP数据包输出所述出网节点的第二时间值;根据所述第二时间值更新所述第一更新PTP数据包中的修正域字段的修正值,得到第二更新PTP数据包。The egress node is configured to record a second time value of the first update PTP data packet outputting the egress node, and update a correction domain field in the first update PTP data packet according to the second time value Correct the value to get the second update PTP packet.
根据第一种可能的实现方式,结合第五方面,所述入网节点还配置为对所述PTP数据包进行校验,确定所述PTP数据包不正确时,结束当前处理。According to the first possible implementation manner, in combination with the fifth aspect, the network access node is further configured to check the PTP data packet, and when the PTP data packet is determined to be incorrect, the current processing ends.
根据第二种可能的实现方式,结合第五方面,所述出网节点还配置为对所述第一更新PTP数据包进行校验,确定所述第一更新PTP数据包不正确时,结束当前处理。According to the second possible implementation, in combination with the fifth aspect, the out network node is further configured to check the first update PTP data packet, and determine that the first update PTP data packet is incorrect, and end the current deal with.
本发明实施例还提供了一种存储介质,所述存储介质中存储有计算机程序,所述计算机程序配置为执行前述的时间同步的方法。The embodiment of the invention further provides a storage medium in which a computer program is stored, the computer program being configured to perform the aforementioned method of time synchronization.
本发明实施例提供的时间同步的方法、设备和系统,仅通过传输网络的入网节点和出网节点对该传输网络的驻留时间进行计算,使得无需传输网络中的每个节点都来计算各自的驻留时间,减少了传输网络中的资源开销;而且也不会积累由传输网络中的每个节点计算各自驻留时间时造成的计算误差,提高了传输网络的驻留时间的计算精度;更加不需要考虑传输网络中每个节点之间传输介质的双向传输路径不对称的情况,减少了网络的工作量。The method, device and system for time synchronization provided by the embodiments of the present invention calculate the dwell time of the transport network only by the network access node and the egress node of the transport network, so that each node in the transport network is not required to calculate each The dwell time reduces the resource overhead in the transport network; and it does not accumulate the computational errors caused by each node in the transport network calculating its own dwell time, and improves the calculation accuracy of the dwell time of the transport network; It is even more unnecessary to consider the asymmetry of the two-way transmission path of the transmission medium between each node in the transmission network, thereby reducing the workload of the network.
图1为本发明实施例提出的一种应用场景示意图;FIG. 1 is a schematic diagram of an application scenario according to an embodiment of the present invention;
图2为本发明实施例提出的一种时间同步的方法的流程示意图;2 is a schematic flowchart of a method for time synchronization according to an embodiment of the present invention;
图3为本发明实施例提出的一种入网节点根据第一时间值更新PTP数
据包中的修正域字段的修正值的流程示意图;FIG. 3 is a schematic diagram of a method for updating a PTP according to a first time value according to an embodiment of the present invention;
According to the flow chart of the correction value of the correction domain field in the package;
图4为本发明实施例提出的另一种时间同步的方法的流程示意图;4 is a schematic flowchart diagram of another method for time synchronization according to an embodiment of the present invention;
图5为本发明实施例提出的一种出网节点根据第二时间值更新PTP数据包中的修正域字段的修正值的流程示意图;FIG. 5 is a schematic flowchart of a modified value of a modified domain field in a PTP data packet according to a second time value according to an embodiment of the present invention;
图6为本发明实施例提供的一种时间同步的方法的详细流程示意图;FIG. 6 is a schematic flowchart diagram of a method for time synchronization according to an embodiment of the present disclosure;
图7为本发明实施例提供的一种入网节点的结构示意图;FIG. 7 is a schematic structural diagram of a network access node according to an embodiment of the present disclosure;
图8为本发明实施例提供的另一种入网节点的结构示意图;FIG. 8 is a schematic structural diagram of another network access node according to an embodiment of the present disclosure;
图9为本发明实施例提供的一种出网节点的结构示意图;FIG. 9 is a schematic structural diagram of an outgoing network node according to an embodiment of the present disclosure;
图10为本发明实施例提供的另一种出网节点的结构示意图;FIG. 10 is a schematic structural diagram of another network outlet node according to an embodiment of the present disclosure;
图11为本发明实施例提供的一种入网节点的硬件结构示意图;FIG. 11 is a schematic structural diagram of hardware of a network access node according to an embodiment of the present disclosure;
图12为本发明实施例提供的一种出网节点的硬件结构示意图;FIG. 12 is a schematic structural diagram of hardware of an outgoing network node according to an embodiment of the present disclosure;
图13为本发明实施例提供的一种时间同步的系统结构示意图。FIG. 13 is a schematic structural diagram of a system for time synchronization according to an embodiment of the present invention.
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present invention will be clearly and completely described in the following with reference to the accompanying drawings.
本发明实施例中,在整个网络中,仅在入网节点和出网节点对精确时间协议数据包进行时间戳处理,这种方式相当于把整个网络看成一个透明时钟,将入网节点作为数据包的入口,将出网节点作为数据包的出口,忽略网络中其他节点对精确时间协议数据包中关于网络驻留时间的处理,从而避免网络中每个节点计算网络驻留时间所造成的网络资源的开销;忽略网络中每个传送节点设备的积累误差,从而避免网络驻留时间精度的降低;忽略对整个网络两端的传输介质的双向传输路径延时不对称进行补偿,从而减少了网络的工作量。In the embodiment of the present invention, in the entire network, only the ingress network node and the egress node perform timestamp processing on the precise time protocol data packet, which is equivalent to treating the entire network as a transparent clock and using the ingress network node as a data packet. The entry, the outbound network node is used as the egress of the data packet, ignoring the processing of the network dwell time in the precise time protocol data packet by other nodes in the network, thereby avoiding the network resource caused by each node in the network calculating the network dwell time. The overhead of ignoring the accumulation error of each transmitting node device in the network, thereby avoiding the degradation of the network dwell time accuracy; ignoring the compensation of the bidirectional transmission path delay asymmetry of the transmission medium at both ends of the entire network, thereby reducing the network work. the amount.
参见图1,为本发明实施例提供的一个示例性的应用场景,该场景可以包括需要进行时间同步的设备A 110和设备B 120,以及设备A 110和设备
B 120之间的传输网络100。传输网络100可以通过虚线框区域来表示,可以包括但不限于:包括与设备A 110进行连接的入网节点101、与设备B 120进行连接的出网节点102和传输网络内的其他节点103,为了简要说明,网络内的其他节点103用云块表示。本领域技术人员可以意识到,本发明实施方式并不局限于上述的场景中,而还可以适用于其他任意的场景之中。FIG. 1 is an exemplary application scenario of an embodiment of the present invention. The scenario may include device A 110 and device B 120, and device A 110 and device, which need to perform time synchronization.
Transmission network 100 between B 120. The transport network 100 may be represented by a dashed box area, which may include, but is not limited to, an ingress node 101 that is connected to the device A 110, an outbound node 102 that is connected to the device B 120, and other nodes 103 in the transport network. Briefly, other nodes 103 within the network are represented by cloud blocks. Those skilled in the art can appreciate that the embodiments of the present invention are not limited to the above scenarios, but can also be applied to other arbitrary scenarios.
需要说明的是,图1中所示的场景中的传输网络,可以是有线网络,也可以是无线网络;还可以是移动网络等,本发明实施例对此不作任何限定。It should be noted that the transmission network in the scenario shown in FIG. 1 may be a wired network or a wireless network, or may be a mobile network, etc., which is not limited in this embodiment of the present invention.
参见图2,为本发明实施例提供的一种时间同步的方法,具体可以应用于图1所示应用场景的传输网络中的入口节点处,可以理解地,不同的网络划分会出现对应的入口节点,因此,入口节点是一个相对的概念。该方法可以包括:Referring to FIG. 2, a method for time synchronization according to an embodiment of the present invention may be applied to an ingress node in a transmission network of the application scenario shown in FIG. 1. It can be understood that different network partitions may have corresponding entries. Nodes, therefore, the entry node is a relative concept. The method can include:
S201:入网节点记录精确时间协议PTP数据包进入所述入网节点的第一时间值;S201: The ingress network node records a first time value of the precise time protocol PTP data packet entering the network access node.
示例性地,在图1所示的场景中,可以设定设备A与设备B之间需要进行时间同步。因此,入网节点可以从设备A发送的数据流中根据PTP数据包的特征字段查找到所述PTP数据包,并且可以记录所述PTP数据包进入入网节点的第一时间值,具体可以用入网时间戳的形式对第一时间值进行保存。Illustratively, in the scenario shown in FIG. 1, it may be set to require time synchronization between device A and device B. Therefore, the ingress network node can find the PTP data packet according to the feature field of the PTP data packet from the data stream sent by the device A, and can record the first time value of the PTP data packet entering the network access node, and specifically can use the network access time. The first time value is saved in the form of a stamp.
优选地,入网节点可以在所述PTP数据包处于输入端的任意一个环节处对第一时间值进行记录;优选地,本发明实施例中,入网节点可以在所述PTP数据包从所述入网节点中靠近物理层的输入接口进入时记录所述第一时间值。Preferably, the network access node may record the first time value at any one of the PTP data packets at the input end; preferably, in the embodiment of the present invention, the network access node may be in the PTP data packet from the network access node. The first time value is recorded when an input interface near the physical layer enters.
S202:入网节点根据所述第一时间值更新所述PTP数据包中的修正域字段的修正值,得到第一更新PTP数据包;
S202: The network access node updates, according to the first time value, a correction value of the correction domain field in the PTP data packet, to obtain a first update PTP data packet.
示例性地,入网节点根据所述第一时间值更新所述PTP数据包中的修正域字段的修正值,具体可以如图3所示,包括:Illustratively, the network access node updates the correction value of the modified domain field in the PTP data packet according to the first time value, as shown in FIG. 3, which includes:
S2021:入网节点按照所述PTP数据包的格式提取PTP数据包中修正域字段的修正值;S2021: The network access node extracts a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet.
可以理解地,由于PTP数据包符合IEEE1588协议,具有固定的数据格式,因此,入网节点可以按照固定的数据格式从所述PTP数据包的修正域字段中提取出修正值。具体实现方法为本领域技术人员的常规实现手段,在此不再赘述。It can be understood that since the PTP data packet conforms to the IEEE1588 protocol and has a fixed data format, the network access node can extract the correction value from the modified domain field of the PTP data packet according to a fixed data format. The specific implementation method is a conventional implementation means of those skilled in the art, and details are not described herein again.
S2022:入网节点将所述修正值减去所述第一时间值,得到第一修正值;S2022: The network access node subtracts the modified value from the first time value to obtain a first correction value.
具体在本实施例中,可以用通过S2021得到修正值减去用入网时间戳的形式保存的第一时间值,从而可以得到入网节点更新后的修正值。为了清楚的说明技术方案,在本实施例中,入网节点通过S2022所得到的入网节点更新后的修正值称之为第一修正值,本领域技术人员可以理解地,在以后的描述中,除非有特殊说明,否则均以第一修正值来表示入网节点通过S2022所得到的入网节点更新后的修正值。Specifically, in this embodiment, the first time value saved in the form of the timestamp of the network is obtained by using the S2021 to obtain the correction value, so that the modified value after the network node is updated can be obtained. In order to clearly explain the technical solution, in this embodiment, the modified value of the network access node obtained by the network access node through S2022 is referred to as a first correction value, and those skilled in the art can understand that, in the following description, unless There is a special description, otherwise the first correction value is used to indicate the correction value of the network node obtained by the network node through S2022 after updating.
S2023:入网节点按照所述PTP数据包的格式将所述第一修正值更新到所述修正域字段。S2023: The network access node updates the first correction value to the correction domain field according to the format of the PTP data packet.
具体地,在得到第一修正值之后,入网节点可以按照所述PTP数据包的格式将修正域字段中的原修正值更改为第一修正值,这样完成了入网节点对PTP数据包的更新,从而得到第一更新PTP数据包。Specifically, after obtaining the first correction value, the network access node may change the original correction value in the correction domain field to the first correction value according to the format of the PTP data packet, thereby completing the update of the PTP data packet by the network access node, Thereby obtaining the first update PTP data packet.
示例性地,在S201和S202之间,该方法还可以包括:入网节点对所述PTP数据包进行校验,确定所述PTP数据包是否正确:当所述PTP数据包正确时,继续执行S202;当所述PTP数据包不正确时,结束当前的处理,例如丢弃所述PTP数据包,并等待下一个PTP数据包的到来;Exemplarily, between S201 and S202, the method may further include: the ingress network node checks the PTP data packet, and determines whether the PTP data packet is correct: when the PTP data packet is correct, proceed to execute S202. When the PTP data packet is incorrect, the current processing is ended, for example, discarding the PTP data packet, and waiting for the arrival of the next PTP data packet;
具体地,入网节点可以根据所述PTP数据包所在的网络层次不同,以
及封装所述PTP数据包的数据流的格式不同,可采用对应的校验技术进行校验,例如当所述PTP数据包封装在互联网际协议(IP,Internet Protocol)V6或IPV4数据流的时候,入网节点可以采用用户数据报协议(UDP,User Datagram Protocol)校验、IP校验、循环冗余校验(CRC,Cyclical Redundancy Check)等校验方法对所述PTP数据包进行校验,来确定所述PTP数据包是否正确。具体校验的实现过程为本领域技术人员的常规实现手段,在此不再赘述。Specifically, the network access node may be different according to the network layer where the PTP data packet is located.
And the format of the data stream encapsulating the PTP data packet is different, and the corresponding verification technology may be used for verification, for example, when the PTP data packet is encapsulated in an Internet Protocol (IP, Internet Protocol) V6 or IPV4 data stream. The access node may perform verification on the PTP data packet by using a user datagram protocol (UDP), an IP check, a CRC (Cyclical Redundancy Check), or the like. Determine if the PTP packet is correct. The implementation process of the specific check is a conventional implementation means of those skilled in the art, and details are not described herein again.
S203:入网节点将所述第一更新PTP数据包发送至网络;S203: The ingress network node sends the first update PTP data packet to the network.
示例性地,通过S203可以使得所述网络将所述第一更新PTP数据包向出网节点发送。Exemplarily, the network may cause the network to send the first updated PTP data packet to an outgoing node by using S203.
示例性地,由于所述第一更新PTP数据包的修正域字段中保存的为第一修正值,因此,所述第一更新PTP数据包中包含了数据流进入传输网络的时间信息;那么,当所述第一更新PTP数据包到达传输网络的出口节点时,就可以通过所述第一更新PTP数据包从传输网络输出的时间信息来获取传输网络的网络驻留时间;最后通过网络驻留时间来实现设备A与设备B之间的时间同步。Exemplarily, since the first modified value is saved in the modified domain field of the first update PTP data packet, the first update PTP data packet includes time information of the data flow entering the transmission network; When the first updated PTP data packet arrives at the egress node of the transport network, the network dwell time of the transport network may be obtained by using the time information output by the first update PTP data packet from the transport network; Time to achieve time synchronization between device A and device B.
参见图4,为本发明实施例提供的一种时间同步的方法,该方法可以应用于图1所示应用场景的传输网络中的出口节点处,可以理解地,不同的网络划分会出现对应的出口节点,因此,出口节点是一个相对的概念。该方法可以包括:FIG. 4 is a method for time synchronization according to an embodiment of the present invention. The method can be applied to an egress node in a transmission network of the application scenario shown in FIG. 1. It can be understood that different network segments may appear correspondingly. The exit node, therefore, the exit node is a relative concept. The method can include:
S401:出网节点记录精确时间协议PTP数据包输出所述出网节点的第二时间值;S401: The outbound network node records a second time value of the outbound network node by the precise time protocol PTP data packet.
需要说明的是,在本实施例中,所述PTP数据包是所述出网节点从网络中接收的,并且由所述网络的入网节点发送的PTP数据包;具体地,在本实施例中,结合前述如图2所示的实施例可以知道,所述出网节点从网
络中接收的PTP数据包实际上是入网节点发送的第一更新PTP数据包,其中,所述第一更新PTP数据包的修正域字段所保存的修正值为第一修正值。It should be noted that, in this embodiment, the PTP data packet is a PTP data packet that is received by the outbound network node from the network and sent by the network access node of the network; specifically, in this embodiment. In combination with the foregoing embodiment shown in FIG. 2, it can be known that the outgoing node is from the network.
The PTP data packet received in the network is actually the first update PTP data packet sent by the network access node, and the correction value saved in the modified domain field of the first update PTP data packet is the first modified value.
与图2所示实施例的入网节点类似的,出网节点可以从网络发送过来的数据流中根据PTP数据包的特征字段查找到所述PTP数据包,并且记录所述PTP数据包通过出网节点输出端的第二时间值,具体可以用出网时间戳的形式对第二时间值进行保存;Similar to the network access node of the embodiment shown in FIG. 2, the egress node can find the PTP data packet according to the feature field of the PTP data packet from the data stream sent by the network, and record the PTP data packet through the egress network. The second time value of the output end of the node, specifically, the second time value may be saved in the form of a network timestamp;
优选地,出网节点可以在所述PTP数据包处于输出端的任意一个环节处对第二时间值进行记录;优选地,本发明实施例中,出网节点可以在所述PTP数据包从所述出网节点中靠近物理层的输出接口输出时记录所述第二时间值。Preferably, the egress node may record the second time value at any one of the PTP data packets at the output end; preferably, in the embodiment of the present invention, the egress node may be in the PTP data packet from the The second time value is recorded when the output interface of the outlet node is close to the physical layer.
S402:出网节点根据所述第二时间值更新所述PTP数据包中的修正域字段的修正值,得到第二更新PTP数据包;S402: The network node updates the correction value of the correction domain field in the PTP data packet according to the second time value, to obtain a second update PTP data packet.
示例性地,S402具体可以如图5所示,包括:Exemplarily, S402 may be specifically as shown in FIG. 5, and includes:
S4021:出网节点按照所述PTP数据包的格式提取PTP数据包中修正域字段的修正值;S4021: The egress node extracts a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet.
可以理解地,由于PTP数据包符合IEEE1588协议,具有固定的数据格式,因此,出网节点可以按照固定的数据格式从所述PTP数据包的修正域字段中提取出修正值。具体实现方式为本领域技术人员的常规实现手段,在此不再赘述。It can be understood that since the PTP data packet conforms to the IEEE1588 protocol and has a fixed data format, the outgoing node can extract the correction value from the modified domain field of the PTP data packet according to a fixed data format. The specific implementation manners are conventional implementation means of those skilled in the art, and are not described herein again.
但是需要说明的是,在本实施例中,结合图2所示的实施例,由于所述PTP数据包为入网节点发送的第一更新PTP数据包,因此,所述PTP数据包修正域字段中的修正值为第一修正值。However, in this embodiment, in combination with the embodiment shown in FIG. 2, since the PTP data packet is the first updated PTP data packet sent by the network access node, the PTP data packet is modified in the field field. The correction value is the first correction value.
S4022:出网节点将所述修正值加上所述第二时间值,得到所述第二修正值;S4022: The network node adds the correction value to the second time value to obtain the second correction value.
具体地,在本实施例中,结合图2所示的实施例,由于所述修正值为
第一修正值,因此出网节点可以将通过S4021得到修正值加上用出网时间戳的形式保存的第二时间值,来得到出网节点更新后的修正值。可以理解地,由于第一修正值中包括了PTP数据包的入网时间信息,所以第一修正值加上第二时间值之后所得到的出网节点更新后的修正值中包括了PTP数据包在整个传输网络的驻留时间信息,该信息可以用于设备B与设备A之间的时间同步。Specifically, in the embodiment, in combination with the embodiment shown in FIG. 2, since the correction value is
The first correction value, therefore, the outlet node can obtain the correction value obtained by the S4021 and the second time value saved in the form of the outgoing network timestamp, to obtain the corrected value after the network node is updated. It can be understood that, since the first correction value includes the network access time information of the PTP data packet, the corrected value of the updated network node obtained after the first correction value plus the second time value includes the PTP data packet. The dwell time information of the entire transport network, which can be used for time synchronization between device B and device A.
为了清楚的说明技术方案,在本实施例中,出网节点通过S4022所得到的出网节点更新后的修正值称之为第二修正值,本领域技术人员可以理解地,在以后的描述中,除非有特殊说明,否则均以第二修正值来表示出网节点通过S4022所得到的出网节点更新后的修正值。In order to clarify the technical solution, in the present embodiment, the modified value of the outgoing node obtained by the outlet node through S4022 is referred to as a second correction value, which can be understood by those skilled in the art in the following description. Unless otherwise specified, the second correction value is used to indicate the correction value of the network node obtained by the network node through S4022 after updating.
S4023:出网节点按照所述PTP数据包的格式将所述第二修正值更新到所述修正域字段;S4023: The egress node updates the second correction value to the correction domain field according to the format of the PTP data packet.
具体地,在得到第二修正值之后,出网节点可以按照所述PTP数据包的格式将修正域字段中的修正值更改为第二修正值,这样完成了出网节点对PTP数据包的更新,从而得到第二更新PTP数据包;Specifically, after obtaining the second correction value, the egress node may change the correction value in the correction domain field to the second correction value according to the format of the PTP data packet, thereby completing the update of the PTP data packet by the egress node. , thereby obtaining a second updated PTP data packet;
在本实施例中,结合图2所示的实施例,出网节点实际上是将第一更新PTP数据包中的第一修正值更改为第二修正值,从而得到第二更新PTP数据包。In this embodiment, in conjunction with the embodiment shown in FIG. 2, the egress node actually changes the first correction value in the first update PTP data packet to the second correction value, thereby obtaining the second update PTP data packet.
示例性地,在S401和S402之间,该方法还可以包括:出网节点对所述PTP数据包进行校验,确定所述PTP数据包是否正确:当所述PTP数据包正确时,继续执行S402;当所述PTP数据包不正确时,结束当前的处理,例如:丢弃所述PTP数据包,并等待下一个PTP数据包的到来;Exemplarily, between S401 and S402, the method may further include: the out network node checks the PTP data packet, and determines whether the PTP data packet is correct: when the PTP data packet is correct, continue to execute S402. When the PTP data packet is incorrect, end the current processing, for example, discarding the PTP data packet, and waiting for the arrival of the next PTP data packet;
具体地,与图2所示的实施例类似,出网节点可以根据所述PTP数据包所在的网络层次不同,以及封装所述PTP数据包的数据流的格式不同,可采用对应的校验技术进行校验;具体的实施方式前述实施例中已有详细
描述,在此不再赘述。Specifically, similar to the embodiment shown in FIG. 2, the egress node may adopt a corresponding verification technology according to different network layers in which the PTP data packet is located, and a format of a data flow encapsulating the PTP data packet. Perform verification; the specific embodiment has been detailed in the foregoing embodiment.
Description, no longer repeat here.
需要说明的是,结合图1所示的应用场景,当第二更新PTP数据包从出网节点输出后到达设备B时,设备B可以通过第二更新PTP数据包修正域字段中的第二修正值得到整个传输网络的驻留时间,并且可以通过该驻留时间与设备A进行时间同步,具体时间同步的实现过程为本领域技术人员的常规技术手段,在此不再赘述。It should be noted that, in combination with the application scenario shown in FIG. 1, when the second update PTP data packet is output from the outbound network node and then arrives at the device B, the device B may correct the second correction in the domain field by using the second update PTP data packet. The value of the time of the entire transmission network is obtained, and the time synchronization of the time synchronization is performed by the device A. The implementation process of the specific time synchronization is a conventional technical means of those skilled in the art, and details are not described herein again.
参见图6,为本发明实施例提供的一种时间同步方法的详细流程示意图,可以理解地,该详细流程以图1所示的应用场景,具体可以包括:FIG. 6 is a schematic flowchart of a time synchronization method according to an embodiment of the present invention. The detailed process may be as follows:
S601:设备A向入网节点发送PTP数据包;S601: Device A sends a PTP data packet to the network access node.
示例性地,在图1所示的应用场景中,设定设备A需要和设备B进行时间同步,而设备A和设备B之间的传输网络100如图1所示的虚线框区域表示,传输网络的入网节点与设备A连接,传输网络的出网节点与设备B连接,设备A可以将PTP数据包封装在向入网节点发送的数据流中。Illustratively, in the application scenario shown in FIG. 1, the setting device A needs to perform time synchronization with the device B, and the transmission network 100 between the device A and the device B is represented by a dotted line frame area as shown in FIG. The network access node of the network is connected to device A, and the outbound network node of the transport network is connected to device B. Device A can encapsulate the PTP data packet in the data stream sent to the ingress network node.
S602:入网节点记录PTP数据包进入所述入网节点的第一时间值;S602: The ingress network node records a first time value of the PTP data packet entering the network access node.
示例性地,当入网节点接收到设备A发送的数据流之后,可以根据PTP数据包的特征字段从数据流中查找到所述PTP数据包,并且记录所述PTP数据包进入入网节点的第一时间值,具体可以用入网时间戳的形式对第一时间值进行保存。Exemplarily, after the network access node receives the data stream sent by the device A, the PTP data packet may be searched from the data stream according to the feature field of the PTP data packet, and the PTP data packet is recorded to enter the first node of the network access node. The time value can be saved in the form of a network timestamp.
优选地,入网节点可以在所述PTP数据包处于输入端的任意一个环节处对第一时间值进行记录;优选地,本发明实施例中,入网节点可以在所述PTP数据包从所述入网节点中靠近物理层的输入接口进入时记录所述第一时间值。Preferably, the network access node may record the first time value at any one of the PTP data packets at the input end; preferably, in the embodiment of the present invention, the network access node may be in the PTP data packet from the network access node. The first time value is recorded when an input interface near the physical layer enters.
S603:入网节点对所述PTP数据包进行校验,确定所述PTP数据包是否正确;S603: The network access node checks the PTP data packet to determine whether the PTP data packet is correct.
具体地,入网节点可以根据所述PTP数据包所在的网络层次不同,以
及封装所述PTP数据包的数据流的格式不同,可采用对应的校验技术进行校验,例如当所述PTP数据包封装在互联网际协议(IP,Internet Protocol)V6或IPV4数据流的时候,入网节点可以采用用户数据报协议(UDP,User Datagram Protocol)校验、IP校验、循环冗余校验(Cyclical Redundancy Check,CRC)等校验方法对所述PTP数据包进行校验,来确定所述PTP数据包是否正确。具体校验的实现过程为本领域技术人员的常规实现手段,在此不再赘述。Specifically, the network access node may be different according to the network layer where the PTP data packet is located.
And the format of the data stream encapsulating the PTP data packet is different, and the corresponding verification technology may be used for verification, for example, when the PTP data packet is encapsulated in an Internet Protocol (IP, Internet Protocol) V6 or IPV4 data stream. The network access node may perform verification of the PTP data packet by using a User Datagram Protocol (UDP), IP check, or Cyclical Redundancy Check (CRC) check method. Determine if the PTP packet is correct. The implementation process of the specific check is a conventional implementation means of those skilled in the art, and details are not described herein again.
具体地,当所述PTP数据包不正确时,结束当前的处理,例如丢弃所述PTP数据包,并等待下一个PTP数据包的到来;当所述PTP数据包正确时,继续执行S604:入网节点根据所述第一时间值更新所述PTP数据包中的修正域字段的修正值,得到第一更新PTP数据包;Specifically, when the PTP data packet is incorrect, the current processing ends, for example, discarding the PTP data packet, and waiting for the arrival of the next PTP data packet; when the PTP data packet is correct, proceeding to S604: accessing the network And the node updates the correction value of the correction domain field in the PTP data packet according to the first time value to obtain a first update PTP data packet;
示例性地,入网节点根据所述第一时间值更新所述PTP数据包中的修正域字段的修正值,具体可以如图3所示,在此不再赘述。Illustratively, the network access node updates the correction value of the modified domain field in the PTP data packet according to the first time value, which may be specifically shown in FIG. 3, and details are not described herein again.
S605:入网节点将第一更新PTP数据包发送至网络;S605: The ingress network node sends the first update PTP data packet to the network.
示例性地,通过S605可以使得所述网络将第一更新PTP数据包向出网节点发送;Exemplarily, the network may cause the network to send the first update PTP data packet to the egress node by using S605;
需要说明的是,由于第一更新PTP数据包的修正域字段中保存的为第一修正值,因此,第一更新PTP数据包中包含了数据流进入传输网络的时间信息。It should be noted that, because the first modified value is stored in the modified domain field of the first update PTP packet, the first updated PTP data packet includes time information of the data flow entering the transport network.
S606:出网节点从网络中接收第一更新PTP数据包;S606: The egress node receives the first update PTP data packet from the network.
示例性地,当入网节点将第一更新PTP数据包发送至网络之后,通过网络的传输,出网节点将会从网络中接收第一更新PTP数据包。Exemplarily, after the network node sends the first update PTP data packet to the network, the network node transmits the first update PTP data packet from the network.
S607:出网节点记录第一更新PTP数据包输出所述出网节点的第二时间值;S607: The outbound network node records, by the first update PTP data packet, a second time value of the outbound network node.
与入网节点类似的,出网节点可以从网络发送过来的数据流中根据PTP
数据包的特征字段查找到第一更新PTP数据包,并且记录第一更新PTP数据包通过出网节点输出端的第二时间值,具体可以用出网时间戳的形式对第二时间值进行保存;Similar to the incoming node, the outgoing node can receive the data stream from the network according to the PTP.
The feature field of the data packet finds the first update PTP data packet, and records the second time value of the first update PTP data packet through the output end of the outgoing network node, and specifically saves the second time value in the form of the outgoing network time stamp;
优选地,出网节点可以在第一更新PTP数据包处于输出端的任意一个环节处对第二时间值进行记录;优选地,本发明实施例中,出网节点可以在第一更新PTP数据包从所述出网节点中靠近物理层的输出接口输出时记录所述第二时间值。Preferably, the egress node can record the second time value at any one of the first update PTP data packets at the output end; preferably, in the embodiment of the present invention, the egress network node can update the PTP data packet from the first The second time value is recorded when the output interface of the outlet node is close to the physical layer.
S608:出网节点对第一更新PTP数据包进行校验,确定第一更新PTP数据包是否正确;S608: The egress node checks the first update PTP data packet to determine whether the first update PTP data packet is correct.
具体地,与S603类似,出网节点可以根据第一更新PTP数据包所在的网络层次不同,以及封装第一更新PTP数据包的数据流的格式不同,可采用对应的校验技术进行校验;具体的实施方式S603中已有详细描述,在此不再赘述。Specifically, similar to S603, the egress node may perform different verification according to a different network layer where the first update PTP data packet is located, and a format of the data flow encapsulating the first updated PTP data packet, and may be verified by using a corresponding verification technology; The specific implementation is described in detail in S603, and details are not described herein again.
具体地,当所述PTP数据包不正确时,结束当前的处理,例如丢弃所述PTP数据包,并等待下一个PTP数据包的到来;当所述PTP数据包正确时,继续执行S609:出网节点根据所述第二时间值更新第一更新PTP数据包中的修正域字段的修正值,得到第二更新PTP数据包;Specifically, when the PTP data packet is incorrect, the current processing ends, for example, discarding the PTP data packet, and waiting for the arrival of the next PTP data packet; when the PTP data packet is correct, proceeding to S609: And the network node updates, according to the second time value, a correction value of the correction domain field in the first update PTP data packet, to obtain a second update PTP data packet;
示例性地,S609的具体实现过程可以如图5所示,在此不再赘述。Exemplarily, the specific implementation process of S609 can be as shown in FIG. 5, and details are not described herein again.
S610:出网节点将第二更新PTP数据包传输至设备B;S610: The egress node transmits the second update PTP data packet to the device B.
示例性地,设备B可以通过第二更新PTP数据包修正域字段中的第二修正值得到整个传输网络的驻留时间,并且可以通过该驻留时间与设备A进行时间同步,具体时间同步的实现过程为本领域技术人员的常规技术手段,在此不再赘述。Exemplarily, the device B may obtain the dwell time of the entire transmission network by using the second correction value in the second update PTP packet correction domain field, and may perform time synchronization with the device A through the dwell time, and the specific time synchronization The implementation process is a conventional technical means for those skilled in the art and will not be described herein.
本实施例所提供的一种时间同步的方法的详细流程,仅通过传输网络的入网节点和出网节点对该传输网络的驻留时间进行计算,使得无需传输
网络中的每个节点都来计算各自的驻留时间,减少了传输网络中的资源开销;而且也不会积累由传输网络中的每个节点计算各自驻留时间时造成的计算误差,提高了传输网络的驻留时间的计算精度;更加不需要考虑传输网络中每个节点之间传输介质的双向传输路径不对称的情况,减少了网络的工作量。The detailed process of the method for time synchronization provided by this embodiment only calculates the dwell time of the transport network by the network access node and the egress node of the transport network, so that no transmission is needed.
Each node in the network calculates its own dwell time, reduces the resource overhead in the transport network, and does not accumulate the computational errors caused by each node in the transport network calculating its own dwell time. The calculation accuracy of the dwell time of the transmission network; it is even more unnecessary to consider the asymmetry of the bidirectional transmission path of the transmission medium between each node in the transmission network, thereby reducing the workload of the network.
参见图7,为本发明实施例提供的一种入网节点70的结构示意图,如图7所示,入网节点70可以包括:第一记录单元701、第一更新单元702和发送单元703,其中,FIG. 7 is a schematic structural diagram of a network access node 70 according to an embodiment of the present invention. As shown in FIG. 7, the network access node 70 may include: a first recording unit 701, a first updating unit 702, and a sending unit 703, where
第一记录单元701,配置为记录精确时间协议PTP数据包进入入网节点70的第一时间值;The first recording unit 701 is configured to record a first time value of the precise time protocol PTP data packet entering the network access node 70;
第一更新单元702,配置为根据第一记录单元701得到的第一时间值更新所述PTP数据包中的修正域字段的修正值,得到第一更新PTP数据包;The first update unit 702 is configured to update the correction value of the correction domain field in the PTP data packet according to the first time value obtained by the first recording unit 701, to obtain a first update PTP data packet;
发送单元703,配置为将所述第一更新PTP数据包发送至网络,以使得所述网络将所述第一更新PTP数据包向出网节点发送。The sending unit 703 is configured to send the first updated PTP data packet to the network, so that the network sends the first updated PTP data packet to an outgoing node.
示例性地,本实施例可以结合图1所示的场景进行说明,第一记录单元701可以从设备A发送的数据流中根据PTP数据包的特征字段查找到所述PTP数据包,并且可以记录所述PTP数据包进入入网节点的第一时间值,具体地,第一记录单元701可以用入网时间戳的形式对第一时间值进行保存;Exemplarily, the embodiment may be described in conjunction with the scenario shown in FIG. 1. The first recording unit 701 may find the PTP data packet from the data field sent by the device A according to the feature field of the PTP data packet, and may record The PTP data packet enters a first time value of the network access node. Specifically, the first recording unit 701 may save the first time value in the form of a network timestamp;
优选地,第一记录单元701可以在所述PTP数据包处于入网节点70输入端的任意一个环节处对第一时间值进行记录;优选地,本发明实施例中,第一记录单元701可以在所述PTP数据包从入网节点70中靠近物理层的输入接口进入时记录所述第一时间值。Preferably, the first recording unit 701 can record the first time value at any one of the input ends of the PTP data packet; preferably, in the embodiment of the present invention, the first recording unit 701 can The first time value is recorded when the PTP data packet enters from the input interface of the access node 70 near the physical layer.
示例性地,如图8所示,第一更新单元702可以包括:第一提取模块7021、第一计算模块7022和第一更新模块7023,其中,
Illustratively, as shown in FIG. 8, the first update unit 702 may include: a first extraction module 7021, a first calculation module 7022, and a first update module 7023, where
第一提取模块7021配置为按照所述PTP数据包的格式提取PTP数据包中修正域字段的修正值;The first extraction module 7021 is configured to extract a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet;
可以理解地,由于PTP数据包符合IEEE1588协议,具有固定的数据格式,因此,第一提取模块7021可以按照固定的数据格式从所述PTP数据包的修正域字段中提取出修正值。具体实现方法为本领域技术人员的常规实现手段,在此不再赘述;It can be understood that since the PTP data packet conforms to the IEEE1588 protocol and has a fixed data format, the first extraction module 7021 can extract the correction value from the correction domain field of the PTP data packet according to a fixed data format. The specific implementation method is a conventional implementation means of a person skilled in the art, and details are not described herein again;
第一计算模块7022配置为将所述修正值减去所述第一时间值,得到第一修正值;The first calculating module 7022 is configured to subtract the first time value from the correction value to obtain a first correction value;
具体在本实施例中,第一计算模块7022可以用第一提取模块7021得到修正值减去用入网时间戳的形式保存的第一时间值,从而可以得到入网节点70更新后的修正值。为了清楚的说明技术方案,在本实施例中,第一计算模块7022所得到的入网节点更新后的修正值称之为第一修正值,本领域技术人员可以理解地,在以后的描述中,除非有特殊说明,否则均以第一修正值来表示第一计算模块7022所得到的入网节点更新后的修正值;Specifically, in the embodiment, the first calculating module 7022 can obtain the first time value saved by the first extraction module 7021 minus the time stamp in the network, so that the updated value of the network node 70 after updating can be obtained. In order to clearly explain the technical solution, in the present embodiment, the updated value of the network access node obtained by the first calculation module 7022 is referred to as a first correction value, and those skilled in the art can understand that, in the following description, Unless otherwise specified, the correction value after the update of the network access node obtained by the first calculation module 7022 is represented by the first correction value;
第一更新模块7023配置为按照所述PTP数据包的格式将所述第一修正值更新到所述修正域字段;The first update module 7023 is configured to update the first correction value to the correction domain field according to a format of the PTP data packet;
具体地,在第一计算模块7022得到第一修正值之后,第一更新模块7023可以按照所述PTP数据包的格式将修正域字段中的原修正值更改为第一修正值,这样完成了第一更新单元702对PTP数据包的更新,从而得到第一更新PTP数据包。Specifically, after the first calculation module 7022 obtains the first correction value, the first update module 7023 may change the original correction value in the correction domain field to the first correction value according to the format of the PTP data packet, thus completing the first An update unit 702 updates the PTP data packet to obtain a first update PTP data packet.
示例性地,参见图8,入网节点70还可以包括第一校验单元704,配置为对所述PTP数据包进行校验,确定所述PTP数据包是否正确,当确定所述PTP数据包正确时,触发所述第一更新单元702对所述PTP数据包的处理;当确定所述PTP数据包不正确时,触发结束处理,例如丢弃所述PTP数据包,并等待下一个PTP数据包的到来;
For example, referring to FIG. 8, the network access node 70 may further include a first check unit 704 configured to check the PTP data packet, determine whether the PTP data packet is correct, and determine that the PTP data packet is correct. And triggering, by the first update unit 702, processing of the PTP data packet; when determining that the PTP data packet is incorrect, triggering end processing, for example, discarding the PTP data packet, and waiting for the next PTP data packet Coming
具体地,第一校验单元704可以根据所述PTP数据包所在的网络层次不同,以及封装所述PTP数据包的数据流的格式不同,可采用对应的校验技术进行校验,例如当所述PTP数据包封装在互联网际协议(IP,Internet Protocol)V6或IPV4数据流的时候,第一校验单元704可以采用用户数据报协议(UDP,User Datagram Protocol)校验、IP校验、循环冗余校验(CRC,Cyclical Redundancy Check)等校验方法对所述PTP数据包进行校验,来确定所述PTP数据包是否正确。具体校验的实现过程为本领域技术人员的常规实现手段,在此不再赘述。Specifically, the first check unit 704 may be configured according to different network layers in which the PTP data packet is located, and a format of a data flow encapsulating the PTP data packet, and may be verified by using a corresponding verification technology, for example, When the PTP data packet is encapsulated in an Internet Protocol (IP) V6 or IPV4 data stream, the first check unit 704 may use a User Datagram Protocol (UDP) check, an IP check, and a loop. A verification method such as a CRC (Cyclical Redundancy Check) checks the PTP data packet to determine whether the PTP data packet is correct. The implementation process of the specific check is a conventional implementation means of those skilled in the art, and details are not described herein again.
需要说明的是,由于所述第一更新PTP数据包的修正域字段中保存的为第一修正值,因此,所述第一更新PTP数据包中包含了数据流进入传输网络的时间信息;那么,当所述第一更新PTP数据包到达传输网络的出口节点时,就可以通过所述第一更新PTP数据包从传输网络输出的时间信息来获取传输网络的网络驻留时间;最后通过网络驻留时间来实现设备A与设备B之间的时间同步。It should be noted that, since the first modified value is stored in the modified domain field of the first updated PTP data packet, the first updated PTP data packet includes time information of the data flow entering the transmission network; And when the first update PTP data packet arrives at the egress node of the transport network, the network camp time of the transport network may be obtained by using the time information output by the first update PTP data packet from the transport network; Allow time to implement time synchronization between device A and device B.
参见图9,为本发明实施例提供的一种出网节点90的结构示意图,如图9所示,出网节点90可以包括:第二记录单元901和第二更新单元902,其中,FIG. 9 is a schematic structural diagram of an egress node 90 according to an embodiment of the present invention. As shown in FIG. 9, the egress node 90 may include: a second recording unit 901 and a second update unit 902, where
第二记录单元901配置为,记录精确时间协议PTP数据包输出出网节点90的第二时间值;所述PTP数据包是出网节点90从网络中接收的,并且由所述网络的入网节点发送的PTP数据包;The second recording unit 901 is configured to record a second time value of the precise time protocol PTP data packet output network node 90; the PTP data packet is received by the outbound network node 90 from the network, and is connected to the network node of the network. PTP packet sent;
第二更新单元902配置为,根据所述第二时间值更新所述PTP数据包中的修正域字段的修正值,得到第二更新PTP数据包。The second update unit 902 is configured to update the correction value of the correction domain field in the PTP data packet according to the second time value to obtain a second update PTP data packet.
示例性地,在本实施例中,结合前述如图2所示的实施例可以知道,出网节点90从网络中接收的PTP数据包实际上是入网节点发送的第一更新PTP数据包,其中,所述第一更新PTP数据包的修正域字段所保存的修正
值为第一修正值。Exemplarily, in this embodiment, in combination with the foregoing embodiment shown in FIG. 2, it can be known that the PTP data packet received by the egress node 90 from the network is actually the first update PTP data packet sent by the ingress network node, where Correction saved in the modified domain field of the first update PTP packet
The value is the first correction value.
与图2所示实施例的入网节点类似的,第二记录单元901可以从网络发送过来的数据流中根据PTP数据包的特征字段查找到所述PTP数据包,并且记录所述PTP数据包通过出网节点90输出端的第二时间值,具体可以用出网时间戳的形式对第二时间值进行保存;Similar to the network access node of the embodiment shown in FIG. 2, the second recording unit 901 can find the PTP data packet according to the feature field of the PTP data packet from the data stream sent by the network, and record the PTP data packet. The second time value of the output end of the outbound network node 90, specifically, the second time value may be saved in the form of a network timestamp;
优选地,第二记录单元901可以在所述PTP数据包处于出网节点90输出端的任意一个环节处对第二时间值进行记录;优选地,本发明实施例中,第二记录单元901可以在所述PTP数据包从出网节点90中靠近物理层的输出接口输出时记录所述第二时间值。Preferably, the second recording unit 901 can record the second time value at any one of the PTP data packets at the output end of the outlet node 90. Preferably, in the embodiment of the present invention, the second recording unit 901 can be The second time value is recorded when the PTP data packet is output from the output interface of the outgoing node 90 near the physical layer.
示例性地,如图10所示,第二更新单元902可以包括:第二提取模块9021、第二计算模块9022和第二更新模块9023,其中,Illustratively, as shown in FIG. 10, the second update unit 902 may include: a second extraction module 9021, a second calculation module 9022, and a second update module 9023, where
第二提取模块9021配置为按照所述PTP数据包的格式提取PTP数据包中修正域字段的修正值;The second extraction module 9021 is configured to extract a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet;
可以理解地,由于PTP数据包符合IEEE1588协议,具有固定的数据格式,因此,第二提取模块9021可以按照固定的数据格式从所述PTP数据包的修正域字段中提取出修正值。具体实现方法为本领域技术人员的常规实现手段,在此不再赘述。It can be understood that since the PTP data packet conforms to the IEEE1588 protocol and has a fixed data format, the second extraction module 9021 can extract the correction value from the correction domain field of the PTP data packet according to a fixed data format. The specific implementation method is a conventional implementation means of those skilled in the art, and details are not described herein again.
但是需要说明的是,在本实施例中,结合图8所示的实施例,由于所述PTP数据包为入网节点发送的第一更新PTP数据包,因此,所述PTP数据包修正域字段中的修正值为第一修正值。However, in this embodiment, in combination with the embodiment shown in FIG. 8, since the PTP data packet is the first updated PTP data packet sent by the network access node, the PTP data packet is modified in the field field. The correction value is the first correction value.
第二计算模块9022配置为,将所述修正值加上所述第二时间值,得到所述第二修正值;The second calculation module 9022 is configured to add the correction value to the second time value to obtain the second correction value;
具体地,在本实施例中,结合图8所示的实施例,由于所述修正值为第一修正值,因此第二计算模块9022可以将第二提取模块9021所得到的修正值加上用出网时间戳的形式保存的第二时间值,来得到出网节点90更
新后的修正值。可以理解地,由于第一修正值中包括了PTP数据包的入网时间信息,所以第一修正值加上第二时间值之后所得到的出网节点更新后的修正值中包括了PTP数据包在整个传输网络的驻留时间信息,该信息可以用于设备B与设备A之间的时间同步。Specifically, in this embodiment, in combination with the embodiment shown in FIG. 8, since the correction value is the first correction value, the second calculation module 9022 can add the correction value obtained by the second extraction module 9021. The second time value saved in the form of the outgoing timestamp, to obtain the outgoing node 90
The new correction value. It can be understood that, since the first correction value includes the network access time information of the PTP data packet, the corrected value of the updated network node obtained after the first correction value plus the second time value includes the PTP data packet. The dwell time information of the entire transport network, which can be used for time synchronization between device B and device A.
为了清楚的说明技术方案,在本实施例中,第二计算模块9022所得到的出网节点更新后的修正值称之为第二修正值,本领域技术人员可以理解地,在以后的描述中,除非有特殊说明,否则均以第二修正值来表示第二计算模块9022所得到的出网节点更新后的修正值。In order to clearly explain the technical solution, in the present embodiment, the updated value of the network node obtained by the second calculation module 9022 is referred to as a second correction value, which can be understood by those skilled in the art in the following description. Unless otherwise specified, the correction value after the update of the outlet node obtained by the second calculation module 9022 is represented by the second correction value.
第二更新模块9023配置为,按照所述PTP数据包的格式将所述第二修正值更新到所述修正域字段;The second update module 9023 is configured to update the second correction value to the correction domain field according to the format of the PTP data packet;
具体地,在得到第二修正值之后,第二更新模块9023可以按照所述PTP数据包的格式将修正域字段中的修正值更改为第二修正值,这样完成了出网节点对PTP数据包的更新,从而得到第二更新PTP数据包;Specifically, after obtaining the second correction value, the second update module 9023 may change the correction value in the correction domain field to the second correction value according to the format of the PTP data packet, thus completing the outbound network node to the PTP data packet. Update to get the second update PTP packet;
在本实施例中,结合图7所示的实施例,第二更新单元902实际上是将第一更新PTP数据包中的第一修正值更改为第二修正值,从而得到第二更新PTP数据包。In this embodiment, in conjunction with the embodiment shown in FIG. 7, the second update unit 902 actually changes the first correction value in the first update PTP data packet to the second correction value, thereby obtaining the second update PTP data. package.
示例性地,参见图10,出网节点90还可以包括第二校验单元903,配置为对所述PTP数据包进行校验,确定所述PTP数据包是否正确,当确定所述PTP数据包正确时,触发第二更新单元902对所述PTP数据包的处理;当确定所述PTP数据包不正确时,触发结束处理,例如丢弃所述PTP数据包,并等待下一个PTP数据包的到来;For example, referring to FIG. 10, the egress node 90 may further include a second check unit 903 configured to check the PTP data packet to determine whether the PTP data packet is correct, when determining the PTP data packet. When correct, triggering the processing of the PTP data packet by the second updating unit 902; when it is determined that the PTP data packet is incorrect, triggering the end processing, for example, discarding the PTP data packet, and waiting for the arrival of the next PTP data packet ;
具体地,与图8所示的实施例中第一校验单元类似,第二校验单元903可以根据所述PTP数据包所在的网络层次不同,以及封装所述PTP数据包的数据流的格式不同,可采用对应的校验技术进行校验;具体的实施方式前述实施例中已有详细描述,在此不再赘述。
Specifically, similar to the first check unit in the embodiment shown in FIG. 8, the second check unit 903 may be different according to a network layer in which the PTP data packet is located, and a format of a data stream encapsulating the PTP data packet. The verification is performed by using the corresponding verification technology. The specific implementations are described in detail in the foregoing embodiments, and details are not described herein again.
需要说明的是,结合图1所示的应用场景,当第二更新PTP数据包从出网节点输出后到达设备B时,设备B可以通过第二更新PTP数据包修正域字段中的第二修正值得到整个传输网络的驻留时间,并且可以通过该驻留时间与设备A进行时间同步,具体时间同步的实现过程为本领域技术人员的常规技术手段,在此不再赘述。It should be noted that, in combination with the application scenario shown in FIG. 1, when the second update PTP data packet is output from the outbound network node and then arrives at the device B, the device B may correct the second correction in the domain field by using the second update PTP data packet. The value of the time of the entire transmission network is obtained, and the time synchronization of the time synchronization is performed by the device A. The implementation process of the specific time synchronization is a conventional technical means of those skilled in the art, and details are not described herein again.
参见图11,为本发明实施例提供的一种入网节点70的硬件结构示意图,入网节点70可以包括至少一个通信接口1101、处理器1102、存储器1103和总线1104:该至少一个通信接口1101、处理器1102、存储器1103通过总线1104连接并完成相互间的通信。FIG. 11 is a schematic structural diagram of hardware of a network access node 70 according to an embodiment of the present invention. The network access node 70 may include at least one communication interface 1101, a processor 1102, a memory 1103, and a bus 1104: the at least one communication interface 1101 processes The memory 1102 and the memory 1103 are connected by a bus 1104 and complete communication with each other.
该总线1104可以是工业标准体系结构(ISA,Industry Standard Architecture)总线、外部设备互连(PCI,Peripheral Component)总线或扩展工业标准体系结构(EISA,Extended Industry Standard Architecture)总线等。该总线1104可以分为地址总线、数据总线、控制总线等。为便于表示,图11中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。其中:The bus 1104 may be an Industrial Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus 1104 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 11, but it does not mean that there is only one bus or one type of bus. among them:
存储器1103配置为存储可执行程序代码,该程序代码包括计算机操作指令。存储器1103可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。存储设备中存储:操作系统、应用程序,配置为实现本发明实施例的程序代码。操作系统配置为控制和实现处理单元执行的处理功能。应用程序包含程序代码,如字处理软件、email软件。The memory 1103 is configured to store executable program code, the program code including computer operating instructions. The memory 1103 may include a high speed RAM memory and may also include a non-volatile memory such as at least one disk memory. Stored in the storage device: an operating system, an application, and a program code configured to implement the embodiments of the present invention. The operating system is configured to control and implement the processing functions performed by the processing unit. The application contains program code, such as word processing software, email software.
处理器1102可能是一个中央处理器(CPU,Central Processing Unit),或者是特定集成电路(ASIC,Application Specific Integrated Circuit),或者是被配置成实施本发明实施例的一个或多个集成电路。The processor 1102 may be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
通信接口1101,配置为与外部设备进行通信;
a communication interface 1101 configured to communicate with an external device;
处理器1102,配置为记录精确时间协议PTP数据包进入所述入网节点的第一时间值;The processor 1102 is configured to record a first time value of the precise time protocol PTP data packet entering the network access node;
以及根据所述第一记录单元得到的第一时间值更新所述PTP数据包中的修正域字段的修正值,得到第一更新PTP数据包;And updating, according to the first time value obtained by the first recording unit, a correction value of the correction domain field in the PTP data packet, to obtain a first update PTP data packet;
以及通过通信接口1101将所述第一更新PTP数据包发送至网络,以使得所述网络将所述第一更新PTP数据包向出网节点发送。And transmitting, by the communication interface 1101, the first updated PTP data packet to the network, so that the network sends the first updated PTP data packet to an outgoing node.
示例性地,处理器1102还配置为,按照所述PTP数据包的格式提取PTP数据包中修正域字段的修正值;Illustratively, the processor 1102 is further configured to extract a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet;
以及将所述修正值减去所述第一时间值,得到第一修正值;And subtracting the correction value from the first time value to obtain a first correction value;
以及按照所述PTP数据包的格式将所述第一修正值更新到所述修正域字段。And updating the first correction value to the correction domain field according to a format of the PTP data packet.
示例性地,处理器1102还配置为,在所述PTP数据包从入网节点70中靠近物理层的输入接口进入时记录所述第一时间值。Illustratively, the processor 1102 is further configured to record the first time value as the PTP data packet enters from an incoming interface of the physical layer adjacent to the physical layer.
示例性地,处理器1102还配置为,对所述PTP数据包进行校验,确定所述PTP数据包是否正确。Illustratively, the processor 1102 is further configured to verify the PTP data packet to determine if the PTP data packet is correct.
参见图12,为本发明实施例提供的一种出网节点90的硬件结构示意图,出网节点90包括至少一个通信接口1201、处理器1202、存储器1203和总线1204:该至少一个通信接口1201、处理器1202、存储器1203通过总线1204连接并完成相互间的通信。FIG. 12 is a schematic diagram showing the hardware structure of an outgoing node 90 according to an embodiment of the present invention. The outgoing node 90 includes at least one communication interface 1201, a processor 1202, a memory 1203, and a bus 1204: the at least one communication interface 1201 The processor 1202 and the memory 1203 are connected by the bus 1204 and complete communication with each other.
该总线1204可以是工业标准体系结构(ISA,Industry Standard Architecture)总线、外部设备互连(PCI,Peripheral Component)总线或扩展工业标准体系结构(EISA,Extended Industry Standard Architecture)总线等。该总线1204可以分为地址总线、数据总线、控制总线等。为便于表示,图12中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。其中:
The bus 1204 may be an Industrial Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus 1204 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 12, but it does not mean that there is only one bus or one type of bus. among them:
存储器1203配置为存储可执行程序代码,该程序代码包括计算机操作指令。存储器1203可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。存储设备中存储:操作系统、应用程序,配置为实现本发明实施例的程序代码。操作系统配置为控制和实现处理单元执行的处理功能。应用程序包含程序代码,如字处理软件、email软件。The memory 1203 is configured to store executable program code, the program code including computer operating instructions. The memory 1203 may include a high speed RAM memory and may also include a non-volatile memory such as at least one disk memory. Stored in the storage device: an operating system, an application, and a program code configured to implement the embodiments of the present invention. The operating system is configured to control and implement the processing functions performed by the processing unit. The application contains program code, such as word processing software, email software.
处理器1202可能是一个中央处理器(CPU,Central Processing Unit),或者是特定集成电路(ASIC,Application Specific Integrated Circuit),或者是被配置成实施本发明实施例的一个或多个集成电路。The processor 1202 may be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
通信接口1201,配置为与外部设备进行通信;a communication interface 1201 configured to communicate with an external device;
处理器1202,配置为记录精确时间协议PTP数据包输出所述出网节点的第二时间值;所述PTP数据包是所述出网节点从网络中接收的,并且由所述网络的入网节点发送的PTP数据包;The processor 1202 is configured to record a second time value of the outbound network node by using a precise time protocol PTP data packet; the PTP data packet is received by the outbound network node from the network, and is connected to the network by the network node PTP packet sent;
以及根据所述第二时间值更新所述PTP数据包中的修正域字段的修正值,得到第二更新PTP数据包。And updating, according to the second time value, a correction value of the correction domain field in the PTP data packet to obtain a second update PTP data packet.
示例性地,处理器1202还配置为:Illustratively, processor 1202 is further configured to:
按照所述PTP数据包的格式提取PTP数据包中修正域字段的修正值;Extracting a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet;
以及将所述修正值加上所述第二时间值,得到所述第二修正值;And adding the correction value to the second time value to obtain the second correction value;
以及按照所述PTP数据包的格式将所述第二修正值更新到所述修正域字段。And updating the second correction value to the correction domain field according to a format of the PTP data packet.
示例性地,处理器1202还配置为:在所述PTP数据包从所述出网节点中靠近物理层的输出接口输出时记录所述第二时间值。Illustratively, the processor 1202 is further configured to: record the second time value when the PTP data packet is output from an output interface of the outgoing node adjacent to the physical layer.
示例性地,处理器1202还配置为:对所述PTP数据包进行校验,确定所述PTP数据包是否正确。Illustratively, the processor 1202 is further configured to verify the PTP data packet to determine if the PTP data packet is correct.
参见图13,为本发明实施例提供的一种时间同步的系统,该系统可以
包括入网节点70和出网节点90,其中,Referring to FIG. 13, a time synchronization system according to an embodiment of the present invention may be used.
Including the network access node 70 and the outgoing network node 90, wherein
入网节点70配置为记录精确时间协议PTP数据包进入所述入网节点的第一时间值;根据所述第一时间值更新所述PTP数据包中的修正域字段的修正值,得到第一更新PTP数据包;将所述第一更新PTP数据包发送至所述网络,以使得所述网络将所述第一更新PTP数据包向出网节点发送;具体的实现过程如前述实施例所述,在此不再赘述;The network access node 70 is configured to record a first time value of the precise time protocol PTP data packet entering the network access node, and update a correction value of the modified domain field in the PTP data packet according to the first time value to obtain a first update PTP. Transmitting the first update PTP data packet to the network, so that the network sends the first update PTP data packet to an outgoing network node; the specific implementation process is as described in the foregoing embodiment, This will not be repeated here;
出网节点90配置为记录所述第一更新PTP数据包输出所述出网节点的第二时间值;根据所述第二时间值更新所述第一更新PTP数据包中的修正域字段的修正值,得到第二更新PTP数据包;具体的实现过程如前述实施例所述,在此不再赘述;。The outbound node 90 is configured to record a second time value of the first update PTP data packet outputting the outbound network node, and to update a correction domain field in the first update PTP data packet according to the second time value The value is obtained, and the second update PTP data packet is obtained; the specific implementation process is as described in the foregoing embodiment, and details are not described herein again.
示例性地,入网节点70还配置为对所述PTP数据包进行校验,确定所述PTP数据包不正确时,结束当前处理。Illustratively, the ingress network node 70 is further configured to verify the PTP data packet, and when the PTP data packet is determined to be incorrect, terminate the current process.
示例性地,出网节点90还配置为对所述第一更新PTP数据包进行校验,确定所述第一更新PTP数据包不正确时,结束当前处理。Exemplarily, the outbound node 90 is further configured to check the first updated PTP data packet to determine that the first update PTP data packet is incorrect, and end the current process.
本发明实施例还记载了一种时间同步的系统,该系统仅通过传输网络的入网节点70和出网节点90对该传输网络的驻留时间进行计算,使得无需传输网络中的每个节点都来计算各自的驻留时间,减少了传输网络中的资源开销;而且也不会积累由传输网络中的每个节点计算各自驻留时间时造成的计算误差,提高了传输网络的驻留时间的计算精度;更加不需要考虑传输网络中每个节点之间传输介质的双向传输路径不对称的情况,减少了网络的工作量。The embodiment of the invention also describes a time synchronization system, which calculates the dwell time of the transmission network only through the ingress node 70 and the outbound node 90 of the transmission network, so that no node in the transmission network needs to be transmitted. To calculate the respective dwell time, reduce the resource overhead in the transmission network; and it does not accumulate the calculation error caused by calculating the respective dwell time of each node in the transmission network, and improves the dwell time of the transmission network. The calculation accuracy is not necessary to consider the asymmetry of the two-way transmission path of the transmission medium between each node in the transmission network, thereby reducing the workload of the network.
本发明实施例还记载了一种存储介质,所述存储介质中存储有计算机程序,所述计算机程序配置为执行前述各实施例的时间同步的方法。Embodiments of the present invention also describe a storage medium in which a computer program is stored, the computer program being configured to perform the method of time synchronization of the foregoing embodiments.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结
合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may employ hardware embodiments, software embodiments, or junctions.
In the form of an embodiment of the software and hardware aspects. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该
要素的过程、方法、物品或者装置中还存在另外的相同要素。It is to be understood that the term "comprises", "comprising", or any other variants thereof, is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes those elements. It also includes other elements that are not explicitly listed, or elements that are inherent to such a process, method, article, or device. In the absence of more restrictions, the elements defined by the statement "including one..." are not excluded from inclusion.
There are additional identical elements in the process, method, item or device of the element.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。The above is only the preferred embodiment of the present invention and is not intended to limit the scope of the present invention.
本发明通过传输网络的入网节点和出网节点对该传输网络的驻留时间进行计算,使得无需传输网络中的每个节点都来计算各自的驻留时间,减少了传输网络中的资源开销;而且也不会积累由传输网络中的每个节点计算各自驻留时间时造成的计算误差,提高了传输网络的驻留时间的计算精度;更加不需要考虑传输网络中每个节点之间传输介质的双向传输路径不对称的情况,减少了网络的工作量。
The invention calculates the dwell time of the transmission network by the network access node and the egress node of the transmission network, so that each node in the transmission network is not required to calculate the respective dwell time, and the resource overhead in the transmission network is reduced; Moreover, the calculation error caused by calculating the respective dwell time of each node in the transmission network is not accumulated, and the calculation precision of the residence time of the transmission network is improved; and the transmission medium between each node in the transmission network is not required to be considered. The asymmetry of the two-way transmission path reduces the workload of the network.
Claims (20)
- 一种时间同步的方法,包括:A method of time synchronization, including:入网节点记录精确时间协议PTP数据包进入所述入网节点的第一时间值;The network access node records the first time value of the precise time protocol PTP data packet entering the network access node;所述入网节点根据所述第一时间值更新所述PTP数据包中的修正域字段的修正值,得到第一更新PTP数据包;Updating, by the network access node, a correction value of the modified domain field in the PTP data packet according to the first time value, to obtain a first updated PTP data packet;所述入网节点将所述第一更新PTP数据包发送至网络,以使得所述网络将所述第一更新PTP数据包向出网节点发送。The network access node sends the first updated PTP data packet to a network, so that the network sends the first updated PTP data packet to an outgoing network node.
- 根据权利要求1所述的方法,其中,所述入网节点根据所述第一时间值更新所述PTP数据包中的修正域字段的修正值,包括:The method according to claim 1, wherein the network access node updates the correction value of the correction domain field in the PTP data packet according to the first time value, including:所述入网节点按照所述PTP数据包的格式提取PTP数据包中修正域字段的修正值;The network access node extracts a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet;所述入网节点将所述修正值减去所述第一时间值,得到第一修正值;The network access node subtracts the correction value from the first time value to obtain a first correction value;所述入网节点按照所述PTP数据包的格式将所述第一修正值更新到所述修正域字段。The network access node updates the first correction value to the correction domain field according to a format of the PTP data packet.
- 根据权利要求1所述的方法,其中,所述入网节点记录所述PTP数据包进入所述入网节点的第一时间值,包括:The method of claim 1, wherein the network access node records a first time value of the PTP data packet entering the network access node, including:所述入网节点在所述PTP数据包从所述入网节点中靠近物理层的输入接口进入时记录所述第一时间值。The network access node records the first time value when the PTP data packet enters from an input interface of the network access node that is close to the physical layer.
- 根据权利要求1至3任一项所述的方法,其中,在所述入网节点记录所述PTP数据包进入所述入网节点的第一时间值之后,且在所述入网节点根据所述第一时间值更新所述PTP数据包中的修正域字段的修正值之前,所述方法还包括:The method according to any one of claims 1 to 3, wherein after the network node records the first time value of the PTP data packet entering the network access node, and at the network access node according to the first Before the time value updates the correction value of the correction domain field in the PTP data packet, the method further includes:所述入网节点对所述PTP数据包进行校验,确定所述PTP数据包不正确时,结束当前处理。 The network access node checks the PTP data packet to determine that the PTP data packet is incorrect, and ends the current processing.
- 一种时间同步的方法,包括:A method of time synchronization, including:出网节点记录精确时间协议PTP数据包输出所述出网节点的第二时间值;所述PTP数据包由所述出网节点从网络中接收,且由所述网络中的入网节点发送;The outbound network node records the precise time protocol PTP data packet to output the second time value of the outgoing network node; the PTP data packet is received by the outgoing network node from the network, and is sent by the network access node in the network;所述出网节点根据所述第二时间值更新所述PTP数据包中的修正域字段的修正值,得到第二更新PTP数据包。And the egress node updates the correction value of the correction domain field in the PTP data packet according to the second time value to obtain a second update PTP data packet.
- 根据权利要求5所述的方法,其中,所述出网节点根据所述第二时间值更新所述PTP数据包中的修正域字段的修正值,包括:The method according to claim 5, wherein the outgoing node updates the correction value of the correction domain field in the PTP data packet according to the second time value, including:所述出网节点按照所述PTP数据包的格式提取PTP数据包中修正域字段的修正值;And the egress node extracts a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet;所述出网节点将所述修正值加上所述第二时间值,得到所述第二修正值;And the outgoing node adds the correction value to the second time value to obtain the second correction value;所述出网节点按照所述PTP数据包的格式将所述第二修正值更新到所述修正域字段。The egress node updates the second correction value to the correction domain field according to a format of the PTP data packet.
- 根据权利要求5所述的方法,其中,所述出网节点记录所述PTP数据包输出所述出网节点的第二时间值,包括:The method of claim 5, wherein the outbound node records the second time value of the PTP data packet outputting the outbound network node, including:所述出网节点在所述PTP数据包从所述出网节点中靠近物理层的输出接口输出时记录所述第二时间值。The egress node records the second time value when the PTP data packet is output from an output interface of the egress node near the physical layer.
- 根据权利要求5至7任一项所述的方法,其中,在所述出网节点记录所述PTP数据包输出所述出网节点的第二时间值之后,且在所述出网节点根据所述第二时间值更新所述PTP数据包中的修正域字段的修正值之前,所述方法还包括:The method according to any one of claims 5 to 7, wherein after the egress node records the second time value of the PTP data packet outputting the egress node, and at the egress node according to the Before the second time value updates the correction value of the correction domain field in the PTP data packet, the method further includes:所述出网节点对所述PTP数据包进行校验,确定所述PTP数据包不正确时,结束当前处理。The outgoing node checks the PTP data packet to determine that the PTP data packet is incorrect, and ends the current processing.
- 一种入网节点,包括:第一记录单元、第一更新单元和发送单元, 其中,An access node includes: a first recording unit, a first update unit, and a sending unit, among them,所述第一记录单元,配置为记录精确时间协议PTP数据包进入所述入网节点的第一时间值;The first recording unit is configured to record a first time value of the precise time protocol PTP data packet entering the network access node;所述第一更新单元,配置为根据所述第一记录单元得到的第一时间值更新所述PTP数据包中的修正域字段的修正值,得到第一更新PTP数据包;The first update unit is configured to update a correction value of the correction domain field in the PTP data packet according to the first time value obtained by the first recording unit, to obtain a first update PTP data packet;所述发送单元,配置为将所述第一更新PTP数据包发送至网络,以使得所述网络将所述第一更新PTP数据包向出网节点发送。The sending unit is configured to send the first updated PTP data packet to a network, so that the network sends the first updated PTP data packet to an outgoing node.
- 根据权利要求9所述的入网节点,其中,所述第一更新单元包括:第一提取模块、第一计算模块和第一更新模块,其中,The network access node according to claim 9, wherein the first update unit comprises: a first extraction module, a first calculation module, and a first update module, where所述第一提取模块配置为按照所述PTP数据包的格式提取PTP数据包中修正域字段的修正值;The first extraction module is configured to extract a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet;所述第一计算模块配置为将所述修正值减去所述第一时间值,得到第一修正值;The first calculating module is configured to subtract the first time value from the correction value to obtain a first correction value;所述第一更新模块配置为按照所述PTP数据包的格式将所述第一修正值更新到所述修正域字段。The first update module is configured to update the first correction value to the correction domain field in accordance with a format of the PTP data packet.
- 根据权利要求9所述的入网节点,其中,所述第一记录单元配置为,在所述PTP数据包从所述入网节点中靠近物理层的输入接口进入时记录所述第一时间值。The network access node according to claim 9, wherein the first recording unit is configured to record the first time value when the PTP data packet enters from an input interface of the network access node close to the physical layer.
- 根据权利要求9至11任一项所述的入网节点,其中,所述入网节点还包括第一校验单元,配置为对所述PTP数据包进行校验,确定所述PTP数据包不正确时,触发结束处理。The network access node according to any one of claims 9 to 11, wherein the network access node further comprises a first check unit configured to check the PTP data packet to determine that the PTP data packet is incorrect , trigger end processing.
- 一种出网节点,包括:第二记录单元和第二更新单元,其中,An outgoing node includes: a second recording unit and a second updating unit, wherein所述第二记录单元配置为,记录精确时间协议PTP数据包输出所述出网节点的第二时间值;所述PTP数据包是所述出网节点从网络中接收的,且由所述网络的入网节点发送; The second recording unit is configured to: record a precise time protocol PTP data packet to output a second time value of the outgoing network node; the PTP data packet is received by the outgoing network node from the network, and the network is received by the network The network node sends;所述第二更新单元配置为,根据所述第二时间值更新所述PTP数据包中的修正域字段的修正值,得到第二更新PTP数据包。The second update unit is configured to update the correction value of the correction domain field in the PTP data packet according to the second time value to obtain a second update PTP data packet.
- 根据权利要求13所述的出网节点,其中,所述第二更新单元包括:第二提取模块、第二计算模块和第二更新模块,其中,The network outlet node according to claim 13, wherein the second update unit comprises: a second extraction module, a second calculation module, and a second update module, where所述第二提取模块配置为按照所述PTP数据包的格式提取PTP数据包中修正域字段的修正值;The second extraction module is configured to extract a correction value of the correction domain field in the PTP data packet according to the format of the PTP data packet;所述第二计算模块配置为将所述修正值加上所述第二时间值,得到所述第二修正值;The second calculating module is configured to add the correction value to the second time value to obtain the second correction value;所述第二更新模块配置为按照所述PTP数据包的格式将所述第二修正值更新到所述修正域字段。The second update module is configured to update the second correction value to the correction domain field in accordance with a format of the PTP data packet.
- 根据权利要求13所述的出网节点,其中,所述第二记录单元还配置为,在所述PTP数据包从所述出网节点中靠近物理层的输出接口输出时记录所述第二时间值。The outgoing node according to claim 13, wherein the second recording unit is further configured to record the second time when the PTP data packet is output from an output interface of the outgoing node close to the physical layer value.
- 根据权利要求13至15任一项所述的出网节点,其中,所述出网节点还包括:第二校验单元,配置为对所述PTP数据包进行校验,确定所述PTP数据包不正确时,触发结束处理。The egress node according to any one of claims 13 to 15, wherein the egress node further comprises: a second check unit configured to check the PTP data packet to determine the PTP data packet When it is incorrect, the trigger ends processing.
- 一种时间同步的系统,包括入网节点和出网节点,其中,A time synchronization system, including an ingress node and an egress node, wherein所述入网节点配置为记录精确时间协议PTP数据包进入所述入网节点的第一时间值;根据所述第一时间值更新所述PTP数据包中的修正域字段的修正值,得到第一更新PTP数据包;将所述第一更新PTP数据包发送至所述网络,以使得所述网络将所述第一更新PTP数据包向出网节点发送;The network access node is configured to record a first time value of the precise time protocol PTP data packet entering the network access node, and update a correction value of the modified domain field in the PTP data packet according to the first time value to obtain a first update. a PTP data packet; sending the first update PTP data packet to the network, so that the network sends the first update PTP data packet to an outgoing node;所述出网节点配置为记录所述第一更新PTP数据包输出所述出网节点的第二时间值;根据所述第二时间值更新所述第一更新PTP数据包中的修正域字段的修正值,得到第二更新PTP数据包。The egress node is configured to record a second time value of the first update PTP data packet outputting the egress node, and update a correction domain field in the first update PTP data packet according to the second time value Correct the value to get the second update PTP packet.
- 根据权利要求17所述的系统,其中,所述入网节点还配置为对所 述PTP数据包进行校验,确定所述PTP数据包不正确时,结束当前处理。The system of claim 17 wherein said network access node is further configured to be When the PTP data packet is checked and it is determined that the PTP data packet is incorrect, the current processing ends.
- 根据权利要求17所述的系统,其中,所述出网节点还配置为对所述第一更新PTP数据包进行校验,确定所述第一更新PTP数据包不正确时,结束当前处理。The system of claim 17, wherein the outgoing node is further configured to verify the first updated PTP packet and determine that the first updated PTP packet is incorrect, ending the current process.
- 一种存储介质,所述存储介质中存储有计算机程序,所述计算机程序配置为执行权利要求1至4任一项或权利要求5至8任一项所述的时间同步的方法。 A storage medium having stored therein a computer program configured to perform the method of time synchronization according to any one of claims 1 to 4 or any of claims 5 to 8.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410187221.4A CN105099593B (en) | 2014-05-05 | 2014-05-05 | A kind of method, apparatus and system of time synchronized |
CN201410187221.4 | 2014-05-05 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2015169045A1 true WO2015169045A1 (en) | 2015-11-12 |
Family
ID=54392078
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2014/088008 WO2015169045A1 (en) | 2014-05-05 | 2014-09-30 | Time synchronization method, device and system, and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN105099593B (en) |
WO (1) | WO2015169045A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114980296A (en) * | 2021-02-25 | 2022-08-30 | 中国移动通信有限公司研究院 | Method, device and equipment for sending and receiving time information |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101827098A (en) * | 2010-03-31 | 2010-09-08 | 中兴通讯股份有限公司 | Processing method and device for time synchronization |
CN102469377A (en) * | 2010-11-17 | 2012-05-23 | 中兴通讯股份有限公司 | Ethernet passive optical network (EPON) system and method for realizing end-to-end transparent clock in system |
CN102546071A (en) * | 2011-12-23 | 2012-07-04 | 北京北方烽火科技有限公司 | Clock synchronization method and system |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2011025746A1 (en) * | 2009-08-25 | 2011-03-03 | Semtech Corporation | Measurement and adjustment of real-time values according to residence time in networking equipment without access to real time |
CN103067113B (en) * | 2012-12-24 | 2015-08-12 | 中兴通讯股份有限公司 | Method and the device of PTP time synchronized is realized based on aggregated links |
-
2014
- 2014-05-05 CN CN201410187221.4A patent/CN105099593B/en active Active
- 2014-09-30 WO PCT/CN2014/088008 patent/WO2015169045A1/en active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101827098A (en) * | 2010-03-31 | 2010-09-08 | 中兴通讯股份有限公司 | Processing method and device for time synchronization |
CN102469377A (en) * | 2010-11-17 | 2012-05-23 | 中兴通讯股份有限公司 | Ethernet passive optical network (EPON) system and method for realizing end-to-end transparent clock in system |
CN102546071A (en) * | 2011-12-23 | 2012-07-04 | 北京北方烽火科技有限公司 | Clock synchronization method and system |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114980296A (en) * | 2021-02-25 | 2022-08-30 | 中国移动通信有限公司研究院 | Method, device and equipment for sending and receiving time information |
Also Published As
Publication number | Publication date |
---|---|
CN105099593B (en) | 2018-03-30 |
CN105099593A (en) | 2015-11-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11223439B1 (en) | Maintaining a time of day in a physical layer circuit including compensating for drift away from a grandmaster time | |
US9960871B1 (en) | Method and apparatus for securing clock synchronization in a network | |
US9615258B2 (en) | Method and apparatus for securing timing packets over untrusted packet transport network | |
US20190089615A1 (en) | Indirect packet classification timestamping system and method | |
US20170324497A1 (en) | Transmitting residence time information in a network | |
US10148796B2 (en) | Checksum friendly timestamp update | |
WO2021232260A1 (en) | Method for time synchronization of a plurality of auxiliary devices of autonomous vehicle, vehicle, computer device, and storage medium | |
US11349587B2 (en) | Generating a timestamp | |
US20220182330A1 (en) | Method for determining sending period in deterministic network and apparatus | |
CN116112110A (en) | Techniques for compensating for errors in clock drift-induced time synchronization | |
US20180351676A1 (en) | Securing time between nodes | |
US10110688B2 (en) | System and method for remote monitoring of API performance and user behavior associated with user interface | |
KR20170105573A (en) | Time synchronization method, apparatus, system and storage medium in OTN network | |
JPWO2018087927A1 (en) | Network system and communication method | |
US8683307B2 (en) | Checksum calculation, prediction and validation | |
WO2015169045A1 (en) | Time synchronization method, device and system, and storage medium | |
US20230259157A1 (en) | Communication system, communication device, communication method, control circuit, and storage medium | |
WO2017097034A1 (en) | Time stamp processing method and apparatus for time message in optical transport network | |
EP4178127A1 (en) | Technologies to compensate for errors in time synchronization due to clock drift | |
US20190020465A1 (en) | Device, System, and Method for Determining a Forwarding Delay Through a Networking Device | |
CN110691407A (en) | Method and equipment for processing measurement message | |
US9031063B2 (en) | Direct updating of network delay in synchronization packets | |
US11627063B1 (en) | Systems and methods for measuring unidirectional latency of applications over asymmetric links | |
JP2017126864A (en) | Communication system, communication device, second device, communication method and computer program | |
CN117544266A (en) | Error compensation method for enhancing time synchronization port |
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: 14891368 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 07/04/2017) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 14891368 Country of ref document: EP Kind code of ref document: A1 |