CN102158335B - Method and device for processing time synchronization port - Google Patents
Method and device for processing time synchronization port Download PDFInfo
- Publication number
- CN102158335B CN102158335B CN201110101024.2A CN201110101024A CN102158335B CN 102158335 B CN102158335 B CN 102158335B CN 201110101024 A CN201110101024 A CN 201110101024A CN 102158335 B CN102158335 B CN 102158335B
- Authority
- CN
- China
- Prior art keywords
- port
- mode
- notification message
- time synchronization
- state
- Prior art date
- Legal status (The legal status 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 status listed.)
- Expired - Fee Related
Links
- 238000012545 processing Methods 0.000 title claims abstract description 55
- 238000000034 method Methods 0.000 title claims abstract description 34
- 230000004224 protection Effects 0.000 claims description 94
- 238000001514 detection method Methods 0.000 claims description 25
- 238000012544 monitoring process Methods 0.000 claims description 14
- 239000002699 waste material Substances 0.000 claims description 8
- 238000006243 chemical reaction Methods 0.000 claims description 6
- 230000007704 transition Effects 0.000 claims description 5
- 230000008569 process Effects 0.000 description 16
- 238000010586 diagram Methods 0.000 description 10
- 230000010355 oscillation Effects 0.000 description 8
- 230000001360 synchronised effect Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 238000003672 processing method Methods 0.000 description 4
- 230000015556 catabolic process Effects 0.000 description 3
- 238000006731 degradation reaction Methods 0.000 description 3
- 238000005259 measurement Methods 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 108700009949 PTP protocol Proteins 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Landscapes
- Small-Scale Networks (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a method and device for processing a time synchronization port. The method comprises the following steps: determining a protected mode of the port in accordance with port information, wherein the port information comprises the conditions that the port receives notification messages as well as the existing working state and position of the port in a time synchronization network, and the protected mode is one mode selected from a time loop circuit mode, an edge port mode and a master time node mode; and processing the port in accordance with the determined protected mode so as to keep the topological structure of the time synchronization network unchanged. According to the invention, the stability of a system is improved, and the processing capacity of the system is improved.
Description
Technical Field
The present invention relates to the field of communications, and in particular, to a method and an apparatus for processing a time synchronization port.
Background
The IEEE1588 Protocol (i.e., a network measurement and control system Precision clock synchronization Protocol) has attracted a great deal of attention and is widely used in test control systems, automation fields, telecommunications and power systems, and defines a Precision Time Protocol (PTP for short) that synchronizes clocks independently running on separate nodes dispersed in a measurement and control system to a high-Precision and high-reliability clock, thereby realizing sub-microsecond synchronization of clocks in sensors, actuators and other terminal devices in a distributed bus system of a standard ethernet or other multicast technologies.
Fig. 1 is a schematic diagram of a time synchronization network topology according to IEEE1588 protocol of the related art, and as shown in fig. 1, when time synchronization is implemented according to IEEE1588 protocol, clocks participating in synchronization communicate with each other in a tree-shaped communication network, and clocks inside a synchronization system form a corresponding master-slave relationship, where the synchronization system of distributed clocks is composed of a normal clock and a boundary clock, the normal clock only has a capability of receiving time, and the boundary clock has a capability of transmitting time. The ports of the normal clock and the boundary clock are in the following 3 states when working normally: the master port state (i.e., master) indicates that the port is the source of a certain time path, the slave port state (i.e., slave) indicates that the port is synchronized to a master clock, and the backup port state (i.e., passive) indicates that the port is not engaged in synchronization message interaction to prevent time looping. The generation of the port state of the Clock synchronization network may be manual configuration designation, or may be automatically calculated and generated by using a Best Master Clock (BMC) algorithm, that is, a port is set as a passive port by using a data comparison algorithm and a state decision algorithm in a ring network through a notification (announce) message, so as to implement time synchronization redundancy backup of the link.
Fig. 2 is a process flowchart of time synchronization according to the IEEE1588 protocol of the related art, and as shown in fig. 2, the process includes the steps of:
step S202, starting an IEEE1588 protocol and a BMC algorithm thereof;
step S204, judging whether the port can hear the announce message, if so, executing step S210, otherwise, executing step S206;
step S206, judging whether a passive port exists, if so, executing step S208, otherwise, executing step S210;
step S208, entering an announce overtime flow, and converting a passive port into a master port;
step S210, judging whether an edge port (manual configuration) exists, if so, executing step S212, otherwise, executing step S216;
step S212, the BMC recalculates, executes the data comparison algorithm and the state decision algorithm;
step S214, if the priority of the announce message received by the edge port is higher than the priority of the GM, or the priority of the announce message received by the master port is equal to the priority of the Grandmaster Clock node (GM), the Clock ID of the announce message is smaller than the GM, the edge port becomes a slave port, and the time synchronization network topology is updated;
step S216, judging whether the priority of the announce message received by the master port is higher than the priority of the GM, or whether the Clock ID of the announce message is smaller than the GM when the priority of the announce message received by the master port is equal to the priority of the GM, if so, executing step S218, otherwise, keeping the time synchronization network topology unchanged;
step S218, the BMC recalculates, executes the data comparison algorithm and the state decision algorithm;
step S220, if the priority of the announce message received by the edge port is higher than the priority of the GM, or the Clock ID of the announce message received by the master port is smaller than the GM when the priority of the announce message received by the master port is equal to the priority of the GM, the time synchronization network topology is updated (namely, other Clock sources are synchronized).
It can be seen that, in the related art, when a passive port in a time synchronization network cannot receive an announce message due to a link failure or the like, the passive port is converted into a master port after an announce period (for example, step S208), so that a time synchronization temporary loop may occur, and system resources are wasted; for Packet Transport Network (PTN) access layer devices, edge ports (manual configuration) of the access devices are generally directly connected to devices such as a base station, and after the edge ports receive an announce message, a BMC algorithm recalculates (for example, step S212) to cause oscillation of the entire Network topology, and under normal conditions, the edge ports should not receive the announce message of the PTP protocol, and may be Network maintenance personnel configuration errors or faked announce message malicious attacks on the access devices, which may cause time synchronization Network performance degradation, frequent Network topology switching and waste of system resources; in addition, due to configuration error of a network administrator or malicious network attack, a master clock node in the network receives an announce message with a higher priority (for example, step S216), so that the master clock node loses its original position, and is switched from an original synchronous higher-quality clock to a synchronous lower-quality clock, which may cause performance degradation of a time synchronization network and waste of system resources, even cause serious influence on the communication quality of the wireless communication network.
With the wide application of the IEEE1588 protocol in the time synchronization network, the application requirement of the PTP technology in the PTN bearer network is also continuously improved, and how to more effectively improve the reliability, manageability, and security of the time synchronization network has become a direction of important attention in the PTP technology. Therefore, effective protection against the above situation becomes an important issue to be solved urgently in practical networking and engineering applications.
Disclosure of Invention
The main objective of the present invention is to provide a processing scheme for a time synchronization port, so as to at least solve the problems of low utilization rate of system resources and frequent network oscillation in the time synchronization network.
To achieve the above object, according to one aspect of the present invention, a method for processing a time synchronization port is provided.
The processing method of the time synchronization port comprises the following steps: determining a protection mode of a port according to port information, wherein the port information comprises a condition that the port receives a notification message, and a current working state and position of the port in a time synchronization network, and the protection mode comprises one of the following modes: a time loop mode, an edge port mode, a master time node mode; and processing the ports according to the determined protection mode to maintain the topological structure of the time synchronization network unchanged.
Preferably, determining the protection mode of the port according to the port information includes one of: determining that the protection mode is a time loop mode under the condition that the port does not receive the notification message and the current working state of the port in the time synchronization network is a backup port state; determining the protection mode as an edge port mode under the condition that the port receives the notification message and the edge position of the port in the time synchronization network; and determining the protection mode to be the master time node mode under the condition that the port receives the notification message, the port is not at the edge position in the time synchronization network and the priority of the port receiving the notification message is higher than the priority of the GM, or under the condition that the port receives the notification message, the port is not at the edge position in the time synchronization network and the priority of the port receiving the notification message is equal to the priority of the GM, and the clock ID of the notification message is smaller than the clock ID of the GM.
Preferably, when the protection mode is the time loop mode, processing the port according to the determined protection mode includes: and keeping the working state of the port in the time synchronization network as a backup port state.
Preferably, when the protection mode is an edge port mode, processing the port according to the determined protection mode includes: step A1, setting the port to a waste state; step A2, detecting whether the port receives the notification message at regular time; when the timing time is up, setting the port to be in an activated state, and judging whether the port receives a notification message or not; if the port does not receive the notification message, keeping the port in an activated state; otherwise, step A1 and step A2 are repeated.
Preferably, when the protection mode is the master time node mode, processing the port according to the determined protection mode includes: step B1, converting the working state of the port in the time synchronization network into a backup port state; step B2, monitoring the condition that the port receives the notification message; if the monitoring result in the step B2 is one of the following, the working state of the port in the time synchronization network is changed to the master port state; otherwise, the step B2 is executed: when the priority of the notification message received by the port is lower than that of the GM, the clock ID of the notification message is greater than or equal to that of the GM when the priority of the notification message received by the port is equal to that of the GM, and the port does not receive the notification message within the preset time.
In order to achieve the above object, according to another aspect of the present invention, there is also provided a processing apparatus for a time synchronization port.
The processing device of the time synchronization port comprises: the determining module is configured to determine a protection mode of the port according to port information, where the port information includes a condition that the port receives the notification packet, and a current working state and a current position of the port in the time synchronization network, and the protection mode includes one of: a time loop mode, an edge port mode, a master time node mode; and the processing module is used for processing the ports according to the determined protection mode so as to maintain the topological structure of the time synchronization network unchanged.
Preferably, the determining means comprises one of: the system comprises a time loop unit, an edge port unit and a main time node unit; the time loop unit is used for determining that the protection mode is the time loop mode under the condition that the port does not receive the notification message and the current working state of the port in the time synchronization network is the backup port state; the edge port unit is used for determining that the protection mode is an edge port mode under the condition that the port receives the notification message and the edge position of the port in the time synchronization network; and the master time node unit is used for determining that the protection mode is the master time node mode under the condition that the port receives the notification message, the port is not at the edge position in the time synchronization network and the priority of the port receiving the notification message is higher than the priority of the GM, or under the condition that the port receives the notification message, the port is not at the edge position in the time synchronization network and the priority of the port receiving the notification message is equal to the priority of the GM, and the clock ID of the notification message is smaller than the clock ID of the GM.
Preferably, the processing module is further configured to, in a case that the protection mode is the edge port mode, maintain the working state of the port in the time synchronization network as a backup port state.
Preferably, the processing module comprises a port setting unit and a timing detection unit, wherein the port setting unit is configured to set the port to a discard state when the protection mode is the edge port mode; and setting the port to an active state when the timing time of the timing detection unit is reached; the timing detection unit is used for detecting whether the port receives the notification message or not in a timing mode after the port setting unit sets the port to be in a waste state, and judging whether the port receives the notification message or not when the timing time is up; if the port does not receive the notification message, keeping the port in an activated state; otherwise, the port setting unit is instructed to set the port to be in a waste state, and the condition that the port receives the notification message is continuously detected at regular time until the port cannot receive the notification message.
Preferably, the processing module includes a state transition unit and a packet detection unit, where the state transition unit is configured to convert a working state of the port in the time synchronization network into a backup port state when the protection mode is the master time node mode; and converting the working state of the port in the time synchronization network into a main port state according to the command of the message detection unit; the message detection unit is used for monitoring the condition that the port receives the notification message after the state conversion unit converts the working state of the port in the time synchronization network into the backup port state; if the monitoring result is one of the following, indicating the state conversion unit to convert the working state of the port in the time synchronization network into the master port state; otherwise, continuing to monitor the condition that the port receives the notification message until the monitoring result is one of the following: the priority of the port receiving the notification message is lower than that of the GM, when the priority of the port receiving the notification message is equal to that of the GM, the clock ID of the notification message is larger than or equal to that of the GM, and the port does not receive the notification message within the preset time.
According to the invention, the ports are classified and protected according to the condition of the time synchronization port receiving the notification message, the current working state and position and the like, so that the topological structure of the time synchronization network is kept unchanged, the problems of low utilization rate of system resources and frequent network oscillation in the time synchronization network are solved, the stability of the system is increased, and the processing capacity of the system is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a schematic diagram of a time synchronization network topology according to the IEEE1588 protocol of the related art;
fig. 2 is a process flow diagram of time synchronization according to the IEEE1588 protocol of the related art;
FIG. 3 is a flow chart of a method of processing a time synchronization port according to an embodiment of the invention;
FIG. 4 is a block diagram of a processing device of a time synchronization port according to an embodiment of the present invention;
FIG. 5 is a block diagram of a processing device of a time synchronization port in accordance with a preferred embodiment of the present invention;
fig. 6 is a schematic diagram of IEEE1588 protocol enhanced protection according to a first embodiment of the present invention;
fig. 7 is a process flow diagram of implementing an enhanced protection mechanism for time synchronization of IEEE1588 protocol according to the second embodiment of the present invention;
fig. 8 is a flowchart of processing of detecting the primary clock node protection module announce according to the third embodiment of the present invention; and
fig. 9 is a flowchart of a process of timing re-detection of the edge port protection module according to a fourth embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
According to the embodiment of the invention, a processing method of a time synchronization port is provided. Fig. 3 is a flowchart of a processing method of a time synchronization port according to an embodiment of the present invention, as shown in fig. 3, including the following steps:
step S302, determining a protection mode of the port according to the port information, where the port information includes a condition that the port receives a notification message (i.e., an announce message), and a current working state and position of the port in the time synchronization network, and the protection mode includes one of: a time loop mode, an edge port mode, a master time node mode;
and step S304, processing the port according to the determined protection mode to maintain the topological structure of the time synchronization network unchanged.
Through the steps, the ports are classified and protected according to the condition of the time synchronization port receiving the notification message, the current working state, the current position and the like, so that the topological structure of the time synchronization network is kept unchanged, the problems of low utilization rate of system resources and frequent network oscillation in the time synchronization network are solved, the stability of the system is improved, and the processing capacity of the system is improved.
Preferably, in step S302, determining the protection mode of the port according to the port information includes one of: determining that the protection mode is a time loop mode (namely, time loop protection) when the port does not receive the notification message and the current working state of the port in the time synchronization network is a backup port state (namely, passive); determining that the protection mode is an edge port mode (i.e., edge port protection) when the port receives the notification packet and an edge position of the port in the time synchronization network (i.e., an edge port is determined by a network position where the device is located, for example, an access layer network device may be defined as an edge port); when a port receives a notification message, the port is not at an edge position in the time synchronization network, and the priority of the port receiving the notification message is higher than the priority of a GM, or when the port receives the notification message, the port is not at an edge position in the time synchronization network, and the priority of the port receiving the notification message is equal to the priority of the GM, the clock ID of the notification message is smaller than the clock ID of the GM, the protection mode is determined to be the master time node mode (i.e., master time node protection). The method is simple and practical and has strong operability.
Preferably, when the protection mode is the time loop mode, in step S304, processing the port according to the determined protection mode includes: and keeping the working state of the port in the time synchronization network as a backup port state. The method can reduce the times of updating the topological structure of the time synchronization network and reduce the network oscillation.
Preferably, when the protection mode is the edge port mode, in step S304, processing the port according to the determined protection mode includes: firstly, setting a port to be in a waste state; when the timing time is up, the port is converted into an activated state, and whether the port receives a notification message or not is judged; if the port does not receive the notification message, keeping the port in an activated state (for example, link up or forward); otherwise, the port is set to be in a waste state (for example, link down or discard), and whether the port receives the notification message is repeatedly detected at regular time until the port cannot receive the notification message. The method can avoid the update of the topological structure of the time synchronization network caused by the abnormity of the edge port, and improve the stability and the fault-tolerant capability of the system. It should be noted that, in the implementation process, link up may indicate that a port is open, and forward may indicate that the port has the capability of forwarding a specific packet.
Preferably, when the protection mode is the master time node mode, in step S304, the processing the port according to the determined protection mode includes: converting the working state of the port in the time synchronization network into a backup port state; monitoring the condition that the port receives the notification message; if the monitoring result is one of the following, the working state of the port in the time synchronization network is converted into a master port state (namely, master); otherwise, continuing to monitor the condition that the port receives the notification message until the condition is one of the following conditions: the priority of the notification message received by the port is lower than that of the GM, when the priority of the notification message received by the port is equal to that of the GM, the clock ID of the notification message is greater than or equal to that of the GM, and the port does not receive the notification message within the preset time. The method can improve the processing capacity of the system, and is simple to implement and strong in operability.
Corresponding to the method, the embodiment of the invention also provides a processing device of the time synchronization port. Fig. 4 is a block diagram of a processing apparatus of a time synchronization port according to an embodiment of the present invention, as shown in fig. 4, the apparatus including: a determining module 42, configured to determine a protection mode of a port according to port information, where the port information includes a condition that the port receives a notification message, and a current working state and location of the port in a time synchronization network, and the protection mode includes one of: a time loop mode, an edge port mode, a master time node mode; a processing module 44, coupled to the determining module 42, is configured to process the ports according to the determined protection mode to maintain the topology of the time synchronization network unchanged.
By the device, the ports are classified and protected according to the condition of the time synchronization port receiving the notification message, the current working state, the current position and the like, so that the topological structure of the time synchronization network is maintained unchanged, the problems of low utilization rate of system resources and frequent network oscillation in the time synchronization network are solved, the stability of the system is improved, and the processing capacity of the system is improved.
Fig. 5 is a block diagram of a processing device of a time synchronization port according to a preferred embodiment of the present invention, and as shown in fig. 5, the determination module 42 includes one of the following: a time loop unit 422, an edge port unit 424, a master time node unit 426; the time loop unit 422 is configured to determine that the protection mode is the time loop mode when the port does not receive the notification packet and the current working state of the port in the time synchronization network is the backup port state; an edge port unit 424, configured to determine that the protection mode is an edge port mode when the port receives the notification packet and the port is at an edge position in the time synchronization network; a master time node unit 426, configured to determine that the protection mode is the master time node mode if the port receives the notification message, the port is not at the edge location in the time synchronization network, and the priority of the port receiving the notification message is higher than the priority of the GM, or if the port receives the notification message, the port is not at the edge location in the time synchronization network, and the priority of the port receiving the notification message is equal to the priority of the GM, and the clock ID of the notification message is smaller than the clock ID of the GM.
Preferably, the processing module 44 is further configured to maintain the working status of the port in the time synchronization network as a backup port status if the protection mode is the edge port mode.
Preferably, the processing module 44 includes a port setting unit 442 and a timing detection unit 444, wherein the port setting unit 442, coupled to the edge port unit 424, is configured to set the port to a discard state if the protection mode is the edge port mode; and setting the port to an active state when the timing time of the timing detection unit 444 is reached; a timing detection unit 444, coupled to the port setting unit 442, configured to detect whether the port receives the notification message at a fixed time after the port setting unit 442 sets the port to a discard state, and determine whether the port receives the notification message when the fixed time is reached; if the port does not receive the notification message, keeping the port in an activated state; otherwise, the port setting unit 442 is instructed to set the port to the discard state, and the situation that the port receives the notification message is continuously detected at regular time until the port cannot receive the notification message.
Preferably, the processing module 44 includes a state transition unit 446 and a message detection unit 448, where the state transition unit 446 is coupled to the primary time node unit 426, and configured to, when the protection mode is the primary time node mode, convert the working state of the port in the time synchronization network into a backup port state; and according to the command of the message detecting unit 448, the working state of the port in the time synchronization network is converted into the main port state; a message detecting unit 448, coupled to the state converting unit 446, configured to monitor a condition that the port receives the notification message after the state converting unit 446 converts the working state of the port in the time synchronization network into the backup port state; if the monitoring result is one of the following, the state conversion unit 446 is instructed to convert the working state of the port in the time synchronization network into the master port state; otherwise, continuing to monitor the condition that the port receives the notification message until the monitoring result is one of the following: the priority of the port receiving the notification message is lower than that of the GM, when the priority of the port receiving the notification message is equal to that of the GM, the clock ID of the notification message is larger than or equal to that of the GM, and the port does not receive the notification message within the preset time.
The implementation of the above embodiments will be described in detail below with reference to the preferred embodiments and the accompanying drawings.
Example one
The embodiment provides a method for realizing enhanced protection of an IEEE1588 protocol, namely, after the IEEE1588 protocol and a BMC algorithm thereof are started, a master, slave or passive port is generated according to the BMC algorithm, and corresponding processing is carried out according to different receiving conditions of an announce message aiming at various port roles and network positions where the ports are located, so that enhanced protection of IEEE1588 protocol time synchronization is realized. In implementation, the enhanced protection function may include three protections, namely, a time loop guard (loop guard), an edge port guard (intersection guard), and a master time node guard (master guard).
Fig. 6 is a schematic diagram of enhanced protection of IEEE1588 protocol according to a first embodiment of the present invention, and as shown in fig. 6, the method for implementing enhanced protection of IEEE1588 protocol time synchronization in this embodiment may include the following steps:
step A, whether an announce message is received by an IEEE1588 protocol time synchronization port or not; if yes, executing step D, otherwise, executing step B;
b, judging whether the port is a passive port, if so, executing the step C, otherwise, executing the step D;
step C, executing time loop protection (loop guard), wherein the port cannot be updated to a master state, and the port passive state is kept;
d, judging whether the port is an edge port (manual configuration), if so, executing the step E, otherwise, executing the step F;
and E, executing edge port protection (announce guard), wherein the edge port is Link down, the Link up is repeated after a certain time delay, and the edge port continues Link down if the announce message is continuously received. Until receiving no report message, edge port Link up;
step F, judging whether the priority of the announce message received by the master port is higher than the priority of the GM, or whether the Clock ID of the announce message is smaller than the GM when the priority of the announce message received by the master port is equal to the priority of the GM, if so, executing the step G, otherwise, executing the step H;
g, executing master time node protection (master guard), wherein the port state is switched to passive, the port does not process IEEE1588 protocol messages in the state, and the priority information of the messages is not forwarded outwards at the moment, so that the clock master node status is consolidated; when the announce message with higher priority is not received within a certain time delay, the port recovers to a normal state;
and H, maintaining the existing network topology and port state unchanged.
Therefore, in the embodiment, performance degradation of the time synchronization network and frequent oscillation of the time synchronization network caused by configuration errors or network malicious attacks can be avoided, so that protection of IEEE1588 protocol time synchronization enhancement is effectively realized.
Example two
Fig. 7 is a flowchart of a process of implementing an enhanced protection mechanism according to IEEE1588 protocol time synchronization according to a second embodiment of the present invention, and as shown in fig. 7, the process may include the following steps:
step S702, starting an IEEE1588 protocol and a BMC algorithm thereof;
step S704, judging whether the port hears the announce message, if yes, executing step S710, otherwise executing step S706;
step S706, judging whether passive port is available, if yes, executing step S708, otherwise executing step S710;
step S708, executing time loop protection (loop guard), wherein the port cannot be updated to a master state, and the port passive state is maintained; the time synchronization network topology is unchanged;
step S710, judging whether an edge port (manual configuration) exists, if so, executing step S712, otherwise, executing step S714;
step S712, performing edge port protection (announce guard), where the edge port is Link down, and the Link up is repeated after a certain time delay, and if the announce message is continuously received, the edge port continues Link down. Until receiving no report message, edge port Link up; the time synchronization network topology is unchanged;
step S714, judging whether the priority of the announce message received by the master port is higher than the priority of the GM, or whether the Clock ID of the announce message is smaller than the GM when the priority of the announce message received by the master port is equal to the priority of the GM, if so, executing step S716, otherwise, keeping the time synchronization network topology unchanged;
step S716, executing master time node protection (master guard), switching the port state into passive, wherein the port does not process IEEE1588 protocol message in this state, and the priority information of the message is not forwarded to the outside at this time, thus consolidating the clock master node status; when the announce message with higher priority is not received within a certain time delay, the port recovers to a normal state; the time synchronized network topology does not change.
EXAMPLE III
Fig. 8 is a processing flow chart of primary clock node protection module announcing detection according to a third embodiment of the present invention, and as shown in fig. 8, the processing flow of primary clock node protection (master guard) module announcing detection in the present embodiment is as follows:
step S802, the detection of the announce message is started;
step S804, judge whether the port listens to the announce message, if yes, carry out step S808, otherwise carry out step S806;
step S806, judging whether the time of the port intercepting the announce message is overtime, if so, converting the port into a master state;
step S808, judging whether the priority of the announce message received by the master port is higher than the priority of the GM, or whether the Clock ID of the announce message is smaller than the GM when the priority of the announce message received by the master port is equal to the priority of the GM, if so, executing step S810, otherwise, executing step S812;
step S810, the port state keeps passive, the port does not process IEEE1588 protocol message in the state, and the priority information of the message is not forwarded to the outside at the moment, and the clock master node status is consolidated; then step S802 is entered, and the announce message detection is restarted;
step S812, the port recovers the normal state such as master, and the announce detection process ends.
Example four
Fig. 9 is a flowchart of a timing re-detection process of an edge port protection module according to a fourth embodiment of the present invention, and as shown in fig. 9, a timing re-detection process of a primary edge port protection (egress guard) module in the present embodiment is as follows:
step S902, starting to detect again at regular time (namely, detecting the situation of the announce message of the port);
step S904, judge whether the interval timer of the announce arrives, if yes, carry out step S906, otherwise restart the timing to detect again;
step S906, the edge port which is originally linked Down is linked up again, or the port discard is forwarded again;
step S908, judging whether the port senses the announce message, if so, executing step S910, otherwise, periodically re-detecting and ending;
in step S910, the edge port is re-sent by Link down or discard message, and the process goes to step S902 to restart the timing re-detection.
In summary, embodiments of the present invention relate to an accurate time synchronization technology, and provide a method for enhancing protection of an IEEE1588 protocol when a network topology is abnormally changed, that is, classifying and protecting ports according to a condition that a time synchronization port receives an announce packet, a current working state and a current position, and the like, so as to maintain a topology structure of a time synchronization network unchanged, solve the problems of low utilization rate of system resources and frequent network oscillation in the time synchronization network, increase stability of the system, and improve processing capability of the system.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, or they may be separately fabricated into various integrated circuit modules, or multiple modules or steps thereof may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (8)
1. A method for processing a time synchronization port is characterized by comprising the following steps:
determining a protection mode of a port according to port information, wherein the port information includes a condition that the port receives a notification message, and a current working state and position of the port in a time synchronization network, and the protection mode includes one of the following: a time loop mode, an edge port mode, a master time node mode;
processing the port according to the determined protection mode to maintain the topological structure of the time synchronization network unchanged;
wherein determining the protection mode of the port according to the port information comprises one of:
determining that the protection mode is the time loop mode when the port does not receive the notification message and the current working state of the port in the time synchronization network is a backup port state;
determining the protection mode as the edge port mode under the condition that the port receives the notification message and the port is at the edge position in the time synchronization network;
and determining that the protection mode is the master time node mode under the condition that the port receives the notification message, the port is not at the edge position in the time synchronization network, and the priority of the port receiving the notification message is higher than that of a grandmaster clock node (GM), or under the condition that the port receives the notification message, the port is not at the edge position in the time synchronization network, and the clock ID of the notification message is smaller than that of the GM when the port receives the notification message and the priority of the port receiving the notification message is equal to that of the GM.
2. The method of claim 1, wherein, in the case that the protection mode is the time loop mode, processing the port according to the determined protection mode comprises:
and keeping the working state of the port in the time synchronization network as a backup port state.
3. The method according to claim 1, wherein, in the case that the protection mode is the edge port mode, processing the port according to the determined protection mode comprises:
step A1, setting the port to a waste state;
step A2, detecting whether the port receives the notification message at regular time;
when the timing time is up, setting the port to be in an activated state, and judging whether the port receives the notification message;
if the port does not receive the notification message, keeping the port in an activated state; otherwise, repeating the step A1 and the step A2.
4. The method of claim 1, wherein, in the case that the protection mode is the master time node mode, processing the port according to the determined protection mode comprises:
step B1, converting the working state of the port in the time synchronization network into a backup port state;
step B2, monitoring the situation that the port receives the notification message;
if the monitoring result in the step B2 is one of the following, converting the working state of the port in the time synchronization network into a master port state; otherwise, the step B2 is executed continuously: the priority of the notification message received by the port is lower than that of a GM, the clock ID of the notification message is greater than or equal to that of the GM when the priority of the notification message received by the port is equal to that of the GM, and the port does not receive the notification message within a preset time.
5. A device for processing a time synchronization port, comprising:
a determining module, configured to determine a protection mode of a port according to port information, where the port information includes a condition that the port receives a notification packet, and a current working state and location of the port in a time synchronization network, and the protection mode includes one of: a time loop mode, an edge port mode, a master time node mode;
the processing module is used for processing the port according to the determined protection mode so as to maintain the topological structure of the time synchronization network unchanged;
wherein the determining module comprises one of: the system comprises a time loop unit, an edge port unit and a main time node unit; wherein,
the time loop unit is configured to determine that the protection mode is the time loop mode when the port does not receive the notification packet and a current working state of the port in the time synchronization network is a backup port state;
the edge port unit is configured to determine that the protection mode is the edge port mode when the port receives the notification packet and the port is at an edge position in the time synchronization network;
the master time node unit is configured to determine that the protection mode is the master time node mode when the port receives the notification packet, the port is not at an edge position in the time synchronization network, and the priority of the port receiving the notification packet is higher than the priority of a grandmaster clock node GM, or when the port receives the notification packet, the port is not at an edge position in the time synchronization network, and the clock ID of the notification packet is smaller than the clock ID of the GM when the priority of the port receiving the notification packet is equal to the priority of the GM.
6. The processing apparatus as claimed in claim 5, wherein the processing module is further configured to maintain an operating status of the port in the time synchronization network as a backup port status if the protection mode is the edge port mode.
7. The processing apparatus according to claim 5, wherein the processing module comprises a port setting unit and a timing detection unit, wherein,
the port setting unit is configured to set the port to a discard state when the protection mode is the edge port mode; and setting the port to an active state when the timing time of the timing detection unit is reached;
the timing detection unit is configured to detect whether the port receives the notification packet at a timing after the port setting unit sets the port to the discarded state, and determine whether the port receives the notification packet when the timing time arrives; if the port does not receive the notification message, keeping the port in an activated state; otherwise, the port setting unit is instructed to set the port to be in the abandon state, and the condition that the port receives the notification message is continuously detected at regular time until the port cannot receive the notification message.
8. The processing apparatus according to claim 5, wherein the processing module comprises a state transition unit and a packet detection unit, wherein,
the state conversion unit is configured to convert a working state of the port in the time synchronization network into a backup port state when the protection mode is the master time node mode; and converting the working state of the port in the time synchronization network into a master port state according to the command of the message detection unit;
the message detection unit is used for monitoring the condition that the port receives a notification message after the state conversion unit converts the working state of the port in the time synchronization network into a backup port state; if the monitoring result is one of the following, the state conversion unit is indicated to convert the working state of the port in the time synchronization network into a master port state; otherwise, continuing to monitor the condition that the port receives the notification message until the monitoring result is one of the following: the priority of the port receiving the notification message is lower than that of a GM, the clock ID of the notification message is greater than or equal to the clock ID of the GM when the priority of the port receiving the notification message is equal to that of the GM, and the port does not receive the notification message within a preset time.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110101024.2A CN102158335B (en) | 2011-04-21 | 2011-04-21 | Method and device for processing time synchronization port |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110101024.2A CN102158335B (en) | 2011-04-21 | 2011-04-21 | Method and device for processing time synchronization port |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102158335A CN102158335A (en) | 2011-08-17 |
CN102158335B true CN102158335B (en) | 2015-04-01 |
Family
ID=44439538
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201110101024.2A Expired - Fee Related CN102158335B (en) | 2011-04-21 | 2011-04-21 | Method and device for processing time synchronization port |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102158335B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104662857A (en) * | 2012-03-30 | 2015-05-27 | 瑞典爱立信有限公司 | Method and system for robust precision time protocol synchronization |
CN103236894B (en) * | 2013-04-03 | 2016-08-03 | 北京东土科技股份有限公司 | Clock synchronizing method and device in a kind of seamless redundant network |
CN103634208B (en) * | 2013-11-26 | 2017-02-01 | 杭州华三通信技术有限公司 | Method and device for preventing loop in PTP (precision time protocol) TC (transparent clock) looped network |
CN103929294B (en) * | 2014-05-05 | 2017-09-12 | 浙江大学 | A kind of clock system and synchronous method |
CN104092528B (en) * | 2014-07-14 | 2017-06-06 | 新华三技术有限公司 | A kind of clock synchronizing method and device |
CN108419287B (en) * | 2018-01-11 | 2020-08-04 | 浙江大学 | Method for wireless equipment node network synchronization |
CN116684024B (en) * | 2023-05-31 | 2024-06-04 | 中国科学院空间应用工程与技术中心 | FC-AE-1553 boundary clock port state configuration method and system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101207606A (en) * | 2006-12-18 | 2008-06-25 | 华为技术有限公司 | Method and apparatus for main clock selecting |
CN101399757A (en) * | 2007-09-25 | 2009-04-01 | 华为技术有限公司 | Method and device for tracing time clock source |
CN101399655A (en) * | 2007-09-27 | 2009-04-01 | 华为技术有限公司 | Determining method and apparatus for synchronization port of transparent clock device |
CN101882990A (en) * | 2010-06-24 | 2010-11-10 | 中兴通讯股份有限公司 | Method for selecting master clock based on PTP (Picture Transfer Protocol) and link quality, slave clock and system |
-
2011
- 2011-04-21 CN CN201110101024.2A patent/CN102158335B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101207606A (en) * | 2006-12-18 | 2008-06-25 | 华为技术有限公司 | Method and apparatus for main clock selecting |
CN101399757A (en) * | 2007-09-25 | 2009-04-01 | 华为技术有限公司 | Method and device for tracing time clock source |
CN101399655A (en) * | 2007-09-27 | 2009-04-01 | 华为技术有限公司 | Determining method and apparatus for synchronization port of transparent clock device |
CN101882990A (en) * | 2010-06-24 | 2010-11-10 | 中兴通讯股份有限公司 | Method for selecting master clock based on PTP (Picture Transfer Protocol) and link quality, slave clock and system |
Also Published As
Publication number | Publication date |
---|---|
CN102158335A (en) | 2011-08-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102158335B (en) | Method and device for processing time synchronization port | |
EP2688240B1 (en) | Method, system and device for switching and selecting clock source device | |
US10075287B2 (en) | Time synchronization method and device | |
US9300422B2 (en) | Method for detecting a synchronization failure of a transparent clock and related protection schemes | |
CN102843205B (en) | The method and apparatus that a kind of time synchronized based on Precision Time Protocol restrains | |
CN105024841B (en) | A kind of synchronous fault processing method and system of clock and Time Synchronization Network | |
US20160156427A1 (en) | Clock recovery in a packet based network | |
KR20180035145A (en) | Error detection in communication networks | |
US9363206B2 (en) | Method and apparatus for selecting passive port of transparent clock node based on PTP | |
EP2852087A1 (en) | Packet network synchronization method, apparatus and system | |
WO2013152700A1 (en) | Clock source selection method and device for microwave network element | |
CN108282243B (en) | A kind of clock source reliability guarantee method suitable for master-slave mode method for synchronizing time | |
Giorgetti et al. | Performance analysis of media redundancy protocol (MRP) | |
JP6275323B2 (en) | Relay device and communication system | |
EP2685678A1 (en) | Method, system, and switch for adding bridge in mstp to domain | |
US8255732B2 (en) | Self-stabilizing byzantine-fault-tolerant clock synchronization system and method | |
FI95978B (en) | Hierarchical synchronization procedure | |
JP5120097B2 (en) | Time synchronization system and time synchronization apparatus | |
CN113055116B (en) | High-reliability time-sensitive network time synchronization method and system | |
CN102355346A (en) | Validity judgment method of clock synchronous source device and device | |
WO2014101668A1 (en) | Time synchronization processing method and apparatus | |
EP3573298B1 (en) | Multi-node device and method for micro server built-in switch uplink port backup | |
KR101192896B1 (en) | Distributed synchronization method and apparatus for fault tolerance | |
CN110336728B (en) | Message processing method, node equipment, electronic equipment and readable storage medium | |
WO2014086254A1 (en) | Clock protection method and system and related ordinary clock device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20200819 Address after: 210012 Nanjing, Yuhuatai District, South Street, Bauhinia Road, No. 68 Patentee after: Nanjing Zhongxing New Software Co.,Ltd. Address before: 518057 Nanshan District science and technology, Guangdong Province, South Road, No. 55, No. Patentee before: ZTE Corp. |
|
TR01 | Transfer of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20150401 Termination date: 20210421 |
|
CF01 | Termination of patent right due to non-payment of annual fee |