WO2009043299A1 - A determining method and device for the synchronization port of a transparent clock equipment - Google Patents

A determining method and device for the synchronization port of a transparent clock equipment Download PDF

Info

Publication number
WO2009043299A1
WO2009043299A1 PCT/CN2008/072557 CN2008072557W WO2009043299A1 WO 2009043299 A1 WO2009043299 A1 WO 2009043299A1 CN 2008072557 W CN2008072557 W CN 2008072557W WO 2009043299 A1 WO2009043299 A1 WO 2009043299A1
Authority
WO
WIPO (PCT)
Prior art keywords
port
synchronization
determining
clock
clock source
Prior art date
Application number
PCT/CN2008/072557
Other languages
French (fr)
Chinese (zh)
Inventor
Zhen Luo
Li Luo
Aiguo Yan
Original Assignee
Huawei Technologies Co., Ltd.
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 Huawei Technologies Co., Ltd. filed Critical Huawei Technologies Co., Ltd.
Publication of WO2009043299A1 publication Critical patent/WO2009043299A1/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/0685Clock or time synchronisation in a node; Intranode synchronisation
    • H04J3/0688Change 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 network synchronization technologies, and in particular, to a method and apparatus for determining a synchronization port of a through-clock device. Background technique
  • the basic function of the 1588 is to keep other clocks in the distributed network system synchronized with the most accurate clock. IEEE 1588 defines an accuracy.
  • the Precision Time Protocol (PTP) is used to perform sub-microsecond synchronization of clocks of devices in standard Ethernet or other distributed network systems.
  • IEEE 1588 divides the clocks in the entire PTP network system into Ordinary Clock (OC) and Boundary Clock (BC) according to the working mode; the main clock and the slave clock are divided according to the communication relationship.
  • a PTP network system can be composed of multiple PTP communication subnets. Each PTP communication subnet has only one master clock, and the best master clock (BMC) automatically selects the master clock in the PTP communication subnet. And the slave clock is synchronized with the master clock.
  • the optimal clock in the PTP network system is the Grandmaster Clock (GMC), which has the best stability, accuracy, certainty, etc.
  • GMC Grandmaster Clock
  • Each network system has only one GMC, only one communication subnet.
  • the master clock is the GMC.
  • a device in OC mode is called an OC device and has only one communication port.
  • a device in BC mode is called a BC device and has more than one communication port.
  • the communication ports of the BC device and the 0C device have port status, and there are three main types, including: main status (Master, M), slave status (Slave, S), and passive status (Passive, P).
  • the communication port with the port status of the master is referred to as the master port.
  • the master port is used to broadcast the best quality clock source to the entire network.
  • the slave port is used to track the clock of the upstream device.
  • the passive port is in an intermediate position and neither broadcasts the clock source. Nor does it track the clock of the upstream device.
  • the port status appears Passive, which means that there are two in the entire PTP network system or More than two clock sources are of comparable quality.
  • the PTP protocol packets are not processed. All devices are transparently transmitted.
  • the device is called a Transparent Clock (TC) device.
  • the TC device has more than one communication port. , and the communication port does not have a port status.
  • FIG. 1 it is a schematic diagram of device connection and port status supporting PTP protocol.
  • the clock of the OC1 device is the most advanced clock, which is the master clock of the entire network system, and the communication port of the OC1 device has the port status of Master.
  • Port 1 of the BC1 device is connected to the master port of the OC1 device.
  • the port status is Slave.
  • Port 1 is the synchronization port of the BC1 device. It is used to track the clock of the upstream device OC1. For a device, only one port has the port status. It can be a slave, so the port status of the other two ports of the BC1 device can be Master or Passive.
  • the Master is used as an example in Figure 1.
  • the port status of port 1 of BC2 is Slave, and the upstream device BC 1 is tracked.
  • the clock status of the other two ports is Master.
  • the TC device may exist in the path 1 - 5.
  • the TC device can be regarded as a connection during the transmission of PTP packets. It can be seen that the communication port of the BC device and the OC device can maintain the master-slave state, and the BC device can transmit the clock; if the TC device exists in the path 1 - 5, the communication port of the TC device cannot maintain the master-slave state.
  • the TC device Although the TC device directly transmits the PTP protocol packet without being processed, the TC device has a time delay for the delivery of the PTP protocol packet.
  • the transmission time of the PTP protocol packet inside the device is called the dwell time.
  • the time-to-time of the PTP protocol packets in each TC device is increased.
  • the time difference of PTP packets in the first-end device of the entire network system is large. .
  • the TC device When transmitting a PTP protocol packet, the TC device must correct the sending time of the PTP protocol packet according to the dwell time. Only the modified PTP protocol packet will be accurate.
  • the entire network system is a PTP network in the actual sense. system.
  • the TC device determines the dwell time of the PTP protocol according to the system clock frequency, so the factor that affects the calculation accuracy of the dwell time is the frequency.
  • One method is that the TC device takes the oscillation frequency of the internal crystal as the standard, and the calculation accuracy of the dwell time can only be achieved by this method.
  • the synchronization port is a port used to track the clock of the upstream device, and the port state of the synchronization port is siave. Summary of the invention
  • Embodiments of the present invention provide a method and a device for determining a bypass port of a clock-through device, and a synchronization port is determined for a punch-through clock device.
  • An embodiment of the present invention provides a method for determining a synchronization port of a TC device, including: acquiring a clock information delivery message received by at least one port of the TC device; determining an optimal clock source according to the clock information transmission message;
  • the port that receives the clock information corresponding to the optimal clock source is determined as the synchronization port.
  • the embodiment of the present invention further provides a device for determining a synchronization port of a TC device, including: a first acquiring unit, configured to acquire a clock information delivery message received by at least one port of the TC device;
  • a calculating unit configured to determine an optimal clock source according to the clock information delivery message acquired by the first acquiring unit
  • the first determining unit is configured to determine, when the optimal clock source is better than the local clock source of the TC device, that the port that receives the clock information delivery message corresponding to the optimal clock source is a synchronous port.
  • An embodiment of the present invention provides a method for determining a synchronization port of a TC device, including: acquiring a monitoring result of a port of a TC device to track an indication of an upstream device; and receiving, according to the monitoring result, an indication of the tracking upstream device The port of the packet is determined to be the sync port.
  • An embodiment of the present invention further provides another apparatus for determining a synchronization port of a TC device, including:
  • a second acquiring unit configured to acquire a tracking upstream device monitored by a port of the TC device Indicate the monitoring result of the message
  • a second determining unit configured to determine, according to the monitoring result obtained by the second acquiring unit, that the port that receives the tracking upstream device indication packet is a synchronization port.
  • the embodiment of the present invention determines an optimal clock source according to the clock information transmission text received by the at least one port of the TC device, and when the optimal clock source is superior to the local clock source of the TC device, the corresponding clock source is received.
  • the port of the clock information transmission packet is determined to be the synchronization port.
  • the port that receives the indication of the upstream device indication is monitored by the port of the TC device.
  • FIG. 1 is a schematic diagram of a connection and port state of a device supporting a PTP protocol in the prior art
  • FIG. 2 is a flowchart of determining a synchronization port and a port state of a TC device according to Embodiment 1 of the present invention
  • FIG. 3 is a flowchart of determining a synchronization port and a port status of a TC device according to Embodiment 2 of the present invention
  • FIG. 4 is a flowchart of a method for determining a synchronization port of a first TC device according to an embodiment of the present invention
  • FIG. 5 is a block diagram of a device for determining a synchronization port of a first TC device according to an embodiment of the present disclosure
  • FIG. 6 is a flowchart of determining a synchronization port and a port status of a TC device according to Embodiment 3 of the present invention.
  • FIG. 7 is a flowchart of a method for determining a synchronization port of a second TC device according to an embodiment of the present invention.
  • FIG. 8 is a block diagram of a second apparatus for determining a synchronization port of a TC device according to an embodiment of the present invention. detailed description
  • the embodiment of the invention provides a method and a device for determining a synchronization port of a TC device, and how to determine a synchronization port for the TC device, so that the clock of the TC device can achieve an ideal precision, so that the TC device can further implement the PTP protocol packet. Accurate calculation of dwell time.
  • Embodiment 1 is as follows:
  • the first embodiment provides a method for statically determining the status of the synchronization port and the port. For one
  • the announcement message in the PTP protocol packet is not processed.
  • the announce message is a clock information transmission message between all the devices in the network system.
  • the OC device and the BC device both process the announce message and trigger the BMC algorithm according to the clock information carried in the announce message to determine the network system.
  • the optimal clock source, the port status of the ports in the OC device and the BC device is also determined. If the port of the device can have the port status, if the port broadcasts the optimal clock source to the entire network, the port status is Master; if the port tracks the optimal clock of the upstream device, the port status is Slave; The optimal clock source is not broadcast, and the optimal clock of the upstream device is not tracked, and the port state is Passive.
  • the method for determining the synchronization port and the port status of the TC device provided by the first embodiment of the present invention first sets the designated port of the TC device. If the designated port is a device port of the TC device, the TC device works in the external synchronization mode; The port is the internal crystal port of the TC device, which is equivalent to canceling the designation of the TC device synchronization port. The TC device operates in the internal crystal oscillator mode. After the device port of the TC device is configured as the designated port, you need to obtain the announcement message received by the specified port, and analyze the clock information carried in the announce message, but do not need to process other ports in the TC device. Transparently transmitted announce packets. On other ports of the TC device, the announce message still maintains the nature of transparent transmission. When the specified port is set, the designated port also has the port status.
  • a method for determining a synchronization port and a port status of a TC device includes the following steps:
  • the designated port can be any device port of the TC device or an internal crystal oscillator port.
  • the device port and the internal crystal oscillator port of the TC device can be uniformly numbered, distinguished according to a unique number, or according to the device port and the internal crystal port.
  • the MAC address is distinguished.
  • the TC device determines whether the TC device works in the external synchronization mode according to the number or MAC address of the designated port. If the designated port is a device port of the TC device, the TC device works in an external synchronization mode, and the designated port is a TC.
  • the quasi-synchronous port of the device continues to execute S203; if the designated port is the internal crystal oscillator port of the TC device, the TC device operates in the internal crystal oscillator mode, and the process proceeds to S208.
  • 5203 Acquire the announce packet received by the specified port, and obtain the announce packet received by the specified port, and then start the BMC algorithm for the announce packet sent by the specified port, and determine the designation according to the calculation result. Whether the clock source determined by the announce message sent by the port is better than the local clock source.
  • the local clock source refers to the internal crystal oscillator of the TC device. If yes, execute S204. Otherwise, execute S206.
  • the TC device enters the tracking state, tracks the sending port of the received message received by the designated port, and continuously diagnoses the clock source information of the designated port, and returns to S203.
  • the TC device enters the tracking state, that is, the clock of the TC device is synchronized with the upstream device.
  • the TC device enters a hold or free oscillation state, and continuously diagnoses the clock source information of the designated port, and returns to execute S203.
  • the TC device When the TC device enters the hold state, the clock of the upstream device tracked by the TC device is lost. However, because the device has the “short-term memory” capability, the “temporary short-term memory” is used to correct the oscillation frequency of the internal crystal oscillator, and the output clock quality and tracking state. The quality of the clock is close, so it is called the hold state; the TC device enters the free oscillation state, which means that the TC device oscillates freely according to the oscillation frequency of the internal crystal oscillator. When the TC device enters the hold state, After a period of time beyond the ability of "short-term memory", it will enter a state of free oscillation.
  • the designated port of the TC device when the designated port of the TC device is set, and when the designated port is a non-inner crystal port and the clock source of the specified port is better than the local clock source, it is determined that the designated port is a synchronous port, and the method is simple and guaranteed.
  • the TC device is synchronized with the better clock source.
  • the second embodiment provides a method for dynamically determining the synchronization port and port status according to the announce message.
  • the device obtains the announce packet received by all the device ports of the TC device, analyzes the announcement, starts the BMC algorithm, and calculates the optimal clock source based on the clock information carried in the announce message.
  • the optimal clock source is better than the TC.
  • the local clock source of the device determines that the port that receives the announce packet corresponding to the optimal clock source is the synchronous port, so that the TC device tracks the sending port of the optimal clock source.
  • the method for dynamically determining the synchronization port of the TC device requires the TC device to process the announce text received by the port. Although the TC device processes the announce text, it does not broadcast the optimal clock source like the BC device, so the TC The synchronization port determined by the device and the port status of all other ports will not be Master.
  • a method for determining a synchronization port and a port state of a TC device according to Embodiment 2 of the present invention includes the following steps:
  • the BMC algorithm is started on the announce message sent by all the device ports, and the optimal clock source is calculated.
  • the port that receives the announce message corresponding to the optimal clock source is the quasi-synchronous port of the TC device.
  • the TC device enters the tracking state, and tracks the sending port of the received packet received by the synchronous port, and continuously diagnoses the clock source information of all device ports, and returns to S301.
  • the TC device enters the hold or free oscillation state, and continuously diagnoses the clock source information of all device ports, and returns to execute S301.
  • the method for dynamically determining the synchronization port and port status of the TC device provided by the second embodiment of the present invention can capture the optimal clock source in the current network system and keep the TC device synchronized with the optimal clock source at all times.
  • the receiving device can also indicate the received message on the device port of the TC device, and the BMC algorithm is started to calculate the optimal clock source.
  • the optimal clock source is better than the local clock source of the TC device, it is determined that the received message is received.
  • the port of the "announce" corresponding to the optimal clock source is the synchronous port, the port status of the synchronous port is Slave, and the port status of the asynchronous port is Passive; if the local clock source is better than the optimal clock source, the report is received.
  • the port status of the device port of the received announcement packet is Passive.
  • the embodiment of the present invention provides a method for determining a synchronization port of a TC device. As shown in FIG. 4, the method includes:
  • S401 Obtain a clock information delivery message received by at least one port of the TC device.
  • the optimal clock source is determined according to the clock information transmission text.
  • the port that receives the clock information corresponding to the optimal clock source is determined as the synchronization port.
  • the embodiment of the present invention further provides a device for determining a synchronization port of a TC device, which is disposed in the TC device, as shown in FIG. 5, and includes:
  • the first obtaining unit 501 is configured to acquire a clock information delivery message received by the at least one port of the TC device.
  • the calculating unit 502 is configured to determine an optimal clock source according to the clock information delivery message acquired by the first obtaining unit 501;
  • the first determining unit 503 is configured to determine, when the optimal clock source is better than the local clock source of the TC device, the port that receives the clock information delivery message corresponding to the optimal clock source. For the sync port.
  • the clock information delivery message may be an announce message.
  • the third embodiment provides a method for dynamically determining the status of the synchronization port and the port according to the synchronization (sync) message.
  • the TC device keeps track of the upstream device, that is, it tracks the sync message sent by the upstream device.
  • the sync message is used to track the upstream device indication packet.
  • the port status of the send port of the sync packet is definitely Master. Because the master port broadcasts the optimal clock source information in the network system, it is reasonable and feasible to determine that the port that receives the sync message is a synchronous port and directly track the send port of the sync message.
  • a method for determining a synchronization port and a port state of a TC device according to Embodiment 3 of the present invention includes the following steps:
  • the sync packet is a tracking upstream device indication packet sent by the upstream device, and the sync packet is used for clock synchronization.
  • the synchronization packet is detected by the port of the TC device, and the monitoring result of the received synchronization packet is periodically reported. Ways to get monitoring results.
  • the TC device enters the tracking state and tracks the port on which the upstream device sends the sync packet.
  • the sync packet When the sync port of the port is not receiving the sync packet within a certain period of time, the sync packet is lost.
  • the cause of the sync packet loss may be network interruption or receiving error.
  • the TC device enters the hold state, and continuously diagnoses the sync message of the port, and returns to execute S601. 5607. Set the port status of the TC device port to Passive.
  • the TC device enters the hold or free-oscillation state, and continuously diagnoses the sync of the port, and returns to execute S601.
  • the method for determining the synchronization port and the port status of the TC device provided by the third embodiment of the present invention directly determines that the port that receives the sync packet is a synchronous port, and the port that the upstream device sends the sync packet is tracked, and the method is simple and flexible, and can be Keep the TC device synchronized with the optimal clock source at all times.
  • the embodiment of the present invention provides a method for determining a synchronization port of a TC device. As shown in FIG. 7, the method includes the following steps:
  • the port that receives the indication of the upstream device indication is determined as the synchronization port.
  • the embodiment of the present invention further provides a synchronization port determining device for the TC device, which is disposed in the TC device, as shown in FIG. 8, and includes:
  • the second obtaining unit 801 is configured to obtain a monitoring result of the tracking upstream device indication message monitored by the port of the TC device.
  • the second determining unit 802 is configured to determine, according to the monitoring result obtained by the second obtaining unit 801, a port that receives the tracking upstream device indication message as a synchronization port.
  • the tracking upstream device indication packet may be a sync packet.
  • the embodiment of the present invention provides a method for determining a synchronization port of a TC device, and a method for determining an optimal clock source according to a clock information transmission message received by at least one port of the TC device, and the optimal clock source is superior to the TC device.
  • the port that receives the clock information corresponding to the optimal clock source is determined as the synchronization port; and the other method can obtain the monitoring result of the tracking upstream device indication packet monitored by the port of the TC device.
  • the port that receives the tracking upstream device indication packet is determined as the synchronization port.
  • the synchronization port determination method implements how to determine the synchronization port for the TC device, so that the clock of the TC device can achieve the desired accuracy, so that the TC device can accurately calculate the PTP protocol packet residence time.
  • the invention can be implemented by hardware or by means of software plus a necessary general hardware platform.
  • the technical solution of the present invention may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including several The instructions are for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present invention. It is within the spirit and scope of the invention. Thus, it is intended that the present invention cover the modifications and modifications of the invention

Abstract

The invention belongs to the field of network synchronization techniques, especially to a determining technique for the synchronization port of a transparent clock TC equipment. A determining method and device for the synchronization port of the transparent clock equipment are provided by the embodiments of the present invention, and determining the synchronization port of the TC equipment is performed. The method for determining the synchronization port of the transparent clock equipment includes: obtaining the results of the TC equipment port's monitoring of synchronization indication messages; determining, according to said monitoring results, the port which receives the synchronization indication message as the synchronization port. The determining device for the synchronization port of the TC equipment includes: a first obtaining unit, a calculating unit and a first determining unit. Another kind of determining device for the synchronization port of the TC equipment includes: a second obtaining unit and a second determining unit.

Description

穿通时钟设备同步端口的确定方法及装置  Method and device for determining punching through clock device synchronization port
技术领域 Technical field
本发明涉及网络同步技术领域,尤其涉及一种穿通时钟设备同步 端口的确定方法及装置。 背景技术  The present invention relates to the field of network synchronization technologies, and in particular, to a method and apparatus for determining a synchronization port of a through-clock device. Background technique
网络测控系统精确时钟同步协议 IEEE ( Institute of Electrical and Electronics Engineers, 电气和电子工程师协会) 1588的基本功能是 使分布式网络系统中的其它时钟与最精确时钟保持同步, IEEE 1588 定义了一种精确时间协议(Precision Time Protocol, PTP ) , 用于对 标准以太网或其它分布式网络系统中设备的时钟进行亚微秒级同步。  Network Measurement and Control System Accurate Clock Synchronization Protocol IEEE (Institute of Electrical and Electronics Engineers) The basic function of the 1588 is to keep other clocks in the distributed network system synchronized with the most accurate clock. IEEE 1588 defines an accuracy. The Precision Time Protocol (PTP) is used to perform sub-microsecond synchronization of clocks of devices in standard Ethernet or other distributed network systems.
IEEE 1588将整个 PTP网络系统中的时钟按工作模式分为普通时 钟 ( Ordinary Clock, OC )和边界时钟 ( Boundary Clock, BC ) ; 按 通信关系分为主时钟和从时钟。 一个 PTP网络系统可以由多个 PTP通 信子网组成, 每个 PTP通信子网中只有一个主时钟, 由最佳主时钟算 法( Best Master Clock, BMC ) 自动选择 PTP通信子网中的主时钟, 且从时钟与主时钟保持同步。 PTP网络系统中的最优时钟为最高级时 钟( Grandmaster Clock, GMC ) , 有着最好的稳定性、 精确性、 确定 性等, 每个 ΡΤΡ网络系统只有一个 GMC, 在只有一个 ΡΤΡ通信子网的 ΡΤΡ网络系统中, 主时钟就是 GMC。  IEEE 1588 divides the clocks in the entire PTP network system into Ordinary Clock (OC) and Boundary Clock (BC) according to the working mode; the main clock and the slave clock are divided according to the communication relationship. A PTP network system can be composed of multiple PTP communication subnets. Each PTP communication subnet has only one master clock, and the best master clock (BMC) automatically selects the master clock in the PTP communication subnet. And the slave clock is synchronized with the master clock. The optimal clock in the PTP network system is the Grandmaster Clock (GMC), which has the best stability, accuracy, certainty, etc. Each network system has only one GMC, only one communication subnet. In the network system, the master clock is the GMC.
在 OC工作模式下的设备称为 OC设备, 只有一个通信端口; 在 BC 工作模式下的设备称为 BC设备,有一个以上通信端口。 BC设备和 0C 设备的通信端口具备端口状态, 主要有三种, 包括: 主状态(Master, M ) 、 从状态 (Slave, S )和消极状态 (Passive , P ) 。 端口状态为 Master的通信端口简称为 Master端口, Master端口用来向整个网络广 播质量最好的时钟源; Slave端口用来跟踪上游设备的时钟; Passive 端口处于一个中间地位,既不广播时钟源,也不跟踪上游设备的时钟。 端口状态出现 Passive , —般意味着在整个 PTP网络系统中有两个或者 两个以上的时钟源质量不相上下。 在支持 PTP协议的设备中还有一类 特殊的设备, 对 PTP协议报文不进行处理全部都是透明传输, 这类设 备称为穿通时钟(Transparent Clock, TC )设备, TC设备有一个以上 通信端口, 且通信端口不具备端口状态。 A device in OC mode is called an OC device and has only one communication port. A device in BC mode is called a BC device and has more than one communication port. The communication ports of the BC device and the 0C device have port status, and there are three main types, including: main status (Master, M), slave status (Slave, S), and passive status (Passive, P). The communication port with the port status of the master is referred to as the master port. The master port is used to broadcast the best quality clock source to the entire network. The slave port is used to track the clock of the upstream device. The passive port is in an intermediate position and neither broadcasts the clock source. Nor does it track the clock of the upstream device. The port status appears Passive, which means that there are two in the entire PTP network system or More than two clock sources are of comparable quality. There is also a special type of device in the PTP-enabled device. The PTP protocol packets are not processed. All devices are transparently transmitted. The device is called a Transparent Clock (TC) device. The TC device has more than one communication port. , and the communication port does not have a port status.
如图 1所示, 为一个支持 PTP协议的设备连接及端口状态示意图。 其中, OC1设备的时钟为最高级时钟,是整个网络系统的主时钟, OC1 设备的通信端口具备的端口状态为 Master。 BC1设备的端口 1与 OC1 设备的 Master端口相连, 其端口状态为 Slave, 端口 1即为 BC1设备的 同步端口, 用来跟踪上游设备 OC1的时钟; 对于一个设备来说, 只有 一个端口的端口状态可以为 Slave,所以 BC1设备的其它两个端口的端 口状态可以为 Master或 Passive , 图 1中以 Master为例进行说明; 同理, BC2的端口 1的端口状态为 Slave , 跟踪上游设备 BC 1的时钟, 其它两 个端口的端口状态为 Master; 路径 1 - 5中可能存在 TC设备, TC设备 在 PTP协议报文的传递过程中, 可以被看成是一条连线。 可见, BC 设备和 OC设备的通信端口可以保持主从状态, 并且 BC设备可以传递 时钟; 路径 1 - 5中如果存在 TC设备, 那么 TC设备的通信端口是不能 保持主从状态的。  As shown in Figure 1, it is a schematic diagram of device connection and port status supporting PTP protocol. The clock of the OC1 device is the most advanced clock, which is the master clock of the entire network system, and the communication port of the OC1 device has the port status of Master. Port 1 of the BC1 device is connected to the master port of the OC1 device. The port status is Slave. Port 1 is the synchronization port of the BC1 device. It is used to track the clock of the upstream device OC1. For a device, only one port has the port status. It can be a slave, so the port status of the other two ports of the BC1 device can be Master or Passive. The Master is used as an example in Figure 1. Similarly, the port status of port 1 of BC2 is Slave, and the upstream device BC 1 is tracked. The clock status of the other two ports is Master. The TC device may exist in the path 1 - 5. The TC device can be regarded as a connection during the transmission of PTP packets. It can be seen that the communication port of the BC device and the OC device can maintain the master-slave state, and the BC device can transmit the clock; if the TC device exists in the path 1 - 5, the communication port of the TC device cannot maintain the master-slave state.
虽然 TC设备对于 PTP协议报文不处理而直接透明传输, 但是 TC 设备对于 PTP协议报文的传递也是有时间延迟的, PTP协议报文在设 备内部的传递时间称为驻留时间。 PTP协议报文在每个 TC设备中的驻 留时间累加起来, 会使整个网络系统首尾设备中 PTP协议报文的时间 差值很大, 就不能保证 PTP协议报文在所有设备中的时间同步。 TC设 备在传递 PTP协议报文时, 必须根据驻留时间修正 PTP协议报文的发 送时间, 只有修正后的 PTP协议报文, 时间才会精确, 整个网络系统 才是一个实际意义上的 PTP网络系统。  Although the TC device directly transmits the PTP protocol packet without being processed, the TC device has a time delay for the delivery of the PTP protocol packet. The transmission time of the PTP protocol packet inside the device is called the dwell time. The time-to-time of the PTP protocol packets in each TC device is increased. As a result, the time difference of PTP packets in the first-end device of the entire network system is large. . When transmitting a PTP protocol packet, the TC device must correct the sending time of the PTP protocol packet according to the dwell time. Only the modified PTP protocol packet will be accurate. The entire network system is a PTP network in the actual sense. system.
TC设备根据系统时钟频率确定 PTP协议 4艮文的驻留时间, 所以 影响驻留时间计算精度的因素为频率。 一种方法是 TC设备以内部晶 振的振荡频率为标准, 釆用这种方法驻留时间的计算精度只能达到 The TC device determines the dwell time of the PTP protocol according to the system clock frequency, so the factor that affects the calculation accuracy of the dwell time is the frequency. One method is that the TC device takes the oscillation frequency of the internal crystal as the standard, and the calculation accuracy of the dwell time can only be achieved by this method.
0.02%, lms会产生 200ns的误差, 误差太大不能满足 PTP协议报文 在设备中的时间同步。 另一种方法是 IEEE 1588提出的 TC设备应该 和上游设备同步, 只要 TC设备同上游设备传递的高精度时钟同步, 计算出的驻留时间就很精确。 但是现有技术中并没有给出 TC设备同 步端口的确定方法, 同步端口是用来跟踪上游设备时钟的端口, 同步 端口的端口状态为 siave。 发明内容 0.02%, lms will produce 200ns error, too large error can not meet PTP protocol message Time synchronization in the device. Another method is that the TC device proposed by IEEE 1588 should be synchronized with the upstream device. As long as the TC device synchronizes with the high-precision clock transmitted by the upstream device, the calculated dwell time is accurate. However, the prior art does not provide a method for determining the synchronization port of the TC device. The synchronization port is a port used to track the clock of the upstream device, and the port state of the synchronization port is siave. Summary of the invention
本发明实施例提供一种穿通时钟设备同步端口的确定方法及装 置, 实现了为穿通时钟设备确定同步端口。  Embodiments of the present invention provide a method and a device for determining a bypass port of a clock-through device, and a synchronization port is determined for a punch-through clock device.
本发明实施例提供了一种 TC设备同步端口的确定方法, 包括: 获取 TC设备的至少一个端口接收到的时钟信息传递报文; 根据所述时钟信息传递报文确定最优时钟源; 并  An embodiment of the present invention provides a method for determining a synchronization port of a TC device, including: acquiring a clock information delivery message received by at least one port of the TC device; determining an optimal clock source according to the clock information transmission message;
在所述最优时钟源优于所述 TC设备的本地时钟源时, 将接收到 所述最优时钟源对应的时钟信息传递^艮文的端口确定为同步端口。  When the optimal clock source is better than the local clock source of the TC device, the port that receives the clock information corresponding to the optimal clock source is determined as the synchronization port.
本发明实施例还提供了一种 TC设备同步端口的确定装置, 包括: 第一获取单元, 用于获取 TC设备的至少一个端口接收到的时钟 信息传递报文;  The embodiment of the present invention further provides a device for determining a synchronization port of a TC device, including: a first acquiring unit, configured to acquire a clock information delivery message received by at least one port of the TC device;
计算单元,用于根据所述第一获取单元获取的时钟信息传递报文 确定最优时钟源;  a calculating unit, configured to determine an optimal clock source according to the clock information delivery message acquired by the first acquiring unit;
第一确定单元, 用于在所述最优时钟源优于所述 TC设备的本地 时钟源时,确定接收到所述最优时钟源对应的时钟信息传递报文的端 口为同步端口。  The first determining unit is configured to determine, when the optimal clock source is better than the local clock source of the TC device, that the port that receives the clock information delivery message corresponding to the optimal clock source is a synchronous port.
本发明实施例提供了另一种 TC设备同步端口的确定方法,包括: 获取 TC设备的端口对跟踪上游设备指示报文的监测结果; 根据所述监测结果,将接收到所述跟踪上游设备指示报文的端口 确定为同步端口。  An embodiment of the present invention provides a method for determining a synchronization port of a TC device, including: acquiring a monitoring result of a port of a TC device to track an indication of an upstream device; and receiving, according to the monitoring result, an indication of the tracking upstream device The port of the packet is determined to be the sync port.
本发明实施例还提供了另一种 TC设备同步端口的确定装置, 包 括:  An embodiment of the present invention further provides another apparatus for determining a synchronization port of a TC device, including:
第二获取单元, 用于获取 TC设备的端口所监测的跟踪上游设备 指示报文的监测结果; a second acquiring unit, configured to acquire a tracking upstream device monitored by a port of the TC device Indicate the monitoring result of the message;
第二确定单元, 用于根据第二获取单元获取的所述监测结果, 确 定接收到所述跟踪上游设备指示报文的端口为同步端口。  And a second determining unit, configured to determine, according to the monitoring result obtained by the second acquiring unit, that the port that receives the tracking upstream device indication packet is a synchronization port.
本发明实施例通过根据 TC设备的至少一个端口接收到的时钟信 息传递 文确定最优时钟源, 并在最优时钟源优于 TC设备的本地时 钟源时,将接收到最优时钟源对应的时钟信息传递报文的端口确定为 同步端口; 或者通过获取 TC设备的端口所监测的跟踪上游设备指示 报文的监测结果,将接收到跟踪上游设备指示报文的端口确定为同步 端口。 这两种方法均实现了为 TC设备确定同步端口, 从而进一步可 以实现 TC设备对 PTP报文驻留时间的精确计算, 满足了 PTP网络 对时间同步的要求。 附图说明  The embodiment of the present invention determines an optimal clock source according to the clock information transmission text received by the at least one port of the TC device, and when the optimal clock source is superior to the local clock source of the TC device, the corresponding clock source is received. The port of the clock information transmission packet is determined to be the synchronization port. The port that receives the indication of the upstream device indication is monitored by the port of the TC device. Both of these methods implement the determination of the synchronization port for the TC device, so that the TC device can accurately calculate the PTP packet residence time and meet the time synchronization requirements of the PTP network. DRAWINGS
图 1为现有技术中支持 PTP协议的设备连接及端口状态示意图; 图 2为本发明实施例一提供的确定 TC设备同步端口及端口状态 的流程图;  FIG. 1 is a schematic diagram of a connection and port state of a device supporting a PTP protocol in the prior art; FIG. 2 is a flowchart of determining a synchronization port and a port state of a TC device according to Embodiment 1 of the present invention;
图 3为本发明实施例二提供的确定 TC设备同步端口及端口状态 的流程图;  3 is a flowchart of determining a synchronization port and a port status of a TC device according to Embodiment 2 of the present invention;
图 4为本发明实施例提供的第一种 TC设备同步端口的确定方法 流程图;  4 is a flowchart of a method for determining a synchronization port of a first TC device according to an embodiment of the present invention;
图 5为本发明实施例提供的第一种 TC设备同步端口的确定装置 框图;  FIG. 5 is a block diagram of a device for determining a synchronization port of a first TC device according to an embodiment of the present disclosure;
图 6为本发明实施例三提供的确定 TC设备同步端口及端口状态 的流程图;  6 is a flowchart of determining a synchronization port and a port status of a TC device according to Embodiment 3 of the present invention;
图 7为本发明实施例提供的第二种 TC设备同步端口的确定方法 流程图;  FIG. 7 is a flowchart of a method for determining a synchronization port of a second TC device according to an embodiment of the present invention;
图 8为本发明实施例提供的第二种 TC设备同步端口的确定装置 框图。 具体实施方式 FIG. 8 is a block diagram of a second apparatus for determining a synchronization port of a TC device according to an embodiment of the present invention. detailed description
本发明实施例提供了 TC设备同步端口的确定方法及装置, 实现 了如何为 TC设备确定同步端口的问题, 使 TC设备的时钟能够达到 理想的精度,从而进一步可以实现 TC设备对 PTP协议报文驻留时间 的精确计算。 下面以几个具体的实施例进行详细说明。  The embodiment of the invention provides a method and a device for determining a synchronization port of a TC device, and how to determine a synchronization port for the TC device, so that the clock of the TC device can achieve an ideal precision, so that the TC device can further implement the PTP protocol packet. Accurate calculation of dwell time. The following is a detailed description of several specific embodiments.
实施例一如下:  Embodiment 1 is as follows:
实施例一提供了静态确定同步端口及端口状态的方法。对于一个 The first embodiment provides a method for statically determining the status of the synchronization port and the port. For one
TC设备来说, 对 PTP协议报文中的通告(announce )报文是不进行处 理的。 announce报文是网络系统中所有设备之间的时钟信息传递报 文, OC设备和 BC设备都处理 announce报文, 并根据 announce报文中 携带的时钟信息, 触发 BMC算法, 从而确定出网络系统中的最优时 钟源, OC设备和 BC设备中端口的端口状态也随之确定。 在设备的端 口可以具备端口状态的情况下,如果端口向整个网络广播该最优时钟 源, 端口状态即为 Master; 如果端口跟踪上游设备的该最优时钟, 端 口状态即为 Slave; 如果端口既不广播该最优时钟源, 也不跟踪上游 设备的该最优时钟, 端口状态即为 Passive。 For the TC device, the announcement message in the PTP protocol packet is not processed. The announce message is a clock information transmission message between all the devices in the network system. The OC device and the BC device both process the announce message and trigger the BMC algorithm according to the clock information carried in the announce message to determine the network system. The optimal clock source, the port status of the ports in the OC device and the BC device is also determined. If the port of the device can have the port status, if the port broadcasts the optimal clock source to the entire network, the port status is Master; if the port tracks the optimal clock of the upstream device, the port status is Slave; The optimal clock source is not broadcast, and the optimal clock of the upstream device is not tracked, and the port state is Passive.
本发明实施例一提供的确定 TC设备同步端口及端口状态的方 法, 首先设置 TC设备的指定端口, 如果指定端口为 TC设备的某个设 备端口, 则该 TC设备工作在外部同步模式; 如果指定端口为 TC设备 的内部晶振端口, 相当于取消了对该 TC设备同步端口的指定, 则该 TC设备工作在内部晶振模式。 设置了 TC设备的某个设备端口为指定 端口后, 需要获取该指定端口接收到的 announce才艮文, 并对 announce 报文中携带的时钟信息进行分析, 但不需要处理该 TC设备中其它端 口透明传输的 announce报文, 在该 TC设备的其它端口, announce报文 还是保持透明传输的性质。设置了指定端口后, 该指定端口也就相应 具备了端口状态。  The method for determining the synchronization port and the port status of the TC device provided by the first embodiment of the present invention first sets the designated port of the TC device. If the designated port is a device port of the TC device, the TC device works in the external synchronization mode; The port is the internal crystal port of the TC device, which is equivalent to canceling the designation of the TC device synchronization port. The TC device operates in the internal crystal oscillator mode. After the device port of the TC device is configured as the designated port, you need to obtain the announcement message received by the specified port, and analyze the clock information carried in the announce message, but do not need to process other ports in the TC device. Transparently transmitted announce packets. On other ports of the TC device, the announce message still maintains the nature of transparent transmission. When the specified port is set, the designated port also has the port status.
如图 2所示, 本发明实施例一提供的确定 TC设备同步端口及端口 状态的方法, 包括步骤:  As shown in FIG. 2, a method for determining a synchronization port and a port status of a TC device according to Embodiment 1 of the present invention includes the following steps:
S201 , 设置 TC设备的指定端口。 其中, 指定端口可以是 TC设备的任一设备端口, 也可以是内部 晶振端口, TC设备的设备端口和内部晶振端口可以统一编号, 根据 唯一的编号进行区分, 或者根据设备端口和内部晶振端口的 MAC地 址进行区分。 S201. Set a designated port of the TC device. The designated port can be any device port of the TC device or an internal crystal oscillator port. The device port and the internal crystal oscillator port of the TC device can be uniformly numbered, distinguished according to a unique number, or according to the device port and the internal crystal port. The MAC address is distinguished.
5202, 根据该指定端口的编号或者 MAC地址判断 TC设备是否 工作在外部同步模式,如果指定端口为该 TC设备的某一个设备端口, 则该 TC设备工作在外部同步模式, 该指定端口即为 TC设备的准同 步端口 ,继续执行 S203;如果指定端口为该 TC设备的内部晶振端口 , 则该 TC设备工作在内部晶振模式, 继续执行 S208。  5202, determining whether the TC device works in the external synchronization mode according to the number or MAC address of the designated port. If the designated port is a device port of the TC device, the TC device works in an external synchronization mode, and the designated port is a TC. The quasi-synchronous port of the device continues to execute S203; if the designated port is the internal crystal oscillator port of the TC device, the TC device operates in the internal crystal oscillator mode, and the process proceeds to S208.
5203 , 获取该指定端口接收到的 announce报文, 可以通过指示 该指定端口上艮接收到的 announce报文的方式获取, 对该指定端口 上报的 announce报文启动 BMC算法,根据计算结果判断该指定端口 上报的 announce报文确定的时钟源是否优于本地时钟源, 本地时钟 源是指该 TC设备的内部晶振, 如果是则执行 S204, 否则执行 S206。  5203: Acquire the announce packet received by the specified port, and obtain the announce packet received by the specified port, and then start the BMC algorithm for the announce packet sent by the specified port, and determine the designation according to the calculation result. Whether the clock source determined by the announce message sent by the port is better than the local clock source. The local clock source refers to the internal crystal oscillator of the TC device. If yes, execute S204. Otherwise, execute S206.
5204,确定该指定端口为同步端口,设置该指定端口的端口状态 为 Slave。  5204. Determine that the designated port is a synchronous port, and set the port status of the designated port to Slave.
5205 , TC设备进入跟踪状态, 对该指定端口接收到的 announce 报文的发送端口进行跟踪, 并不断诊听该指定端口的时钟源信息, 返 回执行 S203。  5205. The TC device enters the tracking state, tracks the sending port of the received message received by the designated port, and continuously diagnoses the clock source information of the designated port, and returns to S203.
其中, TC设备进入跟踪状态是指 TC设备的时钟同步于上游设 备。  The TC device enters the tracking state, that is, the clock of the TC device is synchronized with the upstream device.
5206, 设置该指定端口的端口状态为 Passive。  5206. Set the port status of the designated port to Passive.
5207, TC设备进入保持或自由振荡状态, 并不断诊听该指定端 口的时钟源信息, 返回执行 S203。  5207, the TC device enters a hold or free oscillation state, and continuously diagnoses the clock source information of the designated port, and returns to execute S203.
TC设备进入保持状态是指 TC设备跟踪的上游设备的时钟丟失, 但是由于设备有 "短期记忆" 能力, 所以凭借着这个 "短期记忆"修 正内部晶振的振荡频率,输出的时钟质量和跟踪状态下的时钟质量接 近, 所以称为保持状态; TC设备进入自由振荡状态是指 TC设备根 据内部晶振的振荡频率进行自由振荡, 当 TC设备进入保持状态的时 间超出具有 "短期记忆" 能力的时间后会进入自由振荡状态。 When the TC device enters the hold state, the clock of the upstream device tracked by the TC device is lost. However, because the device has the "short-term memory" capability, the "temporary short-term memory" is used to correct the oscillation frequency of the internal crystal oscillator, and the output clock quality and tracking state. The quality of the clock is close, so it is called the hold state; the TC device enters the free oscillation state, which means that the TC device oscillates freely according to the oscillation frequency of the internal crystal oscillator. When the TC device enters the hold state, After a period of time beyond the ability of "short-term memory", it will enter a state of free oscillation.
S208, TC设备进入自由振荡状态, 流程结束。  S208, the TC device enters a free oscillation state, and the process ends.
实施例一通过设置 TC设备的指定端口, 并当该指定端口为非内 部晶振端口且指定端口上 >¾的时钟源优于本地时钟源时,确定该指定 端口为同步端口, 方法简单, 保证了 TC设备与较优时钟源的同步。  In the first embodiment, when the designated port of the TC device is set, and when the designated port is a non-inner crystal port and the clock source of the specified port is better than the local clock source, it is determined that the designated port is a synchronous port, and the method is simple and guaranteed. The TC device is synchronized with the better clock source.
实施例二如下:  The second embodiment is as follows:
实施例二提供了根据 announce报文动态确定同步端口及端口状 态的方法。首先获取 TC设备的所有设备端口接收到的 announce报文, 并对 announce进行分析, 启动 BMC算法, 根据 announce报文中携 带的时钟信息计算出最优时钟源, 并在最优时钟源优于 TC设备的本 地时钟源时确定接收到该最优时钟源对应的 announce报文的端口为 同步端口, 使 TC设备对该最优时钟源的发送端口进行跟踪。 这种动 态确定 TC 设备同步端口的方法, 需要 TC 设备对端口接收到的 announce 文进行处理, TC设备虽然对 announce 文进行处理, 但 是其并不像 BC设备那样广播该最优时钟源, 所以 TC设备确定的同 步端口以及所有其它端口的端口状态不会为 Master。  The second embodiment provides a method for dynamically determining the synchronization port and port status according to the announce message. The device obtains the announce packet received by all the device ports of the TC device, analyzes the announcement, starts the BMC algorithm, and calculates the optimal clock source based on the clock information carried in the announce message. The optimal clock source is better than the TC. The local clock source of the device determines that the port that receives the announce packet corresponding to the optimal clock source is the synchronous port, so that the TC device tracks the sending port of the optimal clock source. The method for dynamically determining the synchronization port of the TC device requires the TC device to process the announce text received by the port. Although the TC device processes the announce text, it does not broadcast the optimal clock source like the BC device, so the TC The synchronization port determined by the device and the port status of all other ports will not be Master.
如图 3所示, 本发明实施例二提供的确定 TC设备同步端口及端 口状态的方法, 包括步骤:  As shown in FIG. 3, a method for determining a synchronization port and a port state of a TC device according to Embodiment 2 of the present invention includes the following steps:
5301 ,获取 TC设备的所有设备端口接收到的 announce报文,可 以通过指示所有设备端口上报接收到的 announce报文的方式获取。  5301. Obtaining the announce message received by all the device ports of the TC device, and obtaining the announce message received by all the device ports.
5302,对所有设备端口上报的 announce报文启动 BMC算法,计 算出最优时钟源, 接收到该最优时钟源对应的 announce报文的端口 为 TC设备的准同步端口。  5302. The BMC algorithm is started on the announce message sent by all the device ports, and the optimal clock source is calculated. The port that receives the announce message corresponding to the optimal clock source is the quasi-synchronous port of the TC device.
5303 , 判断该最优时钟源是否优于本地时钟源, 如果是则进行 S304, 否则执行 S307。  5303. Determine whether the optimal clock source is better than the local clock source. If yes, perform S304, otherwise execute S307.
5304, 确定该最优时钟源对应的 announce报文的上报端口为同 步端口。  5304. Determine that the reporting port of the announce message corresponding to the optimal clock source is a synchronous port.
5305 , 设置同步端口的端口状态为 Slave, 非同步端口的端口状 态为 Passive„ 5306 , TC设备进入跟踪状态 , 对同步端口接收到的 announce报 文的发送端口进行跟踪, 并不断诊听所有设备端口的时钟源信息, 返 回执行 S301。 5305, set the port status of the synchronization port to Slave, and the port status of the asynchronous port to Passive. 5306. The TC device enters the tracking state, and tracks the sending port of the received packet received by the synchronous port, and continuously diagnoses the clock source information of all device ports, and returns to S301.
5307 , 设置所有设备端口的端口状态为 Passive。  5307, Set the port status of all device ports to Passive.
5308 , TC设备进入保持或自由振荡状态, 并不断诊听所有设备 端口的时钟源信息, 返回执行 S301。  5308, the TC device enters the hold or free oscillation state, and continuously diagnoses the clock source information of all device ports, and returns to execute S301.
本发明实施例二提供的动态确定 TC设备同步端口及端口状态的 方法, 能够捕获到当前网络系统中的最优时钟源, 时刻保持 TC设备 与最优时钟源的同步。  The method for dynamically determining the synchronization port and port status of the TC device provided by the second embodiment of the present invention can capture the optimal clock source in the current network system and keep the TC device synchronized with the optimal clock source at all times.
当然,也可以指示 TC设备的部分设备端口上^艮接收到的 announce 报文, 启动 BMC算法计算出最优时钟源, 并在最优时钟源优于 TC设 备的本地时钟源时, 确定接收到该最优时钟源对应的 announce"^文的 端口为同步端口, 同步端口的端口状态为 Slave, 非同步端口的端口 状态为 Passive; 如果本地时钟源优于该最优时钟源, 则设置上报接收 到的 announce报文的该部分设备端口的端口状态为 Passive。  Of course, the receiving device can also indicate the received message on the device port of the TC device, and the BMC algorithm is started to calculate the optimal clock source. When the optimal clock source is better than the local clock source of the TC device, it is determined that the received message is received. The port of the "announce" corresponding to the optimal clock source is the synchronous port, the port status of the synchronous port is Slave, and the port status of the asynchronous port is Passive; if the local clock source is better than the optimal clock source, the report is received. The port status of the device port of the received announcement packet is Passive.
根据实施例一和实施例二提供的方案,本发明实施例提供了一种 TC设备同步端口的确定方法, 如图 4所示, 包括:  According to the solution provided by the first embodiment and the second embodiment, the embodiment of the present invention provides a method for determining a synchronization port of a TC device. As shown in FIG. 4, the method includes:
5401 ,获取 TC设备的至少一个端口接收到的时钟信息传递报文。 S401: Obtain a clock information delivery message received by at least one port of the TC device.
5402 , 才艮据时钟信息传递 文确定最优时钟源。 5402, the optimal clock source is determined according to the clock information transmission text.
5403 , 在最优时钟源优于 TC设备的本地时钟源时, 将接收到该 最优时钟源对应的时钟信息传递 文的端口确定为同步端口。  When the optimal clock source is better than the local clock source of the TC device, the port that receives the clock information corresponding to the optimal clock source is determined as the synchronization port.
本发明实施例同时提供了一种 TC设备同步端口的确定装置, 设 置在 TC设备中, 如图 5所示, 包括:  The embodiment of the present invention further provides a device for determining a synchronization port of a TC device, which is disposed in the TC device, as shown in FIG. 5, and includes:
第一获取单元 501 , 用于获取 TC设备的至少一个端口接收到的 时钟信息传递报文;  The first obtaining unit 501 is configured to acquire a clock information delivery message received by the at least one port of the TC device.
计算单元 502 , 用于根据第一获取单元 501获取的时钟信息传递 报文确定最优时钟源;  The calculating unit 502 is configured to determine an optimal clock source according to the clock information delivery message acquired by the first obtaining unit 501;
第一确定单元 503 , 用于在该最优时钟源优于 TC设备的本地时 钟源时,将接收到该最优时钟源对应的时钟信息传递报文的端口确定 为同步端口。 The first determining unit 503 is configured to determine, when the optimal clock source is better than the local clock source of the TC device, the port that receives the clock information delivery message corresponding to the optimal clock source. For the sync port.
其中, 时钟信息传递报文可以为 announce报文。  The clock information delivery message may be an announce message.
实施例三如下:  The third embodiment is as follows:
实施例三提供了根据同步(sync )报文动态确定同步端口及端口 状态的方法。 TC设备跟踪上游设备, 即跟踪上游设备发送的 sync报 文, sync报文为跟踪上游设备指示报文。 在 PTP网络系统中, 如果 一个设备的某个端口接收到 sync报文, 就说明 sync报文的发送端口 的端口状态肯定为 Master。 因为 Master端口广播网络系统中的最优 时钟源信息, 那么确定接收到 sync报文的端口为同步端口, 对 sync 报文的发送端口进行直接跟踪, 即是合理并可行的。  The third embodiment provides a method for dynamically determining the status of the synchronization port and the port according to the synchronization (sync) message. The TC device keeps track of the upstream device, that is, it tracks the sync message sent by the upstream device. The sync message is used to track the upstream device indication packet. In a PTP network system, if a port on a device receives a sync packet, the port status of the send port of the sync packet is definitely Master. Because the master port broadcasts the optimal clock source information in the network system, it is reasonable and feasible to determine that the port that receives the sync message is a synchronous port and directly track the send port of the sync message.
如图 6所示, 本发明实施例三提供的确定 TC设备同步端口及端 口状态的方法, 包括步骤:  As shown in FIG. 6, a method for determining a synchronization port and a port state of a TC device according to Embodiment 3 of the present invention includes the following steps:
5601 , 获取 TC设备的端口所监测的 sync报文的监测结果。 其中, sync报文是上游设备周期发送的跟踪上游设备指示报文, sync报文用于时钟同步, 可以通过指示 TC设备的端口监测 sync报 文并将接收到 sync报文的监测结果周期上报的方式获取监测结果。  5601. Obtain the monitoring result of the sync packet monitored by the port of the TC device. The sync packet is a tracking upstream device indication packet sent by the upstream device, and the sync packet is used for clock synchronization. The synchronization packet is detected by the port of the TC device, and the monitoring result of the received synchronization packet is periodically reported. Ways to get monitoring results.
5602,判断是否有接收到 sync报文的端口,如果是则执行 S603 , 否则执行 S607。  5602. Determine whether there is a port that receives the sync message. If yes, execute S603. Otherwise, execute S607.
5603 , 确定接收到 sync报文的端口为同步端口, 并设置其端口 状态为 Slave, 非同步端口的端口状态为 Passive。  5603. Determine that the port that receives the sync packet is a synchronous port, and set the port status to Slave. The port status of the non-synchronous port is Passive.
5604 , TC设备进入跟踪状态, 对上游设备发送 sync报文的端口 进行跟踪。  5604. The TC device enters the tracking state and tracks the port on which the upstream device sends the sync packet.
5605 ,判断同步端口的 sync报文是否丟失,如果是则执行 S606 , 否则重复执行 S605。  5605. Determine whether the sync message of the synchronization port is lost. If yes, execute S606. Otherwise, execute S605 repeatedly.
当在一定的时间内端口状态为 Slave 的该同步端口没有接收到 sync报文时, 则说明 sync报文丟失了, sync报文丟失的原因可能是 网络中断、 接收出错等。  When the sync port of the port is not receiving the sync packet within a certain period of time, the sync packet is lost. The cause of the sync packet loss may be network interruption or receiving error.
5606, TC设备进入保持状态, 并不断诊听端口的 sync报文, 返 回执行 S601。 5607 , 设置该 TC设备端口的端口状态为 Passive。 5606, the TC device enters the hold state, and continuously diagnoses the sync message of the port, and returns to execute S601. 5607. Set the port status of the TC device port to Passive.
5608, TC设备进入保持或自由振荡状态,并不断诊听端口的 sync 才艮文, 返回执行 S601。  5608, the TC device enters the hold or free-oscillation state, and continuously diagnoses the sync of the port, and returns to execute S601.
本发明实施例三提供的确定 TC设备同步端口及端口状态的方 法, 直接确定接收到 sync报文的端口为同步端口, 并对上游设备发 送 sync报文的端口进行跟踪, 方法简单灵活, 并能时刻保持 TC设备 与最优时钟源的同步。  The method for determining the synchronization port and the port status of the TC device provided by the third embodiment of the present invention directly determines that the port that receives the sync packet is a synchronous port, and the port that the upstream device sends the sync packet is tracked, and the method is simple and flexible, and can be Keep the TC device synchronized with the optimal clock source at all times.
根据实施例三提供的方案, 本发明实施例提供了一种 TC设备同 步端口的确定方法, 如图 7所示, 包括步骤:  According to the solution provided by the third embodiment, the embodiment of the present invention provides a method for determining a synchronization port of a TC device. As shown in FIG. 7, the method includes the following steps:
5701 ,获取 TC设备的端口对跟踪上游设备指示报文的监测结果。 5701. Obtain a monitoring result of the port of the TC device to track the indication of the upstream device indication.
5702 ,根据监测结果,将接收到跟踪上游设备指示报文的端口确 定为同步端口。 5702. According to the monitoring result, the port that receives the indication of the upstream device indication is determined as the synchronization port.
本发明实施例同时提供了一种 TC设备的同步端口确定装置, 设 置在 TC设备中, 如图 8所示, 包括:  The embodiment of the present invention further provides a synchronization port determining device for the TC device, which is disposed in the TC device, as shown in FIG. 8, and includes:
第二获取单元 801 , 用于获取 TC设备的端口所监测的跟踪上游设 备指示报文的监测结果;  The second obtaining unit 801 is configured to obtain a monitoring result of the tracking upstream device indication message monitored by the port of the TC device.
第二确定单元 802,用于根据第二获取单元 801获取的监测结果, 将接收到跟踪上游设备指示报文的端口确定为同步端口。  The second determining unit 802 is configured to determine, according to the monitoring result obtained by the second obtaining unit 801, a port that receives the tracking upstream device indication message as a synchronization port.
其中, 跟踪上游设备指示报文可以为 sync报文。  The tracking upstream device indication packet may be a sync packet.
本发明实施例提供了 TC设备同步端口的确定方法, 一种方法可 以根据 TC设备的至少一个端口接收到的时钟信息传递报文确定最优 时钟源, 并在该最优时钟源优于 TC设备的本地时钟源时, 将接收到 该最优时钟源对应的时钟信息传递 文的端口确定为同步端口;另一 种方法可以通过获取 TC设备的端口所监测的跟踪上游设备指示报文 的监测结果, 将接收到跟踪上游设备指示报文的端口确定为同步端 口。 同步端口确定方法实现了如何为 TC设备确定同步端口, 使 TC 设备的时钟能够达到理想的精度, 从而进一步可以实现 TC设备对 PTP协议报文驻留时间的精确计算。  The embodiment of the present invention provides a method for determining a synchronization port of a TC device, and a method for determining an optimal clock source according to a clock information transmission message received by at least one port of the TC device, and the optimal clock source is superior to the TC device. When the local clock source is used, the port that receives the clock information corresponding to the optimal clock source is determined as the synchronization port; and the other method can obtain the monitoring result of the tracking upstream device indication packet monitored by the port of the TC device. The port that receives the tracking upstream device indication packet is determined as the synchronization port. The synchronization port determination method implements how to determine the synchronization port for the TC device, so that the clock of the TC device can achieve the desired accuracy, so that the TC device can accurately calculate the PTP protocol packet residence time.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解 到本发明可以通过硬件实现,也可以借助软件加必要的通用硬件平台 的方式来实现。基于这样的理解, 本发明的技术方案可以以软件产品 的形式体现出来, 该软件产品可以存储在一个非易失性存储介质(可 以是 CD-ROM, U盘, 移动硬盘等) 中, 包括若干指令用以使得一 台计算机设备 (可以是个人计算机, 服务器, 或者网络设备等)执行 本发明各个实施例所述的方法。 脱离本发明的精神和范围。 这样, 倘若本发明的这些修改和变型属于 本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些 改动和变型在内。 Through the description of the above embodiments, those skilled in the art can clearly understand The invention can be implemented by hardware or by means of software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including several The instructions are for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present invention. It is within the spirit and scope of the invention. Thus, it is intended that the present invention cover the modifications and modifications of the invention

Claims

权利要求 Rights request
1、 一种穿通时钟设备同步端口的确定方法, 其特征在于, 包括: 获取穿通时钟 TC设备的至少一个端口接收到的时钟信息传递报 文; A method for determining a synchronization port of a punch-through clock device, comprising: acquiring a clock information transmission message received by at least one port of a punch-through clock TC device;
根据所述时钟信息传递报文确定最优时钟源; 并  Determining an optimal clock source according to the clock information delivery message;
在所述最优时钟源优于所述 TC设备的本地时钟源时, 将接收到 所述最优时钟源对应的时钟信息传递^艮文的端口确定为同步端口。  When the optimal clock source is better than the local clock source of the TC device, the port that receives the clock information corresponding to the optimal clock source is determined as the synchronization port.
2、 如权利要求 1所述的方法, 其特征在于, 还包括:  2. The method of claim 1, further comprising:
在所述 TC设备的本地时钟源优于所述最优时钟源时,将所述 TC 设备的至少一个端口设置为消极状态。  When the local clock source of the TC device is better than the optimal clock source, at least one port of the TC device is set to a negative state.
3、 如权利要求 2所述的方法, 其特征在于, 所述 TC设备的至 少一个端口为 TC设备的非内部晶振端口。  3. The method of claim 2, wherein at least one port of the TC device is a non-internal crystal port of the TC device.
4、 如权利要求 3所述的方法, 其特征在于, 当只获取 TC设备 的一个端口接收到的时钟信息传递报文时,所述根据时钟信息传递报 文确定最优时钟源的方法为:将根据该一个端口接收到的时钟信息传 递"¾文确定的时钟源作为所述最优时钟源。  The method of claim 3, wherein when the clock information transmission message received by one port of the TC device is obtained, the method for determining the optimal clock source according to the clock information transmission message is: The clock source determined according to the clock information received by the one port is used as the optimal clock source.
5、 如权利要求 2所述的方法, 其特征在于, 当获取 TC设备的 两个以上端口接收到的时钟信息传递报文时,确定出同步端口之后还 包括: 将所述两个以上端口中的非同步端口设置为消极状态。  The method of claim 2, wherein when the clock information delivery message received by the two or more ports of the TC device is acquired, determining the synchronization port further comprises: placing the two or more ports The asynchronous port is set to a negative state.
6、 如权利要求 1至 5任意一项所述的方法, 其特征在于, 所述 时钟信息传递报文包括通告 announce报文。  The method according to any one of claims 1 to 5, wherein the clock information transmission message comprises an announcement message.
7、 一种 TC设备同步端口的确定装置, 其特征在于, 包括: 第一获取单元: 用于获取 TC设备的至少一个端口接收到的时钟 信息传递报文;  A device for determining a synchronization port of a TC device, comprising: a first acquiring unit: configured to acquire a clock information delivery message received by at least one port of the TC device;
计算单元:用于根据所述第一获取单元获取的所述时钟信息传递 报文确定最优时钟源;  a calculating unit, configured to determine an optimal clock source according to the clock information delivery message acquired by the first acquiring unit;
第一确定单元: 用于在所述最优时钟源优于所述 TC设备的本地 时钟源时,将接收到所述最优时钟源对应的时钟信息传递报文的端口 确定为同步端口。 The first determining unit is configured to: when the optimal clock source is better than the local clock source of the TC device, receive the port of the clock information corresponding to the optimal clock source Determined as a sync port.
8、 一种 TC设备同步端口的确定方法, 其特征在于, 包括: 获取 TC设备的端口对跟踪上游设备指示报文的监测结果; 根据所述监测结果,将接收到所述跟踪上游设备指示报文的端口 确定为同步端口。  A method for determining a synchronization port of a TC device, comprising: acquiring a monitoring result of a port of the TC device to track an indication of the upstream device; and receiving, according to the monitoring result, the tracking upstream device indication The port of the text is determined to be the sync port.
9、 如权利要求 8所述的方法, 其特征在于, 还包括:  9. The method of claim 8, further comprising:
将所述同步端口设置为从状态, 所述 TC设备的非同步端口设置 为消极状态。  The synchronization port is set to the slave state, and the asynchronous port of the TC device is set to the passive state.
10、 如权利要求 9所述的方法, 其特征在于, 还包括: 如果没有端口接收到所述跟踪上游设备指示报文, 则将所述 TC 设备的端口设置为消极状态。  10. The method according to claim 9, further comprising: if no port receives the tracking upstream device indication message, setting the port of the TC device to a negative state.
11、 如权利要求 8、 9或 10所述的方法, 其特征在于, 所述跟踪 上游设备指示报文包括同步 sync报文。  The method according to claim 8, 9 or 10, wherein the tracking upstream device indication message comprises a synchronous sync message.
12、 一种 TC设备同步端口的确定装置, 其特征在于, 包括: 第二获取单元: 用于获取 TC设备的端口所监测的跟踪上游设备 指示报文的监测结果;  A device for determining a synchronization port of a TC device, comprising: a second acquiring unit: configured to acquire a monitoring result of a tracking upstream device indication message monitored by a port of the TC device;
第二确定单元: 用于根据所述第二获取单元获取的所述监测结 果, 将接收到所述跟踪上游设备指示报文的端口确定为同步端口。  The second determining unit is configured to determine, according to the monitoring result obtained by the second acquiring unit, a port that receives the tracking upstream device indication message as a synchronization port.
PCT/CN2008/072557 2007-09-27 2008-09-26 A determining method and device for the synchronization port of a transparent clock equipment WO2009043299A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN 200710152521 CN101399655B (en) 2007-09-27 2007-09-27 Determining method and apparatus for synchronization port of transparent clock device
CN200710152521.9 2007-09-27

Publications (1)

Publication Number Publication Date
WO2009043299A1 true WO2009043299A1 (en) 2009-04-09

Family

ID=40517939

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2008/072557 WO2009043299A1 (en) 2007-09-27 2008-09-26 A determining method and device for the synchronization port of a transparent clock equipment

Country Status (2)

Country Link
CN (1) CN101399655B (en)
WO (1) WO2009043299A1 (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2487836A1 (en) 2011-02-01 2012-08-15 Alcatel Lucent Automatic capture of the network delay components
CN102158335B (en) * 2011-04-21 2015-04-01 中兴通讯股份有限公司 Method and device for processing time synchronization port
CN102215101B (en) * 2011-05-31 2015-09-16 中兴通讯股份有限公司 A kind of clock synchronizing method and equipment
WO2012149751A1 (en) * 2011-09-20 2012-11-08 华为技术有限公司 Method and related device for grading clock classes
CN102404102B (en) * 2011-11-16 2017-07-21 南京中兴软件有限责任公司 A kind of method and apparatus of synchronous ethernet
CN103428086B (en) 2012-05-25 2016-08-03 北京东土科技股份有限公司 The passive port electoral machinery of transparent clock based on PTP protocol and device
CN103490840B (en) * 2012-06-12 2017-11-07 中兴通讯股份有限公司 A kind of apparatus and method for carrying out Precision Time Protocol Message processing
CN103117845A (en) * 2012-11-13 2013-05-22 华为技术有限公司 Modification method, device and system of transparent clock residence time
CN103856360B (en) 2012-11-28 2019-01-25 中兴通讯股份有限公司 A kind of synchronization link fault detection method and device
CN104135359B (en) * 2014-07-22 2017-12-12 南京磐能电力科技股份有限公司 Tandem type multi-node synchronization sampling and data transmission method when a kind of strong
CN105703867B (en) * 2016-01-07 2018-05-08 烽火通信科技股份有限公司 Suitable for the rapid deployment system and method for time synchronization network
CN112769606B (en) * 2020-12-31 2022-12-20 网络通信与安全紫金山实验室 Method, device and storage medium for energy conservation of clock synchronization network
CN115603886A (en) * 2021-06-28 2023-01-13 华为技术有限公司(Cn) Source selection method, device, system and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040223518A1 (en) * 2003-02-20 2004-11-11 Zarlink Semiconductor Inc. Alignment of clocks over multiple packet networks
CN1567832A (en) * 2003-06-17 2005-01-19 华为技术有限公司 Method for managing network node equipment in feedthrough state
GB2418113A (en) * 2004-09-13 2006-03-15 Agilent Technologies Inc Synchronizing operations of a plurality of devices via messages over a communication network
WO2006063922A1 (en) * 2004-12-16 2006-06-22 Siemens Aktiengesellschaft Synchronization module
CN101043316A (en) * 2006-05-24 2007-09-26 华为技术有限公司 Synchronous method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040223518A1 (en) * 2003-02-20 2004-11-11 Zarlink Semiconductor Inc. Alignment of clocks over multiple packet networks
CN1567832A (en) * 2003-06-17 2005-01-19 华为技术有限公司 Method for managing network node equipment in feedthrough state
GB2418113A (en) * 2004-09-13 2006-03-15 Agilent Technologies Inc Synchronizing operations of a plurality of devices via messages over a communication network
WO2006063922A1 (en) * 2004-12-16 2006-06-22 Siemens Aktiengesellschaft Synchronization module
CN101043316A (en) * 2006-05-24 2007-09-26 华为技术有限公司 Synchronous method and system

Also Published As

Publication number Publication date
CN101399655B (en) 2011-04-20
CN101399655A (en) 2009-04-01

Similar Documents

Publication Publication Date Title
WO2009043299A1 (en) A determining method and device for the synchronization port of a transparent clock equipment
Cox et al. Time synchronization for ZigBee networks
US10432336B2 (en) System and method of synchronizing a distributed clock in a packet-compatible network
US8873589B2 (en) Methods and devices for clock synchronization
WO2018006686A1 (en) Method, apparatus and device for optimizing time synchronization between communication network devices
Maggs et al. Consensus clock synchronization for wireless sensor networks
CN105680973B (en) The method for synchronizing time of free-running node in avionic device network
CN102195735B (en) Time synchronization method for multi-subsystem equipment and subsystem
KR20090032306A (en) Time synchronization system and method on the network
WO2017032113A1 (en) Method and apparatus for measuring time synchronization deviation
US11095383B2 (en) Method for exchanging time synchronization packet and network apparatus
JP2004186877A (en) Wireless access network system, wireless communication method, synchronous server, and node unit
WO2013020499A1 (en) Method and device for implementing automatic compensation for asymmetric delay of 1588 link
EP3531610B1 (en) Frequency synchronization method and slave clock
CN102237996B (en) Clock synchronization method and clock synchronization device
CN104836630A (en) IEEE1588 clock synchronization system and implementation method therefor
CN108259109B (en) Network equipment in PTP domain and TOD synchronization method
WO2011160595A1 (en) Method, slave clock node and system for selecting master clock node based on precision time protocol (ptp) and link quality
US11456849B2 (en) Method and apparatus for synchronizing different communication ports
Resner et al. Speculative Precision Time Protocol: submicrosecond clock synchronization for the IoT
CN102158335B (en) Method and device for processing time synchronization port
WO2014101668A1 (en) Time synchronization processing method and apparatus
WO2017000480A1 (en) Time synchronization method, server and system, and storage medium
JP2014165582A (en) Time synchronization system, time synchronization method, slave node and computer program
US11831403B2 (en) Network interface card structure and clock synchronization method to precisely acquire heterogeneous PTP synchronization information for PTP synchronization network extension

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

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

Country of ref document: EP

Kind code of ref document: A1