CN106341245B - State information synchronization method and device of static tunnel - Google Patents

State information synchronization method and device of static tunnel Download PDF

Info

Publication number
CN106341245B
CN106341245B CN201510392197.2A CN201510392197A CN106341245B CN 106341245 B CN106341245 B CN 106341245B CN 201510392197 A CN201510392197 A CN 201510392197A CN 106341245 B CN106341245 B CN 106341245B
Authority
CN
China
Prior art keywords
state information
terminal
status information
forwarding detection
bidirectional forwarding
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.)
Active
Application number
CN201510392197.2A
Other languages
Chinese (zh)
Other versions
CN106341245A (en
Inventor
周晓慧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201510392197.2A priority Critical patent/CN106341245B/en
Priority to PCT/CN2016/088572 priority patent/WO2017005165A1/en
Publication of CN106341245A publication Critical patent/CN106341245A/en
Application granted granted Critical
Publication of CN106341245B publication Critical patent/CN106341245B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks

Abstract

The invention discloses a state information synchronization method of a static tunnel.A first terminal extracts second state information corresponding to a second terminal based on a received bidirectional forwarding detection message when receiving the bidirectional forwarding detection message sent by the second terminal based on the static tunnel; when first state information corresponding to a first terminal is inconsistent with second state information, the first terminal determines the priority of the first state information and the second state information; and if the priority of the second state information is higher than that of the first state information, the first terminal synchronizes the first state information into the second state information. The invention also discloses a state information synchronization device of the static tunnel. The invention realizes the automatic synchronization of the information at the two ends of the static tunnel.

Description

State information synchronization method and device of static tunnel
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for synchronizing status information of a static tunnel.
Background
With the development of communication technology, various Network technologies, such as SDN (Software defined Network) and VPN (Virtual Private Network), have been rapidly developed. In the working process of the static tunnel, two terminals generally send messages to each other to detect whether the information of the two terminals is synchronous, for example, the two terminals send BFD (Bidirectional Forwarding Detection) messages to each other, and in the process of sending the BFD messages, if it is detected that the information of the two terminals of the static tunnel is not consistent, an alarm message is sent to inform a user so that the user can perform corresponding operations to realize the synchronization of the information of the two terminals, obviously, the automatic synchronization of the information of the two ends of the static tunnel cannot be realized.
Disclosure of Invention
The invention mainly aims to provide a method and a device for synchronizing information of a static tunnel, aiming at solving the technical problem that automatic synchronization of information at two ends of the static tunnel cannot be realized when the information of the two ends of the static tunnel is inconsistent.
In order to achieve the above object, the present invention provides a method for synchronizing status information of a static tunnel, where the method for synchronizing status information of a static tunnel includes the following steps:
when receiving a bidirectional forwarding detection message sent by a second terminal based on the static tunnel, a first terminal extracts second state information corresponding to the second terminal based on the received bidirectional forwarding detection message;
when first state information corresponding to a first terminal is inconsistent with second state information, the first terminal determines the priority of the first state information and the second state information;
and if the priority of the second state information is higher than that of the first state information, the first terminal synchronizes the first state information into the second state information.
Preferably, after the step of determining, by the first terminal, the priority of the first status information and the priority of the second status information when the first status information corresponding to the first terminal is inconsistent with the second status information, the information synchronization method for the static tunnel includes:
and if the priority of the second state information is lower than or equal to the priority of the first state information, the first terminal keeps the first state information unchanged.
Preferably, the method for synchronizing status information of a static tunnel further includes:
the first terminal acquires current first state information and a preset bidirectional forwarding detection message;
the first terminal writes the acquired first state information into a preset position in the bidirectional forwarding detection message to generate a bidirectional forwarding detection message to be sent;
and the first terminal sends the bidirectional forwarding detection message to be sent to a third terminal.
Preferably, the step of the first terminal acquiring the current first state information and the preset bidirectional forwarding detection packet includes:
the first terminal detects current first state information in real time and judges whether the first state information changes or not;
and if the first state information changes, the first terminal acquires the first state information and a preset bidirectional forwarding detection message.
Preferably, after the step of detecting, by the first terminal, the current first state information in real time and determining whether the first state information changes, the method for synchronizing state information of a static tunnel further includes:
and if the first state information is not sent and changed, the first terminal acquires the first state information and a preset bidirectional forwarding detection message at regular time.
In addition, to achieve the above object, the present invention further provides a status information synchronization apparatus for a static tunnel, including:
the extracting module is used for extracting second state information corresponding to a second terminal based on the received bidirectional forwarding detection message when the bidirectional forwarding detection message sent by the second terminal based on the static tunnel is received;
the determining module is used for determining the priority of the first state information and the second state information when the first state information corresponding to the first terminal is inconsistent with the second state information;
and the synchronization module is used for synchronizing the first state information into the second state information if the priority of the second state information is higher than that of the first state information.
Preferably, the information synchronization apparatus for a static tunnel further includes:
and the maintaining module is used for maintaining the first state information unchanged if the priority of the second state information is lower than or equal to the priority of the first state information.
Preferably, the status information synchronization apparatus of the static tunnel further includes:
the acquisition module is used for acquiring current first state information and a preset bidirectional forwarding detection message;
the generating module is used for writing the acquired first state information into a preset position in the bidirectional forwarding detection message so as to generate a bidirectional forwarding detection message to be sent;
and the sending module is used for sending the bidirectional forwarding detection message to be sent to a third terminal.
Preferably, the obtaining module includes:
the processing unit is used for detecting the current first state information in real time and judging whether the first state information changes or not;
and the obtaining unit is used for obtaining the first state information and a preset bidirectional forwarding detection message if the first state information changes.
Preferably, the obtaining unit is further configured to obtain the first state information and a preset bidirectional forwarding detection packet at regular time if the first state information is not changed.
The invention provides a method and a device for synchronizing state information of a static tunnel.A first terminal of the static tunnel directly extracts second state information corresponding to a second terminal according to a received bidirectional forwarding detection message, and synchronizes the first state information into the second state information when the first state information is different from the second state information and the priority of the first state information is lower than that of the second state information, so as to realize the synchronization of the two terminal information, but not send alarm information to inform a user when the first state information is inconsistent with the second state information in the static tunnel, so that the user can execute corresponding operation to realize the synchronization of the two terminal information.
Drawings
Fig. 1 is a flowchart illustrating a method for synchronizing status information of a static tunnel according to a first embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for synchronizing status information of static tunnels according to a second embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for synchronizing status information of static tunnels according to a third embodiment of the present invention;
fig. 4 is a schematic flow chart of a first embodiment of the present invention, in which a first terminal acquires current first state information and a preset bidirectional forwarding detection packet;
fig. 5 is a schematic flow chart of a second embodiment of the present invention, in which the first terminal acquires current first state information and a preset bidirectional forwarding detection packet;
FIG. 6 is a functional block diagram of a status information synchronization apparatus for static tunnels according to a first embodiment of the present invention;
FIG. 7 is a functional block diagram of a status information synchronization apparatus for static tunnels according to a second embodiment of the present invention;
FIG. 8 is a functional block diagram of a status information synchronization apparatus for static tunnels according to a third embodiment of the present invention;
FIG. 9 is a block diagram illustrating a detailed function of the acquisition module shown in FIG. 8.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a state information synchronization method of a static tunnel.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for synchronizing status information of a static tunnel according to a first embodiment of the present invention.
The present embodiment provides a method for synchronizing status information of a static tunnel, where the method for synchronizing status information of a static tunnel includes:
step S10, when receiving a bidirectional forwarding detection message sent by a second terminal based on the static tunnel, a first terminal extracts second state information corresponding to the second terminal based on the received bidirectional forwarding detection message;
in this embodiment, the static tunnel includes two terminals, which are a first terminal and a second terminal respectively, and may also be referred to as a source terminal and a destination terminal as needed, where the state information includes state information of the two terminals of the static tunnel (e.g., SF (signal fail on Working, Working path signal failure state, WTR (Wait to Restore, etc.). in this embodiment, it is preferable that both terminals may receive or send bidirectional forwarding detection messages, before step S10, the step of presetting bidirectional forwarding detection messages is included in the second terminal of the static tunnel, and preferably, the step of presetting bidirectional forwarding detection messages is performed by the second terminal of the static tunnel detecting current second state information of the second terminal in real time, and when detecting that the second state information is sent to change, adding the second state information to the bidirectional forwarding detection messages preset in the static tunnel, generating a bidirectional forwarding detection message to be sent; or, the second terminal of the static tunnel periodically acquires the second state information in a state information synchronization mode, and adds the acquired second state information to a bidirectional forwarding detection message preset in the static tunnel to generate a bidirectional forwarding detection message to be sent, wherein the state information synchronization mode is preferably in a working process of the static tunnel.
In this embodiment, when the first terminal receives the bidirectional forwarding detection packet sent by the second terminal, based on the bidirectional forwarding detection packet, the first terminal preferably extracts second state information corresponding to a preset second terminal at a preset position of the bidirectional forwarding detection packet, where the preset position is determined according to a position to which the second state information is added by the second terminal, and if the second terminal adds the second state information to a position of a second byte in the bidirectional forwarding detection packet, the first terminal may directly locate the position of the second byte in the bidirectional forwarding detection packet and extract the second state information when extracting the second state information. Those skilled in the art will appreciate that the second status information may be added to other locations of the bidirectional forwarding detection packet according to particular needs. The static tunnel state information synchronization method in the embodiment of the present invention is preferably applied to a novel network, such as an SDN (Software defined network).
Step S20, when the first status information corresponding to the first terminal is inconsistent with the second status information, the first terminal determines the priority of the first status information and the second status information;
in this embodiment, the first terminal first determines whether first state information corresponding to the first terminal is consistent with the second state information according to the extracted second state information, where the determination is that the first terminal compares the first state information with the second state information, and if the state information of the two terminals is matched, the first terminal keeps the first state information unchanged; if the first status information is inconsistent with the second status information, the first terminal further determines the priority of the first status information and the second status information, the determination priority is preferably determined according to a status information priority list preset in a static tunnel, and the status information priority list is preset with the priority corresponding to each status information, such as LP (Lockout of Protection, status of fixed selector on working channel) priority being highest and NR (No Request, No response state) priority being lowest.
Step S30, if the priority of the second status information is higher than the priority of the first status information, the first terminal synchronizes the first status information to the second status information.
In this embodiment, when the first terminal determines that the priority of the second state information is higher than the priority of the first state information, the first state information is synchronized to the second state information, and the synchronization mode is that the first terminal replaces the first state information with the second state information, so that the state information of the first terminal is consistent with the state information of the second terminal, and synchronization of state information of two terminals in a static tunnel is achieved.
In the method for synchronizing status information of a static tunnel provided in this embodiment, a first terminal of the static tunnel directly extracts second status information corresponding to a second terminal according to a received bidirectional forwarding detection packet, and synchronizes first status information into the second status information when the first status information is different from the second status information and the priority of the first status information is lower than that of the second status information, so as to implement synchronization of information of the two terminals, instead of sending an alarm message to notify a user when the first status information is inconsistent with the second status information in the static tunnel, so that the user performs a corresponding operation to implement synchronization of information of the two terminals.
Further, in order to increase the intelligence of the status information synchronization of the static tunnel, a second embodiment of the status information synchronization method of the static tunnel according to the present invention is proposed based on the first embodiment, and in this embodiment, referring to fig. 2, after the step S20, the status information synchronization method of the static tunnel includes:
step S40, if the priority of the second status information is lower than or equal to the priority of the first status information, the first terminal keeps the first status information unchanged.
In this embodiment, if the first terminal determines that the priority of the second status information is lower than or equal to the priority of the first status information, the first terminal keeps the first status information unchanged. It can be understood that, in this embodiment, the operation processes of the two terminals of the static tunnel are consistent, that is, both terminals send bidirectional forwarding detection packets, and the two processes of sending bidirectional forwarding detection packets do not affect each other, when the second terminal sends a bidirectional forwarding detection packet to the first terminal, the first terminal also sends a corresponding bidirectional forwarding detection packet according to the current state information, and then when the first terminal determines that the priority of the second state information is lower than or equal to the priority of the first state information, the first terminal keeps the first state information unchanged, at this time, the second terminal may synchronize the current state information to the first state information, so as to keep the consistency of the state information of the two terminals of the static tunnel.
Further, in order to increase the intelligence of the status information synchronization of the static tunnel, a third embodiment of the status information synchronization method of the static tunnel according to the present invention is proposed based on the first embodiment, and in this embodiment, referring to fig. 3, the status information synchronization method of the static tunnel further includes:
step S50, the first terminal obtains the current first state information and the preset bidirectional forwarding detection message;
in this embodiment, the manner in which the first terminal obtains the current first state information and the preset bidirectional forwarding detection packet includes detecting the current first state information in real time, and obtaining the current first state information and the preset bidirectional forwarding detection packet if it is detected that the current first state information is inconsistent with the first state information at the previous time; or when detecting that the current first state information is not sent and changed, acquiring the current state information of the first state information at regular time. In this embodiment, the detecting that the current first state information is inconsistent with the state information at the previous time includes: a. the first state information of the static tunnel changes. b. The user changes the current first state information of the first terminal in the static tunnel into other state information through a preset conversion command (for example, the state information of the current Lp (Lockout of Protection, fixed selector on working channel) is changed into the state information of Fs (Forced Switch, Forced Switch of selector from working channel to Protection channel)).
Step S60, the first terminal writes the acquired first state information into a preset position in the bidirectional forwarding detection message to generate a bidirectional forwarding detection message to be sent;
in this embodiment, the manner in which the first terminal writes the current first state information into the bidirectional forwarding detection packet to generate the bidirectional forwarding detection packet to be sent is preferably: and the first terminal writes the current first state information into a preset position in the bidirectional forwarding detection message, and generates a bidirectional forwarding detection message to be sent according to the bidirectional forwarding detection message written with the first state information if the current first state information is written into a position of a second byte of the bidirectional forwarding detection message. Further, after writing the first state information, the first state information may be modified according to specific situations, for example, when the first state information written by the first terminal for the first time is Lp state information, when the first state information is continuously written next time, the command clearing is executed through a Clear command, the Lp state information already written in the bidirectional forwarding detection packet is cleared, and then new other state information is written.
Step S70, the first terminal sends the bidirectional forwarding detection packet to be sent to a third terminal.
In this embodiment, when the first terminal sends the bidirectional forwarding detection packet to be sent to the second terminal, the first terminal may send the packet at a preset speed, or send the packet according to a priority corresponding to preset status information in each bidirectional forwarding detection packet to be synchronized, for example, the bidirectional forwarding detection packet with the high priority of the status information is sent first, or the bidirectional forwarding detection packet with the high priority of the status information is sent at a high speed, which may be understood that the first terminal also performs presetting according to other specific needs.
Further, in order to increase the intelligence of the status information synchronization of the static tunnel, a fourth embodiment of the status information synchronization method of the static tunnel according to the present invention is proposed based on the third embodiment, in this embodiment, referring to fig. 4, the step S50 includes;
step S51, the first terminal detects the current first state information in real time and judges whether the first state information changes;
step S52, if the first status information changes, the first terminal obtains the first status information and a preset bidirectional forwarding detection packet.
In this embodiment, it is preferable that the first terminal detects the current first status information of the first terminal in real time, and determines whether the detected current first status information is the same as the first status information at the previous time, if it is detected that the current first status information is not the same as the first status information at the previous time, then the current first state information and the preset bidirectional forwarding detection message are obtained, when the first state information of the static tunnel changes, the changed first state information and the preset bidirectional forwarding detection message can be immediately acquired, and the acquired first state information is written into the bidirectional forwarding detection message and is sent to the second terminal, so as to realize the rapid synchronization of the static tunnel state information, effectively maintain the connectivity of the static tunnel, and the condition that the static tunnels are not communicated when the state information of the two terminals of the static tunnels is inconsistent can not occur.
Further, in order to increase the intelligence of the status information synchronization of the static tunnel, a fifth embodiment of the status information synchronization method of the static tunnel according to the present invention is proposed based on the third embodiment, and in this embodiment, referring to fig. 5, after the step S51, the step S50 includes:
step S53, if the first status information is not changed, the first terminal acquires the first status information and a preset bidirectional forwarding detection packet at regular time.
It can be understood that, in the working process of the static tunnel, the messages of the two terminals of the static tunnel are continuously sent, in this embodiment, preferably, in the working process of the static tunnel, if the first terminal does not detect that the current first state information of the first terminal changes, the current first state information and the preset bidirectional forwarding detection message may be obtained at regular time, for example, the current first state information and the preset bidirectional forwarding detection message are obtained according to each 1S time, which may effectively reduce the waste of resources, and may ensure the connectivity of the static tunnel in real time.
The invention further provides a state information synchronization device of the static tunnel.
Referring to fig. 6, fig. 6 is a functional module diagram of a status information synchronization apparatus of a static tunnel according to a preferred embodiment of the present invention.
It should be emphasized that the functional block diagram of fig. 6 is merely an exemplary diagram of a preferred embodiment, and those skilled in the art can easily add new functional blocks around the functional blocks of the status information synchronization apparatus of the static tunnel shown in fig. 6; the names of the function modules are self-defined names, which are only used for assisting in understanding the program function blocks of the state information synchronization device of the static tunnel, and are not used for limiting the technical scheme of the invention.
This embodiment provides a status information synchronization apparatus for a static tunnel, where the status information synchronization apparatus for the static tunnel includes:
an extracting module 10, configured to, when receiving a bidirectional forwarding detection packet sent by a second terminal based on the static tunnel, extract second state information corresponding to the second terminal based on the received bidirectional forwarding detection packet;
in this embodiment, the static tunnel includes two terminals, which are a first terminal and a second terminal respectively, and may also be referred to as a source terminal and a destination terminal as needed, where the state information includes state information of the two terminals of the static tunnel (e.g., SF (signal fail on Working, Working path signal failure state, WTR (Wait to Restore, etc.). in this embodiment, it is preferable that both terminals may receive or send bidirectional forwarding detection messages, before step S10, the step of presetting bidirectional forwarding detection messages is included in the second terminal of the static tunnel, and preferably, the step of presetting bidirectional forwarding detection messages is performed by the second terminal of the static tunnel detecting current second state information of the second terminal in real time, and when detecting that the second state information is sent to change, adding the second state information to the bidirectional forwarding detection messages preset in the static tunnel, generating a bidirectional forwarding detection message to be sent; or, the second terminal of the static tunnel periodically acquires the second state information in a state information synchronization mode, and adds the acquired second state information to a bidirectional forwarding detection message preset in the static tunnel to generate a bidirectional forwarding detection message to be sent, wherein the state information synchronization mode is preferably in a working process of the static tunnel.
In this embodiment, preferably, when receiving the bidirectional forwarding detection packet sent by the second terminal, the extraction module 10, based on the bidirectional forwarding detection packet, preferably extracts, by the first terminal, second state information corresponding to a preset second terminal at a preset position of the bidirectional forwarding detection packet, where the preset position is determined according to a position to which the second state information is added by the second terminal, and if the second terminal adds the second state information to a position of a second byte in the bidirectional forwarding detection packet, the extraction module 10, when extracting the second state information, may directly locate the position of the second byte in the bidirectional forwarding detection packet and extract the second state information. Those skilled in the art will appreciate that the second status information may be added to other locations of the bidirectional forwarding detection packet according to particular needs. The static tunnel state information synchronization method in the embodiment of the present invention is preferably applied to a novel Network, such as an SDN (Software Defined Network).
A determining module 20, configured to determine priorities of first state information and second state information corresponding to a first terminal when the first state information and the second state information are inconsistent;
in this embodiment, the determining module 20 first determines whether the first state information corresponding to the first terminal is consistent with the second state information according to the extracted second state information, where the determining means is that the first terminal compares the first state information with the second state information, and if the two terminal state information are matched, the first terminal keeps the first state information unchanged; if the first status information is inconsistent with the second status information, the determining module 20 further determines the priority of the first status information and the second status information, and the determining module 20 determines that the priority is preferably determined according to a status information priority list preset in a static tunnel, and the status information priority list is preset with the priority corresponding to each status information, such as that LP (Lockout of Protection, status of fixed selector on working channel) priority is highest, and NR (No Request, No response state) priority is lowest.
A synchronization module 30, configured to synchronize the first state information into the second state information if the priority of the second state information is higher than the priority of the first state information.
In this embodiment, when the determining module 20 determines that the priority of the second status information is higher than the priority of the first status information, the synchronizing module 30 synchronizes the first status information to the second status information, so that the status information of the first terminal is consistent with the status information of the second terminal, and the status information of the two terminals in the static tunnel is synchronized.
In the state information synchronization apparatus for a static tunnel provided in this embodiment, a first terminal of the static tunnel directly extracts second state information corresponding to a second terminal according to a received bidirectional forwarding detection packet, and synchronizes a first state information into the second state information when the first state information is different from the second state information and the priority of the first state information is lower than that of the second state information, so as to implement synchronization of information of the two terminals, instead of sending an alarm information to notify a user when the first state information is inconsistent with the second state information in the static tunnel, so that the user performs a corresponding operation to implement synchronization of information of the two terminals.
Further, in order to increase the intelligence of the status information synchronization of the static tunnel, a second embodiment of the status information synchronization apparatus of the static tunnel according to the present invention is proposed based on the first embodiment, and in this embodiment, referring to fig. 7, the status information synchronization apparatus of the static tunnel further includes:
a keeping module 40, configured to keep the first status information unchanged if the priority of the second status information is lower than or equal to the priority of the first status information.
In this embodiment, if the determining module 20 determines that the priority of the second status information is lower than or equal to the priority of the first status information, the maintaining module 40 maintains the first status information unchanged. It can be understood that, in this embodiment, the operation processes of the two terminals in the static tunnel are consistent, that is, both terminals send bidirectional forwarding detection packets, and the two processes of sending bidirectional forwarding detection packets do not affect each other, when the second terminal sends a bidirectional forwarding detection packet to the first terminal, the first terminal also sends a corresponding bidirectional forwarding detection packet according to the current state information, then when the determining module 20 determines that the priority of the second state information is lower than or equal to the priority of the first state information, the maintaining module 40 maintains the first state information unchanged, at this time, the second terminal may synchronize the current state information to the first state information, so as to maintain the consistency of the state information of the two terminals in the static tunnel.
Further, in order to increase the intelligence of the status information synchronization of the static tunnel, a third embodiment of the status information synchronization apparatus of the static tunnel according to the present invention is proposed based on the first embodiment, and in this embodiment, referring to fig. 8, the status information synchronization apparatus of the static tunnel further includes:
an obtaining module 50, configured to obtain current first state information and a preset bidirectional forwarding detection packet;
in this embodiment, the manner of acquiring the current first state information and the preset bidirectional forwarding detection packet by the acquiring module 50 includes detecting the current first state information in real time, and if it is detected that the current first state information is inconsistent with the first state information at the previous time, the acquiring module 50 acquires the current first state information and the preset bidirectional forwarding detection packet; or when detecting that the current first status information has not sent any change, the obtaining module 50 obtains the current status information thereof at regular time. In this embodiment, the detecting that the current first state information is inconsistent with the state information at the previous time includes: a. the first state information of the static tunnel changes. b. The user changes the current first state information of the first terminal in the static tunnel into other state information through a preset conversion command (for example, the state information of the current Lp (Lockout of Protection, fixed selector on working channel) is changed into the state information of Fs (ForcedSwitch, forced to switch the selector from the working channel to the Protection channel)).
A generating module 60, configured to write the acquired first state information into a preset position in the bidirectional forwarding detection message, so as to generate a bidirectional forwarding detection message to be sent;
in this embodiment, the preferred mode of writing the current first state information into the bidirectional forwarding detection packet by the generating module 60 to generate the bidirectional forwarding detection packet to be sent is as follows: the generating module 60 writes the current first state information into a preset position in the bidirectional forwarding detection message, and if the current first state information is written into a position of a second byte of the bidirectional forwarding detection message, generates a bidirectional forwarding detection message to be sent according to the bidirectional forwarding detection message written with the first state information. Further, after writing the first state information, the modification may be performed according to specific situations, for example, when the first state information written for the first time is Lp state information, and when the first state information is continuously written for the next time, a Clear command is first executed to Clear the Lp state information written in the bidirectional forwarding detection packet, and then the generating module 60 writes new other state information.
A sending module 70, configured to send the bidirectional forwarding detection packet to be sent to a third terminal.
In this embodiment, when the sending module 70 sends the bidirectional forwarding detection packet to be sent to the second terminal, the sending module may send the packet at a preset speed, or send the packet according to a priority corresponding to preset status information in each bidirectional forwarding detection packet to be synchronized, for example, the bidirectional forwarding detection packet with high priority of the status information is sent first, or the sending speed of the bidirectional forwarding detection packet with high priority of the status information is fast, which can be understood that the sending module also performs presetting according to other specific needs.
Further, in order to increase the intelligence of the status information synchronization of the static tunnel, a fourth embodiment of the status information synchronization apparatus of the static tunnel according to the present invention is proposed based on the third embodiment, and in this embodiment, referring to fig. 9, the obtaining module 50 includes:
the processing unit 51 is configured to detect current first state information in real time, and determine whether the first state information changes;
an obtaining unit 52, configured to obtain the first state information and a preset bidirectional forwarding detection packet if the first state information changes.
In this embodiment, it is preferable that the processing unit 51 detects the current first state information of the static tunnel in real time, and determines whether the detected current first state information is the same as the first state information at the previous time, if it is detected that the current first state information is not the same as the first state information at the previous time, the obtaining unit 52 obtains the current first state information and a preset bidirectional forwarding detection packet, so that when the first state information of the static tunnel changes, the changed first state information and the preset bidirectional forwarding detection packet can be immediately obtained, and the sending module 70 writes the obtained first state information into the bidirectional forwarding detection packet, and sends the bidirectional forwarding detection packet to the second terminal, so as to implement fast synchronization of the state information of the static tunnel, effectively maintain connectivity of the static tunnel, and when the state information of the two terminals of the static tunnel does not differ, a static tunnel disconnected situation.
Further, the obtaining unit 52 is further configured to obtain the first state information and a preset bidirectional forwarding detection packet at regular time if the first state information is not changed.
It can be understood that, in the working process of the static tunnel, the messages of the two terminals of the static tunnel are continuously sent, in this embodiment, preferably, in the working process of the static tunnel, if the processing unit 51 does not detect that the current first state information changes, the obtaining unit 52 may obtain the current first state information and the preset bidirectional forwarding detection message at regular time, for example, obtain the current first state information and the preset bidirectional forwarding detection message according to each 1S time, which may effectively reduce the waste of resources, and may ensure the connectivity of the static tunnel in real time.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling an end terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (8)

1. A method for synchronizing status information of a static tunnel is characterized in that the method for synchronizing status information of a static tunnel comprises the following steps:
when receiving a bidirectional forwarding detection message sent by a second terminal based on the static tunnel, a first terminal extracts second state information corresponding to the second terminal based on the received bidirectional forwarding detection message;
the first terminal acquires current first state information, and when the first state information corresponding to the first terminal is inconsistent with the second state information, the first terminal determines the priority of the first state information and the second state information;
and if the priority of the second state information is higher than that of the first state information, the first terminal synchronizes the first state information into the second state information.
2. The method for synchronizing status information of a static tunnel according to claim 1, wherein after the step of the first terminal determining the priority of the first status information and the second status information when the first status information corresponding to the first terminal is inconsistent with the second status information, the method for synchronizing status information of a static tunnel comprises:
and if the priority of the second state information is lower than or equal to the priority of the first state information, the first terminal keeps the first state information unchanged.
3. The method for synchronizing status information of a static tunnel according to claim 1 or 2, wherein the method for synchronizing status information of a static tunnel further comprises:
the first terminal detects current first state information in real time and judges whether the first state information changes or not;
when the first terminal judges that the first state changes, the first terminal acquires current first state information and a preset bidirectional forwarding detection message;
the first terminal writes the acquired first state information into a preset position in the bidirectional forwarding detection message to generate a bidirectional forwarding detection message to be sent;
and the first terminal sends the bidirectional forwarding detection message to be sent to a second terminal.
4. The method for synchronizing status information of static tunnel according to claim 3, wherein after the step of the first terminal detecting the current first status information in real time and determining whether the first status information changes, the method for synchronizing status information of static tunnel further comprises:
and if the first state information is not sent and changed, the first terminal acquires the first state information and a preset bidirectional forwarding detection message at regular time.
5. A status information synchronization apparatus for a static tunnel, the status information synchronization apparatus comprising:
the extracting module is used for extracting second state information corresponding to a second terminal based on the received bidirectional forwarding detection message when the bidirectional forwarding detection message sent by the second terminal based on the static tunnel is received;
the determining module is used for acquiring current first state information, and determining the priority of the first state information and the priority of the second state information when the first state information corresponding to the first terminal is inconsistent with the second state information;
and the synchronization module is used for synchronizing the first state information into the second state information if the priority of the second state information is higher than that of the first state information.
6. The apparatus for synchronizing status information of a static tunnel according to claim 5, wherein the apparatus for synchronizing information of a static tunnel further comprises:
and the maintaining module is used for maintaining the first state information unchanged if the priority of the second state information is lower than or equal to the priority of the first state information.
7. The apparatus for synchronizing status information of a static tunnel according to claim 5 or 6, wherein the apparatus for synchronizing status information of a static tunnel further comprises:
the acquisition module is used for detecting current first state information in real time, judging whether the first state information changes or not, and acquiring the current first state information and a preset bidirectional forwarding detection message when judging that the first state changes;
the generating module is used for writing the acquired first state information into a preset position in the bidirectional forwarding detection message so as to generate a bidirectional forwarding detection message to be sent;
and the sending module is used for sending the bidirectional forwarding detection message to be sent to a second terminal.
8. The apparatus for synchronizing status information of static tunnels according to claim 7, wherein the obtaining module is further configured to obtain the first status information and a predetermined bidirectional forwarding detection packet at regular time if the first status information is not changed.
CN201510392197.2A 2015-07-06 2015-07-06 State information synchronization method and device of static tunnel Active CN106341245B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201510392197.2A CN106341245B (en) 2015-07-06 2015-07-06 State information synchronization method and device of static tunnel
PCT/CN2016/088572 WO2017005165A1 (en) 2015-07-06 2016-07-05 Static tunnel status information synchronization method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510392197.2A CN106341245B (en) 2015-07-06 2015-07-06 State information synchronization method and device of static tunnel

Publications (2)

Publication Number Publication Date
CN106341245A CN106341245A (en) 2017-01-18
CN106341245B true CN106341245B (en) 2020-02-18

Family

ID=57684829

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510392197.2A Active CN106341245B (en) 2015-07-06 2015-07-06 State information synchronization method and device of static tunnel

Country Status (2)

Country Link
CN (1) CN106341245B (en)
WO (1) WO2017005165A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116032720A (en) * 2021-10-27 2023-04-28 中兴通讯股份有限公司 Information recovery method, device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1859423A (en) * 2006-02-27 2006-11-08 华为技术有限公司 Synchronous switching method for host and repeat device
CN102035695A (en) * 2010-12-20 2011-04-27 中兴通讯股份有限公司 Bidirectional forwarding detection method and device
CN102447615A (en) * 2010-10-15 2012-05-09 中兴通讯股份有限公司 Switching method and router
CN102780593A (en) * 2012-07-25 2012-11-14 中兴通讯股份有限公司 BFD (Bidirectional Forwarding Detection) protocol-based link detection method and apparatus and network processor
CN102801584A (en) * 2012-07-30 2012-11-28 杭州华三通信技术有限公司 BFD (Bidirectional Forwarding Detection) realizing method and equipment
US9071514B1 (en) * 2012-12-17 2015-06-30 Juniper Networks, Inc. Application-specific connectivity loss detection for multicast virtual private networks

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1859423A (en) * 2006-02-27 2006-11-08 华为技术有限公司 Synchronous switching method for host and repeat device
CN102447615A (en) * 2010-10-15 2012-05-09 中兴通讯股份有限公司 Switching method and router
CN102035695A (en) * 2010-12-20 2011-04-27 中兴通讯股份有限公司 Bidirectional forwarding detection method and device
CN102780593A (en) * 2012-07-25 2012-11-14 中兴通讯股份有限公司 BFD (Bidirectional Forwarding Detection) protocol-based link detection method and apparatus and network processor
CN102801584A (en) * 2012-07-30 2012-11-28 杭州华三通信技术有限公司 BFD (Bidirectional Forwarding Detection) realizing method and equipment
US9071514B1 (en) * 2012-12-17 2015-06-30 Juniper Networks, Inc. Application-specific connectivity loss detection for multicast virtual private networks

Also Published As

Publication number Publication date
CN106341245A (en) 2017-01-18
WO2017005165A1 (en) 2017-01-12

Similar Documents

Publication Publication Date Title
CN108040108B (en) Communication switching method, device, coordination server and readable storage medium
CN108234171B (en) Data processing method, system and device
CN112738791B (en) User information correlation backfill method, device, equipment and medium based on 5G core network
BR112014011656B1 (en) METHOD TO AUTOMATICALLY DELETE INSTANT MESSAGE INFORMATION, INSTANT COMMUNICATION SYSTEM TO AUTOMATICALLY DELETE INSTANT MESSAGE INFORMATION, AND INFORMATION RECEIVER TERMINAL
CN102006188A (en) Path back switching method and device in transport network
CN106878072B (en) Message transmission method and device
CN103441897A (en) Method and device for locating failure node in virtual network
US20160316515A1 (en) Service Processing Method and Device
CN105338560B (en) Gateway disaster recovery method, equipment and system
CN105024798A (en) Method and device for time synchronization
CN107888434B (en) Network equipment configuration synchronization method and device
CN104156277A (en) Mobile terminal and system restoring method and system restoring device thereof
CN105472049B (en) CGN backup protection method and device for carrier-grade network address conversion
CN108882278B (en) Data link monitoring method, device, apparatus and computer readable storage medium
CN105790965A (en) Method and device for link switching and line card
CN113835369A (en) Edge terminal scene management method, device and system
CN103916226A (en) Redundant backup method based on embedded equipment
CN106341245B (en) State information synchronization method and device of static tunnel
CN109617950B (en) Data updating method, device, equipment and readable storage medium
US20140293769A1 (en) Method, apparatus and system for processing device faults
KR101946173B1 (en) Communication device, communication system and communication method
CN103888283B (en) A kind of SCTP communication means and device
CN103414591A (en) Method and system for fast converging when port failure is recovered
CN105323792B (en) Mobility management entity and its disaster recovery method and disaster tolerance system
CN102710358A (en) Method, device and system for transmitting GM (Grandmaster Clock) state

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant