WO2016184129A1 - Method, device and network apparatus for realizing unicast-based time synchronization - Google Patents

Method, device and network apparatus for realizing unicast-based time synchronization Download PDF

Info

Publication number
WO2016184129A1
WO2016184129A1 PCT/CN2016/070075 CN2016070075W WO2016184129A1 WO 2016184129 A1 WO2016184129 A1 WO 2016184129A1 CN 2016070075 W CN2016070075 W CN 2016070075W WO 2016184129 A1 WO2016184129 A1 WO 2016184129A1
Authority
WO
WIPO (PCT)
Prior art keywords
time synchronization
network device
unicast
network
role
Prior art date
Application number
PCT/CN2016/070075
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 WO2016184129A1 publication Critical patent/WO2016184129A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements

Definitions

  • the present invention relates to the field of time synchronization technologies in a network, and in particular, to a unicast-based time synchronization implementation method, apparatus, and network device.
  • time synchronization protocols have received more and more attention and extensive applications in communication networks.
  • PTP Precision Time Protocol
  • time synchronization protocols Most of them exist in the ring network and require time synchronization path backup.
  • the encapsulation format is multicast by default, but multicast has flooding and security control problems.
  • the unicast negotiation mechanism is clearly defined in the IEEE1588v2 standard. It stipulates that any available port can send unicast requests. Any port can answer unicast requests. However, the time synchronization networking topology under unicast is not described. The time synchronization networking topology under multicast is clearly designed, and the BMCA algorithm is defined to control the networking topology.
  • the IEEE1588v2 unicast negotiation mechanism is adopted to specify the behavior of unicast negotiation and the corresponding topology algorithm, so that unicast can be applied in the packet frequency recovery network, but G.
  • the network model defined by the 8265.1 standard is very limited. The model defined by it does not apply to the ring network time synchronization network. How to use unicast to complete time network deployment in the ring network is a problem that needs to be solved.
  • the embodiment of the invention provides a unicast-based time synchronization implementation method, device and network device, which implements a time synchronization networking topology at least in a unicast network.
  • the technical solution adopted by the embodiment of the present invention is the unicast-based time synchronization implementation method, and the process performed by any network device in the network includes:
  • Unicast time synchronization negotiation to neighbor network devices including:
  • A1 The any network device periodically sends a time synchronization request to the neighbor network device, and responds according to the time synchronization request of the other party;
  • step A2 If the other party agrees and replies to the time synchronization information, the negotiation is successful, and step A1 is repeated; otherwise, the negotiation fails. Repeat step A1.
  • the performing the port state selection includes: when the first precision time synchronization protocol PTP port of the any network device is connected to the second PTP port of a neighbor network device, based on the BMC (Best Master Clock, the best) The primary clock) determines the role of the first PTP port and the second PTP port; between any two adjacent network devices, the role of the port represents the role of the network device;
  • the time synchronization with the neighbor network device includes:
  • the time synchronization information is replied based on the received time synchronization request
  • synchronization is performed based on the received time synchronization information.
  • the any network device periodically sends a time synchronization request to the neighbor network device, including:
  • the neighboring network device is periodically requested to send the announce message, the sync message, and the delay response message to the neighboring network device.
  • the neighboring network device When the role of any network device is master, passive, pre-master, or listening, the neighboring network device is periodically requested to send the announce message to the neighboring network device in the set sending mode.
  • the content of the set transmission mode includes: a keep-alive period and a transmission frequency of each type of message.
  • the responding based on the time synchronization request of the other party includes:
  • the method further includes:
  • the set frequency is at least greater than the frequency corresponding to the keep-alive period.
  • the networking form of the network includes: a ring network or a chain network.
  • the set frequency is greater than the sending frequency of the announce message during the time synchronization process.
  • the present invention further provides a unicast-based time synchronization implementation device, which is disposed in any network device in a network, where the device includes: a negotiation module and a synchronization module, respectively, for each neighbor network device of the any network device Perform the following functions:
  • the negotiation module is configured to perform unicast time synchronization negotiation to the neighbor network device.
  • the synchronization module is configured to perform port state selection during negotiation, and when performing with a neighbor network device Synchronized.
  • the negotiation module includes:
  • the processing module is configured to periodically send a time synchronization request to the neighbor network device, and respond according to the time synchronization request of the other party; if the other party agrees and replies to the time synchronization information, the negotiation succeeds; otherwise, the negotiation succeeds; failure;
  • the callback module is set to recall the processing module when the negotiation is successful and the negotiation fails.
  • the synchronization module is set to:
  • the role of the PTP port; between any two adjacent network devices, the role of the port represents the role of the network device;
  • the time synchronization information is replied based on the received time synchronization request of the neighbor network device;
  • synchronization is performed based on the time synchronization information of the received neighbor network device.
  • the present invention also provides a network device, including the above-described unicast-based time synchronization implementation apparatus.
  • the embodiment of the present invention has at least the following advantages:
  • the unicast-based time synchronization implementation method, device, and network device according to the embodiment of the present invention are compared with related technologies.
  • the embodiment of the present invention proposes a unicast mode and requests a unicast request. Interval to control the interworking speed of packets.
  • the unicast encapsulation is connected to the mature multicast topology calculation model, which solves the problem of unicast deployment in the ring network. This solution can not only complete the unicast ring network requirements, but also It also supports the network topology requirements of a single multicast hybrid application.
  • FIG. 1 is a flowchart of a method for implementing time synchronization based on unicast according to a first embodiment of the present invention
  • FIG. 2 is a flowchart of a method for implementing time synchronization based on unicast according to a second embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a unicast-based time synchronization implementation apparatus according to a third embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a unicast topology of a ring network according to a sixth embodiment of the present invention.
  • FIG. 5 is a schematic diagram of topology switching in a ring network unicast when a fault occurs in the sixth embodiment of the present invention.
  • a first embodiment of the present invention is a unicast-based time synchronization implementation method. As shown in FIG. 1 , a process performed by any network device in a network includes:
  • Step S101 Perform unicast time synchronization negotiation to the neighbor network device.
  • step S101 includes:
  • A1 The any network device periodically sends a time synchronization request to the neighbor network device, and responds according to the time synchronization request of the other party;
  • step A2 If the other party agrees and replies to the time synchronization information, the negotiation is successful, and step A1 is repeated; otherwise, the negotiation fails, and step A1 is repeatedly executed.
  • the time synchronization information is specifically an announce message, a sync message, a delay response message, and the like. Time information carried. In practical applications, initially all network devices in the network are in the state of listening for the listening role.
  • the role of the network device is changed to master, so the roles of almost all network devices become The master, at this time, the any network device and the neighbor network device perform each other in the role of the master: sending a time synchronization request and replying the time synchronization information based on the time synchronization request of the other party, if the other party replies with the role of the master If the time synchronization information is used, the negotiation is successful; otherwise, the negotiation fails.
  • the existing unicast negotiation mechanism stipulates that any available port can send a unicast time synchronization request, and any available port can answer the unicast request.
  • the embodiment of the present invention is directed to the current situation that the unicast negotiation mechanism is not clearly defined. The embodiment stipulates that the ports between adjacent network devices can actively initiate time synchronization negotiation in the role of the master, and the port acting as the master must respond to the request of the other party, thereby determining the role represented by each port.
  • the A1 step is based on the other party's time synchronization request, when the role of any network device is master, the other party requests and answers; when the role of any network device is non-master, discard or reject Corresponding to the request.
  • Step S102 in the process of negotiation, performing port state selection and performing time synchronization with the neighbor network device.
  • the performing port state selection includes: determining, according to the BMC algorithm, that the first PTP port of the any network device is connected to the second PTP port of a neighbor network device
  • the role of the first PTP port and the second PTP port include: master, passive, pre-master, listening, slave, and uncalibrated. Among them, slave, master, and passive are steady-state roles, while pre-master, listening, and uncalibrated are transient roles. In order to make the following description more concise, between the roles of any two adjacent network devices, the role of the network device represents the role of the network device.
  • the time synchronization with the neighbor network device includes:
  • the time synchronization information is replied based on the received time synchronization request, so that the neighbor network device is synchronized according to the time synchronization information when the neighbor network device is in the slave role;
  • the received time synchronization information is synchronized.
  • the embodiment of the present invention specifies that any port of any network device needs to periodically send a time synchronization request to the corresponding neighbor network device, requesting to obtain time synchronization information. .
  • the port of the master role is obliged to reply to the time synchronization information based on the request of the neighbor network device.
  • This helps the multicast BMC algorithm to implement the planning topology in unicast mode, which will be applied to the multicast PTP smoothly.
  • the BMC algorithm is applied to unicast. Because the multicast does not have a request mechanism, each port actively sends time synchronization information according to the role of the master.
  • packet unicast encapsulation in addition to packet unicast encapsulation, other behaviors and The multicast situation is basically the same.
  • any network device periodically sends a time synchronization request to the neighbor network device, including:
  • the neighboring network device is periodically requested to send the announce message, the sync message, and the delay response message to the neighboring network device.
  • the neighboring network device When the role of any network device is master, passive, pre-master, or listening, the neighboring network device is periodically requested to send the announce message to the neighboring network device in the set sending mode.
  • the set transmission mode includes: a keep-alive period and a transmission frequency of each type of message. For example, it is set to send a message every 5 seconds within half an hour, wherein the keep-alive period is half an hour, and every 5 seconds is the transmission frequency of the message.
  • the networking form of the network includes: a ring network or a chain network.
  • the second embodiment of the present invention is a unicast-based time synchronization implementation method.
  • the method in this embodiment is substantially the same as the first embodiment. The difference is that, as shown in FIG. 2, the method in this embodiment includes In addition to the steps S201-202 corresponding to the steps S101-S102 of the first embodiment, the flow performed by any of the network devices further includes the following specific steps:
  • step S203 if the negotiation fails, the unicast time synchronization negotiation is re-requested to the neighbor network device at the set frequency; the set frequency is at least greater than the frequency corresponding to the keep-alive period.
  • the keep-alive period is a periodic period of time that the user presets the requesting neighbor network device to reply to the time synchronization information.
  • the set frequency is greater than the sending frequency of the announce message in the time synchronization process.
  • the third embodiment of the present invention corresponding to the first embodiment, the present embodiment introduces a unicast-based time synchronization implementation device, which is disposed in any network device in the network.
  • the device includes The following components: the negotiation module 100 and the synchronization module 200 perform the following functions for each neighbor network device of any one of the network devices:
  • the negotiation module 100 is configured to perform unicast time synchronization negotiation to the neighbor network device.
  • the negotiation module 100 includes:
  • the processing module is configured to periodically send a time synchronization request to the neighbor network device, and respond according to the time synchronization request of the other party; if the other party agrees and replies to the time synchronization information, the negotiation succeeds; otherwise, the negotiation succeeds; failure;
  • the callback module is set to recall the processing module when the negotiation is successful and the negotiation fails.
  • the role of the network device is changed to master, so the roles of almost all network devices become The master, at this time, the any network device is executed by the negotiation module 100 and the neighbor network device to each other in the role of the master: sending a time synchronization request and replying the time synchronization information based on the time synchronization request of the other party, if the other party is master The role replies to the time synchronization information, then the negotiation is successful; otherwise the negotiation fails.
  • the performing the port state selection includes: when the first PTP port of the any network device is connected to the second PTP port of a neighbor network device, based on the BMC (Best Master Clock)
  • the clock determines the roles of the first PTP port and the second PTP port; the types of roles include: master, passive, pre-master, listening, slave, and uncalibrated.
  • the role of the network device represents the role of the network device.
  • the synchronization module 200 is configured to perform port state selection during the negotiation process and perform time synchronization with the neighbor network device.
  • the synchronization module 200 is configured to:
  • the time synchronization information is replied based on the received time synchronization request of the neighbor network device, so that the neighbor network device is synchronized according to the time synchronization information when the neighbor network device is in the slave role.
  • the time synchronization information of the received neighbor network device is synchronized.
  • synchronization module 200 is configured to:
  • the neighboring network device is periodically requested to send the announce message, the sync message, and the delay response message to the neighboring network device.
  • the neighboring network device When the role of any network device is master, passive, pre-master, or listening, the neighboring network device is periodically requested to send the announce message to the neighboring network device in the set sending mode.
  • the set transmission mode includes: a keep-alive period and a transmission frequency of each type of message.
  • the networking form of the network includes: a ring network or a chain network.
  • the fourth embodiment of the present invention introduces a unicast-based time synchronization implementation device.
  • the device in this embodiment is substantially the same as the third embodiment, and the difference is that the negotiation module in this embodiment 100 also needs to complete the following functions when the negotiation fails:
  • the negotiation module 100 is further configured to request the unicast time synchronization negotiation to the neighbor network device at the set frequency in the case that the negotiation fails.
  • the set frequency is at least greater than the frequency corresponding to the keep alive period of the announce message.
  • the set frequency is greater than the sending frequency of the announce message in the time synchronization process.
  • any network device requests the unicast time synchronization negotiation to the neighbor network device through the negotiation module 100 at a higher frequency, in order to complete the topology response, so that the design can be performed in the BMC algorithm.
  • the announce packet is sent out quickly according to the request to prevent network turbulence caused by slow response.
  • the required request frequency is higher, and the sending frequency of the announce message is set, so that a better quick response effect can be achieved.
  • a fifth embodiment of the present invention includes the unicast-based time synchronization implementation device described in the foregoing third embodiment or the fourth embodiment.
  • the sixth embodiment of the present invention is based on the above embodiment, and uses an unicast ring network as an example to describe an application example of the present invention with reference to FIGS. 4-5.
  • ports of various roles of any network device in the ring network need to periodically request unicast request packets (similar to the time synchronization request in the previous embodiment) to request time synchronization negotiation.
  • port role selection and time synchronization In the process of negotiation, port role selection and time synchronization.
  • the master port of the PTP needs to receive and respond to the unicast request message, and needs to send the time synchronization information of the negotiated announce and sync messages.
  • the other port roles reject or not respond to the unicast request of the neighbor network device. Message.
  • any network device and its neighbor network devices perform the following operations:
  • the performing the port role selection includes: when the first PTP port of the any network device is connected to the second PTP port of a neighbor network device, the first PTP port and the first determined by the BMC algorithm
  • the role of the two PTP ports; the types of roles include: master, passive, pre-master, listening, slave, and uncalibrated.
  • the role of the port represents the role of the network device.
  • the following unicast negotiation interval control mode is adopted between any network device and its neighbor network devices:
  • the time synchronization information is periodically requested to the neighbor network device according to the keep-alive period configured by the user.
  • the time synchronization information of the request to the neighbor network device periodically needs to be maintained at a higher frequency. It is the sending frequency of the announce message.
  • the rate of failed master negotiation can be reduced to 60s.
  • a high-frequency request needs to be maintained in the ring network to complete the rapid response of the topology.
  • the announce message is sent out quickly.
  • the external behavior is the same as that of the multicast unicast encapsulation. This facilitates the multicast topology algorithm. Plan the topology to prevent network turbulence due to response speed.
  • the configuration destination address of the network device is configured first, so that each PTP port sends a unicast request packet.
  • the multicast topology algorithm (BMC algorithm) will time out the port as the master.
  • the port is successfully negotiated with each other and sends an announce packet.
  • the topology is generated according to the algorithm.
  • each port state sends a unicast request packet, but the roles are different.
  • the slave port is used to maintain the time from the master.
  • the passive port is used to keep the peer master port sending announce packets and keep the port in the passive state.
  • the request packet sent by the master port is rejected by the peer.
  • the packets sent by the master port are used to monitor the network topology. When the network sends changes, it can respond quickly.
  • the embodiment of the present invention needs to perform the following operations for each network device:
  • Step A Complete neighbor awareness by configuring an IP address of a neighboring port on each PTP port.
  • Step B Enable the ring network unicast mode
  • Step C The PTP port initiates a unicast time synchronization request packet to the configured IP address.
  • Step D The receiving end of the unicast time synchronization request message: if the master port accepts and responds to the request, the other role ports reject or do not respond to the request.
  • Step E After the master port successfully negotiates the issue of the announce packet, you can refer to the multicast mode to complete the topology calculation.
  • the E device cannot receive the F time, and the time information is degraded.
  • the D device changes the passive port to the master port.
  • the device E changes the time of tracking D, thereby completing the topology switching.
  • the unicast-based time synchronization implementation method, device, and network device compared with the prior art, the present invention proposes a unicast mode and limits the unicast request interval according to the actual requirements of the network deployment. To control the interworking speed of packets, and finally connect the unicast encapsulation to the mature multicast topology calculation model, which solves the problem of unicast deployment in the ring network.
  • This solution can not only complete the unicast ring network requirements, but also simultaneously Support network topology requirements for single multicast hybrid applications.
  • a unicast-based time synchronization implementation method, apparatus, and network device provided by the embodiments of the present invention have the following beneficial effects: according to the actual requirements of network deployment, a unicast mode is proposed, and a unicast request is obtained through constraints. The interval is used to control the interworking speed of packets. Finally, the unicast encapsulation is connected to the mature multicast topology calculation model, which solves the problem of unicast deployment in the ring network. This solution can not only complete the unicast ring network requirements. It also supports the network topology requirements of a single multicast hybrid application.

Abstract

Provided are a method, device and network apparatus for realizing unicast-based time synchronization. A process executed by any network apparatus in a network comprises respectively performing the following operations on each of neighbor network apparatuses of the network apparatus: negotiating with the neighbor network apparatuses for unicast time synchronization; and selecting a port state, and synchronizing with the neighboring network apparatuses. Compared to the related art, the present invention provides a unicast mode according to a practical requirement of network deployment, controls the intercommunication speed of packets by constraining an interval requested by unicast, and finally integrates unicast encapsulation into a mature multicast topology computation model, thereby effectively addressing the problem regarding unicast deployment in a looped network. The solution not only satisfies a requirement for a unicast looped network but also meets a network topology requirement for a hybrid unicast-multicast application.

Description

一种基于单播的时间同步实现方法、装置及网络设备Method, device and network device for implementing time synchronization based on unicast 技术领域Technical field
本发明涉及网络中的时间同步技术领域,尤其涉及一种基于单播的时间同步实现方法、装置及网络设备。The present invention relates to the field of time synchronization technologies in a network, and in particular, to a unicast-based time synchronization implementation method, apparatus, and network device.
背景技术Background technique
随着PTP(Precision Time Protocol,精确时间同步协议)协议在电信网络中的大规模部署展开,时间同步协议在通讯网络中得到越来越多的重视和广泛的应用,目前运营商的时间同步网络大都以环网存在,并且要求实现时间同步路径备份,封装形式默认为组播,但组播存在洪泛、安全等控制问题。With the large-scale deployment of PTP (Precision Time Protocol) protocol in telecommunication networks, time synchronization protocols have received more and more attention and extensive applications in communication networks. Currently, operators' time synchronization networks Most of them exist in the ring network and require time synchronization path backup. The encapsulation format is multicast by default, but multicast has flooding and security control problems.
单播协商机制在IEEE1588v2标准中有着明确定义,规定任意可用端口都可以发送单播请求,任意端口都可以应答单播请求,但对单播下的时间同步组网拓扑却没有描述,标准中只对组播下的时间同步组网拓扑有明确的设计,并定义了BMCA算法来控制组网拓扑。The unicast negotiation mechanism is clearly defined in the IEEE1588v2 standard. It stipulates that any available port can send unicast requests. Any port can answer unicast requests. However, the time synchronization networking topology under unicast is not described. The time synchronization networking topology under multicast is clearly designed, and the BMCA algorithm is defined to control the networking topology.
由于ITU标准推出的G.8265.1标准来定义PTP的频率同步,采用IEEE1588v2单播协商机制,规定单播协商的行为及相应拓扑算法,使得单播能够在包频率恢复网络中得到应用,但是G.8265.1标准定义的网络模型很有限,其定义的模型不适用于环网时间同步网络,在环网中如何使用单播来完成时间网络部署,是一个需要解决的问题。Due to the G.8265.1 standard introduced by the ITU standard to define the frequency synchronization of PTP, the IEEE1588v2 unicast negotiation mechanism is adopted to specify the behavior of unicast negotiation and the corresponding topology algorithm, so that unicast can be applied in the packet frequency recovery network, but G. The network model defined by the 8265.1 standard is very limited. The model defined by it does not apply to the ring network time synchronization network. How to use unicast to complete time network deployment in the ring network is a problem that needs to be solved.
发明内容Summary of the invention
本发明实施例提供了一种基于单播的时间同步实现方法、装置及网络设备,至少在单播网络中实现时间同步组网拓扑。The embodiment of the invention provides a unicast-based time synchronization implementation method, device and network device, which implements a time synchronization networking topology at least in a unicast network.
本发明实施例采用的技术方案是,所述基于单播的时间同步实现方法,网络中的任一网络设备执行的流程包括:The technical solution adopted by the embodiment of the present invention is the unicast-based time synchronization implementation method, and the process performed by any network device in the network includes:
对所述任一网络设备的各邻居网络设备分别执行如下操作:Perform the following operations on each neighbor network device of any of the network devices:
向邻居网络设备进行单播时间同步协商;Unicast time synchronization negotiation to neighbor network devices;
进行端口状态抉择,并与邻居网络设备进行时间同步。Perform port state selection and time synchronization with neighbor network devices.
向邻居网络设备进行单播时间同步协商,包括:Unicast time synchronization negotiation to neighbor network devices, including:
A1:所述任一网络设备周期性的向邻居网络设备发送时间同步请求,以及基于对方的时间同步请求而进行应答;A1: The any network device periodically sends a time synchronization request to the neighbor network device, and responds according to the time synchronization request of the other party;
A2:若对方同意并回复了时间同步信息,则协商成功,重复执行步骤A1;否则协商失败, 重复执行步骤A1。A2: If the other party agrees and replies to the time synchronization information, the negotiation is successful, and step A1 is repeated; otherwise, the negotiation fails. Repeat step A1.
所述的进行端口状态抉择,包括:在所述任一网络设备的第一精确时间同步协议PTP端口与一邻居网络设备的第二PTP端口相连的情况下,基于BMC(Best Master Clock,最佳主时钟)算法确定出的所述第一PTP端口与第二PTP端口的角色;在任意两个相邻的网络设备之间,由端口的角色代表网络设备的角色;The performing the port state selection includes: when the first precision time synchronization protocol PTP port of the any network device is connected to the second PTP port of a neighbor network device, based on the BMC (Best Master Clock, the best) The primary clock) determines the role of the first PTP port and the second PTP port; between any two adjacent network devices, the role of the port represents the role of the network device;
所述的与邻居网络设备进行时间同步,包括:The time synchronization with the neighbor network device includes:
当所述任一网络设备的角色为master时,基于接收到的时间同步请求而回复时间同步信息;When the role of any of the network devices is master, the time synchronization information is replied based on the received time synchronization request;
当所述任一网络设备的角色为slave时,基于接收到的时间同步信息进行同步。When the role of any of the network devices is a slave, synchronization is performed based on the received time synchronization information.
所述任一网络设备周期性的向邻居网络设备发送时间同步请求,包括:The any network device periodically sends a time synchronization request to the neighbor network device, including:
当任一网络设备的角色为slave或uncalibrated时,周期性的向邻居网络设备请求该邻居网络设备以设定的发送方式回复announce报文、sync报文以及delay response报文;When the role of any network device is slave or uncalibrated, the neighboring network device is periodically requested to send the announce message, the sync message, and the delay response message to the neighboring network device.
当任一网络设备的角色为master、passive、pre-master、或listening时,周期性的向邻居网络设备请求该邻居网络设备以设定的发送方式回复announce报文;When the role of any network device is master, passive, pre-master, or listening, the neighboring network device is periodically requested to send the announce message to the neighboring network device in the set sending mode.
所述设定的发送方式的内容包含:保活周期和各类型报文的发送频率。The content of the set transmission mode includes: a keep-alive period and a transmission frequency of each type of message.
所述基于对方的时间同步请求而进行应答,包括:The responding based on the time synchronization request of the other party includes:
当任一网络设备的角色为master时,同意对方请求并应答;当任一网络设备的角色为非master时,丢弃或拒绝对应请求。When the role of any network device is master, the other party requests and responds; when the role of any network device is non-master, the corresponding request is discarded or rejected.
在所述协商失败的情况下,还包括:In the case that the negotiation fails, the method further includes:
以设定的频率向邻居网络设备重新请求单播时间同步协商;所述设定的频率至少大于保活周期对应的频率。Re-requesting unicast time synchronization negotiation to the neighbor network device at the set frequency; the set frequency is at least greater than the frequency corresponding to the keep-alive period.
所述网络的组网形式包括:环形组网或者链形组网。The networking form of the network includes: a ring network or a chain network.
当所述网络的组网形式为环形组网时,所述设定的频率大于时间同步过程中的announce报文的发送频率。When the networking mode of the network is a ring network, the set frequency is greater than the sending frequency of the announce message during the time synchronization process.
本发明还提供一种基于单播的时间同步实现装置,设置于网络中的任一网络设备中,所述装置包括:协商模块和同步模块,针对所述任一网络设备的各邻居网络设备分别执行如下功能:The present invention further provides a unicast-based time synchronization implementation device, which is disposed in any network device in a network, where the device includes: a negotiation module and a synchronization module, respectively, for each neighbor network device of the any network device Perform the following functions:
所述协商模块,设置为向邻居网络设备进行单播时间同步协商;The negotiation module is configured to perform unicast time synchronization negotiation to the neighbor network device.
所述同步模块,设置为在协商的过程中,进行端口状态抉择,并与邻居网络设备进行时 间同步。The synchronization module is configured to perform port state selection during negotiation, and when performing with a neighbor network device Synchronized.
所述协商模块,包括:The negotiation module includes:
处理模块,设置为所述任一网络设备周期性的向邻居网络设备发送时间同步请求,以及基于对方的时间同步请求而进行应答;若对方同意并回复了时间同步信息,则协商成功;否则协商失败;The processing module is configured to periodically send a time synchronization request to the neighbor network device, and respond according to the time synchronization request of the other party; if the other party agrees and replies to the time synchronization information, the negotiation succeeds; otherwise, the negotiation succeeds; failure;
回调模块,设置为在协商成功和协商失败时均重新调用处理模块。The callback module is set to recall the processing module when the negotiation is successful and the negotiation fails.
所述同步模块,设置为:The synchronization module is set to:
在所述任一网络设备的第一精确时间同步协议PTP端口与一邻居网络设备的第二PTP端口相连的情况下,基于最佳主时钟BMC算法确定出的所述第一PTP端口与第二PTP端口的角色;在任意两个相邻的网络设备之间,由端口的角色代表网络设备的角色;The first PTP port and the second determined based on the optimal master clock BMC algorithm, where the first precision time synchronization protocol PTP port of any one of the network devices is connected to the second PTP port of a neighbor network device The role of the PTP port; between any two adjacent network devices, the role of the port represents the role of the network device;
当所述任一网络设备的角色为master时,基于接收到的邻居网络设备的时间同步请求而回复时间同步信息;When the role of any of the network devices is master, the time synchronization information is replied based on the received time synchronization request of the neighbor network device;
当所述任一网络设备的角色为slave时,基于接收到的邻居网络设备的时间同步信息进行同步。When the role of any of the network devices is a slave, synchronization is performed based on the time synchronization information of the received neighbor network device.
本发明还提供一种网络设备,包括上述基于单播的时间同步实现装置。The present invention also provides a network device, including the above-described unicast-based time synchronization implementation apparatus.
采用上述技术方案,本发明实施例至少具有下列优点:With the above technical solution, the embodiment of the present invention has at least the following advantages:
本发明实施例所述基于单播的时间同步实现方法、装置及网络设备,与相关技术相比较,本发明实施例根据网络部署的现实要求,提出了单播模式、并通过约束单播请求的间隔来控制报文的互通速度,最后把单播封装接入已经成熟的组播拓扑计算模型,很好解决了环网中的单播部署问题,此方案不单能完成单播环网需求,也同时支持单组播混合应用的网络拓扑需求。The unicast-based time synchronization implementation method, device, and network device according to the embodiment of the present invention are compared with related technologies. According to the actual requirements of the network deployment, the embodiment of the present invention proposes a unicast mode and requests a unicast request. Interval to control the interworking speed of packets. Finally, the unicast encapsulation is connected to the mature multicast topology calculation model, which solves the problem of unicast deployment in the ring network. This solution can not only complete the unicast ring network requirements, but also It also supports the network topology requirements of a single multicast hybrid application.
附图说明DRAWINGS
图1为本发明第一实施例的基于单播的时间同步实现方法流程图;1 is a flowchart of a method for implementing time synchronization based on unicast according to a first embodiment of the present invention;
图2为本发明第二实施例的基于单播的时间同步实现方法流程图;2 is a flowchart of a method for implementing time synchronization based on unicast according to a second embodiment of the present invention;
图3为本发明第三实施例的基于单播的时间同步实现装置组成结构示意图;3 is a schematic structural diagram of a unicast-based time synchronization implementation apparatus according to a third embodiment of the present invention;
图4为本发明第六实施例环网单播拓扑结构示意图;4 is a schematic diagram of a unicast topology of a ring network according to a sixth embodiment of the present invention;
图5为本发明第六实施例发生故障时环网单播中的拓扑倒换示意图。 FIG. 5 is a schematic diagram of topology switching in a ring network unicast when a fault occurs in the sixth embodiment of the present invention.
具体实施方式detailed description
为更进一步阐述本发明为达成预定目的所采取的技术手段及功效,以下结合附图及较佳实施例,对本发明进行详细说明如后。The present invention will be described in detail below with reference to the accompanying drawings and preferred embodiments.
本发明第一实施例,一种基于单播的时间同步实现方法,如图1所示,网络中的任一网络设备执行的流程,包括:A first embodiment of the present invention is a unicast-based time synchronization implementation method. As shown in FIG. 1 , a process performed by any network device in a network includes:
对所述任一网络设备的各邻居网络设备分别执行如下操作:Perform the following operations on each neighbor network device of any of the network devices:
步骤S101,向邻居网络设备进行单播时间同步协商;Step S101: Perform unicast time synchronization negotiation to the neighbor network device.
具体的,步骤S101包括:Specifically, step S101 includes:
A1:所述任一网络设备周期性的向邻居网络设备发送时间同步请求,以及基于对方的时间同步请求而进行应答;A1: The any network device periodically sends a time synchronization request to the neighbor network device, and responds according to the time synchronization request of the other party;
A2:若对方同意并回复了时间同步信息,则协商成功,重复执行步骤A1;否则协商失败,重复执行步骤A1。本领域公知的,只要邻居网络设备回复了时间同步信息,则该邻居网络设备必然同意了该时间同步请求,这里的时间同步信息具体是指announce报文、sync报文、delay response报文等中携带的时间信息。在实际应用中,初始时,网络中的所有网络设备都处于监听listening角色的状态,若超时未收到时间同步信息,则将自身的角色转变为master,因此几乎所有网络设备的角色都变成了master,此时,所述任一网络设备与邻居网络设备互相向对方以master的角色执行:发送时间同步请求以及基于对方的时间同步请求而回复时间同步信息,若对方以master的角色回复了时间同步信息,则协商成功;否则协商失败。现有的单播协商机制规定任意可用端口都可以发送单播时间同步请求,任意可用端口都可以应答单播请求,本发明实施例针对这种当单播协商机制并未明确规定的现状,本实施例规定相邻的网络设备间的端口均可以以master的角色主动发起时间同步协商,并且作为master的端口必须应答对方的请求,从而确定出各端口所代表的角色。A2: If the other party agrees and replies to the time synchronization information, the negotiation is successful, and step A1 is repeated; otherwise, the negotiation fails, and step A1 is repeatedly executed. As is known in the art, as long as the neighbor network device replies to the time synchronization information, the neighbor network device must agree to the time synchronization request. The time synchronization information is specifically an announce message, a sync message, a delay response message, and the like. Time information carried. In practical applications, initially all network devices in the network are in the state of listening for the listening role. If the time synchronization information is not received after timeout, the role of the network device is changed to master, so the roles of almost all network devices become The master, at this time, the any network device and the neighbor network device perform each other in the role of the master: sending a time synchronization request and replying the time synchronization information based on the time synchronization request of the other party, if the other party replies with the role of the master If the time synchronization information is used, the negotiation is successful; otherwise, the negotiation fails. The existing unicast negotiation mechanism stipulates that any available port can send a unicast time synchronization request, and any available port can answer the unicast request. The embodiment of the present invention is directed to the current situation that the unicast negotiation mechanism is not clearly defined. The embodiment stipulates that the ports between adjacent network devices can actively initiate time synchronization negotiation in the role of the master, and the port acting as the master must respond to the request of the other party, thereby determining the role represented by each port.
此外,如果A1步骤中是基于对方的时间同步请求而进行应答,则当任一网络设备的角色为master时,同意对方请求并应答;当任一网络设备的角色为非master时,丢弃或拒绝对应请求。In addition, if the A1 step is based on the other party's time synchronization request, when the role of any network device is master, the other party requests and answers; when the role of any network device is non-master, discard or reject Corresponding to the request.
进一步的,further,
步骤S102,在协商的过程中,进行端口状态抉择,并与邻居网络设备进行时间同步。Step S102, in the process of negotiation, performing port state selection and performing time synchronization with the neighbor network device.
具体的,在步骤S102中,所述的进行端口状态抉择,包括:在所述任一网络设备的第一PTP端口与一邻居网络设备的第二PTP端口相连的情况下,基于BMC算法确定出的所述第一PTP端口与第二PTP端口的角色。角色的类型包括:master、passive、pre-master、listening、slave、和uncalibrated等,其中,slave、master、passive为稳态角色,而pre-master、listening、uncalibrated为瞬态角色。为了使下面的描述更加简洁明了,在任意两个相邻的网络设备之间,由端口的角色代表网络设备的角色。 Specifically, in step S102, the performing port state selection includes: determining, according to the BMC algorithm, that the first PTP port of the any network device is connected to the second PTP port of a neighbor network device The role of the first PTP port and the second PTP port. The types of roles include: master, passive, pre-master, listening, slave, and uncalibrated. Among them, slave, master, and passive are steady-state roles, while pre-master, listening, and uncalibrated are transient roles. In order to make the following description more concise, between the roles of any two adjacent network devices, the role of the network device represents the role of the network device.
所述与邻居网络设备进行时间同步,包括:The time synchronization with the neighbor network device includes:
当所述任一网络设备的角色为master时,基于接收到的时间同步请求而回复时间同步信息,以供当时该邻居网络设备作为slave角色的情况下基于该时间同步信息进行同步;When the role of the any network device is master, the time synchronization information is replied based on the received time synchronization request, so that the neighbor network device is synchronized according to the time synchronization information when the neighbor network device is in the slave role;
当任一网络设备的角色为slave时,对接收到的时间同步信息进行同步。When the role of any network device is slave, the received time synchronization information is synchronized.
实际上,在整个PTP的过程中,本发明实施例规定任一网络设备的端口不论是什么角色,都需要不停的周期性的向相应的邻居网络设备发送时间同步请求,请求获得时间同步信息。且master角色的端口均有义务基于邻居网络设备的请求而向其回复时间同步信息,这样有助于采用组播的BMC算法在单播情况下实现规划拓扑,顺利的将应用于组播PTP的BMC算法应用于单播,因为组播没有请求机制,各端口均是根据角色为master时而主动发送时间同步信息,本发明实施例可以使得对外表现上,除了报文单播封装外,其他行为与组播情况基本一致。In fact, in the process of the entire PTP, the embodiment of the present invention specifies that any port of any network device needs to periodically send a time synchronization request to the corresponding neighbor network device, requesting to obtain time synchronization information. . The port of the master role is obliged to reply to the time synchronization information based on the request of the neighbor network device. This helps the multicast BMC algorithm to implement the planning topology in unicast mode, which will be applied to the multicast PTP smoothly. The BMC algorithm is applied to unicast. Because the multicast does not have a request mechanism, each port actively sends time synchronization information according to the role of the master. In the embodiment of the present invention, in addition to packet unicast encapsulation, other behaviors and The multicast situation is basically the same.
进一步的,所述任一网络设备周期性的向邻居网络设备发送时间同步请求,包括:Further, the any network device periodically sends a time synchronization request to the neighbor network device, including:
当任一网络设备的角色为slave或uncalibrated时,周期性的向邻居网络设备请求该邻居网络设备以设定的发送方式回复announce报文、sync报文以及delay response报文;When the role of any network device is slave or uncalibrated, the neighboring network device is periodically requested to send the announce message, the sync message, and the delay response message to the neighboring network device.
当任一网络设备的角色为master、passive、pre-master、或listening时,周期性的向邻居网络设备请求该邻居网络设备以设定的发送方式回复announce报文;When the role of any network device is master, passive, pre-master, or listening, the neighboring network device is periodically requested to send the announce message to the neighboring network device in the set sending mode.
所述设定的发送方式中包含:保活周期和各类型报文的发送频率。例如:设定在半小时内每隔5秒发送一次报文,其中,保活周期即为半小时,每隔5秒即为报文的发送频率。The set transmission mode includes: a keep-alive period and a transmission frequency of each type of message. For example, it is set to send a message every 5 seconds within half an hour, wherein the keep-alive period is half an hour, and every 5 seconds is the transmission frequency of the message.
在本实施例中,网络的组网形式包括:环形组网或者链形组网。In this embodiment, the networking form of the network includes: a ring network or a chain network.
本发明第二实施例,一种基于单播的时间同步实现方法,本实施例所述方法与第一实施例大致相同,区别在于,如图2所示,本实施例的所述方法除了包括与第一实施例步骤S101~S102对应的步骤S201~202之外,所述任一网络设备执行的流程还包括以下具体步骤:The second embodiment of the present invention is a unicast-based time synchronization implementation method. The method in this embodiment is substantially the same as the first embodiment. The difference is that, as shown in FIG. 2, the method in this embodiment includes In addition to the steps S201-202 corresponding to the steps S101-S102 of the first embodiment, the flow performed by any of the network devices further includes the following specific steps:
步骤S203,在协商失败的情况下,以设定的频率向邻居网络设备重新请求单播时间同步协商;所述设定的频率至少大于保活周期对应的频率。该保活周期为用户预先设定的请求对方邻居网络设备回复时间同步信息的周期性时长。In step S203, if the negotiation fails, the unicast time synchronization negotiation is re-requested to the neighbor network device at the set frequency; the set frequency is at least greater than the frequency corresponding to the keep-alive period. The keep-alive period is a periodic period of time that the user presets the requesting neighbor network device to reply to the time synchronization information.
优选的,当所述网络的组网形式为环形组网时,所述设定的频率大于时间同步过程中的announce报文的发送频率。Preferably, when the networking form of the network is a ring network, the set frequency is greater than the sending frequency of the announce message in the time synchronization process.
本发明第三实施例,与第一实施例对应,本实施例介绍一种基于单播的时间同步实现装置,设置于网络中的任一网络设备中,如图3所示,所述装置包括以下组成部分:协商模块100和同步模块200,针对所述任一网络设备的各邻居网络设备分别执行如下功能: The third embodiment of the present invention, corresponding to the first embodiment, the present embodiment introduces a unicast-based time synchronization implementation device, which is disposed in any network device in the network. As shown in FIG. 3, the device includes The following components: the negotiation module 100 and the synchronization module 200 perform the following functions for each neighbor network device of any one of the network devices:
1)协商模块100,设置为向邻居网络设备进行单播时间同步协商;1) The negotiation module 100 is configured to perform unicast time synchronization negotiation to the neighbor network device.
具体的,协商模块100,包括:Specifically, the negotiation module 100 includes:
处理模块,设置为所述任一网络设备周期性的向邻居网络设备发送时间同步请求,以及基于对方的时间同步请求而进行应答;若对方同意并回复了时间同步信息,则协商成功;否则协商失败;The processing module is configured to periodically send a time synchronization request to the neighbor network device, and respond according to the time synchronization request of the other party; if the other party agrees and replies to the time synchronization information, the negotiation succeeds; otherwise, the negotiation succeeds; failure;
回调模块,设置为在协商成功和协商失败时均重新调用处理模块。The callback module is set to recall the processing module when the negotiation is successful and the negotiation fails.
在实际应用中,初始时,网络中的所有网络设备都处于监听listening角色的状态,若超时未收到时间同步信息,则将自身的角色转变为master,因此几乎所有网络设备的角色都变成了master,此时,所述任一网络设备通过协商模块100与邻居网络设备互相向对方以master的角色执行:发送时间同步请求以及基于对方的时间同步请求而回复时间同步信息,若对方以master的角色回复了时间同步信息,则协商成功;否则协商失败。In practical applications, initially all network devices in the network are in the state of listening for the listening role. If the time synchronization information is not received after timeout, the role of the network device is changed to master, so the roles of almost all network devices become The master, at this time, the any network device is executed by the negotiation module 100 and the neighbor network device to each other in the role of the master: sending a time synchronization request and replying the time synchronization information based on the time synchronization request of the other party, if the other party is master The role replies to the time synchronization information, then the negotiation is successful; otherwise the negotiation fails.
进一步的,所述的进行端口状态抉择,包括:在所述任一网络设备的第一PTP端口与一邻居网络设备的第二PTP端口相连的情况下,基于BMC(Best Master Clock,最佳主时钟)算法确定出的所述第一PTP端口与第二PTP端口的角色;角色的类型包括:master、passive、pre-master、listening、slave、和uncalibrated等。为了使下面的描述更加简洁明了,在任意两个相邻的网络设备之间,由端口的角色代表网络设备的角色。Further, the performing the port state selection includes: when the first PTP port of the any network device is connected to the second PTP port of a neighbor network device, based on the BMC (Best Master Clock) The clock determines the roles of the first PTP port and the second PTP port; the types of roles include: master, passive, pre-master, listening, slave, and uncalibrated. In order to make the following description more concise, between the roles of any two adjacent network devices, the role of the network device represents the role of the network device.
2)同步模块200,设置为在协商的过程中,进行端口状态抉择,并与邻居网络设备进行时间同步。2) The synchronization module 200 is configured to perform port state selection during the negotiation process and perform time synchronization with the neighbor network device.
具体的,同步模块200设置为:Specifically, the synchronization module 200 is configured to:
当所述任一网络设备的角色为master时,基于接收到的邻居网络设备的时间同步请求而回复时间同步信息,以供当时该邻居网络设备作为slave角色的情况下基于该时间同步信息进行同步;When the role of the any network device is master, the time synchronization information is replied based on the received time synchronization request of the neighbor network device, so that the neighbor network device is synchronized according to the time synchronization information when the neighbor network device is in the slave role. ;
当所述任一网络设备的角色为slave时,对接收到的邻居网络设备的时间同步信息进行同步。When the role of any of the network devices is a slave, the time synchronization information of the received neighbor network device is synchronized.
进一步的,同步模块200设置为:Further, the synchronization module 200 is configured to:
当任一网络设备的角色为slave或uncalibrated时,周期性的向邻居网络设备请求该邻居网络设备以设定的发送方式回复announce报文、sync报文以及delay response报文;When the role of any network device is slave or uncalibrated, the neighboring network device is periodically requested to send the announce message, the sync message, and the delay response message to the neighboring network device.
当任一网络设备的角色为master、passive、pre-master、或listening时,周期性的向邻居网络设备请求该邻居网络设备以设定的发送方式回复announce报文;When the role of any network device is master, passive, pre-master, or listening, the neighboring network device is periodically requested to send the announce message to the neighboring network device in the set sending mode.
所述设定的发送方式中包含:保活周期和各类型报文的发送频率。The set transmission mode includes: a keep-alive period and a transmission frequency of each type of message.
在本实施例中,网络的组网形式包括:环形组网或者链形组网。 In this embodiment, the networking form of the network includes: a ring network or a chain network.
本发明第四实施例,与第二实施例对应,介绍一种基于单播的时间同步实现装置,本实施例所述装置与第三实施例大致相同,区别在于,本实施例中的协商模块100还需完成当协商失败时的如下功能:The fourth embodiment of the present invention, corresponding to the second embodiment, introduces a unicast-based time synchronization implementation device. The device in this embodiment is substantially the same as the third embodiment, and the difference is that the negotiation module in this embodiment 100 also needs to complete the following functions when the negotiation fails:
协商模块100,还设置为,在协商失败的情况下,以设定的频率向邻居网络设备请求单播时间同步协商;所述设定的频率至少大于announce报文的保活周期对应的频率。The negotiation module 100 is further configured to request the unicast time synchronization negotiation to the neighbor network device at the set frequency in the case that the negotiation fails. The set frequency is at least greater than the frequency corresponding to the keep alive period of the announce message.
优选的,当所述网络的组网形式为环形组网时,所述设定的频率大于时间同步过程中的announce报文的发送频率。Preferably, when the networking form of the network is a ring network, the set frequency is greater than the sending frequency of the announce message in the time synchronization process.
本实施例中之所以设计当协商失败时,任一网络设备通过协商模块100以较高的频率向邻居网络设备请求单播时间同步协商,是为了完成拓扑的响应,这样设计,可以在BMC算法把PTP端口状态切换为master端口时,快速的依请求而发出announce报文,防止由于响应速度慢引起的网络动荡。在单播环网的情况下,所要求的请求频率更高,设定为announce报文的发送频率,这样能够达到更好的快速响应效果。In this embodiment, when the negotiation fails, any network device requests the unicast time synchronization negotiation to the neighbor network device through the negotiation module 100 at a higher frequency, in order to complete the topology response, so that the design can be performed in the BMC algorithm. When the state of the PTP port is switched to the master port, the announce packet is sent out quickly according to the request to prevent network turbulence caused by slow response. In the case of a unicast ring network, the required request frequency is higher, and the sending frequency of the announce message is set, so that a better quick response effect can be achieved.
本发明第五实施例,一种网络设备,可以作为实体装置来理解,包括上述第三实施例或者第四实施例中所述的基于单播的时间同步实现装置。A fifth embodiment of the present invention, a network device, which can be understood as a physical device, includes the unicast-based time synchronization implementation device described in the foregoing third embodiment or the fourth embodiment.
本发明第六实施例,本实施例是在上述实施例的基础上,以单播环网形式为例,结合附图4~5介绍一个本发明的应用实例。The sixth embodiment of the present invention is based on the above embodiment, and uses an unicast ring network as an example to describe an application example of the present invention with reference to FIGS. 4-5.
一、单播协商机制1. Unicast negotiation mechanism
本发明实施例最关键的就是规定了以下两个内容:The most important thing in the embodiment of the present invention is to specify the following two contents:
1)在PTP过程中,环网中的任一网络设备的各种角色的端口均需要通过周期性的发送单播请求报文(类似于前面实施例中的时间同步请求)来请求时间同步协商,在协商的过程中,进行端口角色抉择并进行时间同步。1) In the PTP process, ports of various roles of any network device in the ring network need to periodically request unicast request packets (similar to the time synchronization request in the previous embodiment) to request time synchronization negotiation. In the process of negotiation, port role selection and time synchronization.
2)PTP的master端口需要接收并应答该单播请求报文,同时需要发出协商成功的announce、sync报文的时间同步信息,其余的端口角色则拒绝或不响应邻居网络设备的该单播请求报文。2) The master port of the PTP needs to receive and respond to the unicast request message, and needs to send the time synchronization information of the negotiated announce and sync messages. The other port roles reject or not respond to the unicast request of the neighbor network device. Message.
在初始时,任一网络设备与其各邻居网络设备均执行如下操作:Initially, any network device and its neighbor network devices perform the following operations:
在实际应用中,初始时,网络中的所有网络设备都处于监听listening角色的状态,若超时未收到时间同步信息,则将自身的角色转变为master,因此几乎所有网络设备的角色都变成了master,此时,所述任一网络设备与邻居网络设备互相向对方以master的角色执行:请求时间同步信息以及基于对方的请求而回复时间同步信息,若对方以master的角色回复了时间同步信息,则协商成功;否则协商失败。 In practical applications, initially all network devices in the network are in the state of listening for the listening role. If the time synchronization information is not received after timeout, the role of the network device is changed to master, so the roles of almost all network devices become The master, at this time, the any network device and the neighbor network device perform each other in the role of the master: request time synchronization information and reply time synchronization information based on the request of the other party, if the other party replies time synchronization with the role of the master If the information is successful, the negotiation is successful; otherwise, the negotiation fails.
所述进行端口角色抉择,包括:在所述任一网络设备的第一PTP端口与一邻居网络设备的第二PTP端口相连的情况下,基于BMC算法确定出的所述第一PTP端口与第二PTP端口的角色;角色的类型包括:master、passive、pre-master、listening、slave、和uncalibrated。The performing the port role selection includes: when the first PTP port of the any network device is connected to the second PTP port of a neighbor network device, the first PTP port and the first determined by the BMC algorithm The role of the two PTP ports; the types of roles include: master, passive, pre-master, listening, slave, and uncalibrated.
在任意两个相邻的网络设备之间,由端口的角色代表网络设备的角色。Between any two adjacent network devices, the role of the port represents the role of the network device.
二、单播协商间隔控制Second, unicast negotiation interval control
在任一网络设备与其各邻居网络设备之间均遵循以下单播协商的间隔控制方式:The following unicast negotiation interval control mode is adopted between any network device and its neighbor network devices:
协商成功时,按照用户配置的保活周期向邻居网络设备周期性的请求时间同步信息;协商失败时,需要维持在较高频率向邻居网络设备周期性的请求时间同步信息,该较高频率可以是announce报文的发送频率。When the negotiation succeeds, the time synchronization information is periodically requested to the neighbor network device according to the keep-alive period configured by the user. When the negotiation fails, the time synchronization information of the request to the neighbor network device periodically needs to be maintained at a higher frequency. It is the sending frequency of the announce message.
对比G.8265.1的设计,其协商失败时,对失败的master协商速率可以降至60s一次,本实施例在环网中需要维持一个高频请求,是为了完成拓扑的快速响应,这样设计,可以在拓扑算法把PTP端口状态切换为master端口时,快速的发出announce报文,使得对外表现上,除了报文单播封装外,其他行为与组播情况基本一致,这样便于采用组播的拓扑算法来规划拓扑,防止由于响应速度引起网络动荡。Compared with the design of G.8265.1, when the negotiation fails, the rate of failed master negotiation can be reduced to 60s. In this embodiment, a high-frequency request needs to be maintained in the ring network to complete the rapid response of the topology. When the topology algorithm switches the PTP port status to the master port, the announce message is sent out quickly. The external behavior is the same as that of the multicast unicast encapsulation. This facilitates the multicast topology algorithm. Plan the topology to prevent network turbulence due to response speed.
三、具体组网部署说明Third, the specific network deployment instructions
如图4所示,先通过配置网络设备的协商目的地址,这样每个PTP端口都会向外发送单播请求报文,由于组播的拓扑算法(BMC算法)会在初始时把端口超时为master端口,所以会相互协商成功,并发送announce报文,然后按照算法生成拓扑,此时网络中,各个端口状态都会发送单播请求报文,但各自作用不同。slave端口是为了维持从master获取时间;passive端口是为了维持对端master端口发送announce报文,使本端口保持在passive状态。master端口发出请求报文会被对端拒绝,其发送的报文起了监控网络拓扑作用,当网络发送变化时,能快速响应。As shown in Figure 4, the configuration destination address of the network device is configured first, so that each PTP port sends a unicast request packet. The multicast topology algorithm (BMC algorithm) will time out the port as the master. The port is successfully negotiated with each other and sends an announce packet. Then, the topology is generated according to the algorithm. In this case, each port state sends a unicast request packet, but the roles are different. The slave port is used to maintain the time from the master. The passive port is used to keep the peer master port sending announce packets and keep the port in the passive state. The request packet sent by the master port is rejected by the peer. The packets sent by the master port are used to monitor the network topology. When the network sends changes, it can respond quickly.
总结起来,本发明实施例针对每台网络设备均需执行如下操作:In summary, the embodiment of the present invention needs to perform the following operations for each network device:
步骤A:通过在每个PTP端口上配置相邻端口的IP地址完成邻居感知;Step A: Complete neighbor awareness by configuring an IP address of a neighboring port on each PTP port.
步骤B:开启环网单播模式;Step B: Enable the ring network unicast mode;
步骤C:PTP端口向配置的IP地址发起单播时间同步请求报文;Step C: The PTP port initiates a unicast time synchronization request packet to the configured IP address.
步骤D:单播时间同步请求报文的接收端:若是master端口则接受并应答请求,其他角色端口则拒绝或不响应请求。Step D: The receiving end of the unicast time synchronization request message: if the master port accepts and responds to the request, the other role ports reject or do not respond to the request.
步骤E:在master端口协商成功发出announce报文后,就可以参考组播模式完成拓扑计算。具体如图5所示,当设备E与F间发送故障时,此时E设备无法收到F给的时间,其时间信息发生了降质,此时D设备就会把passive端口变为master端口,进而响应设备E的单播请求,设备E检测到D设备后,改成跟踪D的时间,从而完成了拓扑倒换。 Step E: After the master port successfully negotiates the issue of the announce packet, you can refer to the multicast mode to complete the topology calculation. As shown in Figure 5, when a fault is sent between the device E and the F, the E device cannot receive the F time, and the time information is degraded. At this time, the D device changes the passive port to the master port. In response to the unicast request of the device E, after the device E detects the D device, the device E changes the time of tracking D, thereby completing the topology switching.
本发明实施例所述基于单播的时间同步实现方法、装置及网络设备,与现有技术相比较,本发明根据网络部署的现实要求,提出了单播模式、并通过约束单播请求的间隔来控制报文的互通速度,最后把单播封装接入已经成熟的组播拓扑计算模型,很好解决了环网中的单播部署问题,此方案不单能完成单播环网需求,也同时支持单组播混合应用的网络拓扑需求。The unicast-based time synchronization implementation method, device, and network device according to the embodiment of the present invention, compared with the prior art, the present invention proposes a unicast mode and limits the unicast request interval according to the actual requirements of the network deployment. To control the interworking speed of packets, and finally connect the unicast encapsulation to the mature multicast topology calculation model, which solves the problem of unicast deployment in the ring network. This solution can not only complete the unicast ring network requirements, but also simultaneously Support network topology requirements for single multicast hybrid applications.
通过具体实施方式的说明,应当可对本发明为达成预定目的所采取的技术手段及功效得以更加深入且具体的了解,然而所附图示仅是提供参考与说明之用,并非用来对本发明加以限制。The technical means and functions of the present invention for achieving the intended purpose can be more deeply and specifically understood by the description of the specific embodiments. However, the accompanying drawings are only for the purpose of illustration and description, and are not intended to limit.
工业实用性Industrial applicability
如上所述,本发明实施例提供的一种基于单播的时间同步实现方法、装置及网络设备,具有以下有益效果:根据网络部署的现实要求,提出了单播模式、并通过约束单播请求的间隔来控制报文的互通速度,最后把单播封装接入已经成熟的组播拓扑计算模型,很好解决了环网中的单播部署问题,此方案不单能完成单播环网需求,也同时支持单组播混合应用的网络拓扑需求。 As described above, a unicast-based time synchronization implementation method, apparatus, and network device provided by the embodiments of the present invention have the following beneficial effects: according to the actual requirements of network deployment, a unicast mode is proposed, and a unicast request is obtained through constraints. The interval is used to control the interworking speed of packets. Finally, the unicast encapsulation is connected to the mature multicast topology calculation model, which solves the problem of unicast deployment in the ring network. This solution can not only complete the unicast ring network requirements. It also supports the network topology requirements of a single multicast hybrid application.

Claims (12)

  1. 一种基于单播的时间同步实现方法,网络中的任一网络设备执行的流程包括:A method for implementing time synchronization based on unicast, the process performed by any network device in the network includes:
    对所述任一网络设备的各邻居网络设备分别执行如下操作:Perform the following operations on each neighbor network device of any of the network devices:
    向邻居网络设备进行单播时间同步协商;Unicast time synchronization negotiation to neighbor network devices;
    进行端口状态抉择,并与邻居网络设备进行时间同步。Perform port state selection and time synchronization with neighbor network devices.
  2. 根据权利要求1所述的基于单播的时间同步实现方法,其中,所述向邻居网络设备进行单播时间同步协商,包括:The unicast-based time synchronization implementation method according to claim 1, wherein the performing unicast time synchronization negotiation to the neighbor network device comprises:
    A1:所述任一网络设备周期性的向邻居网络设备发送时间同步请求,以及基于对方的时间同步请求而进行应答;A1: The any network device periodically sends a time synchronization request to the neighbor network device, and responds according to the time synchronization request of the other party;
    A2:若对方同意并回复了时间同步信息,则协商成功,重复执行步骤A1;否则协商失败,重复执行步骤A1。A2: If the other party agrees and replies to the time synchronization information, the negotiation is successful, and step A1 is repeated; otherwise, the negotiation fails, and step A1 is repeatedly executed.
  3. 根据权利要求1所述的基于单播的时间同步实现方法,其中,所述的进行端口状态抉择,包括:在所述任一网络设备的第一精确时间同步协议PTP端口与一邻居网络设备的第二PTP端口相连的情况下,基于最佳主时钟BMC算法确定出的所述第一PTP端口与第二PTP端口的角色;在任意两个相邻的网络设备之间,由端口的角色代表网络设备的角色;The unicast-based time synchronization implementation method according to claim 1, wherein the performing port state selection comprises: a first precise time synchronization protocol PTP port of the any network device and a neighbor network device The role of the first PTP port and the second PTP port determined based on the best master clock BMC algorithm in the case where the second PTP port is connected; the role of the port is represented between any two adjacent network devices The role of the network device;
    所述的与邻居网络设备进行时间同步,包括:The time synchronization with the neighbor network device includes:
    当所述任一网络设备的角色为master时,基于接收到的时间同步请求而回复时间同步信息;When the role of any of the network devices is master, the time synchronization information is replied based on the received time synchronization request;
    当所述任一网络设备的角色为slave时,基于接收到的时间同步信息进行同步。When the role of any of the network devices is a slave, synchronization is performed based on the received time synchronization information.
  4. 根据权利要求2所述的基于单播的时间同步实现方法,其中,所述步骤A1中的任一网络设备周期性的向邻居网络设备发送时间同步请求,包括:The unicast-based time synchronization implementation method according to claim 2, wherein any one of the network devices in the step A1 periodically sends a time synchronization request to the neighbor network device, including:
    当任一网络设备的角色为slave或uncalibrated时,周期性的向邻居网络设备请求该邻居网络设备以设定的发送方式回复announce报文、sync报文以及delay response报文;When the role of any network device is slave or uncalibrated, the neighboring network device is periodically requested to send the announce message, the sync message, and the delay response message to the neighboring network device.
    当任一网络设备的角色为master、passive、pre-master、或listening时,周期性的向邻居网络设备请求该邻居网络设备以设定的发送方式回复announce报文;When the role of any network device is master, passive, pre-master, or listening, the neighboring network device is periodically requested to send the announce message to the neighboring network device in the set sending mode.
    所述设定的发送方式的内容包含:保活周期和各类型报文的发送频率。The content of the set transmission mode includes: a keep-alive period and a transmission frequency of each type of message.
  5. 根据权利要求2所述的基于单播的时间同步实现方法,其特征在于,所述基于对方的时间同步请求而进行应答,包括:The unicast-based time synchronization implementation method according to claim 2, wherein the responding based on the time synchronization request of the other party comprises:
    当任一网络设备的角色为master时,同意对方请求并应答;当任一网络设备的角色为非master时,丢弃或拒绝对应请求。 When the role of any network device is master, the other party requests and responds; when the role of any network device is non-master, the corresponding request is discarded or rejected.
  6. 根据权利要求2所述的基于单播的时间同步实现方法,其中,在所述协商失败的情况下,还包括:The unicast-based time synchronization implementation method according to claim 2, wherein, in the case that the negotiation fails, the method further includes:
    以设定的频率向邻居网络设备重新请求单播时间同步协商;所述设定的频率至少大于保活周期对应的频率。Re-requesting unicast time synchronization negotiation to the neighbor network device at the set frequency; the set frequency is at least greater than the frequency corresponding to the keep-alive period.
  7. 根据权利要求6所述的基于单播的时间同步实现方法,其中,所述网络的组网形式包括:环形组网或者链形组网。The unicast-based time synchronization implementation method according to claim 6, wherein the network form of the network comprises: a ring network or a chain network.
  8. 根据权利要求7所述的基于单播的时间同步实现方法,其中,当所述网络的组网形式为环形组网时,所述设定的频率大于时间同步过程中的announce报文的发送频率。The unicast-based time synchronization implementation method according to claim 7, wherein when the networking form of the network is a ring network, the set frequency is greater than the sending frequency of the announce message during the time synchronization process. .
  9. 一种基于单播的时间同步实现装置,设置于网络中的任一网络设备中,所述装置包括:协商模块和同步模块,对所述任一网络设备的各邻居网络设备分别执行如下功能:A unicast-based time synchronization implementation device is disposed in any network device in a network, where the device includes: a negotiation module and a synchronization module, and performs the following functions on each neighbor network device of any one of the network devices:
    所述协商模块,设置为向邻居网络设备进行单播时间同步协商;The negotiation module is configured to perform unicast time synchronization negotiation to the neighbor network device.
    所述同步模块,设置为进行端口状态抉择,并与邻居网络设备进行时间同步。The synchronization module is configured to perform port state selection and perform time synchronization with the neighbor network device.
  10. 根据权利要求9所述的基于单播的时间同步实现装置,其中,所述协商模块,包括:The unicast-based time synchronization implementation apparatus according to claim 9, wherein the negotiation module comprises:
    处理模块,设置为所述任一网络设备周期性的向邻居网络设备发送时间同步请求,以及基于对方的时间同步请求而进行应答;若对方同意并回复了时间同步信息,则协商成功;否则协商失败;The processing module is configured to periodically send a time synchronization request to the neighbor network device, and respond according to the time synchronization request of the other party; if the other party agrees and replies to the time synchronization information, the negotiation succeeds; otherwise, the negotiation succeeds; failure;
    回调模块,设置为在协商成功和协商失败时均重新调用处理模块。The callback module is set to recall the processing module when the negotiation is successful and the negotiation fails.
  11. 根据权利要求10所述的基于单播的时间同步实现装置,其中,所述同步模块,设置为:The unicast-based time synchronization implementation apparatus according to claim 10, wherein the synchronization module is configured to:
    在所述任一网络设备的第一精确时间同步协议PTP端口与一邻居网络设备的第二PTP端口相连的情况下,基于最佳主时钟BMC算法确定出的所述第一PTP端口与第二PTP端口的角色;在任意两个相邻的网络设备之间,由端口的角色代表网络设备的角色;The first PTP port and the second determined based on the optimal master clock BMC algorithm, where the first precision time synchronization protocol PTP port of any one of the network devices is connected to the second PTP port of a neighbor network device The role of the PTP port; between any two adjacent network devices, the role of the port represents the role of the network device;
    当所述任一网络设备的角色为master时,基于接收到的邻居网络设备的时间同步请求而回复时间同步信息;When the role of any of the network devices is master, the time synchronization information is replied based on the received time synchronization request of the neighbor network device;
    当所述任一网络设备的角色为slave时,基于接收到的时间同步信息进行同步。When the role of any of the network devices is a slave, synchronization is performed based on the received time synchronization information.
  12. 一种网络设备,包括如权利要求9-11中任一项所述的单播的时间同步实现装置。 A network device comprising the unicast time synchronization implementation device of any of claims 9-11.
PCT/CN2016/070075 2015-05-21 2016-01-04 Method, device and network apparatus for realizing unicast-based time synchronization WO2016184129A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510263983.2A CN106301645A (en) 2015-05-21 2015-05-21 A kind of time synchronization implementation method based on clean culture, device and the network equipment
CN201510263983.2 2015-05-21

Publications (1)

Publication Number Publication Date
WO2016184129A1 true WO2016184129A1 (en) 2016-11-24

Family

ID=57319299

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/070075 WO2016184129A1 (en) 2015-05-21 2016-01-04 Method, device and network apparatus for realizing unicast-based time synchronization

Country Status (2)

Country Link
CN (1) CN106301645A (en)
WO (1) WO2016184129A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111191088A (en) * 2020-01-02 2020-05-22 武汉大学 Method, system and readable medium for analyzing cross-boundary service demand

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114221730A (en) * 2020-09-04 2022-03-22 华为技术有限公司 Message processing method, device, equipment, system and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101667909B (en) * 2009-09-25 2011-12-07 华为技术有限公司 Clock docking method, clock device and clock docking system
CN102611546A (en) * 2011-01-25 2012-07-25 中兴通讯股份有限公司 PTP (precision time protocol) clock unicast and multicast mixed clock system and clock synchronization method
CN102843205A (en) * 2012-09-03 2012-12-26 杭州华三通信技术有限公司 Method and device for time synchronization convergence based on precision time protocol
CN104170291A (en) * 2012-02-22 2014-11-26 瑞典爱立信有限公司 Precision time protocol offloading in a PTP boundary clock

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101789954B (en) * 2009-01-24 2012-08-29 华为技术有限公司 Communication method, equipment and system in unicast environment
US9369224B2 (en) * 2013-01-30 2016-06-14 Huawei Technologies Co., Ltd. Clock synchronization method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101667909B (en) * 2009-09-25 2011-12-07 华为技术有限公司 Clock docking method, clock device and clock docking system
CN102611546A (en) * 2011-01-25 2012-07-25 中兴通讯股份有限公司 PTP (precision time protocol) clock unicast and multicast mixed clock system and clock synchronization method
CN104170291A (en) * 2012-02-22 2014-11-26 瑞典爱立信有限公司 Precision time protocol offloading in a PTP boundary clock
CN102843205A (en) * 2012-09-03 2012-12-26 杭州华三通信技术有限公司 Method and device for time synchronization convergence based on precision time protocol

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111191088A (en) * 2020-01-02 2020-05-22 武汉大学 Method, system and readable medium for analyzing cross-boundary service demand
CN111191088B (en) * 2020-01-02 2022-02-01 武汉大学 Method, system and readable medium for analyzing cross-boundary service demand

Also Published As

Publication number Publication date
CN106301645A (en) 2017-01-04

Similar Documents

Publication Publication Date Title
TWI575917B (en) Establishing reliable routes without expensive mesh peering
US9369224B2 (en) Clock synchronization method and device
EP2688307B1 (en) Wireless communication system for offline participation in a display session
CN101616163B (en) Method and device for processing precise time transfer protocol message
WO2016095099A1 (en) Time synchronization method and apparatus
CN103001887A (en) Link keeping alive method, controller and switchboard
JP2022535385A (en) TSN and 5GS QoS Mapping - User Plane Based Method
WO2012068844A1 (en) Method and system for synchronizing clock of master-slave clock devices
WO2014117489A1 (en) Clock synchronization method and device
CN103067113B (en) Method and the device of PTP time synchronized is realized based on aggregated links
TW201422024A (en) Method for device-to-device communication and a corresponding control method
TWI700573B (en) Wireless docking system for audio-video relay
WO2012034330A1 (en) Method, system and convergence loop apparatus for synchronization between apparatuses in convergence network
WO2012071910A1 (en) Method and device for achieving time synchronization
WO2011134371A1 (en) Method for synchronizing clocks and clock synchronization device
US20130336117A1 (en) Distributed processing scheme to support ieee 1588 ptp over multiple ports spanning a lag
CN105227393A (en) A kind of bidirectional forwarding detection (BFD) method
WO2016184129A1 (en) Method, device and network apparatus for realizing unicast-based time synchronization
EP2984794A1 (en) Network device with tunnel establishment control based on site-type attribute received from other network device
CN106411446B (en) A kind of adaptive approach for realizing 1588 time synchronizations under unicast mode
WO2015035851A1 (en) Data transmission method and device
US9654559B2 (en) Method, apparatus, and system for exchanging data of edge area user on cloud radio access network
US20230199683A1 (en) Clock synchronization mode indication method and communication apparatus
JP2018508161A (en) SCTP connection reestablishing method and apparatus, and storage medium
JP5656306B1 (en) Synchronization establishment method

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

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

Country of ref document: EP

Kind code of ref document: A1