CN114205405A - BFD message sending method, device, electronic equipment and storage medium - Google Patents

BFD message sending method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114205405A
CN114205405A CN202111279208.8A CN202111279208A CN114205405A CN 114205405 A CN114205405 A CN 114205405A CN 202111279208 A CN202111279208 A CN 202111279208A CN 114205405 A CN114205405 A CN 114205405A
Authority
CN
China
Prior art keywords
bfd
session
state
packet
value
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
CN202111279208.8A
Other languages
Chinese (zh)
Other versions
CN114205405B (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.)
New H3C Technologies Co Ltd Hefei Branch
Original Assignee
New H3C Technologies Co Ltd Hefei Branch
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 New H3C Technologies Co Ltd Hefei Branch filed Critical New H3C Technologies Co Ltd Hefei Branch
Priority to CN202111279208.8A priority Critical patent/CN114205405B/en
Publication of CN114205405A publication Critical patent/CN114205405A/en
Application granted granted Critical
Publication of CN114205405B publication Critical patent/CN114205405B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/142Managing session states for stateless protocols; Signalling session states; State transitions; Keeping-state mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/148Migration or transfer of sessions

Landscapes

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

Abstract

The application provides a BFD message sending method, a BFD message sending device, electronic equipment and a storage medium. For any one of the BRAS-CP device and the BRAS-UP device, when the session state of the BFD session between the BRAS-CP device and the BRAS-UP device is UP, once a corresponding BFD packet sent by the opposite-end device is not received within a certain set period, the session state is not directly changed from the UP state to the Down state, but is changed to the first temporary state, and the opposite-end device is continuously tried to send a specific BFD packet to the opposite-end device, so that the opposite-end device is guided to change the intermediate link between the BRAS-CP device and the opposite-end device in a manner of changing the source port of the related BFD packet which is continuously sent after the change under the condition that the related session state is UP, the sending success rate of the related BFD packet is improved, oscillation caused by timeout detection of the BFD session is avoided to a certain extent, and further the oscillation of the CUSP link is reduced.

Description

BFD message sending method, device, electronic equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a BFD packet sending method, apparatus, electronic device, and storage medium.
Background
A Broadband Remote Access Server (BRAS) is used as an Access gateway device of a user and an edge of an IP network, and a control plane and a forwarding plane are tightly coupled together, so that performance processing is affected with each other, performance of the control plane and the forwarding plane cannot be fully exerted, and resource utilization rate is low.
At present, a virtualized BRAS with a Control Plane and a forwarding Plane separated from each other, that is, a vbars architecture, has been proposed, where the Control Plane may be implemented by a BRAS-Control Plane (CP) device, and is defined as a user Control management component, and is used to implement functions such as user Control management, user access Control, user authentication authorization charging, address management, configuration management, and the like; the forwarding Plane can be implemented by a BRAS-User Plane (UP, also referred to as a forwarding Plane) device, and is defined as a three-layer network edge and a User policy execution component, and can be used for implementing functions such as traffic forwarding and traffic statistics.
A Control Plane and User Plane Separated Protocol (CUSP) link is generally established between the BRAS-UP device and the BRAS-CP device, and the two devices quickly detect the connectivity of the link through a Bidirectional Forwarding Detection (BFD) session established between the two devices. However, under a scenario that a plurality of intermediate links are deployed between the two devices, when any one of the two devices sends a BFD packet corresponding to the BFD session to the opposite device, only the hashed one of the intermediate links sends the BFD packet corresponding to the BFD session to the opposite device, and once the corresponding BFD packet sent by the opposite device is not received in a set period (the corresponding duration includes a duration of a BFD detection period corresponding to the BFD session and a retransmission duration (i.e., a duration of a retransmission-related BFD packet)), the session state of the BFD session is changed from an established (UP) state to a disconnected (Down) state, that is, it means that the intermediate link fails, and BFD session oscillation occurs, and since a certain time is required for route convergence, CUSP link oscillation may be further caused.
Disclosure of Invention
In order to overcome the problems in the related art, the application provides a BFD message sending method, a BFD message sending device, electronic equipment and a storage medium.
According to a first aspect of the embodiments of the present application, a BFD packet sending method is provided, where the method is applied to any one of a BRAS-CP device and a BRAS-UP device, and a CUSP link and a BFD session corresponding to the CUSP link are established between the BRAS-CP device and the BRAS-UP device, and the method includes:
when a set period arrives, judging whether a first BFD message corresponding to the BFD session sent by an opposite terminal device is received, wherein the session state of the BFD session carried in the first BFD message is an UP state, and the duration of the set period comprises the duration of a BFD detection period and the retransmission duration corresponding to the BFD session;
if the determination result is yes, if the session state of the BFD session recorded locally is an UP state, keeping the session state of the BFD session recorded locally unchanged, and when the BFD detection period is reached, determining whether the value in the first reserved field carried in the first BFD packet is a first set value or a second set value, when the value in the first reserved field is determined to be the first set value, sending the second BFD packet to the opposite-end device through an egress interface determined when the second BFD packet corresponding to the BFD session sent to the opposite-end device last time is sent, when the value in the first reserved field is determined to be the second set value, re-generating a third BFD packet corresponding to the BFD session, and sending the third BFD packet to the opposite-end device through the egress interface of the determined third BFD packet, where the first set value is used to indicate that the device does not need to re-generate the BFD session to the opposite-end device A BFD message corresponding to the session, where the second setting value is used to indicate that the device needs to regenerate a BFD message corresponding to the BFD session sent to the opposite device, the session states of the BFD session carried in the second BFD message and the third BFD message are both UP states, the value in the second reserved field carried in the second BFD message and the value in the third reserved field carried in the third BFD message are both the first setting value, and source ports of the third BFD message and the second BFD message are different;
if the session state of the locally recorded BFD session is a first temporary state, changing the locally recorded session state of the BFD session into an UP state, and starting to execute a step of judging whether the value in a first reserved field carried in the first BFD message is a first set value or a second set value when the BFD detection period is reached;
if the session state of the BFD session recorded locally is a second temporary state, changing the session state of the BFD session recorded locally into an UP state, and when the BFD detection period is reached, sending the second BFD message to the opposite terminal equipment through the last determined output interface;
if the session state of the locally recorded BFD session is an UP state, changing the locally recorded session state of the BFD session into the first temporary state, changing a value in a second reserved field carried in the second BFD message into the second set value when the BFD detection period is reached, and sending the changed second BFD message to the opposite terminal equipment through the last determined outlet interface;
if the session state of the BFD session recorded locally is the first temporary state, changing the session state of the BFD session recorded locally to the second temporary state, and when the BFD detection period is reached, regenerating a fifth BFD packet corresponding to the BFD session, and sending the fifth BFD packet to the opposite-end device through the determined output interface of the fifth BFD packet, where a value in a fourth reserved field carried in the fifth BFD packet is the second set value, the session state of the carried BFD session is an UP state, and source ports of the fifth BFD packet and the second BFD packet are different;
if the session state of the locally recorded BFD session is the second temporary state, changing the locally recorded session state of the BFD session into a Down state.
According to a second aspect of the embodiments of the present application, a BFD packet sending apparatus is provided, where the apparatus is applied to any one of a BRAS-CP device and a BRAS-UP device, and a CUSP link and a BFD session corresponding to the CUSP link are established between the BRAS-CP device and the BRAS-UP device, and the apparatus includes:
a determining module, configured to determine, when a set period arrives, whether a first BFD packet corresponding to the BFD session sent by an opposite-end device is received, where a session state of the BFD session carried in the first BFD packet is an UP state, and a duration of the set period includes a duration of a BFD detection period and a retransmission duration corresponding to the BFD session;
a first sending module, configured to, when the determination result of the determining module is yes, if the session state of the BFD session recorded locally is an UP state, keep the session state of the BFD session recorded locally unchanged, and when the BFD detection period is reached, determine whether a value in a first reserved field carried in the first BFD packet is a first set value or a second set value, when the value in the first reserved field is determined to be the first set value, send the second BFD packet to the peer device through an egress interface determined when a second BFD packet corresponding to the BFD session sent to the peer device last time is determined, when the value in the first reserved field is determined to be the second set value, regenerate a third BFD packet corresponding to the BFD session, send the third BFD packet to the peer device through the egress interface of the determined third BFD packet, the first setting value is used for indicating that the device does not need to regenerate a BFD packet corresponding to the BFD session sent to the opposite-end device, the second setting value is used for indicating that the device needs to regenerate a BFD packet corresponding to the BFD session sent to the opposite-end device, the session states of the BFD session carried in the second BFD packet and the third BFD packet are both UP states, the value in the second reserved field carried in the second BFD packet and the value in the third reserved field carried in the third BFD packet are both the first setting value, and source ports of the third BFD packet and the second BFD packet are different; if the session state of the locally recorded BFD session is a first temporary state, changing the locally recorded session state of the BFD session into an UP state, and starting to execute a step of judging whether the value in a first reserved field carried in the first BFD message is a first set value or a second set value when the BFD detection period is reached; if the session state of the BFD session recorded locally is a second temporary state, changing the session state of the BFD session recorded locally into an UP state, and when the BFD detection period is reached, sending the second BFD message to the opposite terminal equipment through the last determined output interface;
a second sending module, configured to, if the determination result of the determining module is negative, change the session state of the BFD session recorded locally to the first temporary state if the session state of the BFD session recorded locally is an UP state, change a value in a second reserved field carried in the second BFD packet to the second set value when the BFD detection period is reached, and send the changed second BFD packet to the peer device through the last determined outgoing interface; if the session state of the BFD session recorded locally is the first temporary state, changing the session state of the BFD session recorded locally to the second temporary state, and when the BFD detection period is reached, regenerating a fifth BFD packet corresponding to the BFD session, and sending the fifth BFD packet to the opposite-end device through the determined output interface of the fifth BFD packet, where a value in a fourth reserved field carried in the fifth BFD packet is the second set value, the session state of the carried BFD session is an UP state, and source ports of the fifth BFD packet and the second BFD packet are different; and if the locally recorded session state of the BFD session is the second temporary state, changing the locally recorded session state of the BFD session into a Down state.
According to a third aspect of embodiments herein, there is provided an electronic device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: the method steps of the BFD message sending method are realized.
According to a fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the method steps of the BFD messaging method described above.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
in this embodiment of the present application, for any one of the BRAS-CP device and the BRAS-UP device that have established the CUSP link and created the BFD session corresponding to the CUSP link, when the session state of the locally recorded BFD session is in an UP state, once a BFD packet corresponding to the BFD session sent by the peer device is not received within a certain set period, the session state is not directly changed from the UP state to a Down state, but the session state is changed from the UP state to a first temporary state, and an attempt is continuously made to send a corresponding BFD packet to the peer device (the value in the reserved field carried in the BFD packet is the second set value), so as to guide the peer device to change an intermediate link between the CUSP link and the BFD session state by changing a source port of a related BFD packet that is continuously sent after the change when the session state of the locally recorded BFD session is in the UP state, therefore, the success rate of sending related BFD messages is improved, the phenomenon that the BFD session detection is overtime and vibrates is avoided to a certain extent, and the CUSP link vibration is reduced.
And if the BFD message corresponding to the BFD session sent by the peer device is not received in the next set period, the session state is continuously changed from the first temporary state to the second temporary state, the corresponding BFD message is regenerated (the value in the reserved field carried in the BFD message is still the second set value, and the source port of the BFD message is different from the source port of the last BFD message sent), and the BFD message is sent to the peer device through the determined output interface of the regenerated BFD message, that is, the intermediate link is changed by trying again, so as to further improve the sending success rate of the related BFD message, thereby avoiding oscillation caused by the BFD session detection timeout to a certain extent, and further reducing CUSP link oscillation.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic flow chart of a BFD packet sending method according to an embodiment of the present application;
fig. 2 is a schematic diagram of a networking architecture to which a BFD packet sending method according to an embodiment of the present application is applied;
fig. 3 is a schematic structural diagram of a BFD packet sending apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
Next, examples of the present application will be described in detail.
The embodiment of the application provides a BFD message sending method, which is applied to any one of a BRAS-CP device and a BRAS-UP device, and a CUSP link and a BFD session corresponding to the CUSP link are established between the BRAS-CP device and the BRAS-UP device, as shown in fig. 1, the method can comprise the following steps:
and S11, when the set period is reached, judging whether the first BFD message sent by the opposite terminal equipment is received.
In this step, the session state of the BFD session carried in the first BFD packet is the UP state. And, the duration of the set period may include a duration of a BFD detection period and a retransmission duration corresponding to the BFD session.
Here, the setting period, the BFD detection period, and the retransmission time period may all be set according to actual requirements of a network where the device is located. The retransmission time duration may be the same as the BFD detection period, or may be different from the BFD detection period, for example, the retransmission time duration and the BFD detection period may be in a multiple relationship.
After executing the above step S11, if the determination result is yes, if the session state of the locally recorded BFD session is UP, the apparatus executes step S12 and step S13; if the session state of the locally recorded BFD session is the first temporary state, the apparatus performs steps S14 and S13; if the session state of the locally recorded BFD session is the second temporary state, the apparatus performs step S15.
If the determination result is negative, if the session state of the locally recorded BFD session is the UP state, the apparatus executes step S16; if the session state of the locally recorded BFD session is the first temporary state, the apparatus performs step S17; if the session state of the locally recorded BFD session is the second temporary state, the apparatus performs step S18.
S12, keeping the session state of the BFD session recorded locally unchanged.
S13, when a BFD detection period is reached, judging whether the value in a first reserved field carried in a first BFD message is a first set value or a second set value, when the value in the first reserved field is judged to be the first set value, sending a second BFD message to opposite-end equipment through an outlet interface determined when a second BFD message corresponding to a BFD session sent to the opposite-end equipment last time is judged, when the value in the first reserved field is judged to be the second set value, regenerating a third BFD message corresponding to the BFD session, and sending the third BFD message to the opposite-end equipment through the outlet interface of the determined third BFD message.
In this step, the first setting value is used to indicate that the device does not need to regenerate a BFD packet corresponding to the BFD session sent to the peer device; the second setting value is used for indicating that the device needs to regenerate the BFD packet corresponding to the BFD session sent to the opposite device.
In one example, the first setting value may be represented by "0" and the second setting value may be represented by "1". Of course, the first setting value and the second setting value can be expressed in other ways, and are not listed here.
In addition, in this step, the session states of the BFD sessions carried in the second BFD packet and the third BFD packet are both UP states; the value in the second reserved field carried in the second BFD message and the value in the third reserved field carried in the third BFD message are both the first set value, and the source ports of the third BFD message and the second BFD message are different, that is, the quintuple information of the third BFD message and the second BFD message is the same as other information (for example, the source IP, the destination IP, and the destination port of the third BFD message and the second BFD message) except the source ports of the third BFD message and the second BFD message.
S14, changing the session state of the BFD session recorded locally to UP state.
The apparatus continues to perform the above-described step S14 after performing the above-described step S15.
And S15, changing the session state of the BFD session recorded locally into an UP state, and sending a second BFD message to the opposite terminal equipment through the last determined outlet interface when the BFD detection period is reached.
And S16, changing the session state of the BFD session recorded locally into a first temporary state, changing the value in a second reserved field carried in a second BFD message into a second set value when the BFD detection period is reached, and sending the changed second BFD message to the opposite terminal equipment through the last determined outlet interface.
And S17, changing the session state of the BFD session recorded locally into a second temporary state, regenerating a fifth BFD message corresponding to the BFD session when the BFD detection period is reached, and sending the fifth BFD message to the opposite terminal equipment through the determined outlet interface of the fifth BFD message.
In this step, the value in the third reserved field carried in the fifth BFD packet is the second set value, the session state of the carried BFD session is the UP state, and the source ports of the fifth BFD packet are different from those of the second BFD packet, that is, the five-tuple information of the fifth BFD packet and the second BFD packet are the same as each other (for example, the source IP, the destination IP, and the destination port of the fifth BFD packet and the destination port of the second BFD packet) except that the source ports of the fifth BFD packet and the second BFD packet are different from each other.
And S18, changing the session state of the BFD session recorded locally into a Down state.
It should be noted that, for the device, after the step S11 is completed, if the session state of the locally recorded BFD session is the first temporary state, this indicates that this session state is changed when the device has not received the BFD packet corresponding to the BFD session sent by the peer device in the last set period and the session state of the BFD session recorded at that time is the UP state.
If the session state of the locally recorded BFD session is the second temporary state, this indicates that this session state is changed in the case that the device has not received the BFD packet corresponding to the BFD session sent by the peer device in the last set period and the session state of the BFD session recorded at that time is the first temporary state, and also indicates that the device has not received the BFD packet corresponding to the BFD session sent by the peer device in the last set period and has changed the session state of the BFD session recorded at that time from the UP state to the first temporary state.
In addition, in step S13, for the device, once it is determined that the value in the first reserved field carried in the first BFD packet is the first set value, it means that the first BFD packet is sent by the peer device when the session state of the BFD session recorded locally by the peer device is the UP state, and at this time, the device still uses the BFD packet corresponding to the BFD session sent to the peer device last time (for convenience of distinguishing the first BFD packet, it is referred to as a second BFD packet), and sends the BFD packet to the peer device through the outgoing interface used when the second BFD packet is sent last time.
Once the value in the first reserved field carried in the first BFD packet is determined to be the second set value, it means that the first BFD packet is sent by the peer device in the first temporary state or the second temporary state of the session state of the BFD session locally recorded, at this time, the device needs to regenerate the third BFD packet, and then send the third BFD packet to the peer device through the determined outgoing interface of the third BFD packet.
Here, the source port of the third BFD packet may be a port whose port number on the device is the port number of the source port of the second BFD packet minus a set value. For example, a value of 1 is set.
Of course, the source port of the third BFD packet may also be any port on the device other than the source port of the second BFD packet, and the selection manner of the source port of the third BFD packet is not limited herein.
After the device regenerates the third BFD packet, the outgoing interface of the third BFD packet is still determined by using the existing determining method, for example, the outgoing interface of the third BFD packet is determined by using the determining method of performing the hash operation on the quintuple information of the third BFD packet by using the MD5 hash algorithm, and the specific determining process is not described in detail herein.
It should be further noted that, by executing the step S16, the device may direct the opposite device to change the intermediate link between the two devices by changing the source port of the relevant BFD packet sent later when the session state of the BFD session recorded locally is the UP state, so as to improve the sending success rate of the relevant BFD packet, avoid oscillation caused by timeout of the BFD session to a certain extent, and further reduce CUSP link oscillation.
By executing the step S17, the device further improves the success rate of sending the related BFD packet by trying to change the intermediate link again, thereby avoiding oscillation due to timeout of the BFD session to a certain extent, and further reducing CUSP link oscillation.
Specifically, in step S17, the source port of the fifth BFD packet regenerated by the device may also be a port whose port number on the device is the port number of the source port of the second BFD packet minus a set value; of course, the source port of the fifth BFD packet may also be any port on the device except the source port of the second BFD packet, and the selection manner of the source port of the fifth BFD packet is not limited in any way here.
The BFD messaging method is described in detail below with reference to specific embodiments.
As shown in fig. 2, it is assumed that BRAS-CP device 1 establishes CUSP link 1 and its corresponding BFD session 1 with BRAS-UP device 1, and that BRAS-CP device 1 establishes CUSP link 2 and its corresponding BFD session 2 with BRAS-UP device 2. The BRAS-UP device 1 and the BRAS-UP device 2 have a main standby relationship. Assume that the first set value is 0 and the second set value is 1.
It should be noted that fig. 2 also includes other communication devices, which are not shown one by one here.
Taking BRAS-UP device 1 as an example, assuming that a certain set period is reached, BRAS-UP device 1 does not receive BFD packet 1 corresponding to BFD session 1 sent by BRAS-CP device 1, and at this time, the session state of locally recorded BFD session 1 is UP state, in this case, BRAS-UP device 1 changes the session state of locally recorded BFD session 1 to the first temporary state (denoted as IDLE1 state).
Assuming that a period of time elapses and a BFD detection period corresponding to the BFD session 1 is reached, the BRAS-UP device 1 changes a value in a reserved field carried in a BFD packet 2 corresponding to the BFD session 1 sent to the BRAS-CP device 1 last time to 1, and sends the changed BFD packet 2 to the BRAS-CP device 1 through an outgoing interface determined last time, for example, an interface directly connected to the gateway device 1 on the BRAS-CP device 1. Here, the session state of the BFD session 1 carried in the BFD packet 2 is an UP state.
That is to say, in such a situation, BRAS-UP device 1 does not change the source port first, but changes the value in the reserved field carried in BFD packet 2 corresponding to BFD session 1 sent to BRAS-CP device 1 last time to guide BRAS-CP device 1 to change the source port, so as to improve the sending success rate of the relevant BFD packet, and to avoid oscillation due to BFD session detection timeout to a certain extent, thereby reducing CUSP link oscillation.
And subsequently, the next set period is reached, and it is assumed that the BRAS-UP device 1 does not receive the BFD message 1 corresponding to the BFD session 1 sent by the BRAS-CP device 1, and at this time, the session state of the locally recorded BFD session 1 is the IDLE1 state, in this case, the BRAS-UP device 1 changes the session state of the locally recorded BFD session 1 into the second temporary state (denoted as the IDLE2 state).
Next, when the BFD detection period is reached again, BRAS-UP device 1 regenerates BFD packet 3 corresponding to BFD session 1 (the port number of the corresponding source port is the port number of the source port of BFD packet 2 minus 1, the value in the carried reserved field is 1, and the session state of the carried BFD1 session is the UP state), and sends BFD packet 3 to BRAS-CP device 1 through the determined outgoing interface of BFD packet 3, for example, the outgoing interface is an interface on BRAS-CP device 1 directly connected to gateway device 2. That is, BRAS-UP device 1 sends BFD packet 3 to BRAS-CP device 1 through gateway device 2 and leaf device 1.
That is to say, in this situation, the BRAS-UP device 1 regenerates the relevant BFD packet by changing the source port, so as to try to send the relevant BFD packet to the BRAS-CP device 1 through other normal intermediate links, further improve the sending success rate of the relevant BFD packet, avoid oscillation due to the BFD session detection timeout to a certain extent, and further reduce CUSP link oscillation.
After the next set period is reached, suppose that BRAS-UP device 1 receives BFD message 1 corresponding to BFD session 1 sent by BRAS-CP device 1, and at this time, the session state of locally recorded BFD session 1 is IDLE2 state, in this case, BRAS-UP device 1 changes the session state of locally recorded BFD session 1 to UP state.
When the BFD detection period is reached again, it is assumed that BRAS-UP device 1 determines that the value in the reserved field carried in BFD packet 1 is 0, and at this time, BRAS-UP device 1 sends BFD packet 3 to BRAS-CP device 1 through the outgoing interface (i.e., the interface directly connected to gateway device 2) determined when last BFD packet 3 was sent to BRAS-CP device 1.
It should be noted that the processing flow when each subsequent setting period arrives is not described in detail.
It can be seen from the above technical solutions that, in the embodiment of the present application, for any one of the BRAS-CP device and the BRAS-UP device that have established the CUSP link and created the BFD session corresponding to the CUSP link, when the session state of the locally recorded BFD session is in the UP state, once the BFD packet corresponding to the BFD session sent by the peer device is not received within a certain set period, the session state is not directly changed from the UP state to the Down state, but the session state is changed from the UP state to the first temporary state, and the peer device continues to try to send the corresponding BFD packet to the peer device (where a value in a reserved field carried in the BFD packet is a second set value), so as to guide the peer device to pass through a manner of changing a source port of a related BFD packet that is continuously sent after the change when the session state of the locally recorded BFD session is in the UP state, the intermediate link between the BFD and the CUSP is changed, so that the sending success rate of the related BFD messages is improved, the oscillation caused by the overtime detection of the BFD session is avoided to a certain extent, and the oscillation of the CUSP link is reduced.
And if the BFD message corresponding to the BFD session sent by the peer device is not received in the next set period, the session state is continuously changed from the first temporary state to the second temporary state, the corresponding BFD message is regenerated (the value in the reserved field carried in the BFD message is still the second set value, and the source port of the BFD message is different from the source port of the last BFD message sent), and the BFD message is sent to the peer device through the determined output interface of the regenerated BFD message, that is, the intermediate link is changed by trying again, so as to further improve the sending success rate of the related BFD message, thereby avoiding oscillation caused by the BFD session detection timeout to a certain extent, and further reducing CUSP link oscillation.
Based on the same inventive concept, the present application further provides a BFD packet sending apparatus, which is applied to any one of the BRAS-CP device and the BRAS-UP device, and a CUSP link and a BFD session corresponding thereto are established between the BRAS-CP device and the BRAS-UP device, and a schematic structural diagram of the apparatus is shown in fig. 3, and specifically includes:
a determining module 31, configured to determine, when a set period arrives, whether a first BFD packet corresponding to the BFD session sent by an opposite-end device is received, where a session state of the BFD session carried in the first BFD packet is an UP state, and a duration of the set period includes a duration of a BFD detection period and a retransmission duration corresponding to the BFD session;
a first sending module 32, configured to, when the determination result of the determining module 31 is yes, if the session state of the BFD session recorded locally is an UP state, keep the session state of the BFD session recorded locally unchanged, and when the BFD detection period is reached, determine whether a value in a first reserved field carried in the first BFD packet is a first set value or a second set value, when the value in the first reserved field is determined to be the first set value, send the second BFD packet to the peer device through an egress interface determined when a second BFD packet corresponding to the BFD session sent to the peer device last time is determined, and when the value in the first reserved field is determined to be the second set value, re-generate a third BFD packet corresponding to the BFD session, send the third BFD packet to the peer device through the egress interface of the determined third BFD packet, the first setting value is used for indicating that the device does not need to regenerate a BFD packet corresponding to the BFD session sent to the opposite-end device, the second setting value is used for indicating that the device needs to regenerate a BFD packet corresponding to the BFD session sent to the opposite-end device, the session states of the BFD session carried in the second BFD packet and the third BFD packet are both UP states, the value in the second reserved field carried in the second BFD packet and the value in the third reserved field carried in the third BFD packet are both the first setting value, and source ports of the third BFD packet and the second BFD packet are different; if the session state of the locally recorded BFD session is a first temporary state, changing the locally recorded session state of the BFD session into an UP state, and starting to execute a step of judging whether the value in a first reserved field carried in the first BFD message is a first set value or a second set value when the BFD detection period is reached; if the session state of the BFD session recorded locally is a second temporary state, changing the session state of the BFD session recorded locally into an UP state, and when the BFD detection period is reached, sending the second BFD message to the opposite terminal equipment through the last determined output interface;
a second sending module 32, configured to, if the determination result of the determining module 31 is negative, change the locally recorded session state of the BFD session to the first temporary state if the locally recorded session state of the BFD session is an UP state, change a value in a second reserved field carried in the second BFD packet to the second set value when the BFD detection period is reached, and send the changed second BFD packet to the peer device through the last determined outgoing interface; if the session state of the BFD session recorded locally is the first temporary state, changing the session state of the BFD session recorded locally to the second temporary state, and when the BFD detection period is reached, regenerating a fifth BFD packet corresponding to the BFD session, and sending the fifth BFD packet to the opposite-end device through the determined output interface of the fifth BFD packet, where a value in a fourth reserved field carried in the fifth BFD packet is the second set value, the session state of the carried BFD session is an UP state, and source ports of the fifth BFD packet and the second BFD packet are different; and if the locally recorded session state of the BFD session is the second temporary state, changing the locally recorded session state of the BFD session into a Down state.
Preferably, the first set value is 0, and the second set value is 1.
Preferably, the source ports of the third BFD packet and the fifth BFD packet are both ports whose port numbers on the device are the port number of the source port of the second BFD packet minus a set value.
Preferably, the source ports of the third BFD packet and the fifth BFD packet are both any ports on the device except the source port of the second BFD packet.
It can be seen from the above technical solutions that, in the embodiment of the present application, for any one of the BRAS-CP device and the BRAS-UP device that have established the CUSP link and created the BFD session corresponding to the CUSP link, when the session state of the locally recorded BFD session is in the UP state, once the BFD packet corresponding to the BFD session sent by the peer device is not received within a certain set period, the session state is not directly changed from the UP state to the Down state, but the session state is changed from the UP state to the first temporary state, and the peer device continues to try to send the corresponding BFD packet to the peer device (where a value in a reserved field carried in the BFD packet is a second set value), so as to guide the peer device to pass through a manner of changing a source port of a related BFD packet that is continuously sent after the change when the session state of the locally recorded BFD session is in the UP state, the intermediate link between the BFD and the CUSP is changed, so that the sending success rate of the related BFD messages is improved, the oscillation caused by the overtime detection of the BFD session is avoided to a certain extent, and the oscillation of the CUSP link is reduced.
And if the BFD message corresponding to the BFD session sent by the peer device is not received in the next set period, the session state is continuously changed from the first temporary state to the second temporary state, the corresponding BFD message is regenerated (the value in the reserved field carried in the BFD message is still the second set value, and the source port of the BFD message is different from the source port of the last BFD message sent), and the BFD message is sent to the peer device through the determined output interface of the regenerated BFD message, that is, the intermediate link is changed by trying again, so as to further improve the sending success rate of the related BFD message, thereby avoiding oscillation caused by the BFD session detection timeout to a certain extent, and further reducing CUSP link oscillation.
An electronic device is further provided in the embodiments of the present application, as shown in fig. 4, and includes a processor 41 and a machine-readable storage medium 42, where the machine-readable storage medium 42 stores machine-executable instructions that can be executed by the processor 41, and the processor 41 is caused by the machine-executable instructions to: and realizing the steps of the BFD message sending method.
The machine-readable storage medium may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the machine-readable storage medium may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In another embodiment provided by the present application, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the BFD messaging method described above.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (10)

1. A bidirectional forwarding detection BFD message sending method is characterized in that the method is applied to any one of broadband remote access server BRAS-control plane CP equipment and BRAS-user plane UP equipment, a control plane and user plane separation protocol CUSP link and a corresponding BFD session are established between the BRAS-CP equipment and the BRAS-UP equipment, and the method comprises the following steps:
when a set period arrives, judging whether a first BFD message corresponding to the BFD session sent by an opposite terminal device is received, wherein the session state of the BFD session carried in the first BFD message is an UP state, and the duration of the set period comprises the duration of a BFD detection period and a retransmission duration corresponding to the BFD session;
if the determination result is yes, if the session state of the BFD session recorded locally is an UP state, keeping the session state of the BFD session recorded locally unchanged, and when the BFD detection period is reached, determining whether the value in the first reserved field carried in the first BFD packet is a first set value or a second set value, when the value in the first reserved field is determined to be the first set value, sending the second BFD packet to the opposite-end device through an egress interface determined when the second BFD packet corresponding to the BFD session sent to the opposite-end device last time is sent, when the value in the first reserved field is determined to be the second set value, re-generating a third BFD packet corresponding to the BFD session, and sending the third BFD packet to the opposite-end device through the egress interface of the determined third BFD packet, where the first set value is used to indicate that the device does not need to re-generate the BFD session to the opposite-end device A BFD message corresponding to the session, where the second setting value is used to indicate that the device needs to regenerate a BFD message corresponding to the BFD session sent to the opposite device, the session states of the BFD session carried in the second BFD message and the third BFD message are both UP states, the value in the second reserved field carried in the second BFD message and the value in the third reserved field carried in the third BFD message are both the first setting value, and source ports of the third BFD message and the second BFD message are different;
if the session state of the locally recorded BFD session is a first temporary state, changing the locally recorded session state of the BFD session into an UP state, and starting to execute a step of judging whether the value in a first reserved field carried in the first BFD message is a first set value or a second set value when the BFD detection period is reached;
if the session state of the BFD session recorded locally is a second temporary state, changing the session state of the BFD session recorded locally into an UP state, and when the BFD detection period is reached, sending the second BFD message to the opposite terminal equipment through the last determined output interface;
if the session state of the locally recorded BFD session is an UP state, changing the locally recorded session state of the BFD session into the first temporary state, changing a value in a second reserved field carried in the second BFD message into the second set value when the BFD detection period is reached, and sending the changed second BFD message to the opposite terminal equipment through the last determined outlet interface;
if the session state of the BFD session recorded locally is the first temporary state, changing the session state of the BFD session recorded locally to the second temporary state, and when the BFD detection period is reached, regenerating a fifth BFD packet corresponding to the BFD session, and sending the fifth BFD packet to the opposite-end device through the determined output interface of the fifth BFD packet, where a value in a fourth reserved field carried in the fifth BFD packet is the second set value, the session state of the carried BFD session is an UP state, and source ports of the fifth BFD packet and the second BFD packet are different;
and if the locally recorded session state of the BFD session is the second temporary state, changing the locally recorded session state of the BFD session into a disconnected Down state.
2. The method of claim 1, wherein the first set point is 0 and the second set point is 1.
3. The method according to claim 1, wherein the source ports of the third BFD packet and the fifth BFD packet are both ports whose port numbers on the device are the port number of the source port of the second BFD packet minus a set value.
4. The method of claim 1, wherein the source ports of the third BFD packet and the fifth BFD packet are each any port on the device other than the source port of the second BFD packet.
5. A bidirectional forwarding detection BFD message sending device is characterized in that the device is applied to any one of broadband remote access server BRAS-control plane CP equipment and BRAS-user plane UP equipment, a control plane and user plane separation protocol CUSP link and a corresponding BFD session are established between the BRAS-CP equipment and the BRAS-UP equipment, and the device comprises:
a determining module, configured to determine, when a set period arrives, whether a first BFD packet corresponding to the BFD session sent by an opposite-end device is received, where a session state of the BFD session carried in the first BFD packet is an UP state, and a duration of the set period includes a duration of a BFD detection period and a retransmission duration corresponding to the BFD session;
a first sending module, configured to, when the determination result of the determining module is yes, if the session state of the BFD session recorded locally is an UP state, keep the session state of the BFD session recorded locally unchanged, and when the BFD detection period is reached, determine whether a value in a first reserved field carried in the first BFD packet is a first set value or a second set value, when the value in the first reserved field is determined to be the first set value, send the second BFD packet to the peer device through an egress interface determined when a second BFD packet corresponding to the BFD session sent to the peer device last time is determined, when the value in the first reserved field is determined to be the second set value, regenerate a third BFD packet corresponding to the BFD session, send the third BFD packet to the peer device through the egress interface of the determined third BFD packet, the first setting value is used for indicating that the device does not need to regenerate a BFD packet corresponding to the BFD session sent to the opposite-end device, the second setting value is used for indicating that the device needs to regenerate a BFD packet corresponding to the BFD session sent to the opposite-end device, the session states of the BFD session carried in the second BFD packet and the third BFD packet are both UP states, the value in the second reserved field carried in the second BFD packet and the value in the third reserved field carried in the third BFD packet are both the first setting value, and source ports of the third BFD packet and the second BFD packet are different; if the session state of the locally recorded BFD session is a first temporary state, changing the locally recorded session state of the BFD session into an UP state, and starting to execute a step of judging whether the value in a first reserved field carried in the first BFD message is a first set value or a second set value when the BFD detection period is reached; if the session state of the BFD session recorded locally is a second temporary state, changing the session state of the BFD session recorded locally into an UP state, and when the BFD detection period is reached, sending the second BFD message to the opposite terminal equipment through the last determined output interface;
a second sending module, configured to, if the determination result of the determining module is negative, change the session state of the BFD session recorded locally to the first temporary state if the session state of the BFD session recorded locally is an UP state, change a value in a second reserved field carried in the second BFD packet to the second set value when the BFD detection period is reached, and send the changed second BFD packet to the peer device through the last determined outgoing interface; if the session state of the BFD session recorded locally is the first temporary state, changing the session state of the BFD session recorded locally to the second temporary state, and when the BFD detection period is reached, regenerating a fifth BFD packet corresponding to the BFD session, and sending the fifth BFD packet to the opposite-end device through the determined output interface of the fifth BFD packet, where a value in a fourth reserved field carried in the fifth BFD packet is the second set value, the session state of the carried BFD session is an UP state, and source ports of the fifth BFD packet and the second BFD packet are different; and if the locally recorded session state of the BFD session is the second temporary state, changing the locally recorded session state of the BFD session into a disconnected Down state.
6. The apparatus of claim 5, wherein the first set point is 0 and the second set point is 1.
7. The apparatus according to claim 5, wherein the source ports of the third BFD packet and the fifth BFD packet are both ports whose port numbers on the device are the port number of the source port of the second BFD packet minus a set value.
8. The apparatus of claim 5, wherein the source ports of the third BFD packet and the fifth BFD packet are any port on the device except for the source port of the second BFD packet.
9. An electronic device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: carrying out the method steps of any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 4.
CN202111279208.8A 2021-10-31 2021-10-31 BFD message sending method and device, electronic equipment and storage medium Active CN114205405B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111279208.8A CN114205405B (en) 2021-10-31 2021-10-31 BFD message sending method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111279208.8A CN114205405B (en) 2021-10-31 2021-10-31 BFD message sending method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114205405A true CN114205405A (en) 2022-03-18
CN114205405B CN114205405B (en) 2023-11-07

Family

ID=80646705

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111279208.8A Active CN114205405B (en) 2021-10-31 2021-10-31 BFD message sending method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114205405B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108055172A (en) * 2018-01-30 2018-05-18 迈普通信技术股份有限公司 A kind of bidirectional forwarding detection (BFD) method and device
CN108234358A (en) * 2017-12-29 2018-06-29 新华三技术有限公司 A kind of multicast message transmission method, device and machine readable storage medium
CN109039799A (en) * 2018-06-26 2018-12-18 新华三技术有限公司 Link state detection method, device and the network equipment
WO2019047855A1 (en) * 2017-09-06 2019-03-14 新华三技术有限公司 Backup method and apparatus for bras having separated forwarding plane and control plane
CN110535760A (en) * 2018-05-25 2019-12-03 丛林网络公司 The forwarding of aggregation interface detects
CN111478851A (en) * 2020-02-29 2020-07-31 新华三信息安全技术有限公司 Message processing method and device
CN112737880A (en) * 2020-12-25 2021-04-30 北京华三通信技术有限公司 Forwarding method and network equipment for Bidirectional Forwarding Detection (BFD) message

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019047855A1 (en) * 2017-09-06 2019-03-14 新华三技术有限公司 Backup method and apparatus for bras having separated forwarding plane and control plane
CN108234358A (en) * 2017-12-29 2018-06-29 新华三技术有限公司 A kind of multicast message transmission method, device and machine readable storage medium
CN108055172A (en) * 2018-01-30 2018-05-18 迈普通信技术股份有限公司 A kind of bidirectional forwarding detection (BFD) method and device
CN110535760A (en) * 2018-05-25 2019-12-03 丛林网络公司 The forwarding of aggregation interface detects
CN109039799A (en) * 2018-06-26 2018-12-18 新华三技术有限公司 Link state detection method, device and the network equipment
CN111478851A (en) * 2020-02-29 2020-07-31 新华三信息安全技术有限公司 Message processing method and device
CN112737880A (en) * 2020-12-25 2021-04-30 北京华三通信技术有限公司 Forwarding method and network equipment for Bidirectional Forwarding Detection (BFD) message

Also Published As

Publication number Publication date
CN114205405B (en) 2023-11-07

Similar Documents

Publication Publication Date Title
US10511522B2 (en) Methods and systems for evaluating network performance of and transmitting packets through an aggregated connection
EP2904745B1 (en) Method and apparatus for accelerating forwarding in software-defined networks
US10951640B2 (en) Traffic attack protection method and system, controller, router, and storage medium
US9819590B2 (en) Method and apparatus for notifying network abnormality
US9294343B2 (en) System and method using RSVP hello suppression for graceful restart capable neighbors
EP3605968B1 (en) N:1 stateful application gateway redundancy model
US20100274893A1 (en) Methods and apparatus for detecting and limiting focused server overload in a network
US20160261504A1 (en) Methods and systems for transmitting data packets
US9692697B2 (en) Control channel establishing method, forwarding point, and controller
CN107465613B (en) Link aggregation interface communication state switching method and device
CA3090903C (en) Packet sending method and related device
WO2008080314A1 (en) A method, forwarding engine and communication device for message acces control
WO2020083272A1 (en) Processing strategy generation method and system, and storage medium
US9800479B2 (en) Packet processing method, forwarder, packet processing device, and packet processing system
US10298487B2 (en) Method and device for transmitting data
CN108471372B (en) State control method, device and message transmission method
US10511494B2 (en) Network control method and apparatus
CN110192378B (en) Apparatus and method for controlling use of non-optimal path
CN114205405A (en) BFD message sending method, device, electronic equipment and storage medium
CN105812274B (en) Service data processing method and related equipment
CN106992878B (en) Multicast detection method and device
US20200145478A1 (en) Method, electronic device, and computer program product for handling congestion of data transmission
CN115378872B (en) Flow control method, system, computer equipment and readable storage medium
CN106941474B (en) Session initiation protocol server overload control method and server
CN111683009B (en) Control method and device of virtual forwarder

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