WO2011160595A1 - Method, slave clock node and system for selecting master clock node based on precision time protocol (ptp) and link quality - Google Patents

Method, slave clock node and system for selecting master clock node based on precision time protocol (ptp) and link quality Download PDF

Info

Publication number
WO2011160595A1
WO2011160595A1 PCT/CN2011/076233 CN2011076233W WO2011160595A1 WO 2011160595 A1 WO2011160595 A1 WO 2011160595A1 CN 2011076233 W CN2011076233 W CN 2011076233W WO 2011160595 A1 WO2011160595 A1 WO 2011160595A1
Authority
WO
WIPO (PCT)
Prior art keywords
clock node
link
delay
value
master clock
Prior art date
Application number
PCT/CN2011/076233
Other languages
French (fr)
Chinese (zh)
Inventor
常伟
廖俊锋
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2011160595A1 publication Critical patent/WO2011160595A1/en

Links

Classifications

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

Definitions

  • the present invention relates to the field of mobile communications, and in particular, to a method, a slave clock node and a system for selecting a master clock node based on a precision clock synchronization protocol (TM) and link quality.
  • TM precision clock synchronization protocol
  • clock synchronization In the field of mobile network technology, there is a strict requirement for high-precision clock synchronization.
  • the purpose of clock synchronization is to synchronize the clocks of nodes in the network to the same reference.
  • Frequency Division Duplex such as Universal Mobile Telecommunications System (UMTS)
  • UMTS Universal Mobile Telecommunications System
  • TDD Time Division Duplexing
  • the wireless system such as Time Division-Synchronous Code Division Multiple Access (CDMA) or Code Division Multiple Access (CDMA) requires synchronization of the clock frequency and phase.
  • CDMA Time Division-Synchronous Code Division Multiple Access
  • CDMA Code Division Multiple Access
  • Clock synchronization through PTP protocol includes establishing master-slave hierarchy and clock synchronization Stages.
  • PTP first organizes the clock nodes in the network into the synchronization level of the master clock-Slave Clock.
  • the master clock node provides the standard clock, and the local time is released to the network at regular intervals.
  • the time information sent by the master clock node is received, and after the correlation calculation is performed, the time of the clock node is synchronized to the master clock node.
  • a slave clock node can connect multiple potential master clock nodes through a switch, for how to resolve multiple potential master clock nodes (such as n master clocks as shown in Figure 1)
  • Node, n is an integer greater than 1)
  • a master clock node is selected as its primary clock node for time synchronization.
  • the PTP protocol proposes the best master clock algorithm (BMC) to determine the master-slave relationship.
  • the BMC needs to complete the determining the master-slave relationship based on the announce message.
  • the announcement message has data describing the clock characteristics. The characteristics mainly include the clock quality of the master clock node (the clock level of the user-configured clock level and the clock accuracy, etc.). Does not involve link information).
  • the data set comparison algorithm in the BMC is used to compare the data set in the notification message received by all the ports, select one master clock node, and then use the state decision algorithm to determine each clock. Status (Master Or Slave).
  • the time synchronization is performed between the master clock node and the slave clock node through the interaction time packet.
  • Four types of messages are defined in the PTP protocol: Synchronous Message (Sync), Follow Message (Follow_up), Delay Request Message (Delay_req), and Delay Response Message (Delay-Resp).
  • the slave clock node uses the above four messages to obtain a time stamp to determine its time offset from the master clock node to adjust its own clock.
  • the timestamp includes a time t1 at which the master clock node sends the synchronization message, a time t2 when the synchronization message is received from the clock node, a time t3 when the delay message is sent from the clock node, and a delay request received by the master clock node.
  • the time t4 of the text, the time offset Offset between the master and slave clock nodes, and the network transmission link delay Delay are as follows: (1) and (2):
  • T2-tl Delay+Offset ( 1 )
  • T4-t3 Delay-Offset ( 2 )
  • the time deviation Offset [(t2-tl )-(t4-t3)]/2 is obtained, and the slave clock node can adjust its own time offset based on the calculated time offset Offset. clock.
  • the traditional private telephone network usually uses the BMC algorithm to select the primary clock node, receives the advertisement packets sent by multiple primary clock nodes from the clock node, and compares the advertisement packets, and selects one of the advertisement packets. The best master clock node.
  • the master clock node in the PTN does not send an advertisement "3 ⁇ 4 text, which causes the problem that the destination master clock node cannot be selected when facing multiple master clock nodes.
  • the prior art BMC algorithm cannot According to the user's needs, the master clock node cannot be selected according to the user's pre-defined selection strategy.
  • the main purpose of the present invention is to provide a method for selecting a master clock node based on PTP and link quality, a slave clock node and a system, and aiming to select a destination master clock node according to the quality of the link to solve the master clock in the traditional PTN.
  • the invention provides a method for selecting a master clock node based on PTP and link quality, and the method comprises the following steps:
  • the link quality selection policy is configured according to the link quality indicator, where the link quality indicator includes: link loss rate, and/or delay jitter, and/or link delay;
  • the link quality selection policy includes: a first strategy for selecting a destination master clock node by using a link loss rate as a first judgment indicator, and using a delay jitter and/or a link delay as a second judgment indicator; Or
  • the selecting a destination master clock node according to the configured link quality selection policy includes:
  • the value of the link loss ratio is obtained, or according to the value of the link loss ratio, or according to the link loss ratio and delay jitter and/or link delay. For the value of time, select the corresponding primary clock node as the destination primary clock node.
  • the selecting a destination master clock node according to the configured link quality selection policy includes:
  • the corresponding master clock node is selected as the destination master clock node.
  • the selecting a destination master clock node according to the configured link quality selection policy includes:
  • the master clock node And receiving, by the master clock node, the synchronization packet that is sent by the interval time and carries a first timestamp indicating a synchronization message sending time; Acquiring a second timestamp indicating the time of receiving the synchronization message; identifying, according to a clock identifier in the synchronization message, a primary clock node that sends the synchronization message, and saving related information of the primary clock node, and Counting the number of received synchronization packets plus one count into the number of received packets;
  • the value of the packet loss rate is calculated according to the number of received packets, and the value of the packet loss rate is a ratio of the number of received packets from the clock node to the theoretical expected value during the duration.
  • the method further includes:
  • the master clock node When the master clock node is a two-step clock, the number of received follow messages is counted in the number of received packets.
  • the present invention provides a slave clock node that selects a master clock node based on PTP and link quality, and the slave clock node includes:
  • a configuration module configured to configure a link quality selection policy according to a link quality indicator, where the link quality indicator includes: a link loss rate, and/or a delay jitter, and/or a link delay;
  • the selecting module is configured to select a destination primary clock node according to the configured link quality selection policy.
  • the link quality selection policy includes: a first strategy for selecting a destination master clock node by using a link loss rate as a first judgment indicator, and using a delay jitter and/or a link delay as a second judgment indicator; Or Taking the delay jitter as the first judgment indicator, and selecting the second strategy of the destination master clock node by using the link loss rate and/or the link delay as the second judgment indicator; or
  • the link loss rate and/or the delay jitter are used as the second judgment indicator to select the third strategy of the destination master clock node.
  • the selecting module comprises:
  • an obtaining unit configured to: when the first policy is used to select a destination primary clock node, obtain a link selection unit, configured to obtain a value of a link loss ratio obtained according to the acquiring unit, or a link loss rate according to a link, and For the value of delay jitter and/or link delay, select the corresponding master clock node as the destination master clock node.
  • the acquiring unit is further configured to: when the target primary clock node is selected by using the second policy, obtain a value of the delay jitter, or obtain a delay jitter, a link loss ratio, and/or a link delay.
  • Time value when the target primary clock node is selected by using the second policy, obtain a value of the delay jitter, or obtain a delay jitter, a link loss ratio, and/or a link delay.
  • the selecting unit is further configured to: according to the value of the delay jitter acquired by the acquiring unit, or the target master clock node.
  • the acquiring unit is further configured to: when selecting the destination primary clock node by using the third policy, obtain a link delay value, or obtain a link delay value and a link loss ratio and/or The value of the delay jitter;
  • the selecting unit is further configured to: according to the value of the link delay acquired by the acquiring unit, or the target master clock node.
  • the acquiring unit includes:
  • a sending subunit configured to send, to the primary clock node corresponding to the slave clock node, a management message or a signal message carrying an interval and duration of the synchronization message sent by the desired primary clock node
  • a receiving subunit configured to receive, by the primary clock node, the synchronization packet that is sent by the interval time and carries a first timestamp indicating a synchronization packet sending time
  • Obtaining a sub-unit configured to acquire a second timestamp indicating a time for receiving the synchronization packet; identifying a primary clock node that sends the synchronization packet according to a clock identifier in the synchronization packet, and saving related information of the primary clock node ;
  • a message counting sub-unit configured to count the number of received synchronization packets plus one count into the number of received messages
  • the sending subunit is further configured to send a delay request message to the primary clock node, where the acquiring subunit is further configured to acquire a third timestamp indicating a sending time of the delayed request message;
  • the receiving subunit is further configured to receive, by the primary clock node, a delayed response packet that includes a fourth timestamp indicating a time when the delay request packet is received;
  • a calculating subunit configured to calculate a value of the link delay according to the first timestamp, the second timestamp, the third timestamp, and the fourth timestamp;
  • the value of the packet loss rate is calculated according to the number of received packets, and the value of the packet loss rate is a ratio of the number of received packets from the clock node to the theoretical expected value in the duration.
  • the ⁇ gram count subunit is further configured to count the number of received follow messages into the number of received packets when the master clock node is a two-step clock.
  • the present invention proposes a system for selecting a master clock node based on PTP and link quality, comprising a slave clock node as described above, and a plurality of master clock nodes connected to the slave clock node through a switch.
  • the invention is based on the method of selecting the master clock node based on the PTP and the link quality, the slave clock node and the system, and configuring the link quality through the user (mainly including the link loss rate, and/or the delay jitter, and/or Or link delay and other indicators) select the policy and combine the policy according to the link quality selected by the user.
  • the PTP protocol selects the destination master clock node, which not only satisfies the user's actual selection requirements, but also improves the selectivity and flexibility when acquiring the master clock node, and solves the problem that the master clock node cannot select the master when the announcement message is not sent in the traditional PTN.
  • the problem with the clock node DRAWINGS
  • FIG. 1 is a schematic diagram of a connection between a master clock node and a slave clock node in an existing mobile network
  • FIG. 2 is a schematic diagram of time synchronization between a master clock node and a slave clock node through an interaction time message in the prior art
  • FIG. 3 is a schematic diagram of a method for selecting a master clock node based on PTP and link quality according to an embodiment of the present invention
  • step 102 is a schematic diagram of a specific process of step 102 in the method for selecting a master clock node based on PTP and link quality shown in FIG. 3;
  • FIG. 5 is a schematic flowchart of obtaining a value of a link loss rate, a delay jitter, and a link delay in a link quality indicator in the foregoing embodiment
  • FIG. 6 is a schematic flow chart of another embodiment of a method for selecting a master clock node based on PTP and link quality according to the present invention.
  • FIG. 7 is a schematic flow chart of still another embodiment of a method for selecting a master clock node based on PTP and link quality according to the present invention.
  • FIG. 8 is a schematic structural diagram of a configuration of a slave clock node according to an embodiment of the present invention for selecting a master clock node based on PTP and link quality;
  • FIG. 9 is a schematic structural diagram of a selection module of a slave clock node selected from a master clock node based on PTP and link quality shown in FIG. 8;
  • FIG. 10 is a schematic diagram showing the structure of a component selected by a module in a slave clock node based on PTP and a link quality selection master clock node shown in FIG. 9;
  • FIG. 10 is a schematic diagram showing the structure of a component selected by a module in a slave clock node based on PTP and a link quality selection master clock node shown in FIG. 9;
  • FIG. 11 is a schematic diagram of a system for selecting a master clock node based on PTP and link quality according to the present invention. Schematic diagram of the composition.
  • the solution of the embodiment of the present invention is as follows: Based on the link quality selection policy configured by the user, the main clock node is selected according to the quality of the link (including the link delay, jitter, or packet loss rate). To solve the problem that the primary clock node in the traditional PTN does not send the advertisement packet and cannot obtain the destination master clock node.
  • the link quality selection policy configured by the user uses the link loss rate as the judgment indicator of the destination master clock node and sets the primary clock node with the smallest link loss rate as the destination master clock node
  • the following method is adopted.
  • Obtaining the destination master clock node The slave clock node sends a management message or a signal message, requires interaction with multiple master clock nodes connected thereto, and then counts the received 1588 interaction packets of the multiple master clock nodes separately, in the predetermined
  • the time between the number of packets actually received and the number of packets expected to be received by the clock node are compared, and the packet loss ratio between the slave clock node and each master clock node is calculated, and one of the packets is selected.
  • the primary clock node with the lowest link loss rate is used as the destination primary clock node.
  • an embodiment of the present invention provides a method for selecting a primary clock node based on PTP and link quality, and the method includes:
  • Step 101 Configure a link quality selection policy according to the link quality indicator.
  • the link quality indicator includes: link loss rate, and/or delay jitter, and/or link delay.
  • the operating environment of the method embodiment includes a slave clock node and a plurality of (multiple) master clock nodes connected to the slave clock node through the switch, when an optimal master clock node, that is, a destination master clock node, needs to be selected for the slave clock node.
  • an optimal master clock node that is, a destination master clock node
  • the user can select the best master clock node according to the link quality. You can select one of the link quality indicators or Two or three to select the primary clock node. For example, the user can configure the link loss rate as the first judgment indicator, and use the delay jitter and/or the link delay as the second judgment indicator to select the target primary clock node.
  • the first strategy or using the delay jitter as the first judgment indicator, using the link loss rate and/or the link delay as the second judgment indicator to select the second strategy of the destination master clock node; or
  • the first determining indicator selects a third policy of the target primary clock node by using the link loss rate and/or the delay jitter as the second determining indicator.
  • the user can select the primary clock node with the lowest link loss rate as the destination primary clock node of the secondary clock node, and at the same time, the link loss rate is the first judgment indicator, with a delay.
  • the jitter and/or link delay is used to select the destination primary clock node for the second judgment indicator, that is, when there are multiple primary clock nodes with the smallest link loss rate, the delay jitter or the link delay may be the second.
  • the primary clock node with the lowest delay or the lowest link delay in the primary clock node with the lowest link loss rate is the primary clock node.
  • the user can pre-configure various indicators in the link quality as required.
  • the threshold is used to select the destination master clock node. For example, the packet loss rate can be less than 10%.
  • Step 102 Select a destination primary clock node according to the configured link quality selection policy.
  • the destination primary clock node is selected according to the configured link quality selection policy. For example, when the primary clock node is selected by using the first policy, the corresponding primary clock node may be selected as the primary clock node according to the minimum value of the link loss rate in the link quality indicator, where the link loss rate is the smallest.
  • the value can be obtained by sending a synchronization packet between the clock node and the primary clock node in the PTP protocol.
  • step 102 may include:
  • Step 1021 When the first primary node is selected by using the first policy, obtain the value of the link loss rate, or obtain the link loss rate, and the value of the delay jitter and/or the link delay.
  • Step 1022 Select a corresponding primary clock node as the destination primary clock node according to the value of the link loss ratio, or according to the link loss ratio and the value of the delay jitter and/or the link delay.
  • the destination primary clock node when the destination primary clock node is selected by using the first policy, the destination primary clock node may be selected according to the value of the link loss ratio, and the link loss rate may be the first judgment indicator. The delay jitter and/or the link delay are used to select the destination primary clock node for the second judgment indicator.
  • the value of the link loss rate is obtained to minimize The primary clock node corresponding to the link loss rate of the value is the destination primary clock node.
  • the delay jitter and/or the link delay are selected as the second judgment indicator.
  • the main clock node for example, there are multiple primary clock nodes with the smallest link loss rate. In this case, the delay jitter or the link delay is the smallest among the primary clock nodes with the smallest packet loss rate.
  • the primary clock node is the destination primary clock node.
  • the specific process of obtaining the value of the link loss rate, the value of the delay jitter, and the value of the link delay in the link quality indicator may include:
  • Step 501 The slave clock node sends a management message or a signal message carrying the interval and duration of the synchronization message sent by the desired master clock node to the corresponding master clock node.
  • Step 502 Receive a synchronization packet that carries the first timestamp sent by the primary clock node in the interval time.
  • the first timestamp is represented by tl, and the first timestamp is the time at which the synchronization packet is sent by the primary clock node.
  • Step 503 Obtain a second timestamp indicating the time of receiving the synchronization packet, identify a primary clock node that sends the synchronization packet according to a clock identifier in the synchronization packet, and perform related information of the primary clock node. Save, and count the number of received synchronization packets plus one count into the number of received messages;
  • the second timestamp is represented by t2, indicating the time when the synchronization message is received from the clock node.
  • Step 504 Send a delay request message to the primary clock node, and obtain a third timestamp indicating a time for sending the delay request message.
  • the third timestamp is represented by t3, indicating the time when the delay request is sent from the clock node.
  • Step 505 When the receiving the primary clock node sends the message indicating that the delay request message is received Delayed response message of the fourth timestamp between;
  • the fourth timestamp is represented by t4, indicating the time when the master clock node receives the delay request message.
  • Step 506 Calculate a value of the link delay according to the first timestamp, the second timestamp, the third timestamp, and the fourth timestamp.
  • the average value of the delay of each link delay is taken as the link delay of the current primary clock node.
  • Step 507 Calculate a value of the delay jitter according to the first timestamp, the second timestamp, the third timestamp, and the fourth timestamp.
  • the difference between the maximum value and the minimum value of the delay value of each link delay is the value of the delay jitter, and the value of the delay jitter is used as the delay of the current master clock node.
  • the value of the jitter is selected, when the destination clock node is selected by using the delay jitter as the index, the master clock node with the smallest delay jitter value is selected as the destination master clock node.
  • Step 508 After expiration of the duration, calculate a value of a packet loss rate according to the number of received packets, where the value of the packet loss rate is a ratio of the number of received packets from the clock node to the theoretical expected value in the duration.
  • the link loss may be obtained through the foregoing steps 501 to 503 and step 508.
  • the delay jitter and/or the link delay are selected as the second judgment index.
  • the value of the link delay is selected from the primary clock node with the smallest link loss rate of the corresponding link selected in the duration, and the corresponding primary clock node with the smallest delay jitter and/or the link delay is selected.
  • the node serves as the destination master clock node, so as to achieve the purpose of selecting the destination master clock node according to the configured link quality selection policy.
  • a user selects a link quality (including a link loss rate, a delay jitter, or a link delay) to select a policy, and selects a destination master clock according to a link quality selection policy configured by the user and a PTP protocol.
  • the node not only satisfies the actual selection requirements of the user, but also improves the multi-selectivity and flexibility when acquiring the master clock node, and solves the problem that the master clock node cannot transmit the advertisement message when the master clock node does not send the advertisement message.
  • step 102 specifically includes:
  • Step 1023 When the second policy is used to select the destination primary clock node, the step 1024 of acquiring the delay jitter is performed according to the value of the delay jitter, or according to the delay jitter and the link loss rate and/or the link delay. Value, select the corresponding primary clock node as the destination primary clock node.
  • the destination primary clock node when the second policy is selected to select the target primary clock node, the destination primary clock node may be selected according to the value of the delay jitter, and the delay jitter may be used as the first judgment indicator, and the link loss rate and / or the link delay is the second judgment indicator to select the destination master clock node.
  • the value of the delay jitter can be obtained through the above steps 501 to 505 and step 507, and The primary clock node corresponding to the minimum delay jitter in the duration is identified, and the primary clock node is used as the destination primary clock node.
  • the delay jitter When the delay jitter is selected as the first judgment indicator, and the target primary clock node is selected by using the link loss ratio and/or the link delay as the second judgment indicator, the delay jitter can be obtained according to the foregoing steps 501 to 508.
  • Link loss rate and/or link delay The value of the primary clock node with the smallest link delay rate and/or the link delay is selected in the primary clock node with the smallest delay jitter selected in the duration, and the primary clock node is used as the primary clock. The node, so as to achieve the purpose of selecting the destination primary clock node according to the configured link quality selection policy.
  • step 102 may specifically include: Step 1025: When the third policy selects the destination primary clock node, step 1026 of obtaining the link delay is selected according to the value of the link delay or according to the link delay and the link loss rate and/or the value of the delay jitter.
  • the primary clock node is the destination primary clock node.
  • the destination primary clock node when the third policy is selected to select the destination primary clock node, the destination primary clock node may be selected according to the value of the link delay, and the link delay may be used as the first judgment indicator, and the link loss rate is And/or delay jitter is the second judgment indicator to select the destination master clock node.
  • the value of the link delay can be obtained through the foregoing steps 501 to 506. And identifying the primary clock node corresponding to the minimum link delay in the duration, and using the primary clock node as the destination primary clock node.
  • the link delay When the link delay is selected as the first judgment indicator, and the target primary clock node is selected by using the link loss ratio and/or the delay jitter as the second judgment indicator, the link delay may be obtained according to the foregoing steps 501 to 508. And the value of the link loss rate and/or the delay jitter, and the corresponding link loss rate and/or the delay jitter minimum is selected among the primary clock nodes with the smallest link delay selected in the duration.
  • the master clock node uses the master clock node as the destination master clock node to achieve the purpose of selecting the destination master clock node according to the configured link quality selection policy.
  • the master clock node when the master clock node is a two-step clock, the number of corresponding follow-up messages received is counted in the number of received packets.
  • the master clock node When the master clock node is a two-step clock, that is, the time at which the master clock node sends the synchronization packet is not carried by the timestamp, and the synchronization packet is sent to the slave clock node, but After sending the synchronization packet, the master clock node notifies the slave clock node of the time at which the slave clock node sends the synchronization packet by sending the following message including the time when the master clock node sends the synchronization packet, in this case, the slave clock.
  • the node counts the number of corresponding following packets received into the number of received packets, so as to calculate the link loss rate.
  • the present invention also provides a slave clock node for selecting a master clock node based on PTP and link quality, including:
  • the configuration module 801 is configured to configure a link quality selection policy according to the link quality indicator, where the link quality indicator includes: a link loss rate, and/or a delay jitter, and/or a link delay.
  • the selecting module 802 is configured to select a destination main clock node according to the configured link quality selection policy.
  • the link quality selection policy includes: a first criterion for selecting a target primary clock node by using a link loss rate as a first judgment indicator, and using a delay jitter and/or a link delay as a second judgment indicator; And/or, using the delay jitter as the first judgment indicator, selecting the second strategy of the destination master clock node by using the link loss rate and/or the link delay as the second judgment indicator; and/or The time is the first judgment indicator, and the third strategy of selecting the destination master clock node by using the link loss rate and/or the delay jitter as the second judgment indicator.
  • the selection module 802 can include:
  • the obtaining unit 8021 is configured to obtain a value when the destination primary clock node is selected by using the first policy.
  • the selecting unit 8022 is configured to select a corresponding primary clock node as the destination primary clock node according to the value of the link loss ratio of the link, or according to a link loss ratio and a value of delay jitter and/or link delay.
  • the selection unit 8022 is the most The small link loss rate or the minimum link loss rate is combined with the minimum delay jitter and/or link delay to select the destination primary clock node.
  • the obtaining unit 8021 is further configured to: when the target primary clock node is selected by using the second policy, obtain a value of delay jitter, or obtain a delay jitter and a link loss ratio. / or the value of the link delay;
  • the selecting unit 8022 is further configured to select the corresponding primary clock node as the destination primary clock node according to the value of the delay jitter or according to the delay jitter and the link loss rate and/or the link delay value.
  • the obtaining unit 8021 obtains the value of the delay jitter, or obtains the value of the delay jitter and the link loss rate and/or the link delay, and the selecting unit 8022 is configured therein.
  • the minimum delay jitter or minimum delay jitter is combined with the minimum link loss rate and/or link delay to select the destination primary clock node.
  • the obtaining unit 8021 is further configured to: when selecting the destination primary clock node by using the third policy, obtain a link delay value, or obtain a link delay value and a link loss ratio and/or The value of the delay jitter;
  • the selecting unit 8022 is further configured to select the corresponding primary clock node as the destination primary clock node according to the value of the link delay or according to the link delay and the link loss rate and/or the value of the delay jitter.
  • the obtaining unit 8021 obtains the link delay.
  • the minimum link delay or the minimum link delay is combined with the minimum link loss rate and/or delay jitter to select the destination primary clock node.
  • the obtaining unit 8021 may include:
  • the sending subunit 80211 is configured to send, to the corresponding primary clock node, a management message or a signal message carrying an interval and duration of the synchronization message sent by the desired primary clock node;
  • a receiving subunit 80212 configured to receive the master clock node at the interval for the duration
  • the time-sent synchronization message carrying the first timestamp indicating the synchronization time of the synchronization message
  • the obtaining sub-unit 80213 configured to acquire a second timestamp indicating the time of receiving the synchronization message, according to the synchronization message
  • the clock identifier identifies a primary clock node that sends the synchronization packet, and saves related information of the primary clock node;
  • a message counting sub-unit 80214 configured to count the number of received synchronization packets plus one count into the number of received messages
  • the sending sub-unit 80211 is further configured to send a delay request message to the primary clock node, and the obtaining sub-unit 80213 is further configured to obtain a third timestamp indicating the sending time of the delayed request message;
  • the receiving subunit 80212 is further configured to receive, by the primary clock node, a delayed response packet that includes a fourth timestamp indicating a time when the delay request packet is received;
  • a calculating subunit 80215 configured to calculate a value of each link delay according to the first timestamp, the second timestamp, the third timestamp, and the fourth timestamp;
  • the number of packets actually received from the clock node is the ratio of the number of received packets to the theoretical expected value.
  • the present invention further provides a system 1 for selecting a master clock node based on PTP and link quality, including the slave clock node 10 in the above embodiment, and a plurality of masters connected to the slave clock node 10 through the switch. Clock node 11.
  • the step of synchronizing the clock is performed by performing 1588 interaction with the destination master clock node.
  • a user selects a link quality (including a link loss ratio, and/or a delay jitter, and/or a link delay) to select a policy, and combines the link quality selection policy according to the user configuration.
  • the PTP protocol selects the destination master clock node, which not only satisfies the actual selection needs of the user.
  • the method further improves the multi-selectivity and flexibility when acquiring the master clock node, and solves the problem that the master clock node cannot select the master clock node when the master clock node does not send the advertisement message.

Landscapes

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

Abstract

The present invention discloses a method for selecting a master clock node based on a precision time protocol (PTP) and link quality. The method includes the following steps: configuring a link quality selection policy according to a link quality index, wherein the link quality index comprises link packet loss ratio, and/or time delay jitter and/or link time delay; selecting a target master clock node according to the configured link quality selection policy. The present invention also discloses a slave clock node and system for selecting a master clock node based on a PTP and link quality. The present invention not only satisfies the actual selection requirement of a user, but also improves the multi-selectivity and flexibility of obtaining the master clock node, and solves the problem that in traditional private telephonic network (PTN) a master clock node can not be selected when the master clock node does not send a notification message.

Description

基于 PTP及链路质量选取主时钟节点的方法、 从时钟节点及系统 技术领域 Method for selecting master clock node based on PTP and link quality, slave clock node and system
本发明涉及移动通讯领域,尤其涉及一种基于精确时钟同步协议( ΡΤΡ, Precision Time Protocol )及链路质量选取主时钟节点的方法、从时钟节点及 系统。 背景技术  The present invention relates to the field of mobile communications, and in particular, to a method, a slave clock node and a system for selecting a master clock node based on a precision clock synchronization protocol (TM) and link quality. Background technique
在移动网络技术领域中, 对高精度时钟同步具有严格的要求, 时钟同 步的目的是将网络中各节点的时钟同步到同一基准。 比如: 基于频分双工 ( FDD , Frequency Division Duplex ) 的无线系统如通用移动通信系统 ( UMTS , Universal Mobile Telecommunications System )要求各节点间保持 时钟频率同步, 而基于时分双工 (TDD , Time Division Duplexing ) 的无线 系统如时分同步码分多址(TD-SCDMA, Time Division-Synchronous Code Division Multiple Access )/码分多址( CDMA, Code Division Multiple Access ) 2000等则要求时钟频率和相位的同步。  In the field of mobile network technology, there is a strict requirement for high-precision clock synchronization. The purpose of clock synchronization is to synchronize the clocks of nodes in the network to the same reference. For example: Wireless systems based on Frequency Division Duplex (FDD), such as Universal Mobile Telecommunications System (UMTS), require clock frequency synchronization between nodes, based on Time Division Duplexing (TDD). The wireless system such as Time Division-Synchronous Code Division Multiple Access (CDMA) or Code Division Multiple Access (CDMA) requires synchronization of the clock frequency and phase.
目前, 移动网络中时钟同步较多釆用导航星测时与测距全球定位系统 或全球定位系统 (GPS , Navigation Satellite Timing And Ranging Global Position System )授时的方法, 但 GPS授时存在成本高, 安装困难(需要 120度净空要求等), 且存在不可用的风险。 现有的美国电气和电子工程师 协会 ( IEEE, Institute of Electrical and Electronics Engineers ) 1588标准, 网络化测量和控制系统的 PTP, 提供了网络内时钟同步的方案, 该方案可 以使网络内其它时钟与网络内最精确时钟保持同步, 因此成为 GPS的替代 方案。  At present, there are more clock synchronizations in mobile networks, such as navigation star test and GPS or Navigation Satellite Timing And Ranging Global Position System (GPS), but the cost of GPS timing is high and installation is difficult. (requires 120 degree clearance requirements, etc.) and there is a risk of unavailability. The existing 1588 standard of the IEEE, Institute of Electrical and Electronics Engineers, PTP for networked measurement and control systems, provides a solution for clock synchronization within the network, which enables other clocks and networks within the network. The most accurate clocks in the clock remain synchronized, thus becoming an alternative to GPS.
通过 PTP协议完成时钟同步包括建立主从层次结构及进行时钟同步两 个阶段。 PTP 首先将网络中的时钟节点组织进入主时钟节点一从时钟节点 ( Master Clock-Slave Clock ) 的同步层次, 主时钟节点提供标准时钟, 每 隔一定时间将本地时间发布到网络中, 从时钟节点接收主时钟节点发送的 时间信息, 进行相关计算后, 将从时钟节点的时间同步到主时钟节点。 Clock synchronization through PTP protocol includes establishing master-slave hierarchy and clock synchronization Stages. PTP first organizes the clock nodes in the network into the synchronization level of the master clock-Slave Clock. The master clock node provides the standard clock, and the local time is released to the network at regular intervals. The time information sent by the master clock node is received, and after the correlation calculation is performed, the time of the clock node is synchronized to the master clock node.
如图 1 所示, 在移动网络应用中, 一个从时钟节点可以通过交换机连 接多个潜在的主时钟节点,对于如何解决从多个潜在的主时钟节点(如图 1 所示的 n个主时钟节点, n为大于 1的整数)选取一个主时钟节点作为其目 的主时钟节点以进行时间同步的问题, PTP 协议提出了最佳主时钟节点算 法( BMC, Best M aster Clock Algorithm )来确定主从关系。 BMC需要基于 通告( announce )消息来完成确定主从关系, 通告消息中带有描述时钟特性 的数据, 该特性主要包括主时钟节点的时钟质量(用户配置的时钟等级以 及时钟精度等时钟属性, 但不涉及到链路信息)。 当从时钟节点通过端口接 收到通告消息后,先使用 BMC中的数据集比较算法比较所有端口收到的通 告消息中的数据集, 从中选取一个主时钟节点, 再使用状态决策算法决定 每个时钟的状态 ( Master Or Slave )。  As shown in Figure 1, in a mobile network application, a slave clock node can connect multiple potential master clock nodes through a switch, for how to resolve multiple potential master clock nodes (such as n master clocks as shown in Figure 1) Node, n is an integer greater than 1) A master clock node is selected as its primary clock node for time synchronization. The PTP protocol proposes the best master clock algorithm (BMC) to determine the master-slave relationship. The BMC needs to complete the determining the master-slave relationship based on the announce message. The announcement message has data describing the clock characteristics. The characteristics mainly include the clock quality of the master clock node (the clock level of the user-configured clock level and the clock accuracy, etc.). Does not involve link information). After receiving the advertisement message from the clock node through the port, the data set comparison algorithm in the BMC is used to compare the data set in the notification message received by all the ports, select one master clock node, and then use the state decision algorithm to determine each clock. Status (Master Or Slave).
如图 2所示, 确定主时钟节点和从时钟节点后, 主时钟节点和从时钟 节点之间将通过交互时间报文来进行时间同步。 PTP协议中定义了四种报 文: 同步报文(Sync )、 跟随报文( Follow_up )、 延时请求报文( Delay_req ) 以及延时应答报文( Delay— resp )。 从时钟节点利用上述四种报文获得时间 戳, 以确定其与主时钟节点之间的时间偏差来调整自身时钟。 其中, 时间 戳包括主时钟节点发送同步报文的时间 tl、 从时钟节点接收到同步报文的 时间 t2、 从时钟节点发送延迟请求 ^艮文的时间 t3、 以及主时钟节点接收到 延迟请求 ^艮文的时间 t4, 主从时钟节点间的时间偏差 Offset和网络传输链 路延时 Delay, 关系如下式(1 )和式(2 )所示:  As shown in Figure 2, after the master clock node and the slave clock node are determined, the time synchronization is performed between the master clock node and the slave clock node through the interaction time packet. Four types of messages are defined in the PTP protocol: Synchronous Message (Sync), Follow Message (Follow_up), Delay Request Message (Delay_req), and Delay Response Message (Delay-Resp). The slave clock node uses the above four messages to obtain a time stamp to determine its time offset from the master clock node to adjust its own clock. The timestamp includes a time t1 at which the master clock node sends the synchronization message, a time t2 when the synchronization message is received from the clock node, a time t3 when the delay message is sent from the clock node, and a delay request received by the master clock node. The time t4 of the text, the time offset Offset between the master and slave clock nodes, and the network transmission link delay Delay are as follows: (1) and (2):
t2-tl=Delay+Offset ( 1 ) t4-t3=Delay-Offset ( 2 ) 由上述公式得到时间偏差 Offset=[(t2-tl )-(t4-t3)]/2 , 从时钟节点即可根 据计算得到的时间偏移 Offset调整自己的时钟。 T2-tl=Delay+Offset ( 1 ) T4-t3=Delay-Offset ( 2 ) From the above formula, the time deviation Offset=[(t2-tl )-(t4-t3)]/2 is obtained, and the slave clock node can adjust its own time offset based on the calculated time offset Offset. clock.
传统的专用电话网 ( PTN, Private Telephonic Network )通常釆用 BMC 算法来选取主时钟节点, 从时钟节点接收多个主时钟节点发送过来的通告 报文, 并对通告报文进行比较, 从中选取一个最佳主时钟节点。  The traditional private telephone network (PTN, Private Telephonic Network) usually uses the BMC algorithm to select the primary clock node, receives the advertisement packets sent by multiple primary clock nodes from the clock node, and compares the advertisement packets, and selects one of the advertisement packets. The best master clock node.
然而, 在某些情况, PTN 中的主时钟节点并不发送通告"¾文, 由此造 成在面临多个主时钟节点时无法选择目的主时钟节点的问题, 同时, 现有 技术 BMC 算法也无法根据用户需要即无法根据用户预先制定的选择策略 来选取主时钟节点。 发明内容  However, in some cases, the master clock node in the PTN does not send an advertisement "3⁄4 text, which causes the problem that the destination master clock node cannot be selected when facing multiple master clock nodes. Meanwhile, the prior art BMC algorithm cannot According to the user's needs, the master clock node cannot be selected according to the user's pre-defined selection strategy.
本发明的主要目的在于提供一种基于 PTP及链路质量选取主时钟节点 的方法、 从时钟节点及系统, 旨在根据链路质量的好坏选取目的主时钟节 点, 以解决传统 PTN中主时钟节点不发送通告 文时无法选择主时钟节点 的问题。  The main purpose of the present invention is to provide a method for selecting a master clock node based on PTP and link quality, a slave clock node and a system, and aiming to select a destination master clock node according to the quality of the link to solve the master clock in the traditional PTN. The problem that the primary clock node cannot be selected when the node does not send the announcement.
本发明提出的一种基于 PTP及链路质量选取主时钟节点的方法, 所述 方法包括以下步骤:  The invention provides a method for selecting a master clock node based on PTP and link quality, and the method comprises the following steps:
根据链路质量指标配置链路质量选择策略, 所述链路质量指标包括: 链路丟包率、 和 /或延时抖动、 和 /或链路延时;  The link quality selection policy is configured according to the link quality indicator, where the link quality indicator includes: link loss rate, and/or delay jitter, and/or link delay;
根据配置的链路质量选择策略选取目的主时钟节点。  Select the destination primary clock node according to the configured link quality selection policy.
优选地, 所述链路质量选择策略包括: 以链路丟包率为第一判断指标, 以延时抖动和 /或链路延时为第二判断指标选取目的主时钟节点的第一策 略; 或  Preferably, the link quality selection policy includes: a first strategy for selecting a destination master clock node by using a link loss rate as a first judgment indicator, and using a delay jitter and/or a link delay as a second judgment indicator; Or
以延时抖动为第一判断指标, 以链路丟包率和 /或链路延时为第二判断 指标选取目的主时钟节点的第二策略; 或 以链路延时为第一判断指标, 以链路丟包率和 /或延时抖动为第二判断 指标选取目的主时钟节点的第三策略。 Taking the delay jitter as the first judgment indicator, and selecting the second strategy of the destination master clock node by using the link loss rate and/or the link delay as the second judgment indicator; or Taking the link delay as the first judgment indicator, the third strategy of selecting the destination master clock node by using the link loss rate and/or the delay jitter as the second judgment indicator.
优选地, 所述根据配置的链路质量选择策略选取目的主时钟节点, 包 括:  Preferably, the selecting a destination master clock node according to the configured link quality selection policy includes:
釆用所述第一策略选取目的主时钟节点时, 获取链路丟包率的值, 或 根据链路丟包率的值、 或者根据链路丟包率以及延时抖动和 /或链路延 时的值, 选取对应的主时钟节点为目的主时钟节点。  When the destination primary clock node is selected by using the first policy, the value of the link loss ratio is obtained, or according to the value of the link loss ratio, or according to the link loss ratio and delay jitter and/or link delay. For the value of time, select the corresponding primary clock node as the destination primary clock node.
优选地, 所述根据配置的链路质量选择策略选取目的主时钟节点, 包 括:  Preferably, the selecting a destination master clock node according to the configured link quality selection policy includes:
釆用所述第二策略选取目的主时钟节点时, 获取延时抖动的值, 或者 获取延时抖动以及链路丟包率和 /或链路延时的值;  And obtaining the value of the delay jitter, or obtaining the value of the delay jitter and the link loss rate and/or the link delay when the destination primary clock node is selected by using the second policy;
根据延时抖动的值、 或者根据延时抖动以及链路丟包率和 /或链路延时 的值, 选取对应的主时钟节点为目的主时钟节点。  According to the value of the delay jitter, or according to the value of the delay jitter and the link loss rate and/or the link delay, the corresponding master clock node is selected as the destination master clock node.
优选地, 所述根据配置的链路质量选择策略选取目的主时钟节点, 包 括:  Preferably, the selecting a destination master clock node according to the configured link quality selection policy includes:
釆用所述第三策略选取目的主时钟节点时, 获取链路延时的值, 或者 根据链路延时的值、 或者根据链路延时以及链路丟包率和 /或延时抖动 的值, 选取对应的主时钟节点为目的主时钟节点。 从时钟节点向与自身对应的主时钟节点发送携带有期望主时钟节点发 送同步报文的间隔时间和持续时间的管理消息或信号消息;  Obtaining the value of the link delay when selecting the destination primary clock node by using the third policy, or according to the link delay value, or according to the link delay and the link loss rate and/or delay jitter Value, select the corresponding primary clock node as the destination primary clock node. Transmitting, from the clock node to the master clock node corresponding to itself, a management message or a signal message carrying an interval and duration of the synchronization message sent by the desired master clock node;
接收主时钟节点在所述持续时间内以所述间隔时间发送的携带有表示 同步报文发送时间的第一时间戳的同步报文; 获取表示所述同步报文接收时间的第二时间戳; 根据所述同步报文中 时钟标识符识别发送所述同步^艮文的主时钟节点, 将所述主时钟节点的相 关信息保存, 并将已接收同步报文数计数加一计入接收报文数内; And receiving, by the master clock node, the synchronization packet that is sent by the interval time and carries a first timestamp indicating a synchronization message sending time; Acquiring a second timestamp indicating the time of receiving the synchronization message; identifying, according to a clock identifier in the synchronization message, a primary clock node that sends the synchronization message, and saving related information of the primary clock node, and Counting the number of received synchronization packets plus one count into the number of received packets;
向主时钟节点发送延时请求报文, 并获取表示所述延时请求报文发送 时间的第三时间戳;  Sending a delay request message to the primary clock node, and acquiring a third timestamp indicating the time for sending the delayed request message;
接收主时钟节点发送的包含有表示所述延时请求报文接收时间的第四 时间戳的延时应答 ^艮文;  Receiving, by the primary clock node, a delay response including a fourth timestamp indicating the time when the delay request message is received;
根据所述第一时间戳、 第二时间戳、 第三时间戳以及第四时间戳计算 链路延时的值; 和 /或  Calculating a value of the link delay according to the first timestamp, the second timestamp, the third timestamp, and the fourth timestamp; and/or
根据所述第一时间戳、 第二时间戳、 第三时间戳以及第四时间戳计算 延时抖动的值; 和 /或  Calculating a value of the delay jitter according to the first timestamp, the second timestamp, the third timestamp, and the fourth timestamp; and/or
所述持续时间期满后, 根据所述接收报文数计算丟包率的值, 所述丟 包率的值为持续时间内从时钟节点接收报文数与理论期望值的比值。  After the expiration of the duration, the value of the packet loss rate is calculated according to the number of received packets, and the value of the packet loss rate is a ratio of the number of received packets from the clock node to the theoretical expected value during the duration.
优选地, 所述将已接收同步报文数计数加一计入接收报文数内之后, 所述方法还包括:  Preferably, after the counting of the number of received synchronization packets is counted in the number of received packets, the method further includes:
所述主时钟节点为两步时钟时, 将收到的跟随报文数计入所述接收报 文数内。  When the master clock node is a two-step clock, the number of received follow messages is counted in the number of received packets.
本发明提出一种基于 PTP及链路质量选取主时钟节点的从时钟节点, 所述从时钟节点包括:  The present invention provides a slave clock node that selects a master clock node based on PTP and link quality, and the slave clock node includes:
配置模块, 用于根据链路质量指标配置链路质量选择策略, 所述链路 质量指标包括: 链路丟包率、 和 /或延时抖动、 和 /或链路延时;  a configuration module, configured to configure a link quality selection policy according to a link quality indicator, where the link quality indicator includes: a link loss rate, and/or a delay jitter, and/or a link delay;
选择模块, 用于根据配置的链路质量选择策略选取目的主时钟节点。 优选地, 所述链路质量选择策略包括: 以链路丟包率为第一判断指标, 以延时抖动和 /或链路延时为第二判断指标选取目的主时钟节点的第一策 略; 或 以延时抖动为第一判断指标, 以链路丟包率和 /或链路延时为第二判断 指标选取目的主时钟节点的第二策略; 或 The selecting module is configured to select a destination primary clock node according to the configured link quality selection policy. Preferably, the link quality selection policy includes: a first strategy for selecting a destination master clock node by using a link loss rate as a first judgment indicator, and using a delay jitter and/or a link delay as a second judgment indicator; Or Taking the delay jitter as the first judgment indicator, and selecting the second strategy of the destination master clock node by using the link loss rate and/or the link delay as the second judgment indicator; or
以链路延时为第一判断指标, 以链路丟包率和 /或延时抖动为第二判断 指标选取目的主时钟节点的第三策略。  Taking the link delay as the first judgment indicator, the link loss rate and/or the delay jitter are used as the second judgment indicator to select the third strategy of the destination master clock node.
优选地, 所述选择模块包括:  Preferably, the selecting module comprises:
获取单元, 用于釆用所述第一策略选取目的主时钟节点时, 获取链路 选择单元, 用于根据所述获取单元所获取链路丟包率的值、 或者根据 链路丟包率以及延时抖动和 /或链路延时的值 , 选取对应的主时钟节点为目 的主时钟节点。  And an obtaining unit, configured to: when the first policy is used to select a destination primary clock node, obtain a link selection unit, configured to obtain a value of a link loss ratio obtained according to the acquiring unit, or a link loss rate according to a link, and For the value of delay jitter and/or link delay, select the corresponding master clock node as the destination master clock node.
优选地, 所述获取单元, 还用于釆用所述第二策略选取目的主时钟节 点时, 获取延时抖动的值, 或者获取延时抖动的以及链路丟包率和 /或链路 延时的值;  Preferably, the acquiring unit is further configured to: when the target primary clock node is selected by using the second policy, obtain a value of the delay jitter, or obtain a delay jitter, a link loss ratio, and/or a link delay. Time value
所述选择单元, 还用于根据所述获取单元所获取延时抖动的值、 或者 为目的主时钟节点。  The selecting unit is further configured to: according to the value of the delay jitter acquired by the acquiring unit, or the target master clock node.
优选地, 所述获取单元, 还用于釆用所述第三策略选取目的主时钟节 点时, 获取链路延时的值, 或者获取链路延时的值以及链路丟包率和 /或延 时抖动的值;  Preferably, the acquiring unit is further configured to: when selecting the destination primary clock node by using the third policy, obtain a link delay value, or obtain a link delay value and a link loss ratio and/or The value of the delay jitter;
所述选择单元, 还用于根据所述获取单元所获取链路延时的值、 或者 为目的主时钟节点。  The selecting unit is further configured to: according to the value of the link delay acquired by the acquiring unit, or the target master clock node.
优选地, 所述获取单元包括:  Preferably, the acquiring unit includes:
发送子单元, 用于向对应从时钟节点的主时钟节点发送携带有期望主 时钟节点发送同步报文的间隔时间和持续时间的管理消息或信号消息; 接收子单元, 用于接收主时钟节点在所述持续时间内以所述间隔时间 发送的携带有表示同步报文发送时间的第一时间戳的同步报文; a sending subunit, configured to send, to the primary clock node corresponding to the slave clock node, a management message or a signal message carrying an interval and duration of the synchronization message sent by the desired primary clock node; a receiving subunit, configured to receive, by the primary clock node, the synchronization packet that is sent by the interval time and carries a first timestamp indicating a synchronization packet sending time;
获取子单元, 用于获取表示所述同步报文接收时间的第二时间戳; 根 据同步报文中时钟标识符识别发送同步报文的主时钟节点, 将所述主时钟 节点的相关信息进行保存;  Obtaining a sub-unit, configured to acquire a second timestamp indicating a time for receiving the synchronization packet; identifying a primary clock node that sends the synchronization packet according to a clock identifier in the synchronization packet, and saving related information of the primary clock node ;
报文计数子单元, 用于将已接收同步报文数计数加一计入接收报文数 内;  a message counting sub-unit, configured to count the number of received synchronization packets plus one count into the number of received messages;
所述发送子单元, 还用于向所述主时钟节点发送延时请求报文; 所述获取子单元, 还用于获取表示所述延时请求报文发送时间的第三 时间戳;  The sending subunit is further configured to send a delay request message to the primary clock node, where the acquiring subunit is further configured to acquire a third timestamp indicating a sending time of the delayed request message;
所述接收子单元, 还用于接收主时钟节点发送的包含有表示所述延时 请求报文接收时间的第四时间戳的延时应答报文;  The receiving subunit is further configured to receive, by the primary clock node, a delayed response packet that includes a fourth timestamp indicating a time when the delay request packet is received;
计算子单元, 用于根据所述第一时间戳、 第二时间戳、 第三时间戳以 及第四时间戳计算链路延时的值; 和 /或  a calculating subunit, configured to calculate a value of the link delay according to the first timestamp, the second timestamp, the third timestamp, and the fourth timestamp; and/or
根据所述第一时间戳、 第二时间戳、 第三时间戳以及第四时间戳计算 延时抖动的值; 和 /或  Calculating a value of the delay jitter according to the first timestamp, the second timestamp, the third timestamp, and the fourth timestamp; and/or
所述持续时间期满后, 根据所述接收报文数计算丟包率的值, 所述丟 包率的值为所述持续时间内从时钟节点接收报文数与理论期望值的比值。  After the expiration of the duration, the value of the packet loss rate is calculated according to the number of received packets, and the value of the packet loss rate is a ratio of the number of received packets from the clock node to the theoretical expected value in the duration.
优选地, 所述 ^艮文计数子单元还用于在所述主时钟节点为两步时钟时, 将收到的跟随报文数计入所述接收报文数内。  Preferably, the ^ gram count subunit is further configured to count the number of received follow messages into the number of received packets when the master clock node is a two-step clock.
本发明提出一种基于 PTP及链路质量选取主时钟节点的系统, 包括如 上所述的从时钟节点, 以及与所述从时钟节点通过交换机连接的复数个主 时钟节点。  The present invention proposes a system for selecting a master clock node based on PTP and link quality, comprising a slave clock node as described above, and a plurality of master clock nodes connected to the slave clock node through a switch.
本发明基于 PTP及链路质量选取主时钟节点的方法、 从时钟节点及系 统, 通过用户配置链路质量 (主要包括链路丟包率、 和 /或延时抖动、 和 / 或链路延时等指标)选择策略, 并根据用户配置的链路质量选择策略结合The invention is based on the method of selecting the master clock node based on the PTP and the link quality, the slave clock node and the system, and configuring the link quality through the user (mainly including the link loss rate, and/or the delay jitter, and/or Or link delay and other indicators) select the policy and combine the policy according to the link quality selected by the user.
PTP 协议选取目的主时钟节点, 不仅满足了用户的实际选择需求, 而且提 高了获取主时钟节点时的多选择性和灵活性, 解决了传统 PTN中主时钟节 点不发送通告报文时无法选择主时钟节点的问题。 附图说明 The PTP protocol selects the destination master clock node, which not only satisfies the user's actual selection requirements, but also improves the selectivity and flexibility when acquiring the master clock node, and solves the problem that the master clock node cannot select the master when the announcement message is not sent in the traditional PTN. The problem with the clock node. DRAWINGS
图 1是现有移动网络中主时钟节点与从时钟节点连接示意图; 图 2是现有技术中主时钟节点和从时钟节点之间通过交互时间报文来 进行时间同步的示意图;  1 is a schematic diagram of a connection between a master clock node and a slave clock node in an existing mobile network; FIG. 2 is a schematic diagram of time synchronization between a master clock node and a slave clock node through an interaction time message in the prior art;
图 3是本发明实施例基于 PTP及链路质量选取主时钟节点的方法流程 示意图;  3 is a schematic diagram of a method for selecting a master clock node based on PTP and link quality according to an embodiment of the present invention;
图 4是图 3所示的基于 PTP及链路质量选取主时钟节点的方法中步骤 102具体流程示意图;  4 is a schematic diagram of a specific process of step 102 in the method for selecting a master clock node based on PTP and link quality shown in FIG. 3;
图 5是上述实施例中获取链路质量指标中链路丟包率、 延时抖动以及 链路延时的值的流程示意图;  5 is a schematic flowchart of obtaining a value of a link loss rate, a delay jitter, and a link delay in a link quality indicator in the foregoing embodiment;
图 6是本发明基于 PTP及链路质量选取主时钟节点的方法另一实施例 流程示意图;  6 is a schematic flow chart of another embodiment of a method for selecting a master clock node based on PTP and link quality according to the present invention;
图 7是本发明基于 PTP及链路质量选取主时钟节点的方法再一实施例 的流程示意图;  7 is a schematic flow chart of still another embodiment of a method for selecting a master clock node based on PTP and link quality according to the present invention;
图 8是本发明基于 PTP及链路质量选取主时钟节点的从时钟节点一实 施例的组成结构示意图;  8 is a schematic structural diagram of a configuration of a slave clock node according to an embodiment of the present invention for selecting a master clock node based on PTP and link quality;
图 9是图 8所示的基于 PTP及链路质量选取主时钟节点的从时钟节点 中选择模块的组成结构示意图;  9 is a schematic structural diagram of a selection module of a slave clock node selected from a master clock node based on PTP and link quality shown in FIG. 8;
图 10是图 9所示的基于 PTP及链路质量选取主时钟节点的从时钟节点 中选择模块内获取单元的组成结构示意图;  FIG. 10 is a schematic diagram showing the structure of a component selected by a module in a slave clock node based on PTP and a link quality selection master clock node shown in FIG. 9; FIG.
图 11是本发明基于 PTP及链路质量选取主时钟节点的系统一实施例的 组成结构示意图。 11 is a schematic diagram of a system for selecting a master clock node based on PTP and link quality according to the present invention; Schematic diagram of the composition.
为了使本发明的技术方案更加清楚、 明了, 下面将结合附图作进一步 详述。 具体实施方式  In order to make the technical solutions of the present invention clearer and clearer, the following will be further described in detail with reference to the accompanying drawings. detailed description
本发明实施例解决方案主要是: 以用户配置的链路质量选择策略为前 提, 根据链路质量(主要包括链路延时、 抖动或者丟包率等指标) 的好坏 来选取主时钟节点, 以解决传统 PTN中主时钟节点不发送通告报文而无法 获取目的主时钟节点的问题。  The solution of the embodiment of the present invention is as follows: Based on the link quality selection policy configured by the user, the main clock node is selected according to the quality of the link (including the link delay, jitter, or packet loss rate). To solve the problem that the primary clock node in the traditional PTN does not send the advertisement packet and cannot obtain the destination master clock node.
例如: 当用户配置的链路质量选择策略以链路丟包率作为选取目的主 时钟节点的判断指标, 并设置对应链路丟包率最小的主时钟节点作为目的 主时钟节点时, 通过以下方法获取目的主时钟节点: 从时钟节点通过发送 管理消息或者信号消息, 要求与其相接的多个主时钟节点交互, 然后对接 收到的多个主时钟节点的 1588交互报文分别进行计数, 在预定时间内, 将 实际收到的报文数与理论上从时钟节点期望收到的报文数进行比较, 计算 出从时钟节点与每个主时钟节点之间的链路丟包率, 从中选取一个链路丟 包率最小的主时钟节点作为目的主时钟节点。  For example, when the link quality selection policy configured by the user uses the link loss rate as the judgment indicator of the destination master clock node and sets the primary clock node with the smallest link loss rate as the destination master clock node, the following method is adopted. Obtaining the destination master clock node: The slave clock node sends a management message or a signal message, requires interaction with multiple master clock nodes connected thereto, and then counts the received 1588 interaction packets of the multiple master clock nodes separately, in the predetermined The time between the number of packets actually received and the number of packets expected to be received by the clock node are compared, and the packet loss ratio between the slave clock node and each master clock node is calculated, and one of the packets is selected. The primary clock node with the lowest link loss rate is used as the destination primary clock node.
如图 3所示, 本发明一实施例提出一种基于 PTP及链路质量选取主时 钟节点的方法, 所述方法包括:  As shown in FIG. 3, an embodiment of the present invention provides a method for selecting a primary clock node based on PTP and link quality, and the method includes:
步骤 101 , 根据链路质量指标配置链路质量选择策略;  Step 101: Configure a link quality selection policy according to the link quality indicator.
本实施例中, 链路质量指标包括: 链路丟包率、 和 /或延时抖动、 和 / 或链路延时。  In this embodiment, the link quality indicator includes: link loss rate, and/or delay jitter, and/or link delay.
本方法实施例的运行环境包括从时钟节点以及与从时钟节点通过交换 机连接的多个(复数个)主时钟节点, 当需要为从时钟节点选取一个最佳 主时钟节点即目的主时钟节点以进行时钟同步时, 用户可以根据链路质量 来选取最佳主时钟节点, 具体可以根据需要选择链路质量指标中的一个或 两个或三个来选取主时钟节点, 比如, 用户可以配置以链路丟包率为第一 判断指标, 以延时抖动和 /或链路延时为第二判断指标选取目的主时钟节点 的第一策略; 或以延时抖动为第一判断指标, 以链路丟包率和 /或链路延时 为第二判断指标选取目的主时钟节点的第二策略; 或以链路延时为第一判 断指标, 以链路丟包率和 /或延时抖动为第二判断指标选取目的主时钟节点 的第三策略。 The operating environment of the method embodiment includes a slave clock node and a plurality of (multiple) master clock nodes connected to the slave clock node through the switch, when an optimal master clock node, that is, a destination master clock node, needs to be selected for the slave clock node. When the clock is synchronized, the user can select the best master clock node according to the link quality. You can select one of the link quality indicators or Two or three to select the primary clock node. For example, the user can configure the link loss rate as the first judgment indicator, and use the delay jitter and/or the link delay as the second judgment indicator to select the target primary clock node. The first strategy; or using the delay jitter as the first judgment indicator, using the link loss rate and/or the link delay as the second judgment indicator to select the second strategy of the destination master clock node; or The first determining indicator selects a third policy of the target primary clock node by using the link loss rate and/or the delay jitter as the second determining indicator.
以第一策略为例, 用户可以选择对应链路丟包率最小的主时钟节点作 为从时钟节点的目的主时钟节点, 同时, 还可以以链路丟包率为第一判断 指标, 以延时抖动和 /或链路延时为第二判断指标选取目的主时钟节点, 即 当对应链路丟包率最小的主时钟节点有多个时, 可以以延时抖动或链路延 时为第二判断指标, 选取链路丟包率最小的主时钟节点中延时抖动或链路 延时最小的主时钟节点为目的主时钟节点; 另外, 用户还可以根据需要预 先配置链路质量中各种指标的阀值来选取目的主时钟节点, 比如可以预先 配置要求丟包率小于 10%等。  Taking the first policy as an example, the user can select the primary clock node with the lowest link loss rate as the destination primary clock node of the secondary clock node, and at the same time, the link loss rate is the first judgment indicator, with a delay. The jitter and/or link delay is used to select the destination primary clock node for the second judgment indicator, that is, when there are multiple primary clock nodes with the smallest link loss rate, the delay jitter or the link delay may be the second. Assume that the primary clock node with the lowest delay or the lowest link delay in the primary clock node with the lowest link loss rate is the primary clock node. In addition, the user can pre-configure various indicators in the link quality as required. The threshold is used to select the destination master clock node. For example, the packet loss rate can be less than 10%.
步骤 102, 根据配置的链路质量选择策略选取目的主时钟节点。  Step 102: Select a destination primary clock node according to the configured link quality selection policy.
本实施例中, 当配置好链路质量选择策略后, 根据配置的链路质量选 择策略选取目的主时钟节点。 比如, 当釆用第一策略选取主时钟节点时, 可以根据链路质量指标中链路丟包率的最小值选取对应的主时钟节点为目 的主时钟节点, 其中, 链路丟包率的最小值可以根据 PTP协议中从时钟节 点与主时钟节点之间发送同步报文的方式获取。  In this embodiment, after the link quality selection policy is configured, the destination primary clock node is selected according to the configured link quality selection policy. For example, when the primary clock node is selected by using the first policy, the corresponding primary clock node may be selected as the primary clock node according to the minimum value of the link loss rate in the link quality indicator, where the link loss rate is the smallest. The value can be obtained by sending a synchronization packet between the clock node and the primary clock node in the PTP protocol.
如图 4所示, 其中, 步骤 102可以包括:  As shown in FIG. 4, step 102 may include:
步骤 1021 , 当釆用第一策略选取目的主时钟节点时, 获取链路丟包率 的值, 或者获取链路丟包率、 以及延时抖动和 /或链路延时的值;  Step 1021: When the first primary node is selected by using the first policy, obtain the value of the link loss rate, or obtain the link loss rate, and the value of the delay jitter and/or the link delay.
步骤 1022 , 根据链路丟包率的值、 或者根据链路丟包率以及延时抖动 和 /或链路延时的值, 选取对应的主时钟节点为目的主时钟节点。 上述步骤 1021和 1022中, 当釆用第一策略选取目的主时钟节点时, 可以根据链路丟包率的值选取目的主时钟节点, 还可以以链路丟包率为第 一判断指标, 以延时抖动和 /或链路延时为第二判断指标选取目的主时钟节 点, 当选择以链路丟包率的值选取目的主时钟节点时, 通过获取链路丟包 率的值, 以最小值的链路丟包率对应的主时钟节点为目的主时钟节点; 当 选择以链路丟包率为第一判断指标, 以延时抖动和 /或链路延时为第二判断 指标选取目的主时钟节点时, 比如对应链路丟包率最小的主时钟节点有多 个, 此时在对应多个链路丟包率最小的主时钟节点中, 选取延时抖动或链 路延时最小的主时钟节点为目的主时钟节点。 Step 1022: Select a corresponding primary clock node as the destination primary clock node according to the value of the link loss ratio, or according to the link loss ratio and the value of the delay jitter and/or the link delay. In the foregoing steps 1021 and 1022, when the destination primary clock node is selected by using the first policy, the destination primary clock node may be selected according to the value of the link loss ratio, and the link loss rate may be the first judgment indicator. The delay jitter and/or the link delay are used to select the destination primary clock node for the second judgment indicator. When the destination primary clock node is selected by the value of the link loss ratio, the value of the link loss rate is obtained to minimize The primary clock node corresponding to the link loss rate of the value is the destination primary clock node. When the link loss rate is selected as the first judgment indicator, the delay jitter and/or the link delay are selected as the second judgment indicator. In the main clock node, for example, there are multiple primary clock nodes with the smallest link loss rate. In this case, the delay jitter or the link delay is the smallest among the primary clock nodes with the smallest packet loss rate. The primary clock node is the destination primary clock node.
如图 5 所示, 获取链路质量指标中链路丟包率的值、 延时抖动的值、 以及链路延时的值的具体过程, 可以包括:  As shown in FIG. 5, the specific process of obtaining the value of the link loss rate, the value of the delay jitter, and the value of the link delay in the link quality indicator may include:
步骤 501 ,从时钟节点向与其对应的主时钟节点发送携带有期望主时钟 节点发送同步报文的间隔时间和持续时间的管理消息或信号消息;  Step 501: The slave clock node sends a management message or a signal message carrying the interval and duration of the synchronization message sent by the desired master clock node to the corresponding master clock node.
步骤 502,接收主时钟节点在所述持续时间内以所述间隔时间发送的携 带有第一时间戳的同步报文;  Step 502: Receive a synchronization packet that carries the first timestamp sent by the primary clock node in the interval time.
以 tl表示第一时间戳,第一时间戳为主时钟节点发送同步报文的时间。 步骤 503 , 获取表示所述同步报文接收时间的第二时间戳,根据所述同 步报文中时钟标识符识别发送所述同步报文的主时钟节点, 将所述主时钟 节点的相关信息进行保存, 并将已接收同步报文数计数加一计入接收报文 数内;  The first timestamp is represented by tl, and the first timestamp is the time at which the synchronization packet is sent by the primary clock node. Step 503: Obtain a second timestamp indicating the time of receiving the synchronization packet, identify a primary clock node that sends the synchronization packet according to a clock identifier in the synchronization packet, and perform related information of the primary clock node. Save, and count the number of received synchronization packets plus one count into the number of received messages;
以 t2表示第二时间戳, 表示从时钟节点接收到同步报文的时间。  The second timestamp is represented by t2, indicating the time when the synchronization message is received from the clock node.
步骤 504, 向所述主时钟节点发送延时请求报文, 并获取表示所述延时 请求报文发送时间的第三时间戳;  Step 504: Send a delay request message to the primary clock node, and obtain a third timestamp indicating a time for sending the delay request message.
以 t3表示第三时间戳, 表示从时钟节点发送延时请求^艮文的时间。 步骤 505,接收主时钟节点发送的包含有表示所述延时请求报文接收时 间的第四时间戳的延时应答报文; The third timestamp is represented by t3, indicating the time when the delay request is sent from the clock node. Step 505: When the receiving the primary clock node sends the message indicating that the delay request message is received Delayed response message of the fourth timestamp between;
以 t4表示第四时间戳, 表示主时钟节点接收到所述延时请求^艮文的时 间。  The fourth timestamp is represented by t4, indicating the time when the master clock node receives the delay request message.
步骤 506, 根据所述第一时间戳、 第二时间戳、 第三时间戳以及第四时 间戳计算链路延时的值;  Step 506: Calculate a value of the link delay according to the first timestamp, the second timestamp, the third timestamp, and the fourth timestamp.
首先, 计算每次链路延时的值 delay = ( t2-tl+ t4-t3 )。  First, calculate the value of each link delay delay = ( t2-tl + t4-t3 ).
这里, 在持续时间期满后, 取各次链路延时的值 delay的平均值作为当 前主时钟节点的链路延时。  Here, after the duration expires, the average value of the delay of each link delay is taken as the link delay of the current primary clock node.
步骤 507, 根据所述第一时间戳、 第二时间戳、 第三时间戳以及第四时 间戳计算延时抖动的值;  Step 507: Calculate a value of the delay jitter according to the first timestamp, the second timestamp, the third timestamp, and the fourth timestamp.
当所述持续时间期满后,各次链路延时的值 delay中最大值与最小值的 差值即为延时抖动的值, 并将该延时抖动的值作为当前主时钟节点的延时 抖动的值, 当以延时抖动为指标选取目的主时钟节点时, 选取延时抖动值 最小的主时钟节点作为目的主时钟节点。  After the expiration of the duration, the difference between the maximum value and the minimum value of the delay value of each link delay is the value of the delay jitter, and the value of the delay jitter is used as the delay of the current master clock node. When the value of the jitter is selected, when the destination clock node is selected by using the delay jitter as the index, the master clock node with the smallest delay jitter value is selected as the destination master clock node.
步骤 508, 当所述持续时间期满后, 根据接收报文数计算丟包率的值, 所述丟包率的值为所述持续时间内从时钟节点接收报文数与理论期望值的 比值。  Step 508: After expiration of the duration, calculate a value of a packet loss rate according to the number of received packets, where the value of the packet loss rate is a ratio of the number of received packets from the clock node to the theoretical expected value in the duration.
本实施例中, 当用户选择第一策略获取目的主时钟节点, 并且具体选 择以最小链路丟包率选择目的主时钟节点时, 可以通过上述步骤 501 至步 骤 503 以及步骤 508获取链路丟包率的值, 并识别出持续时间内的最小链 路丟包率对应的主时钟节点, 将该主时钟节点作为目的主时钟节点, 从而 达到根据配置的链路质量选择策略选取目的主时钟节点的目的。 同理, 当 用户釆用第一策略选取目的主时钟节点时, 并且具体釆用以链路丟包率为 第一判断指标, 以延时抖动和 /或链路延时为第二判断指标选取目的主时钟 节点时, 按照上述步骤 501至步骤 508获取链路丟包率以及延时抖动和 /或 链路延时的值, 在持续时间内选取的对应链路丟包率最小的主时钟节点中 , 选出延时抖动和 /或链路延时最小的对应的主时钟节点, 将该主时钟节点作 为目的主时钟节点, 从而达到根据配置的链路质量选择策略选取目的主时 钟节点的目的。 In this embodiment, when the user selects the first policy to obtain the destination primary clock node, and specifically selects the destination primary clock node by using the minimum link loss ratio, the link loss may be obtained through the foregoing steps 501 to 503 and step 508. The value of the rate, and identify the primary clock node corresponding to the minimum link loss rate in the duration, and use the primary clock node as the destination primary clock node, so as to select the destination primary clock node according to the configured link quality selection policy. purpose. Similarly, when the user selects the destination master clock node by using the first policy, and specifically uses the link loss rate as the first judgment indicator, the delay jitter and/or the link delay are selected as the second judgment index. For the destination clock node, obtain the link loss rate and delay jitter and/or according to steps 501 to 508 above. The value of the link delay is selected from the primary clock node with the smallest link loss rate of the corresponding link selected in the duration, and the corresponding primary clock node with the smallest delay jitter and/or the link delay is selected. The node serves as the destination master clock node, so as to achieve the purpose of selecting the destination master clock node according to the configured link quality selection policy.
本发明实施例通过用户配置链路质量(主要包括链路丟包率、 延时抖 动或者链路延时等指标)选择策略, 并根据用户配置的链路质量选择策略 结合 PTP协议选取目的主时钟节点, 不仅满足了用户的实际选择需求, 而 且提高了获取主时钟节点时的多选择性和灵活性, 解决了传统 PTN中主时 钟节点不发送通告报文时造成无法选择主时钟节点的问题。  In the embodiment of the present invention, a user selects a link quality (including a link loss rate, a delay jitter, or a link delay) to select a policy, and selects a destination master clock according to a link quality selection policy configured by the user and a PTP protocol. The node not only satisfies the actual selection requirements of the user, but also improves the multi-selectivity and flexibility when acquiring the master clock node, and solves the problem that the master clock node cannot transmit the advertisement message when the master clock node does not send the advertisement message.
如图 6所示, 本发明另一实施例提出一种基于精确时钟同步协议 PTP 及链路质量选取主时钟节点的方法, 在上述实施例的基础上, 其中步骤 102 具体包括:  As shown in FIG. 6, another embodiment of the present invention provides a method for selecting a master clock node based on a precise clock synchronization protocol (PTP) and link quality. Based on the foregoing embodiment, step 102 specifically includes:
步骤 1023 , 当釆用第二策略选取目的主时钟节点时, 获取延时抖动的 步骤 1024, 根据延时抖动的值、 或者根据延时抖动以及链路丟包率和 / 或链路延时的值, 选取对应的主时钟节点为目的主时钟节点。  Step 1023: When the second policy is used to select the destination primary clock node, the step 1024 of acquiring the delay jitter is performed according to the value of the delay jitter, or according to the delay jitter and the link loss rate and/or the link delay. Value, select the corresponding primary clock node as the destination primary clock node.
本实施例中, 在选择第二策略来选取目的主时钟节点时, 可以根据延 时抖动的值选取目的主时钟节点, 还可以以延时抖动为第一判断指标, 以 链路丟包率和 /或链路延时为第二判断指标选取目的主时钟节点。 当选择根 据延时抖动的值选取目的主时钟节点, 即选择对应延时抖动最小的主时钟 节点为目的时钟时, 可以通过上述步骤 501至步骤 505以及步骤 507来获 取延时抖动的值, 并识别出持续时间内的最小延时抖动对应的主时钟节点, 将该主时钟节点作为目的主时钟节点。 当选择以延时抖动为第一判断指标, 以链路丟包率和 /或链路延时为第二判断指标选取目的主时钟节点时, 可以 按照上述步骤 501至步骤 508获取延时抖动以及链路丟包率和 /或链路延时 的值, 在持续时间内选取的对应延时抖动最小的主时钟节点中, 选出链路 丟包率和 /或链路延时最小对应的主时钟节点, 将该主时钟节点作为目的主 时钟节点, 从而达到根据配置的链路质量选择策略选取目的主时钟节点的 目的。 In this embodiment, when the second policy is selected to select the target primary clock node, the destination primary clock node may be selected according to the value of the delay jitter, and the delay jitter may be used as the first judgment indicator, and the link loss rate and / or the link delay is the second judgment indicator to select the destination master clock node. When the destination clock node is selected according to the value of the delay jitter, that is, the master clock node with the smallest delay jitter is selected as the destination clock, the value of the delay jitter can be obtained through the above steps 501 to 505 and step 507, and The primary clock node corresponding to the minimum delay jitter in the duration is identified, and the primary clock node is used as the destination primary clock node. When the delay jitter is selected as the first judgment indicator, and the target primary clock node is selected by using the link loss ratio and/or the link delay as the second judgment indicator, the delay jitter can be obtained according to the foregoing steps 501 to 508. Link loss rate and/or link delay The value of the primary clock node with the smallest link delay rate and/or the link delay is selected in the primary clock node with the smallest delay jitter selected in the duration, and the primary clock node is used as the primary clock. The node, so as to achieve the purpose of selecting the destination primary clock node according to the configured link quality selection policy.
如图 7所示, 本发明再一实施例提出一种基于 PTP及链路质量选取主 时钟节点的方法, 在上述实施例的基础上, 其中步骤 102具体可以包括: 步骤 1025 , 当釆用第三策略选取目的主时钟节点时, 获取链路延时的 步骤 1026, 根据链路延时的值、 或者根据链路延时以及链路丟包率和 / 或延时抖动的值, 选取对应的主时钟节点为目的主时钟节点。  As shown in FIG. 7, another embodiment of the present invention provides a method for selecting a master clock node based on PTP and link quality. Based on the foregoing embodiment, step 102 may specifically include: Step 1025: When the third policy selects the destination primary clock node, step 1026 of obtaining the link delay is selected according to the value of the link delay or according to the link delay and the link loss rate and/or the value of the delay jitter. The primary clock node is the destination primary clock node.
本实施例中, 当选择第三策略选取目的主时钟节点时, 可以根据链路 延时的值选取目的主时钟节点, 还可以以链路延时为第一判断指标, 以链 路丟包率和 /或延时抖动为第二判断指标选取目的主时钟节点。 当选择根据 链路延时的值选取目的主时钟节点时, 即选择对应链路延时最小的主时钟 节点为目的时钟时, 可以通过上述步骤 501至步骤 506来获取链路延时的 值, 并识别出持续时间内的最小链路延时对应的主时钟节点, 将该主时钟 节点作为目的主时钟节点。 当选择以链路延时为第一判断指标, 以链路丟 包率和 /或延时抖动为第二判断指标选取目的主时钟节点时, 可以按照上述 步骤 501至步骤 508获取链路延时以及链路丟包率和 /或延时抖动的值, 在 持续时间内选取的对应链路延时最小的主时钟节点中, 选出链路丟包率和 / 或延时抖动最小的对应的主时钟节点, 将该主时钟节点作为目的主时钟节 点, 从而达到根据配置的链路质量选择策略选取目的主时钟节点的目的。  In this embodiment, when the third policy is selected to select the destination primary clock node, the destination primary clock node may be selected according to the value of the link delay, and the link delay may be used as the first judgment indicator, and the link loss rate is And/or delay jitter is the second judgment indicator to select the destination master clock node. When the destination clock node is selected according to the value of the link delay, that is, when the master clock node with the smallest link delay is selected as the destination clock, the value of the link delay can be obtained through the foregoing steps 501 to 506. And identifying the primary clock node corresponding to the minimum link delay in the duration, and using the primary clock node as the destination primary clock node. When the link delay is selected as the first judgment indicator, and the target primary clock node is selected by using the link loss ratio and/or the delay jitter as the second judgment indicator, the link delay may be obtained according to the foregoing steps 501 to 508. And the value of the link loss rate and/or the delay jitter, and the corresponding link loss rate and/or the delay jitter minimum is selected among the primary clock nodes with the smallest link delay selected in the duration. The master clock node uses the master clock node as the destination master clock node to achieve the purpose of selecting the destination master clock node according to the configured link quality selection policy.
本实施例中, 当主时钟节点为两步时钟时, 将收到的相应的跟随 ^艮文 数计入接收报文数内。 当主时钟节点为两步时钟时, 即主时钟节点发送同 步报文的时间不是通过时间戳携带在同步报文发送给从时钟节点, 而是当 主时钟节点发送同步报文之后, 通过向从时钟节点发送包含有主时钟节点 发送同步报文的时间的跟随报文告知从时钟节点其发送同步报文的时间, 在此种情况下, 从时钟节点将收到的相应的跟随报文数计入接收报文数内, 以便后续计算链路丟包率之用。 In this embodiment, when the master clock node is a two-step clock, the number of corresponding follow-up messages received is counted in the number of received packets. When the master clock node is a two-step clock, that is, the time at which the master clock node sends the synchronization packet is not carried by the timestamp, and the synchronization packet is sent to the slave clock node, but After sending the synchronization packet, the master clock node notifies the slave clock node of the time at which the slave clock node sends the synchronization packet by sending the following message including the time when the master clock node sends the synchronization packet, in this case, the slave clock. The node counts the number of corresponding following packets received into the number of received packets, so as to calculate the link loss rate.
如图 8所示, 本发明还提出一种基于 PTP及链路质量选取主时钟节点 的从时钟节点, 包括:  As shown in FIG. 8, the present invention also provides a slave clock node for selecting a master clock node based on PTP and link quality, including:
配置模块 801 , 用于根据链路质量指标配置链路质量选择策略, 所述链 路质量指标包括: 链路丟包率、 和 /或延时抖动、 和 /或链路延时;  The configuration module 801 is configured to configure a link quality selection policy according to the link quality indicator, where the link quality indicator includes: a link loss rate, and/or a delay jitter, and/or a link delay.
选择模块 802 , 用于根据配置的链路质量选择策略选取目的主时钟节 点。  The selecting module 802 is configured to select a destination main clock node according to the configured link quality selection policy.
本实施例中, 链路质量选择策略包括: 以链路丟包率为第一判断指标, 以延时抖动和 /或链路延时为第二判断指标选取目的主时钟节点的第一策 略; 和 /或, 以延时抖动为第一判断指标, 以链路丟包率和 /或链路延时为第 二判断指标选取目的主时钟节点的第二策略; 和 /或, 以链路延时为第一判 断指标, 以链路丟包率和 /或延时抖动为第二判断指标选取目的主时钟节点 的第三策略。  In this embodiment, the link quality selection policy includes: a first criterion for selecting a target primary clock node by using a link loss rate as a first judgment indicator, and using a delay jitter and/or a link delay as a second judgment indicator; And/or, using the delay jitter as the first judgment indicator, selecting the second strategy of the destination master clock node by using the link loss rate and/or the link delay as the second judgment indicator; and/or The time is the first judgment indicator, and the third strategy of selecting the destination master clock node by using the link loss rate and/or the delay jitter as the second judgment indicator.
如图 9所示, 选择模块 802可以包括:  As shown in FIG. 9, the selection module 802 can include:
获取单元 8021 , 用于釆用所述第一策略选取目的主时钟节点时, 获取 值;  The obtaining unit 8021 is configured to obtain a value when the destination primary clock node is selected by using the first policy.
选择单元 8022, 用于根据所述链路丟包率的值、 或者根据链路丟包率 以及延时抖动和 /或链路延时的值, 选取对应的主时钟节点为目的主时钟节 点。  The selecting unit 8022 is configured to select a corresponding primary clock node as the destination primary clock node according to the value of the link loss ratio of the link, or according to a link loss ratio and a value of delay jitter and/or link delay.
本实施例中, 根据获取单元 8021所获取链路丟包率的值, 或者获取链 路丟包率的值以及延时抖动和 /或链路延时的值,选择单元 8022以其中的最 小链路丟包率或者最小链路丟包率结合最小延时抖动和 /或链路延时来选择 目的主时钟节点。 In this embodiment, according to the value of the link loss rate obtained by the obtaining unit 8021, or the value of the link packet loss rate and the value of the delay jitter and/or the link delay, the selection unit 8022 is the most The small link loss rate or the minimum link loss rate is combined with the minimum delay jitter and/or link delay to select the destination primary clock node.
更进一步的, 本实施例中, 获取单元 8021 , 还用于釆用所述第二策略 选取目的主时钟节点时, 获取延时抖动的值, 或者获取延时抖动的以及链 路丟包率和 /或链路延时的值;  Further, in this embodiment, the obtaining unit 8021 is further configured to: when the target primary clock node is selected by using the second policy, obtain a value of delay jitter, or obtain a delay jitter and a link loss ratio. / or the value of the link delay;
选择单元 8022, 还用于根据所述延时抖动的值、 或者根据延时抖动以 及链路丟包率和 /或链路延时的值, 选取对应的主时钟节点为目的主时钟节 点。  The selecting unit 8022 is further configured to select the corresponding primary clock node as the destination primary clock node according to the value of the delay jitter or according to the delay jitter and the link loss rate and/or the link delay value.
釆用第二策略选取目的主时钟节点时, 获取单元 8021获取延时抖动的 值, 或者获取延时抖动的以及链路丟包率和 /或链路延时的值, 选择单元 8022 以其中的最小延时抖动或者最小延时抖动结合最小链路丟包率和 /或 链路延时来选择目的主时钟节点。  When the second policy is used to select the destination primary clock node, the obtaining unit 8021 obtains the value of the delay jitter, or obtains the value of the delay jitter and the link loss rate and/or the link delay, and the selecting unit 8022 is configured therein. The minimum delay jitter or minimum delay jitter is combined with the minimum link loss rate and/or link delay to select the destination primary clock node.
更进一步的, 获取单元 8021 , 还用于釆用所述第三策略选取目的主时 钟节点时, 获取链路延时的值, 或者获取链路延时的值以及链路丟包率和 / 或延时抖动的值;  Further, the obtaining unit 8021 is further configured to: when selecting the destination primary clock node by using the third policy, obtain a link delay value, or obtain a link delay value and a link loss ratio and/or The value of the delay jitter;
选择单元 8022, 还用于根据链路延时的值、 或者根据链路延时以及链 路丟包率和 /或延时抖动的值, 选取对应的主时钟节点为目的主时钟节点。  The selecting unit 8022 is further configured to select the corresponding primary clock node as the destination primary clock node according to the value of the link delay or according to the link delay and the link loss rate and/or the value of the delay jitter.
釆用第三策略选取目的主时钟节点时, 获取单元 8021获取链路延时的  When the third strategy is used to select the destination primary clock node, the obtaining unit 8021 obtains the link delay.
8022 其中的最小链路延时或者最小链路延时结合最小链路丟包率和 /或延 时抖动来选取目的主时钟节点。 8022 The minimum link delay or the minimum link delay is combined with the minimum link loss rate and/or delay jitter to select the destination primary clock node.
如图 10所示, 获取单元 8021可以包括:  As shown in FIG. 10, the obtaining unit 8021 may include:
发送子单元 80211 ,用于向对应的主时钟节点发送携带有期望主时钟节 点发送同步报文的间隔时间和持续时间的管理消息或信号消息;  The sending subunit 80211 is configured to send, to the corresponding primary clock node, a management message or a signal message carrying an interval and duration of the synchronization message sent by the desired primary clock node;
接收子单元 80212 ,用于接收主时钟节点在所述持续时间内以所述间隔 时间发送的携带有表示同步报文发送时间的第一时间戳的同步报文; 获取子单元 80213 , 用于获取表示所述同步报文接收时间的第二时间 戳, 根据所述同步报文中时钟标识符识别发送所述同步报文的主时钟节点, 将所述主时钟节点的相关信息保存; a receiving subunit 80212, configured to receive the master clock node at the interval for the duration The time-sent synchronization message carrying the first timestamp indicating the synchronization time of the synchronization message; the obtaining sub-unit 80213, configured to acquire a second timestamp indicating the time of receiving the synchronization message, according to the synchronization message The clock identifier identifies a primary clock node that sends the synchronization packet, and saves related information of the primary clock node;
报文计数子单元 80214,用于将已接收同步报文数计数加一计入接收报 文数内;  a message counting sub-unit 80214, configured to count the number of received synchronization packets plus one count into the number of received messages;
其中, 发送子单元 80211 , 还用于向主时钟节点发送延时请求 文; 获取子单元 80213 ,还用于获取表示所述延时请求报文发送时间的第三 时间戳;  The sending sub-unit 80211 is further configured to send a delay request message to the primary clock node, and the obtaining sub-unit 80213 is further configured to obtain a third timestamp indicating the sending time of the delayed request message;
接收子单元 80212 ,还用于接收主时钟节点发送的包含有表示所述延时 请求报文接收时间的第四时间戳的延时应答报文;  The receiving subunit 80212 is further configured to receive, by the primary clock node, a delayed response packet that includes a fourth timestamp indicating a time when the delay request packet is received;
计算子单元 80215 , 用于根据第一时间戳、 第二时间戳、 第三时间戳以 及第四时间戳计算每次链路延时的值; 以及  a calculating subunit 80215, configured to calculate a value of each link delay according to the first timestamp, the second timestamp, the third timestamp, and the fourth timestamp;
根据第一时间戳以及第二时间戳计算每次延时抖动的值; 以及 所述持续时间期满后, 根据接收报文数计算丟包率的值, 该丟包率的 值为持续时间内从时钟节点实际收到的报文数即所述接收报文数与理论期 望值的比值。  Calculating a value of each delay jitter according to the first timestamp and the second timestamp; and after expiration of the duration, calculating a value of the packet loss rate according to the number of received packets, where the value of the packet loss rate is a duration The number of packets actually received from the clock node is the ratio of the number of received packets to the theoretical expected value.
如图 11所示,本发明还提出一种基于 PTP及链路质量选取主时钟节点 的系统 1 , 包括上述实施例中的从时钟节点 10, 以及与从时钟节点 10通过 交换机连接的复数个主时钟节点 11。 上述实施例中, 当从时钟节点选择根 据配置的链路质量选择策略选取目的主时钟节点之后, 通过与所述目的主 时钟节点进行 1588交互, 进行后续同步本时钟的步骤。  As shown in FIG. 11, the present invention further provides a system 1 for selecting a master clock node based on PTP and link quality, including the slave clock node 10 in the above embodiment, and a plurality of masters connected to the slave clock node 10 through the switch. Clock node 11. In the above embodiment, after the slave clock node selects the destination master clock node according to the configured link quality selection policy, the step of synchronizing the clock is performed by performing 1588 interaction with the destination master clock node.
本发明实施例通过用户配置链路质量(主要包括链路丟包率、 和 /或延 时抖动、 和 /或链路延时等指标)选择策略, 并根据用户配置的链路质量选 择策略结合 PTP协议选取目的主时钟节点, 不仅满足了用户的实际选择需 求, 而且提高了获取主时钟节点时的多选择性和灵活性, 解决了传统 PTN 中主时钟节点不发送通告报文时无法选择主时钟节点的问题。 In the embodiment of the present invention, a user selects a link quality (including a link loss ratio, and/or a delay jitter, and/or a link delay) to select a policy, and combines the link quality selection policy according to the user configuration. The PTP protocol selects the destination master clock node, which not only satisfies the actual selection needs of the user. The method further improves the multi-selectivity and flexibility when acquiring the master clock node, and solves the problem that the master clock node cannot select the master clock node when the master clock node does not send the advertisement message.
以上所述仅为本发明的优选实施例, 并非因此限制本发明的专利范围, 凡是利用本发明说明书及附图内容所作的等效结构或流程变换, 或直接或 间接运用在其他相关的技术领域, 均同理包括在本发明的专利保护范围内。  The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the invention, and equivalent structural or process changes made by the present specification and the drawings may be directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of the present invention.

Claims

权利要求书 Claim
1、 一种基于精确时钟同步协议(PTP )及链路质量选取主时钟节点的 方法, 其特征在于, 所述方法包括以下步骤:  A method for selecting a master clock node based on a precise clock synchronization protocol (PTP) and link quality, wherein the method comprises the following steps:
根据链路质量指标配置链路质量选择策略, 所述链路质量指标包括: 链路丟包率、 和 /或延时抖动、 和 /或链路延时;  The link quality selection policy is configured according to the link quality indicator, where the link quality indicator includes: link loss rate, and/or delay jitter, and/or link delay;
根据配置的链路质量选择策略选取目的主时钟节点。  Select the destination primary clock node according to the configured link quality selection policy.
2、 根据权利要求 1所述的方法, 其特征在于, 所述链路质量选择策略 包括: 以链路丟包率为第一判断指标, 以延时抖动和 /或链路延时为第二判 断指标选取目的主时钟节点的第一策略; 或  The method according to claim 1, wherein the link quality selection policy comprises: a link loss rate as a first judgment indicator, and a delay jitter and/or a link delay as a second Determining the first strategy of selecting the destination master clock node; or
以延时抖动为第一判断指标, 以链路丟包率和 /或链路延时为第二判断 指标选取目的主时钟节点的第二策略; 或  Taking the delay jitter as the first judgment indicator, and selecting the second strategy of the destination master clock node by using the link loss rate and/or the link delay as the second judgment indicator; or
以链路延时为第一判断指标, 以链路丟包率和 /或延时抖动为第二判断 指标选取目的主时钟节点的第三策略。  Taking the link delay as the first judgment indicator, the link loss rate and/or the delay jitter are used as the second judgment indicator to select the third strategy of the destination master clock node.
3、 根据权利要求 2所述的方法, 其特征在于, 所述根据配置的链路质 量选择策略选取目的主时钟节点, 包括:  The method according to claim 2, wherein the selecting a destination master clock node according to the configured link quality selection policy comprises:
釆用所述第一策略选取目的主时钟节点时, 获取链路丟包率的值, 或
Figure imgf000021_0001
W或链路延时 的值选取对应的主时钟节点为目的主时钟节点。
When the destination primary clock node is selected by using the first policy, the value of the link loss ratio is obtained, or
Figure imgf000021_0001
The value of the W or link delay selects the corresponding primary clock node as the destination primary clock node.
4、 根据权利要求 2所述的方法, 其特征在于, 所述根据配置的链路质 量选择策略选取目的主时钟节点, 包括:  The method according to claim 2, wherein the selecting a destination master clock node according to the configured link quality selection policy comprises:
釆用所述第二策略选取目的主时钟节点时, 获取延时抖动的值, 或者 获取延时抖动以及链路丟包率和 /或链路延时的值;  And obtaining the value of the delay jitter, or obtaining the value of the delay jitter and the link loss rate and/or the link delay when the destination primary clock node is selected by using the second policy;
根据延时抖动的值、 或者根据延时抖动以及链路丟包率和 /或链路延时 的值, 选取对应的主时钟节点为目的主时钟节点。 According to the value of the delay jitter, or according to the delay jitter and the link loss rate and/or the link delay value, the corresponding primary clock node is selected as the target primary clock node.
5、 根据权利要求 2所述的方法, 其特征在于, 所述根据配置的链路质 量选择策略选取目的主时钟节点, 包括: The method according to claim 2, wherein the selecting a destination master clock node according to the configured link quality selection policy comprises:
釆用所述第三策略选取目的主时钟节点时, 获取链路延时的值, 或者 根据链路延时的值、 或者根据链路延时以及链路丟包率和 /或延时抖动 的值, 选取对应的主时钟节点为目的主时钟节点。  Obtaining the value of the link delay when selecting the destination primary clock node by using the third policy, or according to the link delay value, or according to the link delay and the link loss rate and/or delay jitter Value, select the corresponding primary clock node as the destination primary clock node.
6、 根据权利要求 3至 5中任一项所述的方法, 其特征在于, 获取链路 丟包率和 /或延时抖动和 /或链路延时的值, 包括:  The method according to any one of claims 3 to 5, characterized in that the value of the link loss rate and/or the delay jitter and/or the link delay is obtained, including:
从时钟节点向与自身对应的主时钟节点发送携带有期望主时钟节点发 送同步报文的间隔时间和持续时间的管理消息或信号消息;  Transmitting, from the clock node to the master clock node corresponding to itself, a management message or a signal message carrying an interval and duration of the synchronization message sent by the desired master clock node;
接收主时钟节点在所述持续时间内以所述间隔时间发送的携带有表示 同步报文发送时间的第一时间戳的同步报文;  And receiving, by the master clock node, the synchronization packet that is sent by the interval time and has a first timestamp indicating a synchronization packet sending time;
获取表示所述同步报文接收时间的第二时间戳, 根据所述同步报文中 时钟标识符识别发送同步报文的主时钟节点, 将所述主时钟节点的相关信 息保存, 并将已接收同步报文数计数加一计入接收报文数内;  Obtaining a second timestamp indicating the time of receiving the synchronization packet, identifying a primary clock node that sends the synchronization packet according to the clock identifier in the synchronization packet, saving related information of the primary clock node, and receiving the information The number of synchronization packets is counted plus one counted into the number of received packets;
向主时钟节点发送延时请求报文, 并获取表示所述延时请求报文发送 时间的第三时间戳;  Sending a delay request message to the primary clock node, and acquiring a third timestamp indicating the time for sending the delayed request message;
接收主时钟节点发送的包含有表示所述延时请求报文接收时间的第四 时间戳的延时应答 ^艮文;  Receiving, by the primary clock node, a delay response including a fourth timestamp indicating the time when the delay request message is received;
根据所述第一时间戳、 第二时间戳、 第三时间戳以及第四时间戳计算 链路延时的值; 和 /或  Calculating a value of the link delay according to the first timestamp, the second timestamp, the third timestamp, and the fourth timestamp; and/or
根据所述第一时间戳、 第二时间戳、 第三时间戳以及第四时间戳计算 延时抖动的值; 和 /或  Calculating a value of the delay jitter according to the first timestamp, the second timestamp, the third timestamp, and the fourth timestamp; and/or
所述持续时间期满后, 根据所述接收报文数计算丟包率的值, 所述丟 包率的值为所述持续时间内从时钟节点接收报文数与理论期望值的比值。 After the expiration of the duration, the value of the packet loss rate is calculated according to the number of received packets, and the value of the packet loss rate is a ratio of the number of received packets from the clock node to the theoretical expected value in the duration.
7、 根据权利要求 6所述的方法, 其特征在于, 所述将已接收同步报文 数计数加一计入接收报文数内之后, 所述方法还包括: The method according to claim 6, wherein, after the counting of the number of received synchronization packets is counted in the number of received packets, the method further includes:
所述主时钟节点为两步时钟时, 将收到的跟随报文数计入所述接收报 文数内。  When the master clock node is a two-step clock, the number of received follow messages is counted in the number of received packets.
8、 一种基于 PTP及链路质量选取主时钟节点的从时钟节点, 其特征在 于, 所述从时钟节点包括:  8. A slave clock node that selects a master clock node based on PTP and link quality, wherein the slave clock node includes:
配置模块, 用于根据链路质量指标配置链路质量选择策略, 所述链路 质量指标包括: 链路丟包率、 和 /或延时抖动、 和 /或链路延时;  a configuration module, configured to configure a link quality selection policy according to a link quality indicator, where the link quality indicator includes: a link loss rate, and/or a delay jitter, and/or a link delay;
选择模块, 用于根据配置的链路质量选择策略选取目的主时钟节点。 The selecting module is configured to select a destination primary clock node according to the configured link quality selection policy.
9、 根据权利要求 8所述的从时钟节点, 其特征在于, 所述链路质量选 择策略包括: 以链路丟包率为第一判断指标, 以延时抖动和 /或链路延时为 第二判断指标选取目的主时钟节点的第一策略; 或 9. The slave clock node according to claim 8, wherein the link quality selection policy comprises: a link loss rate as a first judgment indicator, and a delay jitter and/or a link delay The second criterion is to select a first strategy of the destination master clock node; or
以延时抖动为第一判断指标, 以链路丟包率和 /或链路延时为第二判断 指标选取目的主时钟节点的第二策略; 或  Taking the delay jitter as the first judgment indicator, and selecting the second strategy of the destination master clock node by using the link loss rate and/or the link delay as the second judgment indicator; or
以链路延时为第一判断指标, 以链路丟包率和 /或延时抖动为第二判断 指标选取目的主时钟节点的第三策略。  Taking the link delay as the first judgment indicator, the link loss rate and/or the delay jitter are used as the second judgment indicator to select the third strategy of the destination master clock node.
10、 根据权利要求 9所述的从时钟节点, 其特征在于, 所述选择模块 包括:  The slave clock node according to claim 9, wherein the selection module comprises:
获取单元, 用于釆用所述第一策略选取目的主时钟节点时, 获取链路 选择单元, 用于根据所述获取单元所获取链路丟包率的值、 或者根据 链路丟包率以及延时抖动和 /或链路延时的值 , 选取对应的主时钟节点为目 的主时钟节点。  And an obtaining unit, configured to: when the first policy is used to select a destination primary clock node, obtain a link selection unit, configured to obtain a value of a link loss ratio obtained according to the acquiring unit, or a link loss rate according to a link, and For the value of delay jitter and/or link delay, select the corresponding master clock node as the destination master clock node.
11、 根据权利要求 10所述的从时钟节点, 其特征在于,  11. The slave clock node of claim 10, wherein
所述获取单元, 还用于釆用所述第二策略选取目的主时钟节点时, 获 取延时抖动的值,或者获取延时抖动的 The obtaining unit is further configured to: when the second policy is used to select a target master clock node, obtain Take the value of the delay jitter or obtain the delay jitter
所述选择单元, 还用于根据所述获取单元所获取延时抖动的值、 或者 为目的主时钟节点。  The selecting unit is further configured to: according to the value of the delay jitter acquired by the acquiring unit, or the target master clock node.
12、 根据权利要求 10所述的从时钟节点, 其特征在于,  12. The slave clock node of claim 10, wherein
所述获取单元, 还用于釆用所述第三策略选取目的主时钟节点时, 获 值;  The obtaining unit is further configured to: when the third policy is used to select a destination master clock node, obtain the value;
所述选择单元, 还用于根据所述获取单元所获取链路延时的值、 或者 为目的主时钟节点。  The selecting unit is further configured to: according to the value of the link delay acquired by the acquiring unit, or the target master clock node.
13、 根据权利要求 10、 11或 12所述的从时钟节点, 其特征在于, 所 述获取单元包括:  The slave clock node according to claim 10, 11 or 12, wherein the obtaining unit comprises:
发送子单元, 用于向对应从时钟节点的主时钟节点发送携带有期望主 时钟节点发送同步报文的间隔时间和持续时间的管理消息或信号消息; 接收子单元, 用于接收主时钟节点在所述持续时间内以所述间隔时间 发送的携带有表示同步报文发送时间的第一时间戳的同步报文;  a sending subunit, configured to send, to the primary clock node corresponding to the slave clock node, a management message or a signal message carrying an interval and duration of sending the synchronization message by the desired primary clock node; and a receiving subunit, configured to receive the primary clock node And transmitting, by the interval, the synchronization packet that carries the first timestamp indicating the synchronization packet sending time;
获取子单元, 用于获取表示所述同步报文接收时间的第二时间戳; 根 据同步报文中时钟标识符识别发送同步报文的主时钟节点, 将所述主时钟 节点的相关信息保存;  Obtaining a sub-unit, configured to acquire a second timestamp indicating a time for receiving the synchronization packet; identifying a primary clock node that sends the synchronization packet according to a clock identifier in the synchronization packet, and saving related information of the primary clock node;
报文计数子单元, 用于将已接收同步报文数计数加一计入接收报文数 内;  a message counting sub-unit, configured to count the number of received synchronization packets plus one count into the number of received messages;
所述发送子单元, 还用于向所述主时钟节点发送延时请求报文; 所述获取子单元, 还用于获取表示所述延时请求报文发送时间的第三 时间戳; 所述接收子单元, 还用于接收主时钟节点发送的包含有表示所述延时 请求报文接收时间的第四时间戳的延时应答报文; The sending subunit is further configured to send a delay request message to the primary clock node, where the acquiring subunit is further configured to acquire a third timestamp indicating a sending time of the delay request message; The receiving subunit is further configured to receive, by the primary clock node, a delayed response packet that includes a fourth timestamp indicating a time when the delay request packet is received;
计算子单元, 用于根据所述第一时间戳、 第二时间戳、 第三时间戳以 及第四时间戳计算链路延时的值; 和 /或  a calculating subunit, configured to calculate a value of the link delay according to the first timestamp, the second timestamp, the third timestamp, and the fourth timestamp; and/or
根据所述第一时间戳、 第二时间戳、 第三时间戳以及第四时间戳计算 延时抖动的值; 和 /或  Calculating a value of the delay jitter according to the first timestamp, the second timestamp, the third timestamp, and the fourth timestamp; and/or
所述持续时间期满后, 根据所述接收报文数计算丟包率的值, 该丟包 率的值为持续时间内从时钟节点接收报文数与理论期望值的比值。  After the expiration of the duration, the value of the packet loss rate is calculated according to the number of received packets, and the value of the packet loss rate is a ratio of the number of received packets from the clock node to the theoretical expected value during the duration.
14、 根据权利要求 13所述的从时钟节点, 其特征在于, 所述报文计数 子单元还用于在所述主时钟节点为两步时钟时, 将收到的跟随报文数计入 所述接收报文数内。  The slave clock node according to claim 13, wherein the message counting subunit is further configured to count the number of received packets when the master clock node is a two-step clock. The number of received messages.
15、 一种基于 PTP及链路质量选取主时钟节点的系统, 其特征在于, 包括如权利要求 8至权利要求 14所述的从时钟节点, 以及与所述从时钟节 点通过交换机连接的复数个主时钟节点。  15. A system for selecting a master clock node based on PTP and link quality, comprising: a slave clock node according to claims 8 to 14, and a plurality of slave clock nodes connected through a switch Primary clock node.
PCT/CN2011/076233 2010-06-24 2011-06-23 Method, slave clock node and system for selecting master clock node based on precision time protocol (ptp) and link quality WO2011160595A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010209111.5 2010-06-24
CN201010209111.5A CN101882990B (en) 2010-06-24 2010-06-24 Method for selecting master clock based on PTP (Picture Transfer Protocol) and link quality, slave clock and system

Publications (1)

Publication Number Publication Date
WO2011160595A1 true WO2011160595A1 (en) 2011-12-29

Family

ID=43054893

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/076233 WO2011160595A1 (en) 2010-06-24 2011-06-23 Method, slave clock node and system for selecting master clock node based on precision time protocol (ptp) and link quality

Country Status (2)

Country Link
CN (1) CN101882990B (en)
WO (1) WO2011160595A1 (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101882990B (en) * 2010-06-24 2014-08-13 中兴通讯股份有限公司 Method for selecting master clock based on PTP (Picture Transfer Protocol) and link quality, slave clock and system
US8675689B2 (en) * 2011-02-15 2014-03-18 General Electric Company Method of time synchronization of free running nodes in an avionics network
CN102158335B (en) * 2011-04-21 2015-04-01 中兴通讯股份有限公司 Method and device for processing time synchronization port
CN102957488B (en) * 2011-08-18 2016-09-28 中兴通讯股份有限公司 A kind of time synchronized selects source method and device
CN103166750B (en) * 2011-12-14 2018-03-09 中兴通讯股份有限公司 Synchronizing clock time source collocation method and device
CN104641612A (en) * 2012-05-03 2015-05-20 爱立信(中国)通信有限公司(中国) Intelligent supervision for configuration of precision time protocol (PTP) entities
CN103236894B (en) * 2013-04-03 2016-08-03 北京东土科技股份有限公司 Clock synchronizing method and device in a kind of seamless redundant network
CN103618592B (en) * 2013-11-22 2017-01-04 华为技术有限公司 A kind of PWM synchronization method and device
CN104852827A (en) * 2015-04-16 2015-08-19 国网电力科学研究院 Attack testing method and system of precision time synchronization protocol (PTP) clock
CN106330421B (en) * 2015-07-01 2020-02-14 中兴通讯股份有限公司 Method and device for realizing frequency synchronization
CN105610727B (en) * 2015-11-06 2019-02-12 瑞斯康达科技发展股份有限公司 A kind of network data transmission method and device
CN106899370A (en) * 2015-12-18 2017-06-27 中兴通讯股份有限公司 A kind of clock chain circuit changing method, device and base station
WO2020113364A1 (en) * 2018-12-03 2020-06-11 Telefonaktiebolaget Lm Ericsson (Publ) Method and network node for packet based synchronization
CN111385050B (en) 2018-12-29 2022-11-08 华为技术有限公司 Clock synchronization method, device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1845546A (en) * 2006-03-15 2006-10-11 重庆邮电学院 Accurate time synchronization method and system facing measurement and control
US20070008993A1 (en) * 2005-07-06 2007-01-11 Samsung Electronics Co.; Ltd Method for time synchronization in residential Ethernet system
CN101232457A (en) * 2008-02-22 2008-07-30 浙江大学 High-precision real-time synchronization method based on IEEE1588
CN101882990A (en) * 2010-06-24 2010-11-10 中兴通讯股份有限公司 Method for selecting master clock based on PTP (Picture Transfer Protocol) and link quality, slave clock and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101299749B (en) * 2007-04-30 2011-12-07 华为技术有限公司 Method and apparatus for transferring clock between networks
CN101459691B (en) * 2008-12-16 2012-05-23 中兴通讯股份有限公司 Method and system for realizing boundary clock in IEEE1588 protocol

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070008993A1 (en) * 2005-07-06 2007-01-11 Samsung Electronics Co.; Ltd Method for time synchronization in residential Ethernet system
CN1845546A (en) * 2006-03-15 2006-10-11 重庆邮电学院 Accurate time synchronization method and system facing measurement and control
CN101232457A (en) * 2008-02-22 2008-07-30 浙江大学 High-precision real-time synchronization method based on IEEE1588
CN101882990A (en) * 2010-06-24 2010-11-10 中兴通讯股份有限公司 Method for selecting master clock based on PTP (Picture Transfer Protocol) and link quality, slave clock and system

Also Published As

Publication number Publication date
CN101882990A (en) 2010-11-10
CN101882990B (en) 2014-08-13

Similar Documents

Publication Publication Date Title
WO2011160595A1 (en) Method, slave clock node and system for selecting master clock node based on precision time protocol (ptp) and link quality
US10887037B2 (en) Symmetric path/link over LAG interface using LLDP for time synchronization between two nodes using PTP
JP5358813B2 (en) Network node, time synchronization method, and network system
JP5495323B2 (en) Time synchronization device via network
US9154292B2 (en) Communication apparatus, communication system, and time synchronization method
US20100034191A1 (en) Method and system for time synchronization in a sensor network
EP3163786B1 (en) Clock synchronization method and apparatus
WO2014101669A1 (en) Time synchronization method and system
CN102299788A (en) Method and device for controlling automatic transmission of IEEE1558 (Institute of Electrical and Electronic Engineers 1558) protocol message
WO2015117501A1 (en) Time synchronization method, programmable logic device, single board and network element
WO2011134371A1 (en) Method for synchronizing clocks and clock synchronization device
US11683150B2 (en) Methods, apparatus and computer-readable media for synchronization over an optical network
WO2009043299A1 (en) A determining method and device for the synchronization port of a transparent clock equipment
US20220007321A1 (en) Network Entities and Methods for a Wireless Network System for Determining Time Information
Teener et al. Overview and timing performance of IEEE 802.1 AS
Mahmood et al. Clock synchronization for IEEE 802.11 based wired-wireless hybrid networks using PTP
WO2013178148A1 (en) Clock synchronization method and device for communication network
CN102457346A (en) Time synchronization realizing method and clock node
CN102342051B (en) For coming the method for synchronised clock and relevant system and module by separating transmission first and second data via at least one time distribution protocol
WO2013155944A1 (en) Boundary clock, transparent clock, and method for clock transmission
Diarra et al. Improved clock synchronization start-up time for Ethernet AVB-based in-vehicle networks
Cena et al. The reference-broadcast infrastructure synchronization protocol
KR20100048124A (en) Time synchronization method in bridged local area network
JP5656306B1 (en) Synchronization establishment method
US20240187118A1 (en) Synchronization of multiple signals with an unprecise reference clock

Legal Events

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

Ref document number: 11797626

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11797626

Country of ref document: EP

Kind code of ref document: A1