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

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

Info

Publication number
CN114205405B
CN114205405B CN202111279208.8A CN202111279208A CN114205405B CN 114205405 B CN114205405 B CN 114205405B CN 202111279208 A CN202111279208 A CN 202111279208A CN 114205405 B CN114205405 B CN 114205405B
Authority
CN
China
Prior art keywords
bfd
session
state
packet
set 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.)
Active
Application number
CN202111279208.8A
Other languages
Chinese (zh)
Other versions
CN114205405A (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

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

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 of the BRAS-CP device and the BRAS-UP device is the UP state, once the corresponding BFD message sent by the opposite terminal device is not received within a certain set period, the session state is not changed from the UP state to the Down state, but is changed to the first temporary state, and the attempt to send the specific BFD message to the opposite terminal device is continued, so that the opposite terminal device is guided to change the intermediate link of the two BFD messages in a manner of changing the source port of the related BFD message sent subsequently under the condition that the related session state is the UP state, the sending success rate of the related BFD message is improved, the concussion caused by the detection timeout of the BFD session is avoided to a certain extent, and the concurrence of the CUSP link is further reduced.

Description

BFD message sending method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and apparatus for sending a BFD packet, an electronic device, and a storage medium.
Background
The broadband remote access server (Broadband Remote Access Server, BRAS) is used as the edge of the access gateway equipment of the user and the IP network, and the control plane and the forwarding plane are tightly coupled together, so that the performance processing is mutually influenced, the performance of the control plane and the forwarding plane can not be fully exerted, and the resource utilization rate is low.
At present, a virtualized BRAS with a Control Plane and a forwarding Plane separated has been proposed, namely, a vbas architecture, wherein the Control Plane can be implemented through BRAS-Control Plane (CP) equipment, and is defined as a user Control management component, so as to implement functions of user Control management, user access Control, user authentication and authorization charging, address management, configuration management and the like; the forwarding Plane may be implemented by a BRAS-User Plane (UP, which may also be referred to as a forwarding Plane) device, and is defined as a three-layer network edge and a User policy executing component, and may be used to implement functions such as traffic forwarding and traffic statistics.
A control plane and user plane split protocol (Control Plane and User Plane Separated Protocol, CUSP) link is typically established between a BRAS-UP device and a BRAS-CP device, and both quickly detect connectivity of this link through a bidirectional forwarding detection (Bidirectional Forwarding Detection, BFD) session created therebetween. However, in a scenario where multiple intermediate links are deployed between the two, when any device in the two sends a BFD packet corresponding to the BFD session to the peer device, only the BFD packet corresponding to the BFD session is sent to the peer device through a hashed intermediate link, and once the corresponding BFD packet sent by the peer device is not received in a set period (the corresponding period includes the duration of the BFD detection period and the retransmission period (i.e., the duration of the retransmission related BFD packet) of the BFD session), the session state of the BFD session is changed from the UP state to the Down state, that is, the intermediate link fails, and BFD session concurrency occurs, and since a certain time is required for route convergence, the CUSP link concurrency is 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 an embodiment of the present application, there is provided a BFD messaging method, 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 the opposite terminal equipment 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 retransmission duration corresponding to the BFD session;
if the judging result is yes, if the session state of the BFD session of the local record is an UP state, keeping the session state of the BFD session of the local record unchanged, judging whether a value in a first reserved field carried in the first BFD message is a first set value or a second set value when the value in the first reserved field is the first set value, sending the second BFD message to the opposite end device through an outlet interface determined when a second BFD message corresponding to the BFD session is sent to the opposite end device for the last time, and regenerating a third BFD message corresponding to the BFD session when the value in the first reserved field is the second set value, and sending the third BFD message to the opposite end device through an outlet interface of the determined third BFD message, wherein the first set value is used for indicating that the device does not need to regenerate the second set value of the BFD message corresponding to the opposite end device, and the second set value is not carried in the second BFD message corresponding to the second set value, and the second BFD message corresponding to the BFD session is not carried in the second set value;
If the session state of the locally recorded BFD session is a first temporary state, changing the session state of the locally recorded BFD session into an UP state, and starting to execute the 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 sending the second BFD message to the opposite terminal equipment through the last determined outlet interface when the BFD detection period is reached;
if the judging result is that the session state of the BFD session recorded locally is the UP state, changing the session state of the BFD session recorded locally into the first temporary state, changing the 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 device through the interface determined last time;
if the session state of the locally recorded BFD session is the first temporary state, changing the session state of the locally recorded BFD session into the second temporary state, and regenerating a fifth BFD packet corresponding to the BFD session when the BFD detection period is reached, and sending the fifth BFD packet to the peer device through an output interface of the determined 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 session state of the BFD session recorded locally is the second temporary state, changing the session state of the BFD session recorded locally into a Down state.
According to a second aspect of an embodiment of the present application, there is provided a BFD messaging apparatus, 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 thereto are established between the BRAS-CP device and the BRAS-UP device, and the apparatus includes:
the judging module is used for judging whether a first BFD message corresponding to the BFD session sent by the opposite terminal equipment is received or not when a set period arrives, 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;
a first sending module, configured to, when the judging result of the judging module is yes, keep the session state of the locally recorded BFD session unchanged if the session state of the locally recorded BFD session is an UP state, and judge 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 judging result of the first reserved field is a first set value, send, through an output interface determined when a second BFD packet corresponding to the BFD session is sent to the opposite end device for the first time, the second BFD packet to the opposite end device, and regenerate a third BFD packet corresponding to the BFD session when the judging result of the first reserved field is a second set value, and send, through an output interface of the determined third BFD packet, the third BFD packet to the opposite end device, the third BFD packet, where the first set value is used to indicate that the device does not need to regenerate the second set value, and the second BFD packet is a second set value carried in the opposite end device; if the session state of the locally recorded BFD session is a first temporary state, changing the session state of the locally recorded BFD session into an UP state, and starting to execute the 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 locally recorded BFD session is a second temporary state, changing the session state of the locally recorded BFD session into an UP state, and sending the second BFD message to the opposite terminal equipment through the last determined outlet interface when the BFD detection period is reached;
The second sending module is configured to, when the determination result of the determining module is no, change the session state of the locally recorded BFD session to the first temporary state if the session state of the locally recorded BFD session is an UP state, and 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 an output interface determined last time; if the session state of the locally recorded BFD session is the first temporary state, changing the session state of the locally recorded BFD session into the second temporary state, and regenerating a fifth BFD packet corresponding to the BFD session when the BFD detection period is reached, and sending the fifth BFD packet to the peer device through an output interface of the determined 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 session state of the locally recorded BFD session is the second temporary state, changing the session state of the locally recorded BFD session to a Down state.
According to a third aspect of embodiments of the present application, 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, there is provided a computer readable storage medium, in which a computer program is stored, the computer program implementing the method steps of the BFD messaging method described above when executed by a processor.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects:
in the embodiment of the application, for any device in the BRAS-CP device and BRAS-UP device which establish the CUSP link and the corresponding BFD session, in the case that the session state of the locally recorded BFD session is the UP state, once the BFD message corresponding to the BFD session sent by the opposite terminal device is not received within a certain set period, the session state is not changed from the UP state to the Down state, but is changed from the UP state to the first temporary state, and the attempt is continued to send the corresponding BFD message to the opposite terminal device (the value in the reserved field carried in the BFD message is the second set value), so that the opposite terminal device is guided to change the intermediate link of the two related BFD messages in a mode of changing the source port of the related BFD message which is subsequently sent under the condition that the session state of the locally recorded BFD session is the UP state, thereby improving the sending success rate of the related BFD message, avoiding the occurrence of detection timeout of the BFD session, and further reducing the concussion of the CUSP link to a certain extent.
And if the BFD message corresponding to the BFD session sent by the opposite terminal 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 BFD message sent last time), and the BFD message is sent to the opposite terminal device through the determined output interface of the regenerated BFD message, namely, the transmission success rate of the related BFD message is further improved by attempting to change the intermediate link again, the concussion caused by the detection timeout of the BFD session is avoided to a certain extent, and the concussion of the CUSP link is further reduced.
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 as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic flow chart of a BFD message sending method according to an embodiment of the present application;
Fig. 2 is a schematic diagram of a networking architecture to which a BFD messaging method according to an embodiment of the present application is applicable;
fig. 3 is a schematic structural diagram of a BFD message 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 exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the application. Rather, they are merely examples of apparatus and methods consistent with aspects of the application as detailed in the accompanying 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 specification 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 or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited by 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 application. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
The embodiments 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 BRAS-CP equipment and BRAS-UP equipment, and a CUSP link and a corresponding BFD session thereof are established between the BRAS-CP equipment and the BRAS-UP equipment, as shown in figure 1, the method can comprise the following steps:
and S11, judging whether a first BFD message sent by the opposite terminal equipment is received or not when the set period is reached.
In this step, the session state of the BFD session carried in the first BFD packet is an UP state. And, the duration of the set period may include the duration of the BFD detection period and the retransmission duration corresponding to the BFD session.
Here, the setting period, the BFD detection period, and the retransmission duration may all be set according to the actual requirements of the network in which the device is located. The retransmission time period may be the same as the BFD detection period, but may be different from the BFD detection period, for example, the retransmission time period may be a multiple of the BFD detection period.
After executing the step S11, if the judging result is yes, if the session state of the locally recorded BFD session is an UP state, the device executes the step S12 and the step S13; if the session state of the locally recorded BFD session is the first temporary state, the device executes step S14 and step S13; if the session state of the locally recorded BFD session is the second temporary state, the apparatus performs step S15.
If the judging result is no, if the session state of the locally recorded BFD session is the UP state, the device executes step S16; if the session state of the locally recorded BFD session is the first temporary state, the device executes step S17; if the session state of the locally recorded BFD session is the second temporary state, the apparatus performs step S18.
S12, maintaining the session state of the BFD session recorded locally unchanged.
And S13, judging whether a 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, when judging that the value in the first reserved field is the first set value, transmitting the second BFD message to the opposite terminal device through an outlet interface determined when the BFD message corresponding to the BFD session transmitted to the opposite terminal device last time, and when judging that the value in the first reserved field is the second set value, regenerating a third BFD message corresponding to the BFD session, and transmitting the third BFD message to the opposite terminal device through an outlet interface of the determined third BFD message.
In this step, the first set value is used to indicate that the device does not need to regenerate the BFD packet corresponding to the BFD session sent to the peer device; the second set value is used for indicating that the device needs to regenerate the BFD messages corresponding to the BFD session sent to the peer 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 may be represented by other manners, which are not listed here.
In addition, in this step, 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 set value, and the source port of the third BFD packet is different from the source port of the second BFD packet, that is, the source port of the third BFD packet is different from the source port of the second BFD packet except for the five-tuple information of the third BFD packet and the five-tuple information of the second BFD packet, and other information (for example, information such as source IP, destination port of the third BFD packet and the like) of the third BFD packet and the five-tuple information of the second BFD packet are the same.
S14, changing the session state of the BFD session recorded locally into an UP state.
The apparatus continues to execute the above step S14 after executing the above step S15.
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.
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.
S17, changing the session state of the BFD session recorded locally into a second temporary state, and 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 output interface of the fifth BFD message.
In this step, the value in the third reserved field carried in the fifth BFD packet is a second set value, the session state of the carried BFD session is an UP state, and the source ports of the fifth BFD packet and the second BFD packet are different, that is, the source ports of the fifth BFD packet and the five-tuple information of the second BFD packet are different, and other information (for example, information such as source IP, destination port, etc. of the fifth BFD packet and the five-tuple information of the second BFD packet are the same.
S18, changing the session state of the BFD session recorded locally into a Down state.
It should be noted that, after the step S11 is performed, if the session state of the locally recorded BFD session is the first temporary state, this indicates that the session state is changed when the device does not receive 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 the device does not receive the BFD packet corresponding to the BFD session sent by the peer device in the last set period, and the session state of the currently recorded BFD session is changed in the first temporary state, and also indicates that the device does not receive the BFD packet corresponding to the BFD session sent by the peer device in the last set period, and the session state of the currently recorded BFD session is changed from the UP state to the first temporary state.
In addition, in the step S13, 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 locally recorded BFD session is the UP state, and at this time, the device still uses the BFD packet corresponding to the BFD session that was last sent to the peer device (referred to as the second BFD packet for convenience of distinguishing the first BFD packet), and sends the BFD packet to the peer device through the output interface that was last used when the second BFD packet was sent.
Once it is determined that the value in the first reserved field carried in the first BFD packet is the second set value, it means that the first BFD packet is sent by the peer device when the session state of the locally recorded BFD session is the first temporary state or the second temporary state, where the device needs to regenerate the third BFD packet, and then sends the third BFD packet to the peer device through the determined output interface of the third BFD packet.
Here, the source port of the third BFD packet may be a port on the device having a port number that is less than the port number of the source port of the second BFD packet. For example, the numerical value is set to 1 or the like.
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.
After the device regenerates the third BFD packet, the existing determining manner is still used to determine the output interface of the third BFD packet, for example, the MD5 hash algorithm is used to determine the output interface of the third BFD packet by performing a hash operation on the quintuple information of the third BFD packet, which is not described in detail herein.
It should be further noted that, by executing the step S16, the device may guide the peer device to change the intermediate link between the two by changing the mode of the source port of the related BFD packet sent later when the locally recorded session state of the BFD session is the UP state, thereby improving the sending success rate of the related BFD packet, avoiding oscillation caused by the time-out of the BFD session to a certain extent, and further reducing oscillation of the CUSP link.
The device further improves the sending success rate of the related BFD message by executing the step S17 and attempting to change the intermediate link again, so as to avoid oscillation caused by overtime of the BFD session to a certain extent and further reduce oscillation of the CUSP link.
Specifically, in the step S17, the source port of the fifth BFD packet regenerated by the device may also be a port with the port number of the source port of the second BFD packet subtracted by the set value; of course, any port on the device other than the source port of the second BFD packet may be used, and the selection manner of the source port of the fifth BFD packet is not limited.
The following describes the BFD messaging method in detail with reference to specific embodiments.
As shown in fig. 2, it is assumed that BRAS-CP device 1 and BRAS-UP device 1 establish a CUSP link 1 and its corresponding BFD session 1, and that BRAS-CP device 1 and BRAS-UP device 2 establish a CUSP link 2 and its corresponding BFD session 2. Wherein the BRAS-UP device 1 and the BRAS-UP device 2 have a master-slave relationship. Let the first set point be 0 and the second set point be 1.
It should be noted that fig. 2 also includes other communication devices, which are not shown 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 an UP state, in this case, BRAS-UP device 1 changes the session state of locally recorded BFD session 1 to a first temporary state (denoted as an IDLE1 state).
Assuming that a period of time has elapsed, 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 that is sent to the BRAS-CP device 1 last time to 1, and sends a changed BFD packet 2 to the BRAS-CP device 1 through an outgoing interface that is determined last time, for example, an interface on the BRAS-CP device 1 that is directly connected to the gateway device 1. Here, the session state of the BFD session 1 carried in the BFD packet 2 is an UP state.
That is, in this case, the BRAS-UP device 1 does not replace the source port first, but changes the value in the reserved field carried in the BFD packet 2 corresponding to the BFD session 1 that is sent to the BRAS-CP device 1 last time, so as to guide the BRAS-CP device 1 to change the source port, improve the sending success rate of the related BFD packet, avoid oscillation caused by the detection timeout of the BFD session to a certain extent, and further reduce the oscillation of the CUSP link.
The next set period is reached again, assuming that the BRAS-UP device 1 has not received the BFD packet 1 corresponding to the BFD session 1 sent by the BRAS-CP device 1, and the locally recorded session state of the BFD session 1 is the IDLE1 state, in this case, the BRAS-UP device 1 changes the locally recorded session state of the BFD session 1 to the second temporary state (denoted as the IDLE2 state).
Next, when the BFD detection period arrives again, the BRAS-UP device 1 regenerates the BFD packet 3 corresponding to the BFD session 1 (the port number of the corresponding source port is the port number of the source port of the 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 the BFD packet 3 to the BRAS-CP device 1 through the determined outgoing interface of the BFD packet 3, for example, the outgoing interface is the interface directly connected with the gateway device 2 on the BRAS-CP device 1. That is, the BRAS-UP device 1 transmits the BFD packet 3 to the BRAS-CP device 1 through the gateway device 2 and the leaf device 1.
That is, in this case, the BRAS-UP device 1 regenerates the relevant BFD packet by changing the source port, so as to attempt 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 caused by the time-out of the BFD session detection to a certain extent, and further reduce the oscillation of the CUSP link.
After the next setting period is reached, it is assumed that the BRAS-UP device 1 receives the BFD packet 1 corresponding to the BFD session 1 sent by the BRAS-CP device 1, and the session state of the locally recorded BFD session 1 is the IDLE2 state at this time, in this case, the BRAS-UP device 1 changes the session state of the locally recorded BFD session 1 to the UP state.
When the BFD detection period arrives again, it is assumed that the BRAS-UP device 1 determines that the value in the reserved field carried in the BFD packet 1 is 0, and at this time, the BRAS-UP device 1 sends the BFD packet 3 to the BRAS-CP device 1 through the outgoing interface (i.e., the interface directly connected to the gateway device 2) determined when the BFD packet 3 was last sent to the BRAS-CP device 1.
The process flow when each subsequent setting period arrives is not described in detail.
As can be seen from the above technical solutions, in the embodiments of the present application, in the case that a BRAS-CP device and any device in BRAS-UP device that establish a CUSP link and a corresponding BFD session create the CUSP link, in which the session state of the locally recorded BFD session is 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 changed from the UP state to the Down state directly, but is changed from the UP state to the first temporary state, and an attempt is continuously made to send a corresponding BFD packet to the peer device (the value in a reserved field carried in the BFD packet is a second set value), so that the peer device is guided to change the intermediate link of the two BFD packets by changing the source port of the corresponding BFD packet that is subsequently sent in the case that the session state of the locally recorded BFD session is the UP state, thereby improving the success rate of sending the corresponding BFD packet, detecting the BFD session to detect the corresponding BFD session from the UP state to a first temporary state, and reducing the concussion of the corresponding to the corresponding BFD session.
And if the BFD message corresponding to the BFD session sent by the opposite terminal 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 BFD message sent last time), and the BFD message is sent to the opposite terminal device through the determined output interface of the regenerated BFD message, namely, the transmission success rate of the related BFD message is further improved by attempting to change the intermediate link again, the concussion caused by the detection timeout of the BFD session is avoided to a certain extent, and the concussion of the CUSP link is further reduced.
Based on the same inventive concept, the application also provides a BFD message sending device, which is applied to any one of a BRAS-CP device and a BRAS-UP device, and a CUSP link and a corresponding BFD session thereof are established between the BRAS-CP device and the BRAS-UP device, wherein the structural schematic diagram is shown in figure 3, and the BFD message sending device specifically comprises:
the judging module 31 is configured to judge whether a first BFD packet corresponding to the BFD session sent by the peer device is received when a set period arrives, 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 judging result of the judging module 31 is yes, keep the session state of the locally recorded BFD session unchanged if the session state of the locally recorded BFD session is an UP state, and judge 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 judging module 31 judges that the value in the first reserved field is the first set value, send, through an output interface determined when a second BFD packet corresponding to the BFD session is sent to the opposite end device for the last time, the second BFD packet to the opposite end device, and regenerate a third BFD packet corresponding to the BFD session when the judging that the value in the first reserved field is the second set value, and send, through an output interface of the determined third BFD packet, the third BFD packet to the opposite end device, the third BFD packet, where the first set value is used to indicate that the value in the first reserved field is not required to be sent to the opposite end device, and the second BFD packet is the second set value and the second set value carried in the opposite end device, and the second BFD packet is not required to be generated; if the session state of the locally recorded BFD session is a first temporary state, changing the session state of the locally recorded BFD session into an UP state, and starting to execute the 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 locally recorded BFD session is a second temporary state, changing the session state of the locally recorded BFD session into an UP state, and sending the second BFD message to the opposite terminal equipment through the last determined outlet interface when the BFD detection period is reached;
A second sending module 32, configured to, when the determination result of the determining module 31 is no, change the session state of the locally recorded BFD session to the first temporary state if the session state of the locally recorded BFD session is an UP state, and 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 an output interface determined last time; if the session state of the locally recorded BFD session is the first temporary state, changing the session state of the locally recorded BFD session into the second temporary state, and regenerating a fifth BFD packet corresponding to the BFD session when the BFD detection period is reached, and sending the fifth BFD packet to the peer device through an output interface of the determined 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 session state of the locally recorded BFD session is the second temporary state, changing the session state of the locally recorded BFD session to 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 ports with the port number on the device being 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 any port on the device except the source port of the second BFD packet.
As can be seen from the above technical solutions, in the embodiments of the present application, in the case that a BRAS-CP device and any device in BRAS-UP device that establish a CUSP link and a corresponding BFD session create the CUSP link, in which the session state of the locally recorded BFD session is 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 changed from the UP state to the Down state directly, but is changed from the UP state to the first temporary state, and an attempt is continuously made to send a corresponding BFD packet to the peer device (the value in a reserved field carried in the BFD packet is a second set value), so that the peer device is guided to change the intermediate link of the two BFD packets by changing the source port of the corresponding BFD packet that is subsequently sent in the case that the session state of the locally recorded BFD session is the UP state, thereby improving the success rate of sending the corresponding BFD packet, detecting the BFD session to detect the corresponding BFD session from the UP state to a first temporary state, and reducing the concussion of the corresponding to the corresponding BFD session.
And if the BFD message corresponding to the BFD session sent by the opposite terminal 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 BFD message sent last time), and the BFD message is sent to the opposite terminal device through the determined output interface of the regenerated BFD message, namely, the transmission success rate of the related BFD message is further improved by attempting to change the intermediate link again, the concussion caused by the detection timeout of the BFD session is avoided to a certain extent, and the concussion of the CUSP link is further reduced.
An embodiment of the present application also provides an electronic device, as shown in fig. 4, including a processor 41 and a machine-readable storage medium 42, the machine-readable storage medium 42 storing machine-executable instructions executable by the processor 41, the processor 41 being caused by the machine-executable instructions to: the BFD message sending method is realized.
The machine-readable storage medium may include random access Memory (Random Access Memory, RAM) or Non-Volatile Memory (NVM), such as at least one magnetic disk Memory. In the alternative, the machine-readable storage medium may also be at least one memory device located remotely from the foregoing processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present application, a computer readable storage medium is provided, where a computer program is stored, the computer program implementing the steps of the BFD messaging method described above when executed by a processor.
The foregoing description of the preferred embodiments of the application is not intended to be limiting, but rather to enable any modification, equivalent replacement, improvement or the like to be made within the spirit and principles of the application.

Claims (10)

1. The method is applied to any one of a broadband remote access server (BRAS-control plane CP) device and a BRAS-user plane UP device, and a control plane and user plane separation protocol (CUSP) link and a corresponding BFD session are established between the BRAS-CP device and the BRAS-UP device, 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 the opposite terminal equipment is received, wherein the session state of the BFD session carried in the first BFD message is an UP state establishment, and the duration of the set period comprises the duration of a BFD detection period and retransmission duration corresponding to the BFD session;
if the judging result is yes, if the session state of the BFD session of the local record is an UP state, keeping the session state of the BFD session of the local record unchanged, judging whether a value in a first reserved field carried in the first BFD message is a first set value or a second set value when the value in the first reserved field is the first set value, sending the second BFD message to the opposite end device through an outlet interface determined when a second BFD message corresponding to the BFD session is sent to the opposite end device for the last time, and regenerating a third BFD message corresponding to the BFD session when the value in the first reserved field is the second set value, and sending the third BFD message to the opposite end device through an outlet interface of the determined third BFD message, wherein the first set value is used for indicating that the device does not need to regenerate the second set value of the BFD message corresponding to the opposite end device, and the second set value is not carried in the second BFD message corresponding to the second set value, and the second BFD message corresponding to the BFD session is not carried in the second set value;
If the session state of the locally recorded BFD session is a first temporary state, changing the session state of the locally recorded BFD session into an UP state, and starting to execute the 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 sending the second BFD message to the opposite terminal equipment through the last determined outlet interface when the BFD detection period is reached;
if the judging result is that the session state of the BFD session recorded locally is the UP state, changing the session state of the BFD session recorded locally into the first temporary state, changing the 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 device through the interface determined last time;
if the session state of the locally recorded BFD session is the first temporary state, changing the session state of the locally recorded BFD session into the second temporary state, and regenerating a fifth BFD packet corresponding to the BFD session when the BFD detection period is reached, and sending the fifth BFD packet to the peer device through an output interface of the determined 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 session state of the BFD session recorded locally is the second temporary state, changing the session state of the BFD session recorded locally 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 of claim 1, wherein the source ports of the third BFD packet and the fifth BFD packet are each a port on the device having a port number that is 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 port 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, messaging apparatus, wherein the apparatus is applied to any one of a broadband remote access server, BRAS, control plane CP, device and BRAS-user plane UP, device, and a control plane and user plane separation protocol, CUSP, link and a BFD session corresponding thereto are established between the BRAS-CP device and the BRAS-UP device, the apparatus comprising:
The judging module is used for judging whether a first BFD message corresponding to the BFD session sent by the opposite terminal equipment is received or not when a set period arrives, 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 retransmission duration corresponding to the BFD session;
a first sending module, configured to, when the judging result of the judging module is yes, keep the session state of the locally recorded BFD session unchanged if the session state of the locally recorded BFD session is an UP state, and judge 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 judging result of the first reserved field is a first set value, send, through an output interface determined when a second BFD packet corresponding to the BFD session is sent to the opposite end device for the first time, the second BFD packet to the opposite end device, and regenerate a third BFD packet corresponding to the BFD session when the judging result of the first reserved field is a second set value, and send, through an output interface of the determined third BFD packet, the third BFD packet to the opposite end device, the third BFD packet, where the first set value is used to indicate that the device does not need to regenerate the second set value, and the second BFD packet is a second set value carried in the opposite end device; if the session state of the locally recorded BFD session is a first temporary state, changing the session state of the locally recorded BFD session into an UP state, and starting to execute the 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 locally recorded BFD session is a second temporary state, changing the session state of the locally recorded BFD session into an UP state, and sending the second BFD message to the opposite terminal equipment through the last determined outlet interface when the BFD detection period is reached;
The second sending module is configured to, when the determination result of the determining module is no, change the session state of the locally recorded BFD session to the first temporary state if the session state of the locally recorded BFD session is an UP state, and 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 an output interface determined last time; if the session state of the locally recorded BFD session is the first temporary state, changing the session state of the locally recorded BFD session into the second temporary state, and regenerating a fifth BFD packet corresponding to the BFD session when the BFD detection period is reached, and sending the fifth BFD packet to the peer device through an output interface of the determined 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 session state of the locally recorded BFD session is the second temporary state, changing the session state of the locally recorded BFD session to a disconnected Down state.
6. The apparatus of claim 5, wherein the first setting is 0 and the second setting is 1.
7. The apparatus of claim 5, wherein the source ports of the third BFD packet and the fifth BFD packet are each the port number on the device that is the port number of the source port of the second BFD packet minus the set value.
8. The apparatus of claim 5, wherein the source port 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.
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: method steps of any of claims 1-4 are achieved.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-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 CN114205405A (en) 2022-03-18
CN114205405B true 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
CN114205405A (en) 2022-03-18

Similar Documents

Publication Publication Date Title
US9270536B2 (en) BGP slow peer detection
EP3522417A1 (en) Method and device for sending messages, chip and terminal
WO2011151884A1 (en) Communication apparatus and communication method
WO2012174934A1 (en) Adaptive method and device for heartbeat period
US9736244B2 (en) Peer revival detection
KR101419579B1 (en) Method for enabling faster recovery of client applications in the event of server failure
CN109245961B (en) Link quality detection method, device, storage medium and equipment
CN107465613B (en) Link aggregation interface communication state switching method and device
CN114422571B (en) Quantum communication client disconnection reconnection system and method
US20140036662A1 (en) Tcp relay apparatus
US9246751B2 (en) Ethernet ring protection switching method, network device and system
CN111147573A (en) Data transmission method and device
US20190075189A1 (en) Method and system for wireless network bilateral accelerated transmission
US20170331755A1 (en) Discovering Path Maximum Transmission Unit
US10298487B2 (en) Method and device for transmitting data
US10680930B2 (en) Method and apparatus for communication in virtual network
KR102435334B1 (en) Adaptive Bidirectional Forwarding Detection protocol and equipment for maximizing service availability in network system
CN114205405B (en) BFD message sending method and device, electronic equipment and storage medium
CN110192378B (en) Apparatus and method for controlling use of non-optimal path
Cisco Configuring IP Services
CN112929417A (en) Message processing method and device
CN106992878B (en) Multicast detection method and device
CN111224803A (en) Multi-master detection method in stacking system and stacking system
WO2023273838A1 (en) Method and apparatus for establishing session on basis of bfd technology, and network device and computer storage medium
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