CN112422442A - Method for processing session interrupt message of bidirectional forwarding detection protocol and storage medium - Google Patents

Method for processing session interrupt message of bidirectional forwarding detection protocol and storage medium Download PDF

Info

Publication number
CN112422442A
CN112422442A CN202011131837.1A CN202011131837A CN112422442A CN 112422442 A CN112422442 A CN 112422442A CN 202011131837 A CN202011131837 A CN 202011131837A CN 112422442 A CN112422442 A CN 112422442A
Authority
CN
China
Prior art keywords
value
total
interruption
bfd session
bfd
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.)
Granted
Application number
CN202011131837.1A
Other languages
Chinese (zh)
Other versions
CN112422442B (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.)
Peng Cheng Laboratory
Original Assignee
Peng Cheng Laboratory
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 Peng Cheng Laboratory filed Critical Peng Cheng Laboratory
Priority to CN202011131837.1A priority Critical patent/CN112422442B/en
Publication of CN112422442A publication Critical patent/CN112422442A/en
Application granted granted Critical
Publication of CN112422442B publication Critical patent/CN112422442B/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
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/29Flow control; Congestion control using a combination of thresholds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/26Flow control; Congestion control using explicit feedback to the source, e.g. choke packets

Landscapes

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

Abstract

The invention discloses a method for processing session interrupt messages of a bidirectional forwarding detection protocol and a storage medium. The method comprises the following steps: acquiring session interruption information of a bidirectional forwarding detection protocol (BFD) to obtain the total interruption times of the BFD session; increasing the punishment value of the BFD session according to the total interruption times and the interruption threshold value of the BFD session to obtain a punishment total value; setting the system state as a monitoring state and executing the operation of decreasing the punishment total value progressively according to the punishment total value and the monitoring threshold value to obtain an attenuation value; and adjusting the system state and forwarding the flow through the original port according to the attenuation value and the release threshold value. Therefore, the situation that the network is unstable due to frequent flow switching of an upper layer protocol when the link between two ends establishing the BFD session is frequently interrupted is effectively avoided.

Description

Method for processing session interrupt message of bidirectional forwarding detection protocol and storage medium
Technical Field
The present invention relates to the field of communications, and in particular, to a method and a storage medium for processing a session interrupt message of a bidirectional forwarding detection protocol.
Background
The bidirectional forwarding detection protocol (BFD protocol) is a bidirectional forwarding detection mechanism, and can provide millisecond detection and realize end-to-end rapid detection. In the prior art, the BFD neighbor is generally linked with an upper layer protocol to cause switching after being failed, and the upper layer protocol senses that the neighbor is normally switched back. Therefore, frequent jitter and packet loss phenomena in a short time occur in the network between two ends of BFD detection, frequent switching of upper network protocols is easily caused, and as the upper network protocols also need a certain convergence time, the frequent switching can further enlarge the network jitter and packet loss influence, which causes instability of the network.
Thus, there is still a need for improvement and development of the prior art.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a method and a storage medium for processing a BFD session interrupt message, aiming at solving the problem in the prior art that when a link between two ends establishing a BFD session is frequently interrupted, the upper layer protocol is frequently switched to cause unstable network.
The technical scheme adopted by the invention for solving the problems is as follows:
in a first aspect, an embodiment of the present invention provides a method for processing a session interrupt message of a bidirectional forwarding detection protocol, where the method includes:
acquiring session interruption information of a bidirectional forwarding detection protocol (BFD) to obtain the total interruption times of the BFD session;
increasing the punishment value of the BFD session according to the total interruption times and the interruption threshold value of the BFD session to obtain a punishment total value;
setting the system state as a monitoring state and executing the operation of decreasing the punishment total value progressively according to the punishment total value and the monitoring threshold value to obtain an attenuation value;
and adjusting the system state and forwarding the flow through the original port according to the attenuation value and the release threshold value.
In one embodiment, the obtaining the session interruption message of the bidirectional forwarding detection protocol (BFD) and obtaining the total number of BFD session interruptions includes:
sending a BFD detection message, and acquiring a session interruption message of BFD based on a feedback result of the BFD detection message;
and accumulating the BFD session interruption times according to the BFD session interruption message to obtain the total BFD session interruption times.
In an embodiment, the increasing a penalty value of the BFD session according to the total number of BFD session interrupts and the interrupt threshold value, and obtaining the penalty total value includes:
calculating the interval duration of the time for acquiring the BFD session interrupt message this time and the time for acquiring the BFD session interrupt message last time according to the total interruption times of the BFD session and the interrupt threshold;
and increasing the penalty value of the BFD session according to the interval duration and the preset duration to obtain a total penalty value.
In an embodiment, the calculating, according to the total number of times of BFD session interruption and the interruption threshold, an interval duration between a time of acquiring a BFD session interruption message this time and a time of acquiring a BFD session interruption message last time includes:
comparing the total BFD session interruption times with an interruption threshold;
and when the total interruption times of the BFD session are larger than the interruption threshold, calculating the interval duration between the time of acquiring the BFD session interruption message at this time and the time of acquiring the BFD session interruption message at the previous time.
In an embodiment, the increasing a penalty value of the BFD session according to the interval duration and the preset duration to obtain a total penalty value includes:
comparing the interval duration with a preset duration;
and when the interval duration is less than or equal to the preset duration, increasing the penalty value of the BFD session according to a preset value to obtain a total penalty value.
In an embodiment, the setting the system state to the monitoring state and performing an operation of decrementing the total penalty value according to the total penalty value and the monitoring threshold value, and obtaining the attenuation value includes:
comparing the total penalty value to a monitoring threshold;
and when the punishment total value is larger than or equal to the monitoring threshold, setting the system state as a monitoring state, and decreasing the punishment total value according to a preset frequency to obtain an attenuation value.
In one embodiment, the adjusting the system status and forwarding the traffic through the original port according to the attenuation value and the release threshold comprises:
comparing the attenuation value to a release threshold;
when the attenuation value is larger than or equal to the release threshold value, maintaining the system state as a monitoring state and forwarding the flow through the original port;
and when the attenuation value is smaller than the release threshold value, clearing the total interruption times and the total punishment value, restoring the system state from the monitoring state to a normal state, and forwarding the flow through the original port.
In one embodiment, the comparing the total number of BFD session interruptions to an interruption threshold further comprises:
and when the total interruption times of the BFD session is less than or equal to the interruption threshold, generating fault information and sending the fault information to an upper-layer protocol, and controlling the upper-layer protocol to forward the flow through a standby port based on the fault information.
In one embodiment, the comparing the interval duration with the preset duration further comprises:
and when the interval duration is longer than the preset duration, clearing the total interruption times, generating fault information and sending the fault information to an upper layer protocol, and controlling the upper layer protocol to forward the flow through a standby port based on the fault information.
In a second aspect, an embodiment of the present invention provides a storage medium having a plurality of instructions stored thereon, where the instructions are adapted to be loaded and executed by a processor to implement any of the steps of the method for handling a session interrupt message of a bidirectional forwarding detection protocol described above.
The invention has the beneficial effects that: the invention obtains the total interruption times of the bidirectional forwarding detection protocol (BFD) session by obtaining the session interruption message of the BFD; increasing the punishment value of the BFD session according to the total interruption times and the interruption threshold value of the BFD session to obtain a punishment total value; setting the system state as a monitoring state and executing the operation of decreasing the punishment total value progressively according to the punishment total value and the monitoring threshold value to obtain an attenuation value; and adjusting the system state and forwarding the flow through the original port according to the attenuation value and the release threshold value. Therefore, the situation that the network is unstable due to frequent flow switching of an upper layer protocol when the link between two ends establishing the BFD session is frequently interrupted is effectively avoided.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart illustrating a method for processing a session interrupt message of a bidirectional forwarding detection protocol according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating obtaining a total number of times of BFD session interruption according to an embodiment of the present invention.
Fig. 3 is a schematic flowchart of obtaining a total penalty value according to an embodiment of the present invention.
Fig. 4 is a flowchart illustrating a time interval between the time of acquiring the BFD session interrupt message this time and the time of acquiring the BFD session interrupt message last time according to the embodiment of the present invention.
Fig. 5 is a schematic specific flowchart for obtaining a total penalty value according to an embodiment of the present invention.
Fig. 6 is a schematic flowchart of obtaining an attenuation value according to an embodiment of the present invention.
Fig. 7 is a schematic flowchart of a process for restoring the system from the monitoring state to the normal state according to an embodiment of the present invention.
Fig. 8 is a flowchart of steps of a method for processing a session interrupt message of a bidirectional forwarding detection protocol when a total number of BFD session interrupts is less than or equal to an interrupt threshold according to an embodiment of the present invention.
Fig. 9 is a flowchart of a method for processing a session interrupt message of a bidirectional forwarding detection protocol when an interval duration is longer than a preset duration according to an embodiment of the present invention.
Fig. 10 is a functional block diagram of a terminal according to an embodiment of the present invention.
Fig. 11 is a schematic internal structural diagram of an apparatus for processing a session interrupt message of a bidirectional forwarding detection protocol according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It should be noted that, if directional indications (such as up, down, left, right, front, and back … …) are involved in the embodiment of the present invention, the directional indications are only used to explain the relative positional relationship between the components, the movement situation, and the like in a specific posture (as shown in the drawing), and if the specific posture is changed, the directional indications are changed accordingly.
The BFD protocol (Bidirectional Forwarding Detection protocol) is a Bidirectional Forwarding Detection mechanism, and can provide millisecond Detection and realize end-to-end rapid Detection. The main principle of the BFD protocol is that the BFD protocol is linked with an upper layer routing protocol to realize the rapid convergence of the routing and ensure the continuity of the service. Specifically, in a detection scenario of an actual end-to-end BFD session, when detecting that a link between two ends of the BFD session is interrupted, the upper layer protocol is immediately notified, and the upper layer protocol immediately switches an original port for performing traffic forwarding to a standby port for performing traffic forwarding. And when the upper layer protocol senses that the original port normally receives the data packet, the flow back switching occurs. Therefore, if the link between the two ends establishing the BFD session has frequent jitter and packet loss in a short time, frequent switching of the upper layer protocol is easily caused, and since the upper layer protocol also needs a certain convergence time, the frequent switching may further enlarge the link jitter and packet loss effects, resulting in network instability.
To solve the above problems of the prior art, the present invention provides a method for processing a BFD session interrupt message. Briefly, the invention mainly designs an independent functional module between the BFD protocol and the upper layer protocol, wherein the functional module is used for receiving and recording a link detection result between two ends for establishing the BFD session, and when the link detection result is an interruption, the interruption result is analyzed according to a specific logic algorithm, and finally, whether the upper layer protocol is linked for flow switching is decided. Therefore, the problem of frequent traffic switching possibly caused by detection of the BFD session can be effectively solved.
As shown in fig. 1, the present embodiment provides a method for processing a BFD session interrupt message, where the method includes the following steps:
step S100, obtaining a session interruption message of a bidirectional forwarding detection protocol (BFD) to obtain the total BFD session interruption times.
The embodiment enables fast detection of the link state between the native device and the target device by establishing a BFD session. In this embodiment, a BFD module is preset, and when the BFD module detects a link failure between two ends, a BFD session interrupt message is generated and reported to the function module, and the function module obtains the total BFD session interrupt times according to the obtained times of the BFD session interrupt message.
As shown in fig. 2, in an implementation manner, the step S100 specifically includes the following steps:
step S110, sending a BFD detection message, and acquiring a session interruption message of BFD based on a feedback result of the BFD detection message;
and step S120, accumulating the BFD session interruption times according to the BFD session interruption message to obtain the total BFD session interruption times.
Specifically, after the BFD session is established, a BFD detection packet is periodically sent between the two ends to detect the link status between the two ends. If no response message sent back by the target device is detected within a preset time after the BFD module sends the BFD detection messages for a preset number of times, the link between the two ends establishing the BFD session is considered to be faulty (for example, if the local device continuously sends 3 BFD detection messages and no response message sent back by the target device is detected, the link between the two ends is considered to be faulty), the BFD module generates a BFD session interrupt message and reports the BFD session interrupt message to the function module, the function module is provided with an interrupt counter for accumulating the number of times of obtaining the BFD session interrupt message, and the value in the interrupt counter is the total number of times of BFD session interrupt.
After acquiring the total number of times of BFD session interruption, in order to determine a specific cause of a network failure, in an implementation, as shown in fig. 1, the method further includes:
and S200, increasing the penalty value of the BFD session according to the BFD session interruption total times and the interruption threshold value to obtain a penalty total value.
There are many reasons for the interruption of the BFD session link, however, not all the links are interrupted by switching the traffic forwarding port, for example, some links are frequently interrupted due to network instability, so that different link interruption situations cannot be treated differently by adopting a single mode of switching the traffic forwarding port. The present embodiment introduces an interruption threshold and a penalty value to distinguish different link interruption situations. The interruption threshold is used to distinguish whether the current link interruption belongs to a general link interruption, that is, a link interruption situation that is difficult to recover, such as a line interruption. And the penalty value of the BFD session is used for distinguishing whether the current link interruption condition belongs to the frequent link interruption condition, and the total penalty value is obtained by accumulating the penalty value of the BFD session.
As shown in fig. 3, in an implementation manner, the step S200 specifically includes the following steps:
step S210, calculating the interval duration between the time of acquiring the BFD session interrupt message at this time and the time of acquiring the BFD session interrupt message at the previous time according to the total BFD session interrupt times and the interrupt threshold;
and step S220, increasing the penalty value of the BFD session according to the interval duration and the preset duration to obtain a total penalty value.
In order to distinguish whether the current link interruption condition belongs to a general link interruption condition, the present embodiment sets an interruption threshold and a preset time length. The total interruption times of the BFD session may reflect the situation of link interruption between two ends establishing the BFD session, and the interruption threshold may be used to evaluate the total interruption times of the BFD session, so as to preliminarily determine whether the current link interruption situation belongs to a general link interruption situation. In addition, the interval duration between the time of obtaining the BFD session interrupt message this time and the time of obtaining the BFD session interrupt message last time needs to be calculated, and the duration of the interval duration is evaluated according to the preset duration, so as to accurately determine whether the current link interrupt condition belongs to a general link interrupt condition.
As shown in fig. 4, in an implementation manner, the step S210 specifically includes the following steps:
step S211, comparing the total interruption times of the BFD session with an interruption threshold;
and step S212, when the total interruption times of the BFD session is greater than the interruption threshold, calculating the interval duration between the time of acquiring the BFD session interruption message this time and the time of acquiring the BFD session interruption message last time.
Specifically, after the BFD session interruption total number is obtained, the BFD session interruption total number is compared with an interruption threshold, and the comparison method may adopt a most basic difference making method. When the total interruption times of the BFD session is greater than the interruption threshold, it indicates that the interruption times of the current link are more, but it is also necessary to obtain the time for obtaining the BFD session interruption message this time and the time for obtaining the BFD session interruption message last time, calculate the interval duration between the two time points, and further judge the reason of the current link interruption according to the interval duration.
When the total interruption times of the BFD session is less than or equal to the interruption threshold, the current interruption times of the link are less, which may be caused by a general link interruption condition. In order to avoid affecting the normal forwarding of the traffic, as shown in fig. 8, in an implementation manner, the following step is further included after step S211:
and step S1, when the total interruption times of the BFD session is less than or equal to the interruption threshold, generating fault information and sending the fault information to an upper layer protocol, and controlling the upper layer protocol to forward the flow through a standby port based on the fault information.
Specifically, when the total number of times of BFD session interruption is less than or equal to the interruption threshold, the system enters a fault state, triggers a fault event and generates a fault message, and then sends the fault message to an upper layer protocol. After the upper layer protocol acquires the fault message, the switching of the main path and the standby path of the flow is immediately triggered, and the flow is forwarded through the standby path, so that the normal forwarding of the flow cannot be influenced when the networks at two ends establishing the BFD session have a common fault (such as line interruption).
Since it is difficult to distinguish whether a BFD session interrupt message is a general link interrupt or a frequent link interrupt when the BFD session interrupt message is acquired for the first time, in one implementation, the value of the interrupt threshold may be set to 1, that is, each time the BFD session interrupt message is acquired for the first time, the system is brought into a fault state, a fault event is triggered and a fault message is generated, and then the fault message is sent to the upper layer protocol. After the upper layer protocol obtains the fault message, the switching of the main path and the standby path of the flow is triggered immediately, so that the normal forwarding of the flow is ensured.
As shown in fig. 5, in an implementation manner, the step S220 specifically includes the following steps:
step S221, comparing the interval duration with a preset duration;
and step S222, when the interval duration is less than or equal to the preset duration, increasing the penalty value of the BFD session according to a preset numerical value to obtain a total penalty value.
Since frequent link interruption may cause the upper layer protocol to constantly switch the flow port in the standard BFD session, resulting in network instability, a penalty mechanism is adopted in this embodiment to reduce the influence of frequent link interruption on the upper layer protocol. Specifically, after the interval duration of the last two times of obtaining the BFD session interrupt message is calculated, the interval duration is compared with a preset duration, and when the interval duration is less than or equal to the preset duration, it indicates that the time points of the last two times of obtaining the BFD session interrupt message are very close, and possibly belongs to the case of frequent link interrupt, a penalty value of the BFD session is increased according to a preset value, and one penalty value represents an event of the BFD link interrupt message obtained under the condition of short interval duration. In this embodiment, a penalty counter is preset, and a penalty value of the BFD session is accumulated by the penalty counter. Therefore, the total penalty value can be obtained by obtaining the value in the penalty counter, and the total penalty value represents the total times of obtaining the BFD link interruption messages under the condition of short interval time.
As shown in fig. 9, in an implementation manner, the step S221 is further followed by the following steps:
and step S2, when the interval duration is longer than the preset duration, clearing the total interruption times, generating fault information and sending the fault information to an upper layer protocol, and controlling the upper layer protocol to forward the flow through a standby port based on the fault information.
Specifically, when the interval duration is longer than the preset duration, it indicates that the time point of obtaining the BFD session interrupt message this time is far from the time point of obtaining the BFD session interrupt message last time. In order to ensure normal forwarding of traffic, in an implementation manner, when the interval duration is greater than the preset duration, the interval duration is treated as a condition of general link interruption, an interruption counter is cleared, the system enters a fault state, a fault event is triggered and a fault message is generated, and then the fault message is sent to an upper layer protocol. After the upper layer protocol acquires the fault message, the switching of the main path and the standby path of the flow is immediately triggered, and the flow is forwarded through the standby path, so that the normal forwarding of the flow cannot be influenced when the networks at two ends establishing the BFD session have a common fault (such as line interruption).
In order to accurately determine whether the current link interruption condition belongs to the frequent link interruption condition, a monitoring threshold is further set in this embodiment, so that an accidental event that the time points of the BFD session interruption messages obtained last two times are separated by a relatively short time is distinguished from the frequent link interruption condition. Thus, as shown in fig. 1, the method further comprises:
and step S300, setting the system state as a monitoring state according to the punishment total value and the monitoring threshold value, and executing the operation of decreasing the punishment total value to obtain an attenuation value.
Specifically, the monitoring threshold represents the minimum interruption frequency reached by the condition of judging as frequent link interruption, so as to avoid the condition that an accidental event that the time points of the last two times of obtaining BFD session interruption messages are close to each other is mistakenly judged as frequent link interruption. In addition, the embodiment also sets a monitoring state, where the monitoring state is used to indicate that the current system has a frequent link interruption condition. And when the system is in a monitoring state, executing an operation of decrementing the punishment total value to obtain a decay value. The total penalty value is used for accumulating the times that the system detects that the interval duration of the adjacent two BFD interrupt messages is short, so the rising speed of the value can reflect the speed of the system detecting the link interrupt to a certain extent. The attenuation value is obtained by decreasing the penalty total value, so that the descending speed of the value can reflect the speed of the decrease of the penalty total value to a certain extent. Whether the current link interruption condition belongs to the condition of frequent link interruption or not can be more accurately determined through the attenuation value.
As shown in fig. 6, in an implementation manner, the step S300 specifically includes the following steps:
step S310, comparing the total penalty value with a monitoring threshold value;
and step S320, when the total punishment value is greater than or equal to the monitoring threshold, setting the system state as a monitoring state, and decreasing the total punishment value according to a preset frequency to obtain an attenuation value.
Specifically, after the total penalty value is obtained, the total penalty value is compared with a monitoring threshold, a typical difference making method can be adopted as the comparison method, when the total penalty value is greater than or equal to the monitoring threshold, the link interruption frequency is indicated to reach the minimum frequency of the frequent link interruption condition, therefore, the system state is set to be the monitoring state, and the total penalty value is decreased according to the preset frequency to obtain the attenuation value.
And when the total punishment value is smaller than the monitoring threshold value, the link interruption frequency does not reach the lowest frequency of the frequent link interruption condition, and the condition that the link is not subjected to the frequent link interruption is judged. And because the system acquires the BFD session interrupt message at two time points with short interval duration, the condition that the current link interrupt condition belongs to line interrupt is eliminated. In one implementation, when the total penalty value is less than the monitoring threshold, then the system state is reset to a normal state. The system carries out flow forwarding by the original port in a normal state, and periodically sends and receives BFD detection messages according to the standard of a standard BFD session.
After obtaining the attenuation value, as shown in fig. 1, the method further includes the following steps:
and S400, adjusting the system state and forwarding the flow through the original port according to the attenuation value and the release threshold value.
The release threshold represents a minimum attenuation value below which the system needs to return to a normal state. Specifically, the current system state is determined according to the attenuation value and the release threshold value, and the current system state information is reported to an upper layer protocol, and the system is controlled to still forward the flow through the original port.
As shown in fig. 7, in an implementation manner, the step S400 specifically includes the following steps:
step S410, comparing the attenuation value with a release threshold value;
step S420, when the attenuation value is larger than or equal to the release threshold value, maintaining the system state as a monitoring state and forwarding the flow through an original port;
and step S430, when the attenuation value is smaller than the release threshold value, clearing the total interruption times and the total penalty value, restoring the system state from the monitoring state to a normal state, and forwarding the flow through the original port.
Specifically, after the attenuation value is obtained, the attenuation value is compared with a release threshold, when the attenuation value is greater than or equal to the contact threshold, it indicates that the current attenuation value of the system is not less than the minimum attenuation value that the system needs to be lower to recover the normal state, which indicates that the speed of the current system for obtaining the BFD session interruption times (the case that the duration of the interval between two adjacent interruptions is short) is greater than the speed of the attenuation of the BFD session interruption times (the case that the duration of the interval between two adjacent interruptions is short), and it can basically confirm that the current link interruption condition is the frequent link interruption condition, so the system state is continuously maintained as the monitoring state, and the monitoring state information of the system is reported to the upper layer protocol, and after the upper layer protocol receives the monitoring state information of the system, it can be known that the current system has the frequent link interruption condition, and no flow switching measure, but rather continue to maintain traffic forwarding through the original port to avoid exacerbating network instability.
When the attenuation value is smaller than the release threshold, it indicates that the current attenuation value of the system is already lower than the minimum attenuation value that the system needs to be lower to recover the normal state, and this indicates that the speed at which the current system acquires the BFD session interruption times (in the case that the interval duration between two adjacent interruptions is short) is lower than the speed at which the BFD session interruption times (in the case that the interval duration between two adjacent interruptions is short) is attenuated, and therefore, the current frequent link interruption situation may have disappeared, and therefore, the values in the interruption counter and the penalty counter are both cleared, and the monitoring state of the system is recovered to the normal state, and the original port still performs flow forwarding.
Based on the above embodiments, the present invention provides an optimal embodiment of a method for processing a BFD session interrupt message, where the interrupt threshold is set to 1, the preset duration is set to 5, the monitoring threshold is set to 5, the release threshold is set to 1, and the complete process of the optimal embodiment is as follows:
step 1, triggering a 5-second timer to count down and judging whether a BFD session interrupt message is transmitted, and entering step 2 if the BFD session interrupt message is received before the timer counts down; if no BFD session interrupt message is received before the timer has counted down, step 3 is entered.
Step 2, adding 1 to the interrupt counter, judging whether the total interrupt frequency accumulated in the interrupt counter is less than or equal to an interrupt threshold value, setting the interrupt threshold value to be 1, and entering step 4 when the total interrupt frequency is less than or equal to 1; and when the total interruption times are more than 1, entering the step 5.
And 3, re-entering the step 1.
And 4, generating fault information and sending the fault information to an upper layer protocol, controlling the upper layer protocol to forward the flow through a standby port based on the fault information, and then re-entering the step 1.
Step 5, calculating the interval duration of the time for acquiring the BFD session interrupt message this time and the time for acquiring the BFD session interrupt message last time, judging whether the interval duration is less than or equal to the preset duration, setting the preset duration to be 5s, and entering step 6 when the interval duration is less than or equal to 5 s; and when the interval duration is greater than 5s, entering the step 7.
Step 6, increasing the punishment value of the BFD session by 1, obtaining a punishment total value, and judging whether the punishment total value is greater than or equal to a monitoring threshold value, wherein the monitoring threshold value is set to be 5; when the total penalty value is greater than or equal to 5, entering a step 8; and when the total penalty value is less than 5, entering the step 9.
And 7, clearing the total interruption times, generating fault information, sending the fault information to an upper layer protocol, controlling the upper layer protocol to forward the flow through a standby port based on the fault information, and then re-entering the step 1.
Step 8, setting the system state as a monitoring state, triggering a timer to execute the operation of subtracting 1 from the punishment total value every 5s to obtain an attenuation value, judging whether the attenuation value is greater than or equal to a release threshold value, setting the release threshold value as 1, and entering step 10 when the attenuation value is greater than or equal to 1; when the attenuation value is smaller than 1, the process proceeds to step S11.
And 9, resetting the system state to a normal state, and re-entering the step 1.
And step 10, maintaining the system state as a monitoring state, forwarding the flow through the original port, and entering the step 1 again.
And 11, restoring the system state from the monitoring state to a normal state, forwarding the flow through the original port, and re-entering the step 1.
Based on the foregoing embodiment, the present invention further provides a device for processing an interrupt message of a bidirectional forwarding detection protocol, as shown in fig. 11, where the device includes: a BFD module and a functional module; the BFD module and the functional module are both connected with a controller;
the BFD module is used for sending and receiving BFD detection messages and generating BFD session interrupt messages;
the function module comprises an interrupt counter, a penalty counter and a comparison unit;
the interrupt counter is used for accumulating the times of obtaining BFD session interrupt messages;
the penalty counter is used for accumulating penalty values of the BFD session;
the comparison unit is used for comparing the total interruption times with the interruption threshold value, the punishment total value with the monitoring threshold value and the punishment total value with the release threshold value, and sending the comparison result to the controller.
Based on the above embodiments, the present invention further provides an intelligent terminal, and a schematic block diagram thereof may be as shown in fig. 10. The intelligent terminal comprises a processor, a memory, a network interface and a display screen which are connected through a system bus. Wherein, the processor of the intelligent terminal is used for providing calculation and control capability. The memory of the intelligent terminal comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the intelligent terminal is used for being connected and communicated with an external terminal through a network. The computer program is executed by a processor to implement a method of handling session interrupt messages of a bidirectional forwarding detection protocol. The display screen of the intelligent terminal can be a liquid crystal display screen or an electronic ink display screen.
It will be understood by those skilled in the art that the block diagram of fig. 10 is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation to the intelligent terminal to which the solution of the present invention is applied, and a specific intelligent terminal may include more or less components than those shown in the figure, or combine some components, or have different arrangements of components.
In one implementation, one or more programs are stored in a memory of the smart terminal and configured to be executed by one or more processors to include instructions for performing a method of processing a session interrupt message of a two-way forwarding detection protocol.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, databases, or other media used in embodiments provided herein may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
To sum up, the present invention discloses a method and a storage medium for processing a session interrupt message of a bidirectional forwarding detection protocol, wherein the method comprises: acquiring session interruption information of a bidirectional forwarding detection protocol (BFD) to obtain the total interruption times of the BFD session; increasing the punishment value of the BFD session according to the total interruption times and the interruption threshold value of the BFD session to obtain a punishment total value; setting the system state as a monitoring state and executing the operation of decreasing the punishment total value progressively according to the punishment total value and the monitoring threshold value to obtain an attenuation value; and adjusting the system state and forwarding the flow through the original port according to the attenuation value and the release threshold value. Therefore, the situation that the network is unstable due to frequent flow switching of an upper layer protocol when the link between two ends establishing the BFD session is frequently interrupted is effectively avoided.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.

Claims (10)

1. A method of handling a session interrupt message of a bidirectional forwarding detection protocol, the method comprising:
acquiring session interruption information of a bidirectional forwarding detection protocol (BFD) to obtain the total interruption times of the BFD session;
increasing the punishment value of the BFD session according to the total interruption times and the interruption threshold value of the BFD session to obtain a punishment total value;
setting the system state as a monitoring state and executing the operation of decreasing the punishment total value progressively according to the punishment total value and the monitoring threshold value to obtain an attenuation value;
and adjusting the system state and forwarding the flow through the original port according to the attenuation value and the release threshold value.
2. The method of claim 1, wherein obtaining session interrupt messages for bidirectional forwarding detection protocol (BFD) to obtain a total number of BFD session interrupts comprises:
sending a BFD detection message, and acquiring a session interruption message of BFD based on a feedback result of the BFD detection message;
and accumulating the BFD session interruption times according to the BFD session interruption message to obtain the total BFD session interruption times.
3. The method according to claim 1, wherein the step of increasing the penalty value of the BFD session according to the total BFD session interruption times and the interruption threshold to obtain the total penalty value comprises:
calculating the interval duration of the time for acquiring the BFD session interrupt message this time and the time for acquiring the BFD session interrupt message last time according to the total interruption times of the BFD session and the interrupt threshold;
and increasing the penalty value of the BFD session according to the interval duration and the preset duration to obtain a total penalty value.
4. The method according to claim 3, wherein said calculating an interval duration between a time for acquiring the BFD session interrupt message this time and a time for acquiring the BFD session interrupt message last time according to the total number of BFD session interrupts and the interrupt threshold comprises:
comparing the total BFD session interruption times with an interruption threshold;
and when the total interruption times of the BFD session are larger than the interruption threshold, calculating the interval duration between the time of acquiring the BFD session interruption message at this time and the time of acquiring the BFD session interruption message at the previous time.
5. The method according to claim 3, wherein the increasing a penalty value of the BFD session according to the interval duration and the preset duration to obtain a total penalty value comprises:
comparing the interval duration with a preset duration;
and when the interval duration is less than or equal to the preset duration, increasing the penalty value of the BFD session according to a preset value to obtain a total penalty value.
6. The method according to claim 1, wherein the setting the system state to the monitoring state and performing the operation of decrementing the penalty total value according to the penalty total value and the monitoring threshold value, and obtaining the attenuation value comprises:
comparing the total penalty value to a monitoring threshold;
and when the punishment total value is larger than or equal to the monitoring threshold, setting the system state as a monitoring state, and decreasing the punishment total value according to a preset frequency to obtain an attenuation value.
7. The method of claim 1, wherein adjusting the system state and forwarding traffic through the original port according to the attenuation value and the release threshold comprises:
comparing the attenuation value to a release threshold;
when the attenuation value is larger than or equal to the release threshold value, maintaining the system state as a monitoring state and forwarding the flow through the original port;
and when the attenuation value is smaller than the release threshold value, clearing the total interruption times and the total punishment value, restoring the system state from the monitoring state to a normal state, and forwarding the flow through the original port.
8. The method for processing session interrupt messages of a bidirectional forwarding detection protocol according to claim 4, wherein comparing the total number of BFD session interrupts with an interrupt threshold further comprises:
and when the total interruption times of the BFD session is less than or equal to the interruption threshold, generating fault information and sending the fault information to an upper-layer protocol, and controlling the upper-layer protocol to forward the flow through a standby port based on the fault information.
9. The method of claim 5, wherein comparing the interval duration with a preset duration further comprises:
and when the interval duration is longer than the preset duration, clearing the total interruption times, generating fault information and sending the fault information to an upper layer protocol, and controlling the upper layer protocol to forward the flow through a standby port based on the fault information.
10. A storage medium having stored thereon a plurality of instructions adapted to be loaded and executed by a processor to perform the steps of the method of handling session interrupt messages of a bidirectional forwarding detection protocol according to any of the preceding claims 1 to 9.
CN202011131837.1A 2020-10-21 2020-10-21 Method for processing session interrupt message of bidirectional forwarding detection protocol and storage medium Active CN112422442B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011131837.1A CN112422442B (en) 2020-10-21 2020-10-21 Method for processing session interrupt message of bidirectional forwarding detection protocol and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011131837.1A CN112422442B (en) 2020-10-21 2020-10-21 Method for processing session interrupt message of bidirectional forwarding detection protocol and storage medium

Publications (2)

Publication Number Publication Date
CN112422442A true CN112422442A (en) 2021-02-26
CN112422442B CN112422442B (en) 2022-07-05

Family

ID=74840382

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011131837.1A Active CN112422442B (en) 2020-10-21 2020-10-21 Method for processing session interrupt message of bidirectional forwarding detection protocol and storage medium

Country Status (1)

Country Link
CN (1) CN112422442B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115208860A (en) * 2022-07-06 2022-10-18 抖音视界(北京)有限公司 Interrupt rate determination method, interrupt rate determination device, electronic device, processing device, and medium
WO2022262798A1 (en) * 2021-06-18 2022-12-22 中兴通讯股份有限公司 Link processing method and apparatus, network device, and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101483592A (en) * 2009-02-05 2009-07-15 中兴通讯股份有限公司 Method and apparatus for inhibiting bidirectional forwarding detection link oscillation
CN101800673A (en) * 2010-02-03 2010-08-11 中兴通讯股份有限公司 Method and device of bidirectional forwarding detection (BFD) oscillation damping
CN101827010A (en) * 2010-04-30 2010-09-08 华为技术有限公司 Method and device for inhabiting VPN (Virtual Private Network) tunnel oscillation
CN101867502A (en) * 2010-06-02 2010-10-20 中兴通讯股份有限公司 Method and device for inhibiting port oscillation
CN102075390A (en) * 2011-02-16 2011-05-25 华为技术有限公司 Transmission state detection method and related device thereof
CN104980293A (en) * 2014-04-02 2015-10-14 深圳市中兴微电子技术有限公司 Method and device for quickly transmitting and detecting OAM message
CN106572008A (en) * 2015-10-13 2017-04-19 中兴通讯股份有限公司 Method and apparatus for suppressing neighbor oscillation
CN109039746A (en) * 2018-08-07 2018-12-18 新华三技术有限公司 Detect the method and processor of two-way converting path detection session status

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101483592A (en) * 2009-02-05 2009-07-15 中兴通讯股份有限公司 Method and apparatus for inhibiting bidirectional forwarding detection link oscillation
CN101800673A (en) * 2010-02-03 2010-08-11 中兴通讯股份有限公司 Method and device of bidirectional forwarding detection (BFD) oscillation damping
CN101827010A (en) * 2010-04-30 2010-09-08 华为技术有限公司 Method and device for inhabiting VPN (Virtual Private Network) tunnel oscillation
CN101867502A (en) * 2010-06-02 2010-10-20 中兴通讯股份有限公司 Method and device for inhibiting port oscillation
CN102075390A (en) * 2011-02-16 2011-05-25 华为技术有限公司 Transmission state detection method and related device thereof
CN104980293A (en) * 2014-04-02 2015-10-14 深圳市中兴微电子技术有限公司 Method and device for quickly transmitting and detecting OAM message
CN106572008A (en) * 2015-10-13 2017-04-19 中兴通讯股份有限公司 Method and apparatus for suppressing neighbor oscillation
CN109039746A (en) * 2018-08-07 2018-12-18 新华三技术有限公司 Detect the method and processor of two-way converting path detection session status

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022262798A1 (en) * 2021-06-18 2022-12-22 中兴通讯股份有限公司 Link processing method and apparatus, network device, and storage medium
CN115208860A (en) * 2022-07-06 2022-10-18 抖音视界(北京)有限公司 Interrupt rate determination method, interrupt rate determination device, electronic device, processing device, and medium
CN115208860B (en) * 2022-07-06 2024-08-20 抖音视界(北京)有限公司 Interrupt rate determining method, device, electronic equipment, processing equipment and medium

Also Published As

Publication number Publication date
CN112422442B (en) 2022-07-05

Similar Documents

Publication Publication Date Title
CN112422442B (en) Method for processing session interrupt message of bidirectional forwarding detection protocol and storage medium
CN111078453B (en) Method, device, computer equipment and storage medium for automatically fusing and recovering micro-service
CN106603261B (en) Hot backup method, first main device, standby device and communication system
CN110072244B (en) Control method and device of radio link failure timer
CN111447094A (en) Master-slave switching method of dual computers, terminal equipment and computer readable storage medium
US8775869B2 (en) Device and method for coordinating automatic protection switching operation and recovery operation
CN111585797B (en) Ethernet link switching method, device, equipment and computer readable storage medium
EP2784677A1 (en) Processing apparatus, program and method for logically separating an abnormal device based on abnormality count and a threshold
US6964047B2 (en) Method and apparatus for a fast process monitor suitable for a high availability system
CN114157609A (en) PFC deadlock detection method and device
CN114285822A (en) Domain name resolution server switching method and device
CN110545198B (en) ERPS loop damage method and main node
CN112383414B (en) Dual-machine hot backup quick switching method and device
CN112737844A (en) Method and device for switching between main and standby in redundant system
CN112217718A (en) Service processing method, device, equipment and storage medium
US20100070668A1 (en) Interrupt control apparatus, interrupt control system, interrupt control method, and interrupt control program
CN111934909A (en) Method and device for switching IP (Internet protocol) resources of host and standby machine, computer equipment and storage medium
CN114095341A (en) Network recovery method and device, computer equipment and storage medium
CN109818870B (en) Multicast routing method, device, service board and machine readable storage medium
CN110601972A (en) Message transmission method and device and intelligent elastic architecture system
CN115567373A (en) Breaker circuit breaking method and module for Raft consensus algorithm
CN112272110B (en) Connection jitter processing method, system and device for storage cluster controller node
JP2009212862A (en) Congestion control system, congestion control method, and congestion control program
CN115002020B (en) OSPF-based data processing method and device
CN113595837B (en) Communication protocol management method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 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