Synchronization method and apparatus
By using PTP message exchange between PTP slave and master nodes and utilizing latency and send/receive time information for synchronization, the low synchronization performance of the IEEE 1588 protocol is solved, achieving more efficient time and frequency synchronization.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2025-06-30
- Publication Date
- 2026-05-07
AI Technical Summary
In existing technologies, when devices use the IEEE 1588 protocol for time or frequency synchronization, the synchronization performance is relatively low.
PTP slave nodes improve synchronization performance by using the first delay, the first sending time, and the first receiving time to perform time or frequency synchronization through sending and receiving PTP messages.
It eliminates the need for symmetrical delays in bidirectional message paths or stable delays in unidirectional message paths between PTP master and slave nodes, thus improving the performance of time or frequency synchronization.
Smart Images

Figure CN2025105496_07052026_PF_FP_ABST
Abstract
Description
A synchronization method and apparatus
[0001] This application claims priority to Chinese Patent Application No. 202411550014.0, filed with the State Intellectual Property Office of China on October 31, 2024, entitled "A Synchronization Method and Apparatus", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of communications, and in particular to a synchronization method and apparatus. Background Technology
[0003] The Institute of Electrical and Electronics Engineers (IEEE) 1588 protocol is a Precision Time Protocol (PTP). The IEEE 1588 protocol can be used for time synchronization and frequency synchronization, and is currently widely used in many fields. Devices can use the IEEE 1588 protocol for time synchronization. Time synchronization refers to multiple devices keeping their times consistent, while frequency synchronization refers to multiple devices keeping their frequencies consistent. In this application, "PTP" and "IEEE 1588 protocol" can be used interchangeably.
[0004] Currently, when devices use the IEEE 1588 protocol for time or frequency synchronization, there is a problem with low synchronization performance.
[0005] Therefore, a solution is urgently needed to address the above problems. Summary of the Invention
[0006] This application provides a synchronization method and apparatus that can improve the performance of synchronization using PTP.
[0007] Firstly, this application provides a synchronization method applied to a PTP slave node. The PTP slave node sends a first PTP message to a PTP master node and generates a first transmission time for the first PTP message. After sending the first PTP message to the PTP master node, the PTP slave node receives a second PTP message sent by the PTP master node. The second PTP message includes a first reception time and a first delay. The first reception time is the time when the PTP master node receives the first PTP message. The first delay can represent the transmission delay of the first PTP message on the transmission path between the PTP slave node and the PTP master node. When the transmission path includes a transparent clock (TC) node, the first delay includes the cumulative value of the forwarding delay of the TC node forwarding the first PTP message and the link delay between PTP nodes on the transmission path. When the transmission path does not include a TC node, the first delay includes the link delay between PTP nodes on the transmission path of the first PTP message. After receiving the second PTP message, the PTP slave node performs time synchronization or frequency synchronization based on the first transmission time, the first reception time, and the first delay. Using this scheme, since the first delay in the second PTP message can characterize the transmission delay of the first PTP message between the PTP slave node and the PTP master node, the PTP slave node can achieve time synchronization with the PTP master node based on the first delay, the first transmission time, and the first reception time. It is not necessary to require symmetrical delays in the bidirectional message path between the PTP master node and the PTP slave node, which improves the performance of time synchronization between the PTP slave node and the PTP master node. Similarly, when the PTP slave node performs frequency synchronization with the PTP master node based on the first delay, the first transmission time, and the first reception time, it is not necessary to require stable delays in the unidirectional message path between the PTP master node and the PTP slave node. This also improves the performance of frequency synchronization between the PTP slave node and the PTP master node.
[0008] In one possible implementation, the first PTP message includes first indication information, which indicates a correction based on the link delay of the first PTP message. After receiving the first PTP message, a PTP node on the transmission path of the first PTP message can make a correction based on the link delay of the first PTP message, based on the first indication information. This allows the PTP master node to determine the aforementioned first delay and send a second PTP message including the first delay and a first reception time to the PTP slave node, thereby improving the performance of time or frequency synchronization between the PTP slave node and the PTP master node.
[0009] In one possible implementation, the first PTP message can be a first delay request message, that is, the PTP slave node can send a first delay request message to the PTP master node and receive a second PTP message returned by the PTP master node, thereby achieving high-performance time synchronization or frequency synchronization based on the first delay request message and the second PTP message.
[0010] In one possible implementation, the first PTP message can be a first synchronization message, that is, the PTP slave node can send the first synchronization message to the PTP master node and receive the second PTP message returned by the PTP master node, thereby achieving high-performance time synchronization or frequency synchronization based on the first synchronization message and the second PTP message.
[0011] In one possible implementation, the second PTP message can be a first announcement message. That is, after receiving the first PTP message sent by the PTP slave node, the PTP master node sends a first announcement message to the PTP slave node, including a first delay and a first reception time. This enables the PTP slave node to achieve high-performance time synchronization or frequency synchronization based on the first transmission time and the first announcement message. In this scenario, the first announcement message may also include the clock quality information of the PTP master node, allowing the PTP slave node to obtain the clock quality information of the PTP master node.
[0012] In one possible implementation, the first notification message includes an origin timestamp field and a correction field. The first reception time is carried through the origin timestamp field, and the first delay is carried through the correction field. Accordingly, after receiving the first notification message, the PTP slave node can parse the origin timestamp field to obtain the first reception time and parse the correction field to obtain the first delay.
[0013] In one possible implementation, the second PTP message can be a delayed response message, that is: after the PTP master node receives the first PTP message sent by the PTP slave node, it sends a delayed response message to the PTP slave node including a first delay and a first reception time, so that the PTP slave node can achieve high-performance time synchronization or frequency synchronization based on the first transmission time and the delayed response message.
[0014] In one possible implementation, if the aforementioned second PTP message is a delayed response message, then in response to the first PTP message, the PTP master node may send a second notification message to the PTP slave node in addition to sending a delayed response message to the PTP slave node, so as to notify the PTP slave node of the clock quality information of the PTP master node, so that the PTP slave node can select a suitable PTP master node for clock synchronization or time synchronization based on the clock quality information of the PTP master node.
[0015] In one possible implementation, to reduce the number of messages exchanged between the PTP master node and the PTP slave node, when the aforementioned second PTP message is a delayed response message, the PTP master node may not send a second announcement message to the PTP slave node. Instead, it may include the PTP master node's clock quality information in the delayed response message, thereby announcing the PTP master node's clock quality information to the PTP slave node. In other words, the aforementioned delayed response message also includes the PTP master node's clock quality information, so that the PTP slave node can select a suitable PTP master node for clock synchronization or time synchronization based on the PTP master node's clock quality information.
[0016] In one possible implementation, the delay response message may include a type length value (TLV) field, which carries the aforementioned clock quality information. Accordingly, the PTP slave node can parse this TLV field to obtain the clock quality information of the PTP master node.
[0017] In one possible implementation, the PTP slave node can also notify the PTP master node of the first transmission time, so that the PTP master node can determine the synchronization performance of the PTP slave node based on the first transmission time, thereby realizing the monitoring of the synchronization performance of the PTP slave node, so as to trigger an alarm in a timely manner when the synchronization performance of the PTP slave node does not meet the requirements.
[0018] In one possible implementation, the PTP slave node can announce the first transmission time to itself by including it in the first PTP message; in other words, the first PTP message includes the first transmission time. As a specific example, if the PTP slave node is in one-step mode, the first transmission time is carried in the first PTP message. Correspondingly, the PTP master node can parse the first PTP message to obtain the first transmission time, thereby determining the synchronization performance of the PTP slave node based on this first transmission time.
[0019] In one possible implementation, the PTP slave node can announce the first transmission time in a third PTP message. In other words, the third PTP message includes the first transmission time. The third PTP message mentioned here refers to the PTP message sent by the PTP slave node to the PTP master node after sending the first PTP message. As a specific example, if the PTP slave node is in two-step mode, the first transmission time cannot be carried in the first PTP message; in this scenario, the first transmission time is carried in the third PTP message. Accordingly, the PTP master node can parse the third PTP message to obtain the first transmission time, so as to determine the synchronization performance of the PTP slave node based on this first transmission time.
[0020] In one possible implementation, if the first PTP message is a first delay request message, then the third PTP message is a second delay request message, wherein the second delay request message is the next delay request message sent by the PTP slave node to the PTP master node after sending the first delay request message. That is, the PTP slave node can carry the sending time of the current delay request message in the next delay request message and send it to the PTP master node. In this scenario, the current delay request message can carry the sending time of the previous delay request message. In other words, when the current delay request message is the first delay request message, the previous delay request message is the third delay request message, and the next delay request message is the second delay request message, the first delay request message includes the second sending time of the third delay request message, and the second delay request message includes the first sending time.
[0021] In one possible implementation, if the first PTP message is a first delay request message, then the third PTP message is a delay request follow-up message. That is, the first transmission time of the first delay request message is carried in the delay request follow-up message and sent to the PTP master node.
[0022] In one possible implementation, if the first PTP message is a first synchronization message, then the third PTP message is a second synchronization message, wherein the second synchronization message is the next synchronization message sent by the PTP slave node to the PTP master node after sending the first synchronization message. That is, the PTP slave node can carry the sending time of the current synchronization message in the next synchronization message sent to the PTP master node. In this scenario, the current synchronization message can carry the sending time of the previous synchronization message. In other words, when the current synchronization message is the first synchronization message, the previous synchronization message is the third synchronization message, and the next synchronization message is the second synchronization message, the first synchronization message includes the second sending time of the third synchronization message, and the second synchronization message includes the first sending time.
[0023] In one possible implementation, if the first PTP message is a first synchronization message, then the third PTP message is a follow-up message. That is, the first transmission time of the first synchronization message is carried in the follow-up message and sent to the PTP master node.
[0024] In one possible implementation, if the aforementioned third PTP message is a delay request follow-up message, then the first PTP message may include second indication information. This second indication information indicates whether the message carrying the first transmission time is a first delay request message or a delay request follow-up message. In other words, the second indication information indicates that the first transmission time is carried in either the delay request follow-up message or the first delay request message. Accordingly, after receiving the first PTP message, the PTP master node can parse the second indication information to determine whether it needs to further parse the first transmission time from the first delay request message or the delay request follow-up message.
[0025] In one possible implementation, if the aforementioned third PTP message is a follow-up message, the first PTP message may include second indication information. This second indication information indicates whether the message carrying the first transmission time is a first synchronization message or a follow-up message. In other words, the second indication information indicates that the first transmission time is carried in either the follow-up message or the first synchronization message. Accordingly, after receiving the first PTP message, the PTP master node can parse the second indication information to determine whether it needs to further parse the first transmission time from the first synchronization message or the follow-up message.
[0026] In one possible implementation, if the aforementioned third PTP message is a second delay request message, then in addition to carrying the first transmission time, the second delay request message may also carry third indication information. This third indication information indicates the transmission time of the preceding delay request message sent by the PTP slave node, which is carried in the second delay request message. That is, the third indication information can be used to indicate that the second delay request message carries the first transmission time. In this scenario, the first delay request message may, for example, carry fifth indication information, which indicates the transmission time of the preceding delay request message sent by the PTP slave node, which is carried in the first delay request message. That is, the fifth indication information indicates that the first delay request message carries the aforementioned second transmission time. Accordingly, after receiving the first delay request message, the PTP master node can parse the fifth indication information to determine whether it needs to further parse the second transmission time from the first delay request message. Similarly, after receiving the second delay request message, the PTP master node can parse the third indication information to determine the first transmission time that needs to be further parsed from the second delay request message.
[0027] In one possible implementation, if the aforementioned third PTP message is a second synchronization message, then in addition to carrying the first transmission time, the second synchronization message may also carry third indication information. This third indication information indicates the transmission time of the preceding synchronization message sent by the PTP slave node, meaning the second synchronization message carries the first transmission time. In this scenario, the first synchronization message may, for example, carry fifth indication information, which indicates the transmission time of the preceding synchronization message sent by the PTP slave node, meaning the first synchronization message carries the aforementioned second transmission time. Correspondingly, after receiving the first synchronization message, the PTP master node can parse the fifth indication information to determine if it needs to further parse the second transmission time from the first synchronization message. Similarly, after receiving the second synchronization message, the PTP master node can parse the third indication information to determine if it needs to further parse the first transmission time from the second synchronization message.
[0028] In one possible implementation, the aforementioned first PTP message may further include fourth indication information. This fourth indication information instructs the PTP slave node to announce a target transmission time to the PTP master node. The target transmission time is the transmission time of the target PTP message sent by the PTP slave node to the PTP master node, and the target PTP message is a PTP message of the same type as the first PTP message. As an example, when the first PTP message is a first delay request message, the target PTP message can also be a delay request message; for example, the target PTP message can be a first delay request message, or it can be a third delay request message. As another example, when the first PTP message is a first synchronization message, the target PTP message is also a synchronization message.
[0029] Secondly, this application provides a synchronization method applied to a PTP master node. The PTP master node receives a first PTP message sent by a PTP slave node and sends a second PTP message to the PTP slave node. The second PTP message includes a first reception time and a first delay. The first reception time is the time it takes for the PTP master node to receive the first PTP message, and the first delay represents the transmission delay of the first PTP message on the transmission path between the PTP slave node and the PTP master node. When the transmission path includes a TC node, the first delay includes the cumulative value of the forwarding delay of the TC node forwarding the first PTP message and the link delay between PTP nodes on the transmission path. When the transmission path does not include a TC node, the first delay includes the link delay between PTP nodes on the transmission path of the first PTP message. After receiving the second PTP message, the PTP slave node can perform time synchronization or frequency synchronization based on the first transmission time, the first reception time, and the first delay. Using this scheme, since the first delay in the second PTP message can characterize the transmission delay of the first PTP message between the PTP slave node and the PTP master node, the PTP slave node can achieve time synchronization with the PTP master node based on the first delay, the first transmission time, and the first reception time. It is not necessary to require symmetrical delays in the bidirectional message paths between the PTP master and slave nodes, which improves the performance of time synchronization between the PTP slave and master nodes. Similarly, when the PTP slave node performs frequency synchronization with the PTP master node based on the first delay, the first transmission time, and the first reception time, it is not necessary to require stable delays in the unidirectional message paths between the PTP master and slave nodes. This also improves the performance of frequency synchronization between the PTP slave and master nodes.
[0030] In one possible implementation, the first PTP message includes first indication information indicating a correction based on the link delay of the first PTP message.
[0031] In one possible implementation, before sending the second PTP message to the PTP slave node, the PTP master node can first determine the link delay of the first link, where the first link is the link from the first PTP node to the PTP master node, and the first PTP node is the node that supports PTP that is the previous hop of the PTP master node on the transmission path of the first PTP message. Further, the first delay is obtained based on the link delay of the first link. After obtaining the first delay, the second PTP message can be obtained based on the first delay and the first reception time.
[0032] In one possible implementation, the first PTP node is the PTP slave node. In this scenario, the PTP master node can directly use the link delay of the first link as the first delay.
[0033] In one possible implementation, the first PTP node is the first TC node. In this case, the first PTP message carries the second delay, which is the transmission delay of the first PTP message between the PTP slave node and the first TC node. Accordingly, the PTP master node can add the second delay and the link delay of the first link to obtain the first delay.
[0034] In one possible implementation, the first PTP message includes either a first delay request message or a first synchronization message.
[0035] In one possible implementation, the second PTP message includes: a first announcement message, or a delayed response message.
[0036] In one possible implementation, the second PTP message is the delayed response message, and the method further includes: in response to receiving the first PTP message, sending a second announcement message to the PTP slave node, the second announcement message being used to announce the clock quality of the PTP master node.
[0037] In one possible implementation, the delayed response message also includes clock quality information, which is used to indicate the clock quality of the PTP master node.
[0038] In one possible implementation, the method further includes: receiving the first transmission time announced by the PTP slave node.
[0039] In one possible implementation, the first transmission time is carried in either the first PTP message or the third PTP message, wherein the third PTP message is a PTP message sent by the PTP slave node to the PTP master node after sending the first PTP message.
[0040] In one possible implementation, the first PTP message is a first delay request message, and the third PTP message is either a delay request follow-up message or a second delay request message, wherein the second delay request message is the next delay request message sent by the PTP node to the PTP master node after sending the first delay request message. Alternatively, the first PTP message is a first synchronization message, and the third PTP message is either a follow-up message or a second synchronization message, wherein the second synchronization message is the next synchronization message sent by the PTP slave node to the PTP master node after sending the first synchronization message.
[0041] In one possible implementation, the third PTP message is a delay request follow-up message, and the first delay request message further includes second indication information, which is used to indicate that the delay request follow-up message or the first delay request message carries the first transmission time.
[0042] In one possible implementation, if the aforementioned third PTP message is a follow-up message, the first PTP message may include second indication information. This second indication information indicates whether the message carrying the first transmission time is a first synchronization message or a follow-up message. In other words, the second indication information indicates that the first transmission time is carried in either the follow-up message or the first synchronization message. Accordingly, after receiving the first PTP message, the PTP master node can parse the second indication information to determine whether it needs to further parse the first transmission time from the first synchronization message or the follow-up message.
[0043] In one possible implementation, the third PTP message is the second delay request message, and the first transmission time is carried in the second delay request message. The second delay request message also includes third indication information, which indicates the transmission time of the preceding delay request message sent by the PTP slave node in the second delay request message. In this scenario, the first delay request message includes fifth indication information, which indicates the transmission time of the preceding delay request message sent by the PTP slave node in the first delay request message, i.e., the fifth indication information indicates the second transmission time mentioned above is carried in the first delay request message. Accordingly, after receiving the first delay request message, the PTP master node can parse the fifth indication information to determine that it needs to further parse the second transmission time from the first delay request message. Similarly, after receiving the second delay request message, the PTP master node can parse the third indication information to determine that it needs to further parse the first transmission time from the second delay request message.
[0044] In one possible implementation, if the aforementioned third PTP message is a second synchronization message, then in addition to carrying the first transmission time, the second synchronization message may also carry third indication information. This third indication information indicates the transmission time of the preceding synchronization message sent by the PTP slave node, meaning the second synchronization message carries the first transmission time. In this scenario, the first synchronization message may, for example, carry fifth indication information, which indicates the transmission time of the preceding synchronization message sent by the PTP slave node, meaning the first synchronization message carries the aforementioned second transmission time. Correspondingly, after receiving the first synchronization message, the PTP master node can parse the fifth indication information to determine if it needs to further parse the second transmission time from the first synchronization message. Similarly, after receiving the second synchronization message, the PTP master node can parse the third indication information to determine if it needs to further parse the first transmission time from the second synchronization message.
[0045] In one possible implementation, the first PTP message further includes fourth indication information, which instructs the PTP slave node to notify the PTP master node of the transmission time of the target PTP message sent by the PTP slave node, wherein the target PTP message is a PTP message of the same type as the first PTP message.
[0046] In one possible implementation, if the first PTP message is a first delay request message, the third PTP message is a second delay request message, and the first delay request message includes fourth indication information, then the second delay request message also includes the fourth indication information.
[0047] As a concrete example, after receiving the first delay request message, the PTP master node first parses it to obtain the fourth indication information, determining that the PTP slave node will announce the transmission time of the delay request message to the PTP master node. Further, the PTP master node parses the first delay request message to obtain the second indication information, determining whether it needs to further parse the transmission time of the current delay request message (i.e., the first transmission time of the first delay request message) from the first delay request message or the delay request follow-up message. Further, the PTP master node parses the first transmission time from either the first delay request message or the delay request follow-up message, and determines the synchronization performance of the PTP slave node based on the first transmission time.
[0048] As another specific example, after receiving the first delay request message, the PTP master node first parses it to obtain the fourth indication information, determining that the PTP slave node will notify the PTP master node of the transmission time of the delay request message. Further, the PTP master node parses the first PTP message to obtain the fifth indication information, determining that the first delay request message includes the transmission time of the previous delay request message (i.e., the second transmission time of the third delay request message). Further, the PTP master node parses this second transmission time and determines the synchronization performance of the PTP slave node based on the second transmission time.
[0049] As another concrete example, after receiving the second delay request message, the PTP master node first parses it to obtain the fourth indication information, determining that the PTP slave node will notify the PTP master node of the transmission time of the delay request message. Further, the PTP master node parses the second delay request message to obtain the third indication information, determining that the second delay request message includes the transmission time of the previous delay request message (i.e., the first transmission time of the first delay request message). Further, the PTP master node parses this first transmission time and determines the synchronization performance of the PTP slave node based on the first transmission time.
[0050] As a specific example, after receiving the first synchronization message, the PTP master node first parses it to obtain the fourth indication information, determining that the PTP slave node will announce the transmission time of the synchronization message to the PTP master node. Further, the PTP master node parses the first synchronization message to obtain the second indication information, determining whether it needs to further parse the transmission time of the current synchronization message (i.e., the first transmission time of the first synchronization message) from the first synchronization message or the following message. Further, the PTP master node parses the first transmission time from either the first synchronization message or the following message and determines the synchronization performance of the PTP slave node based on the first transmission time.
[0051] As another specific example, after receiving the first synchronization message, the PTP master node first parses it to obtain the fourth indication information, determining that the PTP slave node will announce the transmission time of the synchronization message to the PTP master node. Further, the PTP master node parses the first PTP message to obtain the fifth indication information, determining that the first synchronization message includes the transmission time of the previous synchronization message (i.e., the second transmission time of the third synchronization message). Further, the PTP master node parses this second transmission time and determines the synchronization performance of the PTP slave node based on the second transmission time.
[0052] As another concrete example, after receiving the second synchronization message, the PTP master node first parses it to obtain the fourth indication information, determining that the PTP slave node will announce the transmission time of the synchronization message to the PTP master node. Further, the PTP master node parses the second synchronization message to obtain the third indication information, determining that the second synchronization message includes the transmission time of the previous synchronization message (i.e., the first transmission time of the first synchronization message). Further, the PTP master node parses this first transmission time and determines the synchronization performance of the PTP slave node based on the first transmission time.
[0053] In one possible implementation, the synchronization performance of the aforementioned PTP slave node includes time synchronization performance and / or frequency synchronization performance. In other words, the PTP master node can determine the time synchronization performance and / or frequency synchronization performance of the PTP slave node based on the first transmission time.
[0054] In one possible implementation, the PTP master node can determine the time synchronization performance and / or frequency synchronization performance of the PTP slave node based on a first transmission time, a first reception time, and a first delay. For example, the PTP master node can subtract the first transmission time and the first delay from the first reception time to obtain the time deviation between the PTP slave node and the PTP master node, thereby obtaining the time synchronization performance of the PTP slave node. Alternatively, the PTP master node can use the first transmission time, the first reception time, the first delay, a second transmission time, a second reception time, and the transmission delay of the third delay request message between the PTP slave node and the PTP master node to obtain the frequency deviation between the PTP master node and the PTP slave node, thereby obtaining the frequency synchronization performance of the PTP slave node. Here, the second reception time is the time when the PTP master node receives the third delay request message.
[0055] Thirdly, this application provides a synchronization method applied to a first TC node. The first TC node receives a first PTP message sent by a PTP slave node to a PTP master node. The first PTP message includes a first field, which carries a third delay. Further, the first TC node sends an updated first PTP message to the PTP master node. The first field of the updated first PTP message carries a second delay, which is obtained by adding the forwarding delay of the first TC node when forwarding the first PTP message, the link delay of the second link, and the third delay. The second link is the link from the second PTP node to the first TC node, and the second PTP node is the node that supports PTP that is the previous hop on the transmission path of the first PTP message. Using this scheme, the first TC node can correct the value of the first field based on the forwarding delay of the first PTP packet and the link delay of the second link, thereby enabling the PTP master node to receive the first PTP packet including the second delay. Correspondingly, the PTP master node can further obtain the first delay based on the second delay and further send the aforementioned second PTP packet including the first reception time and the first delay to the PTP slave node. Since the first delay in the second PTP packet can characterize the transmission delay of the first PTP packet between the PTP slave node and the PTP master node, the PTP slave node can achieve time synchronization with the PTP master node based on the first delay, the first transmission time, and the first reception time, without requiring symmetrical delays in the bidirectional packet paths between the PTP master node and the PTP slave node. Consequently, this improves the performance of time synchronization between the PTP slave node and the PTP master node. Similarly, when a PTP slave node performs frequency synchronization with a PTP master node based on a first delay, a first transmission time, and a first reception time, it is not necessary to require the delay of the one-way message path between the PTP master node and the PTP slave node to be stable. Accordingly, this is beneficial to improving the performance of frequency synchronization between the PTP slave node and the PTP master node.
[0056] In one possible implementation, if the second PTP node is the PTP slave node, then the third delay is 0, or the third delay includes partial information of the first transmission time. If the second PTP node is the second TC node, the third delay is the transmission delay of the first PTP message between the PTP slave node and the second TC node.
[0057] In one possible implementation, the first PTP message includes first indication information indicating a correction based on the link delay of the first PTP message.
[0058] In one possible implementation, the first PTP message includes either a first delay request message or a first synchronization message.
[0059] In one possible implementation, the first TC node can also receive a second PTP message sent by the PTP master node. The second PTP message includes a first reception time and a first delay. The first reception time is the time it takes for the PTP master node to receive the first PTP message. The first delay includes the cumulative value of the forwarding delay of the PTP node forwarding the first PTP message and the link delay between PTP nodes on the transmission path of the first PTP message; or, the first delay includes the link delay between PTP nodes on the transmission path of the first PTP message; the transmission path is the path from the PTP slave node to the PTP master node. After receiving the second PTP message, the first TC node does not modify the first delay and the first reception time, but forwards the second PTP message to the PTP slave node so that the PTP slave node can obtain the first reception time and the first delay, and further perform time synchronization or frequency synchronization based on the first transmission time, the first reception time, and the first delay.
[0060] In one possible implementation, the second PTP message includes: a first announcement message, or a delayed response message.
[0061] In one possible implementation, the delayed response message also includes clock quality information, which is used to indicate the clock quality of the PTP master node.
[0062] Fourthly, this application provides a synchronization device applied to a PTP slave node, used to perform the steps of the first aspect above and any one of the first aspects performed by the PTP slave node. The device includes: a sending unit, a receiving unit, and a processing unit. The sending unit is used to send a first PTP message to a PTP master node and generate a first sending time for the first PTP message. The receiving unit is used to receive a second PTP message sent by the PTP master node, the second PTP message including a first receiving time and a first delay. The first receiving time is the time when the PTP master node receives the first PTP message, and the first delay includes: the cumulative value of the forwarding delay of the PTP node forwarding the first PTP message and the link delay between PTP nodes on the transmission path of the first PTP message; or, the first delay includes: the link delay between PTP nodes on the transmission path of the first PTP message; the transmission path is the path from the PTP slave node to the PTP master node. The processing unit is used to perform time synchronization or frequency synchronization based on the first sending time, the first receiving time, and the first delay.
[0063] In one possible implementation, the first PTP message includes first indication information indicating a correction based on the link delay of the first PTP message.
[0064] In one possible implementation, the first PTP message includes either a first delay request message or a first synchronization message.
[0065] In one possible implementation, the second PTP message includes: a first announcement message, or a delayed response message.
[0066] In one possible implementation, the first notification message includes an originTimestamp field and a correctionField field, wherein the first reception time is carried through the originTimestamp field and the first delay is carried through the correctionField field.
[0067] In one possible implementation, the delayed response message also includes clock quality information, which is used to indicate the clock quality of the PTP master node.
[0068] In one possible implementation, the sending unit is further configured to: notify the PTP master node of the first sending time.
[0069] In one possible implementation, the first transmission time is carried in either the first PTP message or the third PTP message, wherein the third PTP message is a PTP message sent by the PTP slave node to the PTP master node after sending the first PTP message.
[0070] In one possible implementation, the first PTP message is a first delay request message, and the third PTP message is either a delay request follow-up message or a second delay request message, wherein the second delay request message is the next delay request message sent by the PTP slave node to the PTP master node after sending the first delay request message; or, the first PTP message is a first synchronization message, and the third PTP message is either a follow-up message or a second synchronization message, wherein the second synchronization message is the next synchronization message sent by the PTP slave node to the PTP master node after sending the first synchronization message.
[0071] In one possible implementation, the first PTP message further includes second indication information, or the third PTP message further includes third indication information, wherein: the first PTP message is a first delay request message, the third PTP message is a delay request follow-up message, and the second indication information is used to indicate that the delay request follow-up message or the first delay request message carries the first transmission time; or, the first PTP message is a first synchronization message, the third PTP message is a follow-up message, and the second indication information is used to indicate that the follow-up message or the first synchronization message carries the first transmission time. Time; or, the third PTP message is the second delay request message, and the first sending time is carried in the second delay request message, the third indication information is used to indicate the sending time of the previous delay request message sent by the PTP slave node in the second delay request message; or, the third PTP message is the second synchronization message, and the first sending time is carried in the second synchronization message, the third indication information is used to indicate the sending time of the previous synchronization message sent by the PTP slave node in the second synchronization message.
[0072] In one possible implementation, the first PTP message further includes fourth indication information, which instructs the PTP slave node to notify the PTP master node of the transmission time of the target PTP message sent by the PTP slave node, wherein the target PTP message is a PTP message of the same type as the first PTP message.
[0073] Fifthly, this application provides a synchronization device applied to a PTP master node, used to perform the steps of the second aspect above and any one of the steps of the second aspect above performed by the PTP master node. The device includes a receiving unit and a sending unit. The receiving unit is used to receive a first PTP message sent by a PTP slave node. The sending unit is used to send a second PTP message to the PTP slave node, the second PTP message including a first reception time and a first delay. The first reception time is the time it takes for the PTP master node to receive the first PTP message, and the first delay includes: the cumulative value of the forwarding delay of the PTP node forwarding the first PTP message and the link delay between PTP nodes on the transmission path of the first PTP message; or, the first delay includes: the link delay between PTP nodes on the transmission path of the first PTP message; the transmission path is the path from the PTP slave node to the PTP master node.
[0074] In one possible implementation, the first PTP message includes first indication information indicating a correction based on the link delay of the first PTP message.
[0075] In one possible implementation, the apparatus further includes a processing unit configured to: determine the link delay of a first link before sending the second PTP message to the PTP slave node, wherein the first link is a link from the first PTP node to the PTP master node, and the first PTP node is the node that supports PTP that is the previous hop of the PTP master node on the transmission path of the first PTP message; obtain the first delay based on the link delay of the first link; and obtain the second PTP message based on the first delay and a first reception time.
[0076] In one possible implementation, the first PTP node is the PTP slave node, and obtaining the first delay based on the link delay of the first link includes: using the link delay of the first link as the first delay.
[0077] In one possible implementation, the first PTP node is a first TC node, and obtaining the first delay based on the link delay of the first link includes: accumulating the second delay and the link delay of the first link to obtain the first delay, wherein the first PTP message carries the second delay, and the second delay is the transmission delay of the first PTP message between the PTP slave node and the first TC node.
[0078] In one possible implementation, the first PTP message includes either a first delay request message or a first synchronization message.
[0079] In one possible implementation, the second PTP message includes: a first announcement message, or a delayed response message.
[0080] In one possible implementation, the second PTP message is the delayed response message, and the sending unit is further configured to: in response to receiving the first PTP message, send a second notification message to the PTP slave node, the second notification message being used to notify the clock quality of the PTP master node.
[0081] In one possible implementation, the delayed response message also includes clock quality information, which is used to indicate the clock quality of the PTP master node.
[0082] In one possible implementation, the receiving unit is further configured to: receive the first transmission time announced by the PTP slave node.
[0083] In one possible implementation, the first transmission time is carried in either the first PTP message or the third PTP message, wherein the third PTP message is a PTP message sent by the PTP slave node to the PTP master node after sending the first PTP message.
[0084] In one possible implementation, the first PTP message is a first delay request message, and the third PTP message is either a delay request follow-up message or a second delay request message, wherein the second delay request message is the next delay request message sent by the PTP slave node to the PTP master node after sending the first delay request message; or, the first PTP message is a first synchronization message, and the third PTP message is either a follow-up message or a second synchronization message, wherein the second synchronization message is the next synchronization message sent by the PTP slave node to the PTP master node after sending the first synchronization message.
[0085] In one possible implementation, the first PTP message further includes second indication information, or the third PTP message further includes third indication information, wherein: the first PTP message is a first delay request message, the third PTP message is a delay request follow-up message, and the second indication information is used to indicate that the delay request follow-up message or the first delay request message carries the first transmission time; or, the first PTP message is a first synchronization message, the third PTP message is a follow-up message, and the second indication information is used to indicate that the follow-up message or the first synchronization message carries the first transmission time. Time; or, the third PTP message is the second delay request message, and the first sending time is carried in the second delay request message, the third indication information is used to indicate the sending time of the previous delay request message sent by the PTP slave node in the second delay request message; or, the third PTP message is the second synchronization message, and the first sending time is carried in the second synchronization message, the third indication information is used to indicate the sending time of the previous synchronization message sent by the PTP slave node in the second synchronization message.
[0086] In one possible implementation, the first PTP message further includes fourth indication information, which instructs the PTP slave node to notify the PTP master node of the transmission time of the target PTP message sent by the PTP slave node, wherein the target PTP message is a PTP message of the same type as the first PTP message.
[0087] In one possible implementation, the processing unit of the apparatus is further configured to: determine the synchronization performance of the PTP slave node based on the first transmission time, the synchronization performance including time synchronization performance and / or frequency synchronization performance.
[0088] In one possible implementation, the processing unit is specifically configured to: determine the synchronization performance of the PTP slave node based on the first transmission time, the first reception time, and the first delay.
[0089] Sixthly, this application provides a synchronization device applied to a first TC node, used to perform the steps of the third aspect above and any one of the third aspects performed by the first TC node. The device includes a receiving unit and a sending unit. The receiving unit is used to receive a first PTP message sent by a PTP slave node, the first PTP message including a first field carrying a third delay. The sending unit is used to send an updated first PTP message, the first field of the updated first PTP message carrying a second delay, the second delay being obtained by adding the forwarding delay of the first TC node forwarding the first PTP message, the link delay of the second link, and the third delay, wherein the second link is the link delay from the second PTP node to the first TC node, and the second PTP node is the node that supports PTP on the previous hop of the first TC node in the transmission path of the first PTP message.
[0090] In one possible implementation, the second PTP node is the PTP slave node, the third delay is 0, or the third delay includes part of the information of the first transmission time; or, the second PTP node is the second TC node, and the third delay is the transmission delay of the first PTP message between the PTP slave node and the second TC node.
[0091] In one possible implementation, the first PTP message includes first indication information indicating a correction based on the link delay of the first PTP message.
[0092] In one possible implementation, the first PTP message includes either a first delay request message or a first synchronization message.
[0093] In one possible implementation, the receiving unit is further configured to: receive a second PTP message sent by a PTP master node, the second PTP message including a first receiving time and a first delay, the first receiving time being the time when the PTP master node receives the first PTP message, the first delay including: the cumulative value of the forwarding delay of the PTP node forwarding the first PTP message and the link delay between PTP nodes on the transmission path of the first PTP message; or, the first delay including: the link delay between PTP nodes on the transmission path of the first PTP message; the transmission path being the path from the PTP slave node to the PTP master node; the sending unit is further configured to send the second PTP message to the PTP slave node.
[0094] In one possible implementation, the second PTP message includes: a first announcement message, or a delayed response message.
[0095] In one possible implementation, the delayed response message also includes clock quality information, which is used to indicate the clock quality of the PTP master node.
[0096] In a seventh aspect, this application provides an apparatus comprising: a processor and a memory; the memory being used to store instructions or a computer program; the processor being used to execute the instructions or the computer program to perform the method described in the first aspect above and any one of the first aspects above; or, the processor being used to execute the instructions or the computer program to perform the method described in the second aspect above and any one of the second aspects above; or, the processor being used to execute the instructions or the computer program to perform the method described in the third aspect above and any one of the third aspects above.
[0097] Eighthly, this application provides a computer-readable storage medium including instructions or a computer program that, when run on a computer, causes the computer to perform the methods described in the first aspect and any one of the first aspects above, or, when run on a computer, causes the computer to perform the methods described in the second aspect and any one of the second aspects above, or, when run on a computer, causes the computer to perform the methods described in the third aspect and any one of the third aspects above.
[0098] Ninthly, this application provides a computer program product comprising instructions or a computer program, which, when run on a computer, causes the computer to perform the methods described in the first aspect and any one of the first aspects above, or, when run on a computer, causes the computer to perform the methods described in the second aspect and any one of the second aspects above, or, when run on a computer, causes the computer to perform the methods described in the third aspect and any one of the third aspects above.
[0099] In a tenth aspect, this application provides a communication system comprising one or more of the following: a PTP slave node performing the method described in the first aspect and any one of the first aspects above; a PTP master node performing the method described in the second aspect and any one of the second aspects above; and a first TC node performing the method described in the third aspect and any one of the third aspects above. Attached Figure Description
[0100] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0101] Figure 1a shows a schematic diagram of a network;
[0102] Figure 1b shows another network schematic diagram;
[0103] Figure 1c shows a schematic diagram of PTP message interaction between a PTP master node and a PTP slave node;
[0104] Figure 1d shows yet another network diagram;
[0105] Figure 1e illustrates another type of PTP message interaction between a PTP master node and a PTP slave node.
[0106] Figure 1f shows a schematic diagram of a data center network topology;
[0107] Figure 1g shows a schematic diagram of another data center network topology;
[0108] Figure 1h shows another schematic diagram of PTP message interaction between a PTP master node and a PTP slave node.
[0109] Figure 2 is a schematic diagram of signaling interaction of a synchronization method provided in an embodiment of this application;
[0110] Figure 3 is a flowchart illustrating a synchronization method provided in an embodiment of this application;
[0111] Figure 4 is a schematic diagram of signaling interaction of a synchronization method provided in an embodiment of this application;
[0112] Figure 5a is a schematic diagram of signaling interaction of a synchronization method provided in an embodiment of this application;
[0113] Figure 5b is a schematic diagram of signaling interaction of a synchronization method provided in an embodiment of this application;
[0114] Figure 5c is a schematic diagram of signaling interaction for another synchronization method provided in an embodiment of this application;
[0115] Figure 5d is a schematic diagram of signaling interaction for another synchronization method provided in an embodiment of this application;
[0116] Figure 5e is a schematic diagram of signaling interaction of a synchronization method provided in an embodiment of this application;
[0117] Figure 5f is a schematic diagram of signaling interaction of a synchronization method provided in an embodiment of this application;
[0118] Figure 5g is a schematic diagram of signaling interaction for another synchronization method provided in an embodiment of this application;
[0119] Figure 5h is a schematic diagram of signaling interaction for another synchronization method provided in an embodiment of this application;
[0120] Figure 6 is a schematic diagram of a synchronization device provided in an embodiment of this application;
[0121] Figure 7 is a schematic diagram of another synchronization device provided in an embodiment of this application;
[0122] Figure 8 is a schematic diagram of the structure of a device provided in an embodiment of this application. Detailed Implementation
[0123] This application provides a time synchronization method and apparatus that can improve the synchronization performance of PTP slave nodes and PTP master nodes.
[0124] To make it easier to understand, let's first introduce the relevant content of PTP.
[0125] Before introducing PTP-related content, it should be noted that the PTP master node mentioned in this application can be referred to as a time transmitter in some scenarios, and the PTP slave node mentioned in this application can be referred to as a time receiver in some scenarios.
[0126] See Figure 1a, which illustrates an exemplary application scenario.
[0127] As shown in Figure 1a, the PTP master node and PTP slave node include networks that do not support PTP. When the PTP master node and PTP slave node synchronize (e.g., time synchronization or frequency synchronization), the node in the PTP-unsupported network can forward the PTP message as a service message when it receives the PTP message.
[0128] See Figure 1b, which illustrates another exemplary application scenario.
[0129] As shown in Figure 1b, the PTP master node and PTP slave node are connected by two networks that do not support PTP. These two networks are connected through a boundary clock (BC) node. In the scenario shown in Figure 1b, the PTP master node and the BC node synchronize, and then the PTP slave node and the BC node synchronize. The role of the BC node differs in different synchronization scenarios. In the scenario where the PTP master node and the BC node synchronize, the BC node acts as a PTP slave node. In the scenario where the PTP slave node and the BC node synchronize, the BC node acts as a PTP master node.
[0130] Next, referring to Figure 1c, the PTP message interaction mechanism between the PTP master node and the PTP slave node will be explained. Figure 1c shows a schematic diagram of PTP message interaction between the PTP master node and the PTP slave node. As shown in Figure 1c, the PTP message interaction process between the PTP master node and the PTP slave node is as follows:
[0131] 1) A PTP slave node sends a signaling message to the PTP master node. This signaling message is a request message. The destination IP address of the request message is the IP address of the PTP master node, and the source IP address is the IP address of the PTP slave node itself. This signaling (request) message can simultaneously carry request messages for Announce, Sync, and Delay_Resp messages mentioned below. Alternatively, the signaling (request) message can carry only a request message for one of these three messages. In this case, three separate signaling (request) messages can be used to carry the request messages for Announce, Sync, and Delay_Resp messages respectively.
[0132] 2) After agreeing to the negotiation request, the PTP master node replies with a signaling message to the PTP slave node. This signaling message is a grant message, with the source IP address being the PTP master node's own IP address and the destination IP address being the PTP slave node's IP address. Additionally, the PTP master node can also send an announcement message to the PTP slave node to announce its own clock quality. This signaling (grant) message can carry grant notifications for Announce, Sync, and Delay_Resp messages simultaneously. Alternatively, it can carry only the grant notification for one of these three messages; in this case, three separate signaling (grant) messages can be used to carry the grant notifications for Announce, Sync, and Delay_Resp messages respectively.
[0133] 3) The PTP master node periodically sends synchronization messages and follow-up messages to the PTP slave nodes.
[0134] If the PTP master node is in one-step mode, it sends a synchronization message to the PTP slave node, and the synchronization message carries the sending time t1. If the PTP master node is in two-step mode, it sends a synchronization message to the PTP slave node, but the synchronization message does not carry the sending time t1. After sending the synchronization message, the PTP master node continues to send a follow-up message to the PTP slave node, and the follow-up message carries the sending time t1 of the synchronization message. After receiving the synchronization message, the PTP slave node records the reception time t2.
[0135] 4) The PTP slave node periodically sends delay request messages to the PTP master node and records the sending time t3 of the delay request message.
[0136] 5) After receiving the delay request message, the PTP master node records the time t4 when it receives the delay request and sends a delay response (Delay_Resp) message to the PTP slave node. The delay response message carries the aforementioned t4.
[0137] After steps 1) to 5) above are completed, the PTP slave node can receive the four times t1, t2, t3 and t4.
[0138] In a frequency synchronization scenario, the PTP slave node can calculate the frequency error with the PTP master node according to the following formula (1), and further adjust its own frequency based on the frequency error to achieve frequency synchronization with the PTP master node. Here, the frequency error can also be referred to as frequency offset.
[0139] In the public notice (1):
[0140] ΔFre_offset is the frequency offset between the PTP slave node and the PTP master node.
[0141] t1(1) and t2(1) are the sending and receiving times of the first synchronization message.
[0142] t1(2) and t2(2) are the sending and receiving times of the second synchronization message.
[0143] The first and second synchronization messages mentioned here are two adjacent synchronization messages sent by the PTP master node to the PTP slave node. The first synchronization message is the synchronization message preceding the second synchronization message. The first synchronization message does not strictly represent the "first" synchronization message.
[0144] If ΔFre_offset is 0, it indicates that the frequencies between the PTP master node and the PTP slave node are synchronized. If ΔFre_offset is not 0, the PTP slave node adjusts its frequency according to the ΔFre_offset calculated by Formula 1. This process continues; each time a PTP slave node receives a Sync message, it uses Formula 1 combined with the previous Sync message it received to obtain the real-time ΔFre_offset, thereby adjusting the PTP slave node's frequency in real time to meet the high-precision frequency synchronization requirements.
[0145] Similarly, the frequency offset between the PTP slave node and the PTP master node can also be calculated using t3 and t4. See formula (2) below for details.
[0146] In the public notice (2):
[0147] ΔFre_offset is the frequency offset between the PTP slave node and the PTP master node.
[0148] t3(1) and t4(1) are the sending and receiving times of the first delay request message.
[0149] t3(2) and t4(2) are the sending and receiving times of the second delay request message.
[0150] The first and second delay request messages mentioned here are two adjacent delay request messages sent by the PTP slave node to the PTP master node. The first delay request message is the delay request message preceding the second delay request message. The first delay request message does not strictly represent the "first" delay request message.
[0151] According to formulas (1) and (2), the latency jitter of the one-way message path between the PTP master node and the PTP slave node will affect the frequency synchronization performance between the PTP slave node and the PTP master node. In the scenario of frequency synchronization based on formula (1), the one-way message path is the transmission path of the Sync message. The latency jitter of the Sync message passing through the intermediate network will affect the frequency synchronization accuracy. For example, the latency of the first Sync message passing through the intermediate network is 1 millisecond, and the latency of the second Sync message passing through the intermediate network is 0.9 milliseconds. Therefore, if the latency jitter of the Sync message transmitted by the intermediate network is too large, it may cause the ΔFre_offset calculated by the PTP slave node to be inaccurate, and correspondingly, the frequency synchronization performance between the PTP slave node and the PTP master node will not meet the requirements. The frequency synchronization performance mentioned here may be, for example, the frequency synchronization accuracy. In the scenario of frequency synchronization based on formula (2), the one-way message path is the path of the delay request message, that is, the latency jitter of the delay request message passing through the intermediate network will also affect the frequency synchronization accuracy.
[0152] In practical applications, one formula can be selected from formula 1 and formula 2 for frequency synchronization, or formula (1) and formula (2) can be combined for frequency synchronization.
[0153] In time synchronization scenarios, PTP slave nodes can use the four time differences t1, t2, t3, and t4 to calculate the time deviation between themselves and the PTP master node. Specifically, this time deviation Δtime_offset can be calculated using formula (3).
[0154] Formula (3) is applicable only if the delay of the bidirectional message path between the PTP master node and the PTP slave node is symmetrical. Symmetrical delay in the bidirectional message path can be understood as the delay of the intermediate network transmitting synchronization messages being symmetrical with the delay of transmitting delay request messages. This symmetry can be understood as the delay of the intermediate network transmitting the synchronization messages being almost the same (or with a small difference) as the delay of the intermediate network transmitting the delay request messages. If the delay of the intermediate network transmitting synchronization messages is asymmetrical with the delay of the delay request messages, the aforementioned time deviation will be inaccurate, and consequently, the time synchronization performance between the PTP slave node and the PTP master node will not meet the requirements. The time synchronization performance mentioned here can be, for example, time synchronization accuracy. There are two ways to ensure the symmetry of the delay in the bidirectional message path: one is to ensure that the optical fibers in the bidirectional message path are of equal length, and the other is to ensure that the bidirectional message path passes through the same nodes.
[0155] In practical applications, to ensure real-time time or frequency synchronization between PTP master nodes and PTP slave nodes, they need to periodically transmit PTP messages according to the aforementioned PTP message exchange mechanism. In one example, although not shown in Figures 1a and 1b, the message path for exchanging PTP messages between the PTP master and slave nodes may include a TC node, where a TC node refers to a node with TC functionality deployed. For example, as shown in Figure 1d, node NE2 is a node supporting TC functionality; that is, node NE2 is a TC node. In this case, the TC node can add its own forwarding delay to the PTP message, thus compensating for the forwarding delay and improving the accuracy of time or frequency synchronization. Figure 1e illustrates another type of PTP message exchange between a PTP master node and a PTP slave node.
[0156] As shown in Figure 1e, the PTP message exchange process between the PTP master node and the PTP slave node is as follows:
[0157] 1) The PTP slave node sends a signaling (request) message to the PTP master node.
[0158] 2) After receiving the signaling(request) message, the PTP master node sends a signaling(grant) message to the PTP slave node.
[0159] 3) The PTP master node sends an Announce message to the PTP slave node.
[0160] 4) The PTP master node sends a Sync message and records the sending time t1 of the Sync message. If the PTP master node is in one-step mode, the Sync message carries t1; if the PTP master node is in two-step mode, the PTP master node will send a Follow_Up message and carry t1 in the Follow_Up message.
[0161] 5) After receiving the Sync message, the TC node will forward the Sync message to the next device (TC node or PTP slave node) according to the IP address. At the same time, it will record the forwarding delay X of the Sync message. If the TC node is in one-step mode, it will add the forwarding delay to the correctionField field of the Sync message (denoted as CF1) before sending the Sync message. If the TC node is in two-step mode, it will add the forwarding delay to the correctionField field of the Follow_Up message (denoted as CF1).
[0162] 6) After receiving the Sync message, the PTP slave node will record the reception time t2 of the Sync message.
[0163] 7) The PTP slave node sends a Delay_Req message and records the sending time t3 of the Delay_Req message.
[0164] 8) After receiving the Delay_Req message, the TC node will forward the Delay_Req message to the next device (TC node or PTP master node) according to the IP address. At the same time, it will record the forwarding delay Y of the Delay_Req message. If the TC node is in one-step mode, it will add the forwarding delay to the correctionField field (denoted as CF2) of the Delay_Req message before sending it. If the TC node is in two-step mode, it will save the forwarding delay Y of the Delay_Req message locally.
[0165] 9) The PTP master node receives the Delay_Req message and records the reception time t4.
[0166] 10) The PTP master node sends a Delay_Resp message to the PTP slave node, carrying t4.
[0167] 11) When the TC node receives the Delay_Resp message, if the TC node is a two-step node, the TC node will add the forwarding delay Y of the Delay_Req message to the correctionField field (denoted as CF2) of the Delay_Resp message.
[0168] In time synchronization scenarios:
[0169] After receiving t1, t2, t3, t4, CF1, and CF2, the PTP slave node can calculate the link delay between the PTP master node and the PTP slave node: Mean_path_delay=[(t2–t1–CF1)+(t4–t3–CF2)] / 2.
[0170] Furthermore, PTP slave nodes can also calculate the time offset (Time_offset) between themselves and the PTP master node, and adjust their local time based on the calculated Time_offset. Specifically:
[0171] Time_offset=T2–T1–CF1–Mean_path_delay.
[0172] In frequency synchronization scenarios, PTP slave nodes can also calculate their frequency offset from the PTP master node based on the following formula (4) or formula (5).
[0173] Formula (4) introduces CF1 (1) and CF1 (2) based on Formula (1), where CF1 (1) is the CF1 corresponding to the first synchronization message and CF1 (2) is the CF1 corresponding to the second synchronization message.
[0174] Formula (5) introduces CF2(1) and CF2(2) based on Formula (2), where CF2(1) is the CF2 corresponding to the first delay request message and CF2(2) is the CF2 corresponding to the second delay request message.
[0175] Currently, servers in data center networks also have a need for time synchronization. A network topology diagram for a data center network can be found in Figure 1f, which illustrates a schematic diagram of a data center network structure.
[0176] In Figure 1f, network devices can be, for example, local area network switches (LSWs), and servers are typically computing servers or storage devices. The connection relationships between the servers and network devices in Figure 1f will not be described in detail here.
[0177] Currently, PTP can be applied to data center networks to achieve time synchronization between servers within the network. Refer to Figure 1g for further understanding; Figure 1g illustrates another data center network topology. (See Figure 1g.)
[0178] Two building integrated timing supply (BITS) devices can be deployed in the data center network shown in Figure 1f. These BITS devices act as grandmaster (GM) clocks, or PTP master nodes. The BITS devices obtain high-precision time from satellite antennas, and then the server devices and BITS devices synchronize their time via PTP. This ensures that the time of the server devices in the data center network is consistent with the aforementioned high-precision time, thus achieving time synchronization among the server devices. The server devices act as PTP slave nodes.
[0179] In the network structure shown in Figure 1g, the network devices support the TC function, meaning that the network devices can act as TC nodes. In this way, the server device and the BITS device shown in Figure 1g can synchronize their time using the process shown in Figure 1e.
[0180] As can be seen from the above description of Figure 1e:
[0181] The PTP master node and PTP slave node need to exchange 7 messages to complete the time synchronization process. The number of messages exchanged between the PTP master node and PTP slave node is relatively large. For data center networks, the number of servers (i.e., PTP slave nodes) is very large, generally reaching hundreds of thousands. If the PTP master node (BITS device) has to exchange PTP messages with hundreds of thousands of servers, the resource pressure on the PTP master node will be very large.
[0182] Furthermore, if the TC nodes traversed by the forward and reverse paths are different, for example, the path of the Sync message is PTP master node → TC node 1 → TC node 2 → TC node 3 → PTP slave node, and the path of the Delay_Req message is PTP slave node → TC node 3 → TC node 4 → TC node 1 → PTP master node, then if the link delay in the direction of TC node 1 → TC node 2 → TC node 3 and the link delay in the direction of TC node 3 → TC node 4 → TC node 1 are not equal, it will affect the time synchronization accuracy. Unless it can be guaranteed that the link delay (e.g., fiber optic delay) through TC node 1 → TC node 2 → TC node 3 and TC node 3 → TC node 4 → TC node 1 is the same, this cannot be completely guaranteed in actual data center networks.
[0183] Secondly, in two-step mode of the TC node, it is also necessary to ensure that the Sync message and the Follow_Up message follow the same path. Otherwise, the Follow_Up message cannot carry the forwarding delay (e.g., X) of the corresponding Sync message. Here, the Sync message corresponding to the Follow_Up message is a PTP message sent by the PTP master node to the same PTP slave node, and the Follow_Up message and the Sync message have the same sequence number. Similarly, it is also necessary to ensure that the Delay_Req message and the corresponding Delay_Resp message follow the same TC node. Otherwise, the Delay_Resp message cannot carry the forwarding delay (e.g., Y) of the Delay_Req message. Here, the Delay_Resp message corresponding to the Delay_Req message refers to the Delay_Resp message being sent to the PTP slave node that sent the Delay_Req message, and the Delay_Resp message has the same sequence number (e.g., sequence ID). This cannot be fully guaranteed in actual data center networks.
[0184] In light of this, in 2024, IEEE initiated the 1588.1 protocol project, which aims to simplify the IEEE 1588 protocol. This solution can be understood with reference to Figure 1h below. Figure 1h shows another schematic diagram of PTP message interaction between PTP master nodes and PTP slave nodes.
[0185] In the scheme shown in Figure 1h, the PTP master node is in two-step mode, the TC node is in one-step mode, and the PTP slave node can be in either two-step or one-step mode.
[0186] As shown in Figure 1h, the PTP message exchange process between the PTP master node and the PTP slave node is as follows:
[0187] 1) The PTP slave node sends a Delay_Req message and records the sending time t3.
[0188] 2) After receiving the Delay_Req message, the TC node will forward the Delay_Req message to the next device (TC node or PTP master node) according to the IP address, and at the same time record the forwarding delay Y of the Delay_Req message. Since the TC node is in one-step mode, before sending the Delay_Req message, the TC node will add the forwarding delay to the correctionField field (denoted as CF2) of the Delay_Req message.
[0189] 3) The PTP master node receives the Delay_Req message and records the reception time t4.
[0190] 4) The PTP master node sends a Sync message and records the sending time t1. Since the PTP master node is in two-step mode, the Sync message cannot carry t1, but the Sync message will carry t4.
[0191] 5) After receiving the Sync message, the TC node will forward the Sync message to the next device (TC node or PTP slave node) according to the IP address, and at the same time record the forwarding delay X of the Sync message. Since the TC node is in one-step mode, before sending the Sync message, the TC node will add the forwarding delay to the correctionField field (denoted as CF1) of the Sync message.
[0192] 6) After receiving the Sync message, the PTP slave node will record the reception time t2 of the Sync message.
[0193] 7) The PTP master node sends an Announce message to the PTP slave node. The Announce message carries t1 and CF2, which is parsed from the Delay_Req message.
[0194] 8) After receiving the Announce message, the TC node does not modify the content of the Announce message, but continues to forward the Announce message to the PTP slave node.
[0195] 9) Finally, after the PTP slave node receives the Announce message, it can obtain t1, t2, t3, t4, as well as CF1 and CF2.
[0196] In time synchronization scenarios, PTP slave nodes can calculate the link latency between PTP master nodes and PTP slave nodes:
[0197] Mean_path_delay=[(t2–t1–CF1)+(t4–t3–CF2)] / 2
[0198] Furthermore, the PTP slave node can also calculate the time offset (Time_offset) between itself and the PTP master node, and further adjust its local time based on the Time_offset. Where: Time_offset = T2 – T1 – CF1 – Mean_path_delay.
[0199] Compared to the scheme in Figure 1e, the scheme in Figure 1h simplifies the message exchange process between the PTP master node and the PTP slave node. However, it still raises the issue of whether the bidirectional message paths between the PTP master node and the PTP slave node are symmetrical. For example, consider the paths of the Sync message and the Delay_Req message. The Sync message path is PTP master node → TC node 1 → TC node 2 → TC node 3 → PTP slave node, while the Delay_Req message path is PTP slave node → TC node 3 → TC node 4 → TC node 1 → PTP master node. If the link delay in the direction of TC node 1 → TC node 2 → TC node 3 is not equal to the link delay in the direction of TC node 3 → TC node 4 → TC node 1, it will affect the time synchronization accuracy. This is unless the link delays in the directions of TC node 1 → TC node 2 → TC node 3 and TC node 3 → TC node 4 → TC node 1 can be guaranteed to be the same, but this cannot be completely guaranteed in a real network. In other words, even using the scheme in Figure 1h for time synchronization, it is difficult to guarantee the performance of time synchronization.
[0200] In addition, if the scheme in Figure 1h is used for frequency synchronization, it is difficult to guarantee the performance of frequency synchronization if the delay of the one-way message path (e.g., the path of the Sync message) between the PTP master node and the PTP slave node is unstable, or the delay of the Delay_Req message path is unstable.
[0201] In addition, some networks require PTP master nodes to monitor the performance of PTP slave nodes. This is particularly important in data center networks where a PTP master node provides time synchronization services to multiple PTP slave nodes. Monitoring the synchronization performance of the slave nodes and issuing alerts for those with synchronization issues would help users identify the problematic slave nodes. However, currently, there is no solution that enables PTP master nodes to monitor the synchronization performance of their slave nodes.
[0202] Therefore, embodiments of this application provide a synchronization method and apparatus that can ensure the performance of time synchronization or frequency synchronization using PTP.
[0203] Referring to Figure 2, this figure is a schematic diagram of signaling interaction for a synchronization method provided in an embodiment of this application. The method shown in Figure 2 can be applied to the application scenarios shown in Figures 1a, 1b, 1d, or 1g above. The method shown in Figure 2 includes the following steps S101-S105.
[0204] S101: The PTP slave node sends the first PTP message to the PTP master node and generates the first transmission time of the first PTP message.
[0205] In one example, the first PTP message is a first delay request message, and correspondingly, the first sending time is the sending time t3 of the first delay request message.
[0206] In another example, the first PTP message is a first synchronization message, and correspondingly, the first sending time is the sending time t1 of the first synchronization message.
[0207] As an example, after the PTP slave node generates the first transmission time, it can save the first transmission time.
[0208] S102: The PTP master node receives the first PTP message sent by the PTP slave node.
[0209] S103: The PTP master node sends a second PTP message to the PTP slave node. The second PTP message includes a first reception time and a first delay. The first reception time is the time when the PTP master node receives the first PTP message. The first delay includes the cumulative value of the forwarding delay of the PTP node that forwards the first PTP message and the link delay between PTP nodes on the transmission path of the first PTP message; or, the first delay includes the link delay between PTP nodes on the transmission path of the first PTP message; the transmission path is the path from the PTP slave node to the PTP master node.
[0210] In this application, the transmission path of the first PTP message includes multiple PTP-enabled nodes. These multiple PTP-enabled nodes include at least a PTP slave node and a PTP master node. Furthermore, if the transmission path of the first PTP message includes a TC node, then the multiple PTP-enabled nodes include the TC node in addition to the PTP slave node and the PTP master node. In this application, unless otherwise specified, the transmission path of the first PTP message refers to the transmission path of the first PTP message from the PTP slave node to the PTP master node.
[0211] In this application, after receiving the first PTP message, the PTP master node can generate a first reception time, which is the time it takes for the PTP master node to receive the first PTP message. Specifically, if the first PTP message is a first synchronization message, the first reception time is t2; if the first PTP message is a first delay request message, the first reception time is t4. Furthermore, to improve the accuracy of time or frequency synchronization by the PTP slave nodes, the PTP master node can also determine a first delay, which is the transmission delay of the first PTP message along its transmission path. After generating the first reception time and determining the first delay, the PTP master node can obtain a second message and send it to the PTP slave nodes. This second PTP message includes the first reception time and the first delay.
[0212] In one example, if the transmission path of the first PTP message includes a TC node, then the first delay is the cumulative value of two delay components: node delay and link delay, where:
[0213] Node latency can be understood as the forwarding latency of the PTP node that forwards the first PTP packet. The PTP node that forwards the first PTP packet can be a TC node. When the transmission path of the first PTP packet includes one TC node, the node latency is the forwarding latency corresponding to that single TC node; when the transmission path of the first PTP packet includes multiple TC nodes, the node latency is the sum of the forwarding latencies corresponding to those multiple TC nodes.
[0214] The link delay is the link delay between PTP nodes along the transmission path of the first PTP message. Specifically, the transmission path of the first PTP message may include multiple sub-links, each of which is a link between adjacent PTP nodes on that transmission path. Correspondingly, the link delay can be the sum of the delays of multiple sub-links. For example, if the transmission path of the first PTP message is PTP slave node → TC node 1 → TC node 2 → PTP master node, then the transmission path of the first PTP message includes three sub-links: sub-link 1 is the link from the PTP slave node to TC node 1, sub-link 2 is the link from TC node 1 to TC node 2, and sub-link 3 is the link from TC node 2 to the PTP master node. Accordingly, the aforementioned link delay is the sum of the delays of sub-link 1, sub-link 2, and sub-link 3.
[0215] In another example, if the transmission path of the first PTP message does not include a TC node, then the first delay includes the link delay between PTP nodes on the transmission path of the first PTP message. In this case, the transmission path of the first PTP message only includes two PTP nodes: a PTP slave node and a PTP master node. Accordingly, the first delay is the link delay from the PTP slave node to the PTP master node.
[0216] For ease of description, the "node that supports PTP up to the previous hop of the PTP master node on the transmission path" is referred to as the "first PTP node," and the "link from the first PTP node to the PTP master node" is referred to as the "first link." The PTP master node can then determine the link delay of the first link and, based on the link delay of the first link, obtain the first delay.
[0217] As an example, the first PTP message received by the PTP master node includes a first field. The PTP master node can add the link delay of the first link to the delay carried in the first field of the first PTP message it received to obtain the first delay. The first field mentioned here could be, for example, the correction field field in the first PTP message.
[0218] In a specific implementation, if the first PTP node is a PTP slave node, the latency carried in the first field of the first PTP message received by the PTP master node can be 0. In this case, the first latency is the link latency of the first link. In other words, in this scenario, after the PTP master node determines the link latency of the first link, it can use the link latency of the first link as the first latency.
[0219] In another specific example, if the first PTP node is the first TC node, in this scenario, the value carried by the aforementioned first field is the second delay, which is the transmission delay of the first PTP message between the PTP slave node and the first TC node. The second delay is added by the first TC node to the first PTP message sent by the first TC node to the PTP master node. For details regarding the operations performed by the first TC node, please refer to the description of the method shown in Figure 3 below; it will not be repeated here.
[0220] In one example, the aforementioned first PTP message may include first indication information, which indicates a correction based on the link delay of the first PTP message. After receiving the first PTP message, a PTP node on the transmission path of the first PTP message can make a correction based on the link delay of the first PTP message, using the first indication information. Specifically, for the PTP master node, after receiving the first indication information, it can make a correction based on the link delay of the first link to obtain the first delay. For the TC node (e.g., the first TC node) on the transmission path of the first PTP message, in addition to making a correction based on its own forwarding delay of the first PTP message, it can also make a correction based on the link delay of the second link, using the first indication information. The second link is the link delay from the second PTP node to the first TC node, and the second PTP node is the node on the previous hop of the first TC node on the transmission path of the first PTP message that supports PTP. For details on how the first TC node corrects the forwarding delay of the first PTP packet based on its own forwarding and the link delay of the second link, please refer to the description of the method shown in Figure 3 below. It will not be repeated here.
[0221] In one example, the aforementioned first indication information can be carried by a reserved field in the first PTP message. As mentioned earlier, the first PTP message can be a first delay request message or a first synchronization message. As a specific example, when the first PTP message is a first delay request message, the first indication information can be carried through the flag field of the first delay request message, for example, through the 7th bit of the 0th byte of the flag field of the first delay request message. As another specific example, when the first PTP message is a first synchronization message, the first indication information can be carried through a reserved bit in the flag field of the first synchronization message. For example, it can be carried through the 7th bit of the 0th byte of the flag field of the first synchronization message.
[0222] In another example, when the first PTP message is a first delay request message, the message format of the delay request message defined by the current IEEE 1588 protocol can be extended to include a new field carrying the first indication information. Similarly, when the first PTP message is a first synchronization message, the message format of the synchronization message defined by the current IEEE 1588 protocol can be extended to include a new field carrying the first indication information.
[0223] In one example, the second PTP message can be a first announcement message. In this case, in one example, the aforementioned first indication information, in addition to indicating the correction based on the link delay of the first PTP message, also instructs the PTP master node to return an announcement message to the PTP slave node. That is, after receiving the first PTP message including the first indication information, the PTP master node, in addition to correcting the link delay based on the first link to obtain the first delay, can further send a first announcement message including the first delay and the first reception time to the PTP slave node.
[0224] In one example, the message format of the first notification message can follow the format of notification messages defined in the current IEEE 1588 protocol. The first notification message includes an original timestamp field and a correction field. The aforementioned first reception time can be carried in the original timestamp field of the first notification message, and the aforementioned first delay can be carried in the correction field field of the first notification message.
[0225] In another example, the format of the first notification message may be an extension of the format of the notification message defined by the current IEEE 1588 protocol. For example, the first notification message may include a first extended field for carrying a first reception time and / or a second extended field for carrying a first delay.
[0226] In addition to the aforementioned first delay and first reception time, the first notification message also includes clock quality information, which is used to notify the clock quality of the PTP master node. For example, the first notification message includes a grandmasterClockQuality field, which carries the clock quality information of the PTP master node. The PTP slave node can determine whether to synchronize time or frequency with the PTP master node based on its clock quality information. Specifically, the PTP slave node can receive clock quality information from multiple PTP master nodes and, based on the received clock quality information, select the PTP master node with the better clock quality for time or frequency synchronization.
[0227] In another example, the second PTP message can be a delayed response message. In this case, in one example, the aforementioned first indication information, in addition to instructing a correction based on the link delay of the first PTP message, also instructs the PTP master node to return a delayed response message to the PTP slave node. That is, after receiving the first PTP message including the first indication information, the PTP master node, in addition to correcting the link delay based on the first link to obtain the first delay, can further send a delayed response message to the PTP slave node including the first delay and the first reception time.
[0228] In one example, the message format of the delayed response message can follow the format defined in the current IEEE 1588 protocol. The delayed response message includes a precise original timestamp field and a correction field. The aforementioned first reception time can be carried through the precise original timestamp field of the delayed response message, and the aforementioned first delay can be carried through the correction field field of the delayed response message.
[0229] In one example, the format of the delayed response message may be an extension of the delayed response message format defined in the current IEEE 1588 protocol. For example, the delayed response message may include a third extended field for carrying a first reception time and / or a fourth extended field for carrying a first delay.
[0230] As described above, the clock quality information of the PTP master node is crucial for PTP slave nodes, as it helps them select a suitable PTP master node for clock or time synchronization. Therefore, in one example, if the aforementioned second PTP message is a delayed response message, the PTP master node, in response to the first PTP message, can send a second notification message to the PTP slave node in addition to sending a delayed response message, to notify the PTP slave node of the PTP master node's clock quality information. Wherein:
[0231] The message format of the second announcement message can follow the format of the announcement message defined by the current IEEE 1588 protocol. In this application, as defined by the current IEEE 1588 protocol, the PTP master node no longer periodically sends announcement messages to the PTP slave node. The PTP master node sends the announcement message (e.g., the second announcement message) when it receives the aforementioned first PTP message including the first indication information.
[0232] In another example, to reduce the number of messages exchanged between the PTP master and PTP slave nodes, when the aforementioned second PTP message is a delayed response message, the PTP master node may not send a second announcement message to the PTP slave node. Instead, it can include the PTP master node's clock quality information in the delayed response message, thereby announcing the PTP master node's clock quality information to the PTP slave node. In other words, the aforementioned delayed response message also includes the PTP master node's clock quality information. As an example, new fields can be extended to carry the PTP master node's clock quality information based on the current IEEE 1588 protocol's defined delayed response message format. For example, the TLV field can be extended to carry the PTP master node's clock quality information. The PTP master node's clock quality information includes, but is not limited to, one or more of the following: grandmaster priority1, grandmaster clock quality, grandmaster priority2, and grandmaster identity.
[0233] `grandmasterPriority1` is the priority1 parameter for the GM, and its definition can be found in the `grandmasterPriority1` parameter of the Announce message defined in the current IEEE 1588 protocol. `grandmasterClockQuality` is the quality level parameter for the GM, and its value is found in the `grandmasterClockQuality` parameter of the Announce message defined in the current IEEE 1588 protocol. `grandmasterPriority2` is the priority2 parameter for the GM, and its value is found in the `grandmasterPriority2` parameter of the Announce message defined in the current IEEE 1588 protocol. `grandmasterIdentity` is the identity parameter for the GM, and its value is found in the `grandmasterIdentity` parameter of the Announce message defined in the current IEEE 1588 protocol.
[0234] S104: The PTP slave node receives the second PTP message sent by the PTP master node.
[0235] S105: The PTP slave node performs time synchronization or frequency synchronization based on the first transmission time, the first reception time, and the first delay.
[0236] After the PTP master node sends the second PTP message, the node that receives the second PTP message (e.g., the first TC node) continues to forward the second PTP message without modifying the first delay and first reception time in the second PTP message, until the second PTP message is sent to the PTP slave node. Accordingly, the PTP slave node receives the second PTP message and can parse the first reception time and the first delay. Furthermore, the PTP slave node can perform time synchronization or frequency synchronization based on the first transmission time, the first reception time, and the first delay. In a specific example, the PTP slave node performs time synchronization based on the first transmission time, the first reception time, and the first delay. In specific implementation, the time offset between itself and the PTP master node can be calculated using the following formula (6): timeoffset. timeoffset = first reception time - first transmission time - first delay Formula (6)
[0237] After obtaining the time deviation between itself and the PTP master node based on formula (6), the PTP slave node can adjust its local time based on the time deviation, thereby achieving time synchronization with the PTP master node.
[0238] In another specific example, if the first PTP message is the first delay request message, the PTP slave node performs frequency synchronization based on the first sending time, the first receiving time, and the first delay. In specific implementation, the first receiving time can be taken as t4 (2), the first sending time as t3 (2), the first delay as CF2 (2), the sending time of the previous delay request message sent by the PTP slave node as t3 (1), the receiving time of the previous delay request message received by the PTP master node as t4 (1), and the transmission delay of the previous delay request message between the PTP slave node and the PTP master node as CF2 (1). Substituting these values into formula (5), the frequency deviation between itself and the PTP master node is obtained, and the local frequency is adjusted based on this frequency deviation to achieve frequency synchronization with the PTP master node.
[0239] In another specific example, if the first PTP message is the first synchronization message, then the PTP slave node performs frequency synchronization based on the first sending time, the first receiving time, and the first delay. In specific implementation, the first receiving time can be taken as t4 (2), the first sending time as t5 (2), the first delay as CF5 (2), the sending time of the previous synchronization message sent by the PTP slave node as t3 (1), the receiving time of the previous synchronization message received by the PTP master node as t4 (1), and the transmission delay of the previous synchronization message between the PTP slave node and the PTP master node as CF2 (1). Substituting these values into formula (5), the frequency deviation between itself and the PTP master node is obtained, and the local frequency is adjusted based on this frequency deviation, thereby achieving frequency synchronization with the PTP master node.
[0240] As described above, using the scheme of this application embodiment, since the first delay in the second PTP message can characterize the transmission delay of the first PTP message between the PTP slave node and the PTP master node, the PTP slave node can achieve time synchronization with the PTP master node based on the first delay, the first transmission time, and the first reception time. It is not necessary to require symmetrical delays in the bidirectional message path between the PTP master node and the PTP slave node, which correspondingly improves the performance of time synchronization between the PTP slave node and the PTP master node. Similarly, when the PTP slave node performs frequency synchronization with the PTP master node based on the first delay, the first transmission time, and the first reception time, it is not necessary to require stable delays in the unidirectional message path between the PTP master node and the PTP slave node. This also helps improve the performance of frequency synchronization between the PTP slave node and the PTP master node.
[0241] Next, referring to Figure 3, we will introduce the specific method by which the first TC node corrects the link delay of the first PTP packet.
[0242] Referring to Figure 3, this figure is a schematic flowchart of a synchronization method provided in an embodiment of this application. The method shown in Figure 3 can be applied to a first TC node, which is an intermediate node on the transmission path of the first PTP message. The method shown in Figure 3 includes the following steps S201-S202.
[0243] S201: The first TC node receives a first PTP message sent by the PTP slave node. The first PTP message includes a first field, and the first field includes a third delay.
[0244] S202: The first TC node sends an updated first PTP message. The first field of the updated PTP message includes a second delay, which is obtained by adding the forwarding delay of the first TC node forwarding the first PTP message, the link delay of the second link, and the third delay. The second link is the link delay from the second PTP node to the first TC node. The second PTP node is the node that supports PTP on the previous hop of the first TC node on the transmission path of the first PTP message.
[0245] For ease of description, the node that supports PTP and is the hop above the first TC node on the transmission path of the first PTP message is referred to as the "second PTP node".
[0246] In one example, if the second PTP node is the PTP slave node, then in one example, the third delay is equal to 0. In another example, the third delay includes a portion of the first transmission time; for example, the third delay is the fractional part of the first transmission time.
[0247] In another example, if the second PTP node is the second TC node, then the third delay is the transmission delay of the first PTP packet between the PTP slave node and the second TC node. In this scenario, the second TC node can determine the third delay and modify the value of the first field in the first PTP packet it receives to the third delay, thereby sending the first PTP packet carrying the third delay to the first TC node. The principle by which the second TC node determines the third delay is the same as the principle by which the first TC node determines the second delay, and will not be repeated here.
[0248] After receiving the first PTP message, which includes the third delay, the first TC node can sum the third delay, the forwarding delay of the first TC node in forwarding the first PTP message, and the link delay of the second link to obtain the second delay. The second link mentioned here refers to the link from the second PTP node to the first TC node.
[0249] After obtaining the second delay, the first TC node can modify the value of the first field in the received first PTP packet. Specifically, the first TC node can change the value of the first field from the third delay to the second delay to obtain an updated first PTP packet. The first field of the updated first PTP packet carries the second delay. For details on the first field, please refer to the previous description; it will not be repeated here.
[0250] After receiving the updated first PTP message, the first TC node can send the updated first PTP message to the PTP master node so that the PTP master node can determine the first delay based on the first PTP message it received, and further send the aforementioned second PTP message to the PTP slave node.
[0251] As described above, using the scheme of this application embodiment, the first TC node can correct the value of the first field based on the forwarding delay of the first PTP packet and the link delay of the second link, thereby enabling the PTP master node to receive the first PTP packet including the second delay. Correspondingly, the PTP master node can further obtain the first delay based on the second delay and further send the aforementioned second PTP packet including the first reception time and the first delay to the PTP slave node. Since the first delay in the second PTP packet can characterize the transmission delay of the first PTP packet between the PTP slave node and the PTP master node, the PTP slave node can achieve time synchronization with the PTP master node based on the first delay, the first transmission time, and the first reception time, without requiring the delay of the bidirectional packet path between the PTP master node and the PTP slave node to be symmetrical. Accordingly, this is beneficial to improving the performance of time synchronization between the PTP slave node and the PTP master node. Similarly, when a PTP slave node performs frequency synchronization with a PTP master node based on a first delay, a first transmission time, and a first reception time, it is not necessary to require the delay of the one-way message path between the PTP master node and the PTP slave node to be stable. Accordingly, this is beneficial to improving the performance of frequency synchronization between the PTP slave node and the PTP master node.
[0252] In one example, any two adjacent PTP nodes on the transmission path of the first PTP message can exchange path delay (Pdelay) messages to determine the link delay between them. For instance, if the transmission path of the first PTP message does not include a TC node, the PTP master node and the PTP slave node can exchange Pdelay messages to determine the link delay between them. Similarly, if the transmission path of the first PTP message includes a TC node, the PTP master node and its upstream TC node (e.g., the first TC node) can exchange Pdelay messages to determine the link delay between them. Likewise, a PTP slave node and its next-hop TC node (e.g., the first or second TC node) can exchange Pdelay messages to determine the link delay between them.
[0253] For the process of exchanging Pdelay messages between PTP nodes, please refer to the description of Pdelay messages in the current IEEE 1588 protocol; it will not be repeated here. Additionally, in one example, to ensure the accuracy of the calculated link delay between adjacent PTP nodes, when bidirectional delay asymmetry between adjacent PTP nodes is determined, the link delay obtained from the Pdelay message can be corrected based on the difference in bidirectional delay. The bidirectional delay between PTP node 1 and PTP node 2 includes the delay from PTP node 1 to PTP node 2 and the delay from PTP node 2 to PTP node 1.
[0254] This application also provides a synchronization method that enables monitoring of the synchronization performance of PTP slave nodes. The synchronization method will now be described in conjunction with the accompanying drawings. Referring to Figure 4, this figure is a schematic diagram of the signaling interaction of a synchronization method provided in this application embodiment.
[0255] The method shown in Figure 4 can be used in combination with the methods shown in Figure 1c, Figure 1e, Figure 1h, or Figure 2.
[0256] The method shown in Figure 4 includes the following steps S301-S303.
[0257] S301: The PTP slave node announces the first transmission time of the first PTP message to the PTP master node.
[0258] In one example, the first PTP message is either a first delay request message or a first synchronization message.
[0259] As a specific example, when the method shown in Figure 4 is used in conjunction with the methods shown in Figure 1c, 1e, or 1h, the first PTP message is a first delay request message. Specifically, when the method shown in Figure 4 is used in conjunction with the method shown in Figure 1c, the first delay request message corresponds to the delay request message shown in Figure 1c, and correspondingly, the first transmission time is t3 shown in Figure 1c. When the method shown in Figure 4 is used in conjunction with the method shown in Figure 1e, the first delay request message corresponds to the delay request message shown in Figure 1e, and correspondingly, the first transmission time is t3 shown in Figure 1e. When the method shown in Figure 4 is used in conjunction with the method shown in Figure 1h, the first delay request message corresponds to the delay request message shown in Figure 1h, and correspondingly, the first transmission time is t3 shown in Figure 1h.
[0260] As another specific example, when the method shown in Figure 4 is used in combination with the method shown in Figure 2, the first PTP message corresponds to the first PTP message shown in Figure 2. As mentioned above, in this scenario, the first PTP message is either the first delay request message or the first synchronization message.
[0261] In one example, the PTP slave node can announce the first transmission time to itself by including it in the first PTP message; in other words, the first PTP message includes the first transmission time. As a specific example, if the PTP slave node is in one-step mode, the first transmission time is carried in the first PTP message. If the first PTP message is a first delay request message, the first transmission time can be carried, for example, through the original timestamp field of the first delay request message. If the first PTP message is a first synchronization message, the first transmission time can be carried, for example, through the original timestamp field of the first synchronization message.
[0262] In another example, the PTP slave node can announce the first transmission time in a third PTP message; in other words, the third PTP message includes the first transmission time. The third PTP message mentioned here is the PTP message sent by the PTP slave node to the PTP master node after sending the first PTP message. As a specific example, if the PTP slave node is in two-step mode, the first transmission time cannot be carried in the first PTP message; in this scenario, the first transmission time is carried in the third PTP message.
[0263] In one example, if the first PTP message is a first synchronization message, the third PTP message can be implemented in multiple ways.
[0264] In one example, the third PTP message is a follow-up message.
[0265] In another example, the third PTP message is the second synchronization message, which is the next synchronization message sent to the PTP slave node after it sends the first synchronization message. In this scenario, in one example, the first PTP message may carry a second sending time, which is the sending time of the third synchronization message, and the third synchronization message is the synchronization message preceding the first synchronization message sent by the PTP slave node. The second sending time can be carried through the original timestamp field of the first PTP message.
[0266] In another example, if the first PTP message is a first delay request message, the third PTP message can be implemented in several ways.
[0267] As an example, the third PTP message can be a second delay request message, wherein the second delay request message is the next delay request message sent to the PTP slave node after the first delay request message is sent. In this scenario, the first sending time can be carried in the original timestamp field of the second delay request message. In one example, the first PTP message can carry a second sending time, which is the sending time of the third delay request message, and the third delay request message is the delay request message preceding the first delay request message sent by the PTP slave node. The second sending time can be carried in the original timestamp field of the first PTP message.
[0268] As another example, the third PTP message could be a delayed request follow message. The delayed request follow message is a new extension of the PTP message based on the current IEEE 1588 protocol. For example, the message type values for PTP messages defined in the current IEEE 1588 protocol range from 0 to F. Values 0 to 7 correspond to event messages, which require a timestamp (e.g., the sending or receiving time) when sent by a PTP node (PTP master or PTP slave). Values 8 to F correspond to general messages, which do not require a timestamp when sent by a PTP node (PTP master or PTP slave). Therefore, the newly extended delayed request follow message could be, for example, a newly extended general message. Currently, the values E and F for the message type corresponding to PTP messages defined in the IEEE 1588 protocol are reserved; therefore, the value of the message type corresponding to the delayed request follow message could be, for example, E or F.
[0269] If the first transmission time is carried via a delayed request follow-up message, in one example, the first transmission time can be carried via the precise original timestamp field of the delayed request follow-up message. Specifically, if the first transmission time is an integer, it can be carried via the precise original timestamp field of the delayed request follow-up message. In another example, if the header of the delayed request follow-up message includes a correction field, the first transmission time can be carried together via both the precise original timestamp field and the correction field included in the header of the delayed request follow-up message. Specifically, if the first transmission time includes both an integer part and a decimal part, the integer part of the first transmission time is carried via the precise original timestamp field of the delayed request follow-up message, and the decimal part is carried via the correction field included in the header of the delayed request follow-up message.
[0270] In one example, if the aforementioned third PTP message is a delayed request follow-up message or a follow-up message, then the first PTP message may include second indication information, wherein:
[0271] If the third PTP message is a delay request follow-up message, then the second indication information is used to indicate whether the message carrying the first transmission time is a first delay request message or a delay request follow-up message. In other words, the second indication information is used to indicate that the first transmission time is carried in either the delay request follow-up message or the first delay request message.
[0272] If the third PTP message is a follow-up message, then the second indication information is used to indicate whether the message carrying the first transmission time is a first synchronization message or a follow-up message. In other words, the second indication information is used to indicate that the first transmission time is carried in either the first synchronization message or the follow-up message.
[0273] As a specific example, the second indication information can be carried through the two-step flag field of the first PTP message. For example, if the third PTP message is a delay request follow-up message, then when the value of the two-step flag field of the first delay request message is 0, the first transmission time is indicated to be carried through the first delay request message; when the value of the two-step flag field of the first delay request message is 1, the first transmission time is indicated to be carried through the delay request follow-up message. As another example, if the third PTP message is a follow-up message, then when the value of the two-step flag field of the first synchronization message is 0, the first transmission time is indicated to be carried through the first synchronization message; when the value of the two-step flag field of the first synchronization message is 1, the first transmission time is indicated to be carried through the follow-up message.
[0274] As another concrete example, the message format of the delay request message (or first synchronization message) defined by the current IEEE 1588 protocol can be extended by adding a new field to carry the second indication information.
[0275] In another example, if the aforementioned third PTP message is a second delay request message or a second synchronization message, then the third PTP message may carry third indication information in addition to the first transmission time. Wherein:
[0276] If the third PTP message is a second delay request message, the third indication information is used to indicate the transmission time of the preceding delay request message sent by the PTP slave node in the second delay request message; that is, the third indication information can be used to indicate the first transmission time carried in the second delay request message. If the third PTP message is a second synchronization message, the third indication information is used to indicate the transmission time of the preceding synchronization message sent by the PTP slave node in the second synchronization message; that is, the third indication information can be used to indicate the first transmission time carried in the second synchronization message. In this scenario, the first PTP message can carry fifth indication information. Specifically, if the first PTP message is a first delay request message, the fifth indication information is used to indicate the transmission time of the preceding delay request message sent by the PTP slave node in the first delay request message. If the first PTP message is a first synchronization message, then the fifth indication information is used to indicate the sending time of the previous synchronization message sent by the PTP slave node in the first synchronization message.
[0277] As a concrete example, if the first PTP message is a first delay request message, the third indication information can be carried through the two-step flag field of the second delay request message. For example, when the two-step flag field of the second delay request message has a value of 1, it indicates the transmission time of the preceding delay request message sent by the PTP slave node in the second delay request message. Similarly, when the two-step flag field of the second delay request message has a value of 0, it indicates the transmission time of the second delay request message in the second delay request message. As another concrete example, the message format of the delay request message defined by the current IEEE 1588 protocol can be extended to include a new field to carry the third indication information.
[0278] As another specific example, if the first PTP message is a first synchronization message, the third indication information can be carried through the two-step flag field of the second synchronization message. For example, when the value of the two-step flag field of the second synchronization message is 1, it indicates the transmission time of the previous synchronization message sent by the PTP slave node in the second synchronization message. Similarly, when the value of the two-step flag field of the second synchronization message is 0, it indicates the transmission time of the second synchronization message in the second synchronization message. As another specific example, the message format of the synchronization message defined by the current IEEE 1588 protocol can be extended to include a new field to carry the third indication information.
[0279] As a concrete example, if the first PTP message is a first delay request message, the fifth indication information can be carried, for example, through the two-step flag field of the first delay request message. For instance, a value of 1 in the two-step flag field indicates that the first delay request message carries the transmission time of the preceding delay request message sent by the PTP slave node. As another concrete example, the message format of the delay request message defined by the current IEEE 1588 protocol can be extended by adding a new field to carry the fifth indication information.
[0280] As another specific example, if the first PTP message is a first synchronization message, the fifth indication information can be carried, for example, through the two-step flag field of the first synchronization message. For instance, a value of 1 in the two-step flag field indicates that the first synchronization message carries the transmission time of the previous synchronization message sent by the PTP slave node. As another specific example, the message format of the delay request message defined in the current IEEE 1588 protocol can be extended to include a new field to carry the fifth indication information.
[0281] In one example, the aforementioned first PTP message may further include fourth indication information, which instructs the PTP slave node to announce a target transmission time to the PTP master node. The target transmission time is the transmission time of the target PTP message sent by the PTP slave node to the PTP master node, and the target PTP message is a PTP message of the same type as the first PTP message. As an example, when the first PTP message is a first delay request message, the target PTP message may also be a delay request message; for example, the target PTP message may be a first delay request message, or it may be a third delay request message. As another example, when the first PTP message is a first synchronization message, the target PTP message is also a synchronization message. For example, the target PTP message may be a first synchronization message, or it may be a third synchronization message.
[0282] In one example, the aforementioned fourth indication information can be carried in the reserved field of the first PTP message. As mentioned earlier, the first PTP message can be a first delay request message or a first synchronization message. As a specific example, when the first PTP message is a first delay request message, the fourth indication information can be carried in the flag field of the first delay request message, for example, in the 7th bit of the 1st byte of the flag field of the first delay request message. As another specific example, when the first PTP message is a first synchronization message, the fourth indication information can be carried in the reserved bit of the flag field of the first synchronization message, for example, in the 7th bit of the 1st byte of the flag field of the first synchronization message.
[0283] In another example, when the first PTP message is a first delay request message, the message format of the delay request message defined by the current IEEE 1588 protocol can be extended to include a new field carrying the fourth indication information. Similarly, when the first PTP message is a first synchronization message, the message format of the first synchronization message defined by the current IEEE 1588 protocol can be extended to include a new field carrying the fourth indication information.
[0284] S302: The first time the PTP master node receives the PTP slave node's announcement.
[0285] S303: The PTP master node determines the synchronization performance of the PTP slave node based on the first transmission time.
[0286] The PTP master node receives the first transmission time announced by the PTP slave node, and further determines the synchronization performance of the PTP slave node based on the first transmission time.
[0287] In one example, if the method shown in Figure 4 is used in combination with the method shown in Figure 1c, Figure 1e, or Figure 1h, the PTP master node can determine the frequency synchronization performance of the PTP slave node after receiving the first transmission time.
[0288] In another example, if the method shown in Figure 4 is used in combination with the method shown in Figure 2, the PTP master node can determine the frequency synchronization performance and / or the time synchronization performance of the PTP slave node after receiving the first transmission time.
[0289] In a specific example, when the method shown in Figure 4 is applied to the scenario shown in Figure 1c, the PTP master node can calculate its frequency offset from the PTP slave node using the aforementioned formula (2), thereby obtaining the frequency synchronization performance of the PTP slave node. For example, the PTP master node can use the first transmission time as t3 (2), the first reception time as t4 (2), the transmission time of the last delay request message sent by the PTP slave node as t3 (1), and the reception time of the last delay request message received by itself as t4 (1), and substitute these into formula (2) to obtain its frequency offset from the PTP slave node.
[0290] In this application, the frequency offset between the PTP master node and the PTP slave node can indicate the frequency synchronization performance of the PTP slave node. Generally speaking, the larger the frequency offset between the PTP master node and the PTP slave node, the worse the frequency synchronization performance of the PTP slave node. Conversely, the smaller the frequency offset between the PTP master node and the PTP slave node, the better the frequency synchronization performance of the PTP slave node. After determining its own frequency offset with the PTP slave node, the PTP master node can directly determine the frequency synchronization performance of the PTP slave node based on the frequency offset, or it can determine the frequency synchronization performance level of the PTP slave node based on the frequency offset. This application does not specifically limit this.
[0291] In another specific example, when the method shown in Figure 4 is applied to the scenario shown in Figure 1e or Figure 1h, the PTP master node can calculate its frequency offset from the PTP slave node using the aforementioned formula (5), thereby obtaining the frequency synchronization performance of the PTP slave node. For example, the PTP master node can take the first transmission time as t3 (2), the first reception time as t4 (2), the CF2 carried in the first delay request message as CF2 (2), the transmission time of the previous delay request message sent by the PTP slave node as t3 (1), the reception time of the previous delay request message received by itself as t4 (1), and the CF2 carried in the previous delay request message as CF2 (1), and substitute them into formula (5) to obtain its frequency offset from the PTP slave node.
[0292] In another specific example, if the method shown in Figure 4 is used in combination with the method shown in Figure 2, the PTP master node can determine the synchronization performance of the PTP slave node based on the first transmission time, the first reception time, and the first delay. The synchronization performance mentioned here includes time synchronization performance and / or frequency synchronization performance. In one example, the PTP master node can substitute the first reception time, the first transmission time, and the first delay into the aforementioned formula (6) to obtain the time deviation between itself and the PTP slave node, and further use this time deviation to obtain the time synchronization performance of the PTP slave node.
[0293] In this application, the time deviation between the PTP master node and the PTP slave node can indicate the time synchronization performance of the PTP slave node. Generally speaking, the larger the time deviation between the PTP master node and the PTP slave node, the worse the time synchronization performance of the PTP slave node. Conversely, the smaller the time deviation between the PTP master node and the PTP slave node, the better the time synchronization performance of the PTP slave node. After determining its own time deviation with the PTP slave node, the PTP master node can directly determine the time synchronization performance of the PTP slave node based on the time deviation, or it can determine the time synchronization performance level of the PTP slave node based on the time deviation. This application does not specifically limit this.
[0294] In another example, the PTP master node can obtain the frequency deviation between itself and the PTP slave node based on the aforementioned formula (5). Specifically, the PTP master node can take the first transmission time as t3 (2), the first reception time as t4 (2), the first delay as CF2 (2), the transmission time of the third delay request message sent by the PTP slave node as t3 (1), the reception time of the third delay request message received by itself as t4 (1), and the transmission delay of the third delay request message between the PTP slave node and the PTP master node as CF2 (1). Substituting these values into formula (5), the frequency deviation between itself and the PTP slave node can be obtained.
[0295] Regarding the transmission delay of the third delay request message between the PTP slave node and the PTP master node, please refer to the previous description of the first delay; it will not be repeated here.
[0296] The solutions provided by the embodiments of this application have been described above. Next, taking the method shown in Figure 4 and the method shown in Figure 2 as examples, we will introduce several possible implementation methods of the embodiments of this application.
[0297] Referring to Figure 5a, this figure is a schematic diagram of signaling interaction of a synchronization method provided in an embodiment of this application.
[0298] As shown in Figure 5a:
[0299] 1. The PTP slave node sends a Delay_Req message to the PTP master node. This Delay_Req message is equivalent to the first PTP message in the method shown in Figure 2. Wherein:
[0300] In Figure 5a, the flag field 0.7 represents the 7th bit of the 0th byte of the flag field of the Delay_Req message. The value of the flag field 0.7 is 1, which corresponds to the aforementioned first indication information, indicating that the link delay is corrected based on the Delay_Req message.
[0301] If the transmission path of the Delay_Req message includes a TC node, the TC node will correct the value of the correction field (corresponding to CF2) in the Delay_Req message based on the link delay and its own forwarding delay for forwarding the Delay_Req message.
[0302] For details on the operations performed by the TC node, please refer to the description of the method shown in Figure 3 above; the description will not be repeated here.
[0303] In Figure 5a, flag field 1.7 represents the 7th bit of the 1st byte of the flag field of the Delay_Req message. The value of flag field 1.7 is 1, corresponding to the aforementioned fourth indication information, indicating the sending time t3 of the delay request message to be announced to the PTP master node. The t3 mentioned here corresponds to the first sending time in the above embodiment.
[0304] The two-step flag field of the Delay_Req message is 1, corresponding to the aforementioned second indication information, indicating that the aforementioned t3 is carried by the delayed request follow message.
[0305] 2. The PTP master node sends an announcement message or a delayed response message to the PTP slave node.
[0306] The notification message and delayed response message mentioned here are equivalent to the second PTP message in the above embodiments.
[0307] After receiving the Delay_Req message, the PTP master node, based on the first indication information and the link delay in the Delay_Req message, corrects the value of the correction field (CF2) in the Delay_Req message to obtain the first delay. It then sends an announcement message or a delay response message to the PTP slave node, carrying t4 (i.e., the first reception time) and the first delay. In the announcement message or delay response message, CF2 represents the first delay.
[0308] Furthermore, based on the fourth and second indication information, the PTP master node determines that it needs to parse the delay request follow-up message to obtain t3. After obtaining t3, the PTP master node can determine the time synchronization performance of the PTP slave node based on t4, t3, and the first delay.
[0309] If the second PTP message sent by the PTP master node to the PTP slave node is a delayed response message, then in one example, as shown in Figure 5a, the delayed response message includes the clock quality information of the PTP master node.
[0310] In another example, if the delayed response message does not include the clock quality information of the PTP master node, as shown in Figure 5b, the PTP master node can also send an announcement message to the PTP slave node to announce its own clock quality information.
[0311] Referring to Figure 5c, this figure is a schematic diagram of signaling interaction for another synchronization method provided in an embodiment of this application.
[0312] As shown in Figure 5c:
[0313] 1. The PTP slave node sends a Delay_Req message to the PTP master node. This Delay_Req message is equivalent to the first PTP message in the method shown in Figure 2. Wherein:
[0314] In Figure 5c, the flag field 0.7 represents the 7th bit of the 0th byte of the flag field of the Delay_Req message. The value of the flag field 0.7 is 1, which corresponds to the aforementioned first indication information, indicating that the link delay is corrected based on the Delay_Req message.
[0315] If the transmission path of the Delay_Req message includes a TC node, the TC node will correct the value of the correction field (corresponding to CF2) in the Delay_Req message based on the link delay and its own forwarding delay for forwarding the Delay_Req message.
[0316] For details on the operations performed by the TC node, please refer to the description of the method shown in Figure 3 above; the description will not be repeated here.
[0317] In Figure 5c, flag field 1.7 represents the 7th bit of the 1st byte of the flag field of the Delay_Req message. The value of flag field 1.7 is 1, which corresponds to the aforementioned fourth indication information, indicating the sending time t3 of the delay request message to be announced to the PTP master node.
[0318] The value of the two-step flag field in the Delay_Req message is 0, corresponding to the aforementioned second indication information, indicating that the aforementioned t3 is carried through the delay request message.
[0319] 2. The PTP master node sends an announcement message or a delayed response message to the PTP slave node.
[0320] The notification message and delayed response message mentioned here are equivalent to the second PTP message in the above embodiments.
[0321] After receiving the Delay_Req message, the PTP master node, based on the first indication information and the link delay in the Delay_Req message, corrects the value of the correction field (CF2) in the Delay_Req message to obtain the first delay. It then sends an announcement message or a delay response message to the PTP slave node, carrying t4 (i.e., the first reception time) and the first delay. In the announcement message or delay response message, CF2 represents the first delay.
[0322] Furthermore, based on the fourth and second indication information, the PTP master node determines that it needs to parse the current delay request message to obtain t3. After obtaining t3, the PTP master node can determine the time synchronization performance of the PTP slave node based on t4, t3, and the first delay. The t3 mentioned here corresponds to the first transmission time in the above embodiment.
[0323] If the second PTP message sent by the PTP master node to the PTP slave node is a delayed response message, then in one example, as shown in Figure 5c, the delayed response message includes the clock quality information of the PTP master node.
[0324] In another example, if the delayed response message does not include the clock quality information of the PTP master node, the PTP master node can also send an announcement message to the PTP slave node to announce its own clock quality information to the PTP slave node, which will not be elaborated here.
[0325] Referring to Figure 5d, this figure is a schematic diagram of signaling interaction for another synchronization method provided in an embodiment of this application.
[0326] As shown in Figure 5d:
[0327] 1. The PTP slave node sends a Delay_Req message to the PTP master node. This Delay_Req message is equivalent to the first PTP message in the method shown in Figure 2. Wherein:
[0328] In Figure 5d, the flag field 0.7 represents the 7th bit of the 0th byte of the flag field of the Delay_Req message. The value of the flag field 0.7 is 1, which corresponds to the aforementioned first indication information, indicating that the link delay is corrected based on the Delay_Req message.
[0329] If the transmission path of the Delay_Req message includes a TC node, the TC node will correct the value of the correction field (corresponding to CF2) in the Delay_Req message based on the link delay and its own forwarding delay for forwarding the Delay_Req message.
[0330] For details on the operations performed by the TC node, please refer to the description of the method shown in Figure 3 above; the description will not be repeated here.
[0331] In Figure 5d, flag field 1.7 represents the 7th bit of the 1st byte of the flag field of the Delay_Req message. The value of flag field 1.7 is 1, which corresponds to the aforementioned fourth indication information, indicating the time to send the delay request message to the PTP master node.
[0332] The two-step flag field of the Delay_Req message is 1, corresponding to the fifth indication information mentioned above, indicating that the current delay request message carries the sending time t3pre of the previous delay request message.
[0333] 2. The PTP master node sends an announcement message or a delayed response message to the PTP slave node.
[0334] The notification message and delayed response message mentioned here are equivalent to the second PTP message in the above embodiments.
[0335] After receiving the Delay_Req message, the PTP master node, based on the first indication information and the link delay in the Delay_Req message, corrects the value of the correction field (CF2) in the Delay_Req message to obtain the first delay. It then sends an announcement message or a delay response message to the PTP slave node, carrying t4 (i.e., the first reception time) and the first delay. In the announcement message or delay response message, CF2 represents the first delay.
[0336] Furthermore, based on the fourth and second indication information, the PTP master node determines that it needs to parse the current delay request message to obtain t3pre. After obtaining t3pre, the PTP master node can determine the time synchronization performance of the PTP slave node based on t4pre, t3pre, and the fourth delay. Here, t3pre corresponds to the second transmission time in the above embodiment, t4pre is the time when the PTP master node receives the previous delay request message, and the fourth delay is the transmission delay of the previous delay request message between the PTP slave node and the PTP master node.
[0337] If the second PTP message sent by the PTP master node to the PTP slave node is a delayed response message, then in one example, as shown in Figure 5d, the delayed response message includes the clock quality information of the PTP master node.
[0338] In another example, if the delayed response message does not include the clock quality information of the PTP master node, the PTP master node can also send an announcement message to the PTP slave node to announce its own clock quality information to the PTP slave node, which will not be elaborated here.
[0339] Referring to Figure 5e, this figure is a schematic diagram of signaling interaction of a synchronization method provided in an embodiment of this application.
[0340] As shown in Figure 5e:
[0341] 1. The PTP slave node sends a Sync message to the PTP master node. This Sync message can be equivalent to the first PTP message in the method shown in Figure 2. Wherein:
[0342] In Figure 5e, the flag field 0.7 represents the 7th bit of the 0th byte of the flag field of the Sync message. The value of the flag field 0.7 is 1, which corresponds to the aforementioned first indication information, indicating that the link delay is corrected based on the Sync message.
[0343] If the transmission path of the Sync message includes a TC node, the TC node will correct the value of the correction field (corresponding to CF2) in the Sync message based on the link delay and its own forwarding delay for forwarding the Sync message.
[0344] For details on the operations performed by the TC node, please refer to the description of the method shown in Figure 3 above; the description will not be repeated here.
[0345] In Figure 5e, flag field 1.7 represents the 7th bit of the 1st byte of the flag field of the Sync message. The value of flag field 1.7 is 1, corresponding to the aforementioned fourth indication information, indicating the sending time t1 of the synchronization message to be announced to the PTP master node. The t1 mentioned here corresponds to the first sending time in the above embodiment.
[0346] The value of the two-step flag field in the Sync message is 1, corresponding to the aforementioned second indication information, indicating that the aforementioned t1 is carried by the follow message.
[0347] 2. The PTP master node sends an announcement message or a delayed response message to the PTP slave node.
[0348] The notification message and delayed response message mentioned here are equivalent to the second PTP message in the above embodiments.
[0349] After receiving the Sync message, the PTP master node, based on the first indication information and the link delay in the Sync message, corrects the value of the correction field (CF2) in the Sync message to obtain the first delay. It then sends an announcement message or a delay response message to the PTP slave node, carrying t2 (i.e., the first reception time) and the first delay. In the announcement message or delay response message, CF2 represents the first delay.
[0350] Furthermore, the PTP master node determines, based on the fourth and second indication information, that it needs to parse the follow-up message to obtain t1. After obtaining t1, the PTP master node can determine the time synchronization performance of the PTP slave node based on t2, t1, and the first delay.
[0351] If the second PTP message sent by the PTP master node to the PTP slave node is a delayed response message, then in one example, as shown in Figure 5e, the delayed response message includes the clock quality information of the PTP master node.
[0352] In another example, if the delayed response message does not include the clock quality information of the PTP master node, as shown in Figure 5f, the PTP master node can also send an announcement message to the PTP slave node to announce its own clock quality information to the PTP slave node.
[0353] See Figure 5g, which is a schematic diagram of signaling interaction for another synchronization method provided in an embodiment of this application.
[0354] As shown in Figure 5g:
[0355] 1. The PTP slave node sends a Sync message to the PTP master node. This Sync message can be equivalent to the first PTP message in the method shown in Figure 2. Wherein:
[0356] In Figure 5g, the flag field 0.7 represents the 7th bit of the 0th byte of the flag field of the Sync message. The value of the flag field 0.7 is 1, which corresponds to the aforementioned first indication information, indicating that the link delay is corrected based on the Sync message.
[0357] If the transmission path of the Sync message includes a TC node, the TC node will correct the value of the correction field (corresponding to CF2) in the Sync message based on the link delay and its own forwarding delay for forwarding the Sync message.
[0358] For details on the operations performed by the TC node, please refer to the description of the method shown in Figure 3 above; the description will not be repeated here.
[0359] In Figure 5g, flag field 1.7 represents the 7th bit of the 1st byte of the flag field field of the Sync message. The value of flag field 1.7 is 1, which corresponds to the aforementioned fourth indication information, indicating the time t1 for announcing the transmission of the synchronization message to the PTP master node.
[0360] The value of the two-step flag field in the Sync message is 0, corresponding to the aforementioned second indication information, indicating that the aforementioned t1 is carried through the synchronization message.
[0361] 2. The PTP master node sends an announcement message or a delayed response message to the PTP slave node.
[0362] The notification message and delayed response message mentioned here are equivalent to the second PTP message in the above embodiments.
[0363] After receiving the Sync message, the PTP master node, based on the first indication information and the link delay in the Sync message, corrects the value of the correction field (CF2) in the Sync message to obtain the first delay. It then sends an announcement message or a delay response message to the PTP slave node, carrying t2 (i.e., the first reception time) and the first delay. In the announcement message or delay response message, CF2 represents the first delay.
[0364] Furthermore, the PTP master node, based on the fourth and second indication information, determines that it needs to parse the current synchronization message to obtain t1. After obtaining t1, the PTP master node can determine the time synchronization performance of the PTP slave node based on t2, t1, and the first delay. The t1 mentioned here corresponds to the first transmission time in the above embodiment.
[0365] If the second PTP message sent by the PTP master node to the PTP slave node is a delayed response message, then in one example, as shown in Figure 5g, the delayed response message includes the clock quality information of the PTP master node.
[0366] In another example, if the delayed response message does not include the clock quality information of the PTP master node, the PTP master node can also send an announcement message to the PTP slave node to announce its own clock quality information to the PTP slave node, which will not be elaborated here.
[0367] See Figure 5h, which is a schematic diagram of signaling interaction for another synchronization method provided in an embodiment of this application.
[0368] As shown in Figure 5h:
[0369] 1. The PTP slave node sends a Sync message to the PTP master node. This Sync message can be equivalent to the first PTP message in the method shown in Figure 2. Wherein:
[0370] In Figure 5h, the flag field 0.7 represents the 7th bit of the 0th byte of the flag field of the Sync message. The value of the flag field 0.7 is 1, which corresponds to the aforementioned first indication information, indicating that the link delay is corrected based on the Sync message.
[0371] If the transmission path of the Sync message includes a TC node, the TC node will correct the value of the correction field (corresponding to CF2) in the Sync message based on the link delay and its own forwarding delay for forwarding the Sync message.
[0372] For details on the operations performed by the TC node, please refer to the description of the method shown in Figure 3 above; the description will not be repeated here.
[0373] In Figure 5h, flag field 1.7 represents the 7th bit of the 1st byte of the flag field field of the Sync message. The value of flag field 1.7 is 1, which corresponds to the aforementioned fourth indication information, indicating the time of sending the synchronization message to the PTP master node.
[0374] The value of the two-step flag field of the Sync message is 1, corresponding to the fifth indication information mentioned above, indicating that the current synchronization message carries the sending time t1pre of the previous synchronization message.
[0375] 2. The PTP master node sends an announcement message or a delayed response message to the PTP slave node.
[0376] The notification message and delayed response message mentioned here are equivalent to the second PTP message in the above embodiments.
[0377] After receiving the Sync message, the PTP master node, based on the first indication information and the link delay in the Sync message, corrects the value of the correction field (CF2) in the Sync message to obtain the first delay. It then sends an announcement message or a delay response message to the PTP slave node, carrying t2 (i.e., the first reception time) and the first delay. In the announcement message or delay response message, CF2 represents the first delay.
[0378] Furthermore, the PTP master node, based on the fourth and second indication information, determines that it needs to parse the current synchronization message to obtain t1pre. After obtaining t1pre, the PTP master node can determine the time synchronization performance of the PTP slave node based on t2pre, t1pre, and the fourth delay. Here, t1pre corresponds to the second transmission time in the above embodiment, t2pre is the time when the PTP master node receives the previous synchronization message, and the fourth delay is the transmission delay of the previous synchronization message between the PTP slave node and the PTP master node.
[0379] If the second PTP message sent by the PTP master node to the PTP slave node is a delayed response message, then in one example, as shown in Figure 5h, the delayed response message includes the clock quality information of the PTP master node.
[0380] In another example, if the delayed response message does not include the clock quality information of the PTP master node, the PTP master node can also send an announcement message to the PTP slave node to announce its own clock quality information to the PTP slave node, which will not be elaborated here.
[0381] It should be noted that although the above description uses the application of this solution to the IEEE 1588 protocol as an example, the solution provided in this application embodiment can also be applied to other standards. For example, the International Telecommunication Union (ITU) has defined two 1588 telecommunications profiles based on IEEE 1588, applicable to the telecommunications field, to meet the high-precision frequency synchronization and high-precision time synchronization requirements of base stations for the 4th generation mobile communication technology (4G) and the 5th generation mobile communication technology (5G). These two 1588 telecommunications profiles are ITU-T G.8265.1 and ITU-T G.8275.2, respectively. In ITU-T G.8265.1 and ITU-T G.8275.2, the "T" in "-T" stands for Telecommunication. The method provided in this application embodiment can also be applied to ITU-T G.8265.1 and ITU-T G.8275.2.
[0382] When this solution is applied to ITU-T G.8265.1, the PTP master node can correspond to the packet-based equipment clock master (PEC-M), and the PTP slave node can correspond to the packet-based equipment clock slave (PEC-S). Accordingly, in this scenario, this solution can improve the performance of frequency synchronization using ITU-T G.8265.1.
[0383] When this solution is applied to ITU-T G.8275.2, the PTP master node can correspond to a telecom grandmaster (T-GM); the PTP slave node can correspond to a telecom time slave clock for partial timing support (T-TSC-P). Accordingly, in this scenario, this solution can improve the performance of frequency synchronization and time synchronization using ITU-T G.8275.2.
[0384] Based on the synchronization method provided in the above embodiments, this application also provides a corresponding device, which will be described below with reference to the accompanying drawings.
[0385] Referring to Figure 6, this figure is a schematic diagram of the structure of a synchronization device provided in an embodiment of this application. The synchronization device 600 shown in Figure 6 is applied to a PTP slave node and is used to execute the method steps provided in the above embodiments by the PTP slave node.
[0386] As shown in Figure 6, the device 600 includes: a transmitting unit 601, a receiving unit 602, and a processing unit 603.
[0387] The sending unit 601 is used to send a first PTP message to the PTP master node and generate a first sending time for the first PTP message.
[0388] The receiving unit 602 is configured to receive a second PTP message sent by the PTP master node. The second PTP message includes a first receiving time and a first delay. The first receiving time is the time it takes for the PTP master node to receive the first PTP message. The first delay includes the cumulative value of the forwarding delay of the PTP node forwarding the first PTP message and the link delay between PTP nodes on the transmission path of the first PTP message; or, the first delay includes the link delay between PTP nodes on the transmission path of the first PTP message; the transmission path is the path from the PTP slave node to the PTP master node.
[0389] The processing unit 603 is used to perform time synchronization or frequency synchronization based on the first sending time, the first receiving time, and the first delay.
[0390] In one possible implementation, the first PTP message includes first indication information indicating a correction based on the link delay of the first PTP message.
[0391] In one possible implementation, the first PTP message includes either a first delay request message or a first synchronization message.
[0392] In one possible implementation, the second PTP message includes: a first announcement message, or a delayed response message.
[0393] In one possible implementation, the first notification message includes an originTimestamp field and a correctionField field, wherein the first reception time is carried through the originTimestamp field and the first delay is carried through the correctionField field.
[0394] In one possible implementation, the delayed response message also includes clock quality information, which is used to indicate the clock quality of the PTP master node.
[0395] In one possible implementation, the sending unit 601 is further configured to: notify the PTP master node of the first sending time.
[0396] In one possible implementation, the first transmission time is carried in either the first PTP message or the third PTP message, wherein the third PTP message is a PTP message sent by the PTP slave node to the PTP master node after sending the first PTP message.
[0397] In one possible implementation, the first PTP message is a first delay request message, and the third PTP message is either a delay request follow-up message or a second delay request message, wherein the second delay request message is the next delay request message sent by the PTP slave node to the PTP master node after sending the first delay request message; or, the first PTP message is a first synchronization message, and the third PTP message is either a follow-up message or a second synchronization message, wherein the second synchronization message is the next synchronization message sent by the PTP slave node to the PTP master node after sending the first synchronization message.
[0398] In one possible implementation, the first PTP message further includes second indication information, or the third PTP message further includes third indication information, wherein: the first PTP message is a first delay request message, the third PTP message is a delay request follow-up message, and the second indication information is used to indicate that the delay request follow-up message or the first delay request message carries the first transmission time; or, the first PTP message is a first synchronization message, the third PTP message is a follow-up message, and the second indication information is used to indicate that the follow-up message or the first synchronization message carries the first transmission time. Time; or, the third PTP message is the second delay request message, and the first sending time is carried in the second delay request message, the third indication information is used to indicate the sending time of the previous delay request message sent by the PTP slave node in the second delay request message; or, the third PTP message is the second synchronization message, and the first sending time is carried in the second synchronization message, the third indication information is used to indicate the sending time of the previous synchronization message sent by the PTP slave node in the second synchronization message.
[0399] In one possible implementation, the first PTP message further includes fourth indication information, which instructs the PTP slave node to notify the PTP master node of the transmission time of the target PTP message sent by the PTP slave node, wherein the target PTP message is a PTP message of the same type as the first PTP message.
[0400] Referring to Figure 7, which is a schematic diagram of another synchronization device provided in an embodiment of this application. As shown in Figure 7, the device 700 includes a receiving unit 701 and a transmitting unit 702.
[0401] In one example, the synchronization device 700 shown in Figure 7 is applied to a PTP master node to execute the method steps provided in the above embodiments performed by the PTP master node. In this case:
[0402] The receiving unit 701 is used to receive the first PTP message sent by the PTP slave node.
[0403] The sending unit 702 is configured to send a second PTP message to the PTP slave node. The second PTP message includes a first reception time and a first delay. The first reception time is the time when the PTP master node receives the first PTP message. The first delay includes the cumulative value of the forwarding delay of the PTP node forwarding the first PTP message and the link delay between PTP nodes on the transmission path of the first PTP message; or, the first delay includes the link delay between PTP nodes on the transmission path of the first PTP message; the transmission path is the path from the PTP slave node to the PTP master node.
[0404] In one possible implementation, the first PTP message includes first indication information indicating a correction based on the link delay of the first PTP message.
[0405] In one possible implementation, the apparatus further includes a processing unit configured to: determine the link delay of a first link before sending the second PTP message to the PTP slave node, wherein the first link is a link from the first PTP node to the PTP master node, and the first PTP node is the node that supports PTP that is the previous hop of the PTP master node on the transmission path of the first PTP message; obtain the first delay based on the link delay of the first link; and obtain the second PTP message based on the first delay and a first reception time.
[0406] In one possible implementation, the first PTP node is the PTP slave node, and obtaining the first delay based on the link delay of the first link includes: using the link delay of the first link as the first delay.
[0407] In one possible implementation, the first PTP node is a first TC node, and obtaining the first delay based on the link delay of the first link includes: accumulating the second delay and the link delay of the first link to obtain the first delay, wherein the first PTP message carries the second delay, and the second delay is the transmission delay of the first PTP message between the PTP slave node and the first TC node.
[0408] In one possible implementation, the first PTP message includes either a first delay request message or a first synchronization message.
[0409] In one possible implementation, the second PTP message includes: a first announcement message, or a delayed response message.
[0410] In one possible implementation, the second PTP message is the delayed response message, and the sending unit 702 is further configured to: in response to receiving the first PTP message, send a second notification message to the PTP slave node, the second notification message being used to notify the clock quality of the PTP master node.
[0411] In one possible implementation, the delayed response message also includes clock quality information, which is used to indicate the clock quality of the PTP master node.
[0412] In one possible implementation, the receiving unit 701 is further configured to: receive the first transmission time announced by the PTP slave node.
[0413] In one possible implementation, the first transmission time is carried in either the first PTP message or the third PTP message, wherein the third PTP message is a PTP message sent by the PTP slave node to the PTP master node after sending the first PTP message.
[0414] In one possible implementation, the first PTP message is a first delay request message, and the third PTP message is either a delay request follow-up message or a second delay request message, wherein the second delay request message is the next delay request message sent by the PTP slave node to the PTP master node after sending the first delay request message; or, the first PTP message is a first synchronization message, and the third PTP message is either a follow-up message or a second synchronization message, wherein the second synchronization message is the next synchronization message sent by the PTP slave node to the PTP master node after sending the first synchronization message.
[0415] In one possible implementation, the first PTP message further includes second indication information, or the third PTP message further includes third indication information, wherein: the first PTP message is a first delay request message, the third PTP message is a delay request follow-up message, and the second indication information is used to indicate that the delay request follow-up message or the first delay request message carries the first transmission time; or, the first PTP message is a first synchronization message, the third PTP message is a follow-up message, and the second indication information is used to indicate that the follow-up message or the first synchronization message carries the first transmission time. Time; or, the third PTP message is the second delay request message, and the first sending time is carried in the second delay request message, the third indication information is used to indicate the sending time of the previous delay request message sent by the PTP slave node in the second delay request message; or, the third PTP message is the second synchronization message, and the first sending time is carried in the second synchronization message, the third indication information is used to indicate the sending time of the previous synchronization message sent by the PTP slave node in the second synchronization message.
[0416] In one possible implementation, the first PTP message further includes fourth indication information, which instructs the PTP slave node to notify the PTP master node of the transmission time of the target PTP message sent by the PTP slave node, wherein the target PTP message is a PTP message of the same type as the first PTP message.
[0417] In one possible implementation, the processing unit of the apparatus is further configured to: determine the synchronization performance of the PTP slave node based on the first transmission time, the synchronization performance including time synchronization performance and / or frequency synchronization performance.
[0418] In one possible implementation, the processing unit is specifically configured to: determine the synchronization performance of the PTP slave node based on the first transmission time, the first reception time, and the first delay.
[0419] In another example, the synchronization device 700 shown in Figure 7 is applied to the first TC node to execute the method steps provided in the above embodiments performed by the first TC node. In this case:
[0420] The receiving unit 701 is used to receive a first PTP message sent by a PTP slave node. The first PTP message includes a first field, and the first field carries a third delay.
[0421] The sending unit 702 is used to send the updated first PTP message. The first field of the updated first PTP message carries a second delay. The second delay is obtained by adding the forwarding delay of the first TC node forwarding the first PTP message, the link delay of the second link, and the third delay. The second link is the link delay from the second PTP node to the first TC node. The second PTP node is the node that supports PTP on the previous hop of the first TC node on the transmission path of the first PTP message.
[0422] In one possible implementation, the second PTP node is the PTP slave node, the third delay is 0, or the third delay includes part of the information of the first transmission time; or, the second PTP node is the second TC node, and the third delay is the transmission delay of the first PTP message between the PTP slave node and the second TC node.
[0423] In one possible implementation, the first PTP message includes first indication information indicating a correction based on the link delay of the first PTP message.
[0424] In one possible implementation, the first PTP message includes either a first delay request message or a first synchronization message.
[0425] In one possible implementation, the receiving unit 701 is further configured to: receive a second PTP message sent by a PTP master node, the second PTP message including a first receiving time and a first delay, the first receiving time being the time when the PTP master node receives the first PTP message, the first delay including: the cumulative value of the forwarding delay of the PTP node forwarding the first PTP message and the link delay between PTP nodes on the transmission path of the first PTP message; or, the first delay including: the link delay between PTP nodes on the transmission path of the first PTP message; the transmission path being the path from the PTP slave node to the PTP master node; the sending unit 702 is further configured to send the second PTP message to the PTP slave node.
[0426] In one possible implementation, the second PTP message includes: a first announcement message, or a delayed response message.
[0427] In one possible implementation, the delayed response message also includes clock quality information, which is used to indicate the clock quality of the PTP master node.
[0428] For details on the specific implementation of each unit of the devices 600 and 700, please refer to the relevant descriptions in the above method embodiments; they will not be repeated here.
[0429] Please refer to Figure 8, which is a schematic diagram of the structure of a device provided in an embodiment of this application. The structures of both the first device and the target device can be as shown in Figure 8. The device 800 shown in Figure 8 includes: a processor 810, a communication interface 820, and a memory 830. The number of processors 810 in the device 800 can be one or more; Figure 8 shows an example of one processor. In this embodiment of the application, the processor 810, the communication interface 820, and the memory 830 can be connected via a bus system or other means; Figure 8 shows an example of connection via a bus system 840.
[0430] Processor 810 may be a CPU, NP, or a combination of CPU and NP. Processor 810 may further include hardware chips. The aforementioned hardware chips may be ASICs, programmable logic devices (PLDs), or combinations thereof. The aforementioned PLDs may be complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), generic array logic (GALs), or any combination thereof.
[0431] The memory 830 may include volatile memory, such as random-access memory (RAM); the memory 830 may also include non-volatile memory, such as flash memory, hard disk drive (HDD) or solid-state drive (SSD); the memory 830 may also include a combination of the above types of memory.
[0432] Optionally, the memory 830 stores an operating system and programs, executable modules, or data structures, or subsets thereof, or extended sets thereof. The programs may include various operation instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and handling hardware-based tasks. The processor 810 can read the programs in the memory 830 to implement the methods provided in the embodiments of this application (e.g., the methods shown in any one of the aforementioned figures 2, 3, 4, and 5a to 5h).
[0433] The bus system 840 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus system 840 can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used in Figure 8, but this does not indicate that there is only one bus or one type of bus.
[0434] This application provides a computer-readable storage medium, including instructions or a computer program, which, when run on a computer, causes the computer to perform the methods described in the above-described method embodiments. For example, the computer is caused to perform the methods shown in any one of the figures 2, 3, 4, and 5a to 5h.
[0435] This application provides a computer program product containing instructions or a computer program, which, when run on a computer, causes the computer to perform the methods described in the above-described method embodiments. For example, it causes the computer to perform the methods shown in any one of the figures 2, 3, 4, and 5a to 5h.
[0436] This application also provides a communication system, which may include at least one of the PTP master node, PTP slave node and first TC node mentioned in the above embodiments, for executing the method steps provided in the above embodiments executed by at least one of the PTP master node, PTP slave node and first TC node.
[0437] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0438] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0439] In the embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical business division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0440] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0441] Furthermore, the various business units in the embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software business unit.
[0442] If the integrated unit is implemented as a software business unit and sold or used as a separate product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0443] Those skilled in the art will recognize that, in one or more of the examples above, the services described in this invention can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these services can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of computer programs from one place to another. Storage media can be any available medium accessible to general-purpose or special-purpose computers.
[0444] The above specific embodiments further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above are merely specific embodiments of the present invention.
[0445] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A synchronization method, characterized in that, The method, applied to a Precision Time Protocol (PTP) slave node, includes: Send the first PTP message to the PTP master node and generate the first transmission time of the first PTP message; The system receives a second PTP message sent by the PTP master node. The second PTP message includes a first reception time and a first delay. The first reception time is the time it takes for the PTP master node to receive the first PTP message. The first delay includes the cumulative value of the forwarding delay of the PTP node forwarding the first PTP message and the link delay between PTP nodes on the transmission path of the first PTP message; or, the first delay includes the link delay between PTP nodes on the transmission path of the first PTP message; the transmission path is the path from the PTP slave node to the PTP master node. Time synchronization or frequency synchronization is performed based on the first sending time, the first receiving time, and the first delay.
2. The method according to claim 1, characterized in that, The first PTP message includes first indication information, which indicates that the link latency should be corrected based on the first PTP message.
3. The method according to claim 1 or 2, characterized in that, The first PTP message includes: The first delay request message or the first synchronization message.
4. The method according to any one of claims 1-3, characterized in that, The second PTP message includes: The first notification message, or a delayed response message.
5. The method according to claim 4, characterized in that, The first notification message includes an originTimestamp field and a correctionField field. The first reception time is carried through the originTimestamp field, and the first delay is carried through the correctionField field.
6. The method according to claim 4, characterized in that, The delayed response message also includes clock quality information, which is used to indicate the clock quality of the PTP master node.
7. The method according to any one of claims 1-6, characterized in that, The method further includes: The first transmission time is announced to the PTP master node.
8. The method according to claim 7, characterized in that, The first transmission time is carried in either the first PTP message or the third PTP message. The third PTP message is a PTP message sent by the PTP slave node to the PTP master node after sending the first PTP message.
9. The method according to claim 8, characterized in that, The first PTP message is a first delay request message, and the third PTP message is either a delay request follow-up message or a second delay request message. The second delay request message is the next delay request message sent by the PTP slave node to the PTP master node after sending the first delay request message. Alternatively, the first PTP message may be a first synchronization message, and the third PTP message may be a follow-up message or a second synchronization message, wherein the second synchronization message is the next synchronization message sent by the PTP slave node to the PTP master node after sending the first synchronization message.
10. The method according to claim 9, characterized in that, The first PTP message further includes second indication information, or the third PTP message further includes third indication information, wherein: The first PTP message is a first delay request message, the third PTP message is a delay request follow-up message, and the second indication information is used to indicate that the delay request follow-up message or the first delay request message carries the first transmission time; or... The first PTP message is a first synchronization message, the third PTP message is a follow-up message, and the second indication information is used to indicate that the follow-up message or the first synchronization message carries the first transmission time; or... The third PTP message is the second delay request message, and the first transmission time is carried in the second delay request message. The third indication information is used to indicate the transmission time of the preceding delay request message sent by the PTP slave node in the second delay request message; or... The third PTP message is the second synchronization message, and the first sending time is carried in the second synchronization message. The third indication information is used to indicate the sending time of the previous synchronization message of the second synchronization message, which is carried in the second synchronization message and sent by the PTP slave node.
11. The method according to any one of claims 7-10, characterized in that, The first PTP message also includes fourth indication information, which instructs the PTP slave node to notify the PTP master node of the transmission time of the target PTP message sent by the PTP slave node, wherein the target PTP message is a PTP message of the same type as the first PTP message.
12. A synchronization method, characterized in that, The method, applied to a Precision Time Protocol (PTP) master node, includes: Receive the first PTP message sent by the PTP slave node; A second PTP message is sent to the PTP slave node. The second PTP message includes a first reception time and a first delay. The first reception time is the time when the PTP master node receives the first PTP message. The first delay includes the cumulative value of the forwarding delay of the PTP node forwarding the first PTP message and the link delay between PTP nodes on the transmission path of the first PTP message; or, the first delay includes the link delay between PTP nodes on the transmission path of the first PTP message; the transmission path is the path from the PTP slave node to the PTP master node.
13. The method according to claim 12, characterized in that, The first PTP message includes first indication information, which indicates that the link latency should be corrected based on the first PTP message.
14. The method according to claim 12 or 13, characterized in that, Before sending the second PTP message to the PTP slave node, the method further includes: Determine the link delay of the first link, which is the link from the first PTP node to the PTP master node, and the first PTP node is the node that supports PTP on the previous hop of the PTP master node on the transmission path of the first PTP message. The first delay is obtained based on the link delay of the first link; The second PTP message is obtained based on the first delay and the first reception time.
15. The method according to claim 14, characterized in that, The first PTP node is the PTP slave node, and the step of obtaining the first delay based on the link delay of the first link includes: The link delay of the first link is taken as the first delay.
16. The method according to claim 14, characterized in that, The first PTP node is the first TC node, and the step of obtaining the first delay based on the link delay of the first link includes: The second delay is summed with the link delay of the first link to obtain the first delay. The second delay is carried in the first PTP message. The second delay is the transmission delay of the first PTP message between the PTP slave node and the first TC node.
17. The method according to any one of claims 12-16, characterized in that, The first PTP message includes: The first delay request message or the first synchronization message.
18. The method according to any one of claims 12-17, characterized in that, The second PTP message includes: The first notification message, or a delayed response message.
19. The method according to claim 18, characterized in that, The second PTP message is the delayed response message, and the method further includes: In response to receiving the first PTP message, a second notification message is sent to the PTP slave node, the second notification message being used to notify the clock quality of the PTP master node.
20. The method according to claim 18, characterized in that, The delayed response message also includes clock quality information, which is used to indicate the clock quality of the PTP master node.
21. The method according to any one of claims 12-20, characterized in that, The method further includes: The first transmission time announced by the PTP slave node is received.
22. The method according to claim 21, characterized in that, The first transmission time is carried in either the first PTP message or the third PTP message. The third PTP message is a PTP message sent by the PTP slave node to the PTP master node after sending the first PTP message.
23. The method according to claim 22, characterized in that, The first PTP message is a first delay request message, and the third PTP message is either a delay request follow-up message or a second delay request message. The second delay request message is the next delay request message sent by the PTP node to the PTP master node after the PTP node sends the first delay request message. Alternatively, the first PTP message may be a first synchronization message, and the third PTP message may be a follow-up message or a second synchronization message, wherein the second synchronization message is the next synchronization message sent by the PTP slave node to the PTP master node after sending the first synchronization message.
24. The method according to claim 23, characterized in that, The first PTP message further includes second indication information, or the third PTP message further includes third indication information, wherein: The first PTP message is a first delay request message, the third PTP message is a delay request follow-up message, and the second indication information is used to indicate that the delay request follow-up message or the first delay request message carries the first transmission time; or... The first PTP message is a first synchronization message, the third PTP message is a follow-up message, and the second indication information is used to indicate that the follow-up message or the first synchronization message carries the first transmission time; or... The third PTP message is the second delay request message, and the first transmission time is carried in the second delay request message. The third indication information is used to indicate the transmission time of the preceding delay request message sent by the PTP slave node in the second delay request message; or... The third PTP message is the second synchronization message, and the first sending time is carried in the second synchronization message. The third indication information is used to indicate the sending time of the previous synchronization message of the second synchronization message, which is carried in the second synchronization message and sent by the PTP slave node.
25. The method according to any one of claims 21-24, characterized in that, The first PTP message also includes fourth indication information, which instructs the PTP slave node to notify the PTP master node of the transmission time of the target PTP message sent by the PTP slave node, wherein the target PTP message is a PTP message of the same type as the first PTP message.
26. The method according to any one of claims 21-25, characterized in that, The method further includes: Based on the first transmission time, the synchronization performance of the PTP slave node is determined, and the synchronization performance includes time synchronization performance and / or frequency synchronization performance.
27. The method according to claim 26, characterized in that, Based on the target transmission time, the synchronization performance of the PTP slave node is determined, including: The synchronization performance of the PTP slave node is determined based on the first transmission time, the first reception time, and the first delay.
28. A synchronization method, characterized in that, Applied to the first transparent clock TC node, the method includes: Receive a first PTP message sent by a PTP slave node, the first PTP message including a first field, the first field carrying a third delay; Send an updated first PTP message, the first field of which carries a second delay. The second delay is obtained by adding the forwarding delay of the first TC node forwarding the first PTP message, the link delay of the second link, and the third delay. The second link is the link delay from the second PTP node to the first TC node. The second PTP node is the node that supports PTP that is the previous hop of the first TC node on the transmission path of the first PTP message.
29. The method according to claim 28, characterized in that, The second PTP node is the PTP slave node, and the third delay is 0, or the third delay includes part of the information of the first transmission time; or, The second PTP node is the second TC node, and the third delay is the transmission delay of the first PTP message between the PTP slave node and the second TC node.
30. The method according to claim 28 or 29, characterized in that, The first PTP message includes first indication information, which indicates that the link latency should be corrected based on the first PTP message.
31. The method according to any one of claims 28-30, characterized in that, The first PTP message includes: The first delay request message or the first synchronization message.
32. The method according to any one of claims 28-31, characterized in that, The method further includes: The PTP master node receives a second PTP message, which includes a first reception time and a first delay. The first reception time is the time it takes for the PTP master node to receive the first PTP message. The first delay includes the cumulative value of the forwarding delay of the PTP node that forwards the first PTP message and the link delay between PTP nodes on the transmission path of the first PTP message; or, the first delay includes the link delay between PTP nodes on the transmission path of the first PTP message; the transmission path is the path from the PTP slave node to the PTP master node. Send the second PTP message to the PTP slave node.
33. The method according to claim 32, characterized in that, The second PTP message includes: The first notification message, or a delayed response message.
34. The method according to claim 33, characterized in that, The delayed response message also includes clock quality information, which is used to indicate the clock quality of the PTP master node.
35. A communication device, characterized in that, The device includes at least one functional module that interacts with each other to implement the method as described in any one of claims 1-34.
36. A communication system, characterized in that, The communication system includes one or more of the following: The PTP slave node that performs the method according to any one of claims 1-11, the PTP master node that performs the method according to any one of claims 12-27, and the first TC node that performs the method according to any one of claims 28-34.
37. A communication device comprising a processor and a memory, the memory for storing program code, the processor for calling the program code in the memory to cause the communication device to perform the method as described in any one of claims 1-34.
38. A computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-34.
39. A computer program product, characterized in that, The computer program product includes instructions or a computer program that, when run on a computer, causes the computer to perform the method described in any one of claims 1-34.
Citation Information
Patent Citations
Method for realizing accurate time synchronization by utilizing IEEE1588 protocol
CN101834712A
Clock synchronization method, system and equipment based on PTP
CN103441832A
Time synchronization error compensation method for multi-hop wireless backhaul network based on PTP protocol
CN106921456A
Clock synchronization mode indication method and communication device
CN115699918A
Clock synchronization method and device
CN116170105A