A method, device and storage medium for switching BFD message length
By sending a pre-switching message in a BFD session to notify the peer to switch the BFD message length, the problem of BFD session interruption is solved, and the stable switching of the BFD message length and the stability of the BFD session are achieved.
Patent Information
- Application Number
- CN202010104826.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-20
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2040-02-20
AI Technical Summary
In a BFD session, when one end enables large-size BFD message transmission, but the peer does not support large-size BFD message processing, the BFD session is interrupted.
By sending pre-switching messages between both ends of the BFD session, the peer is notified to switch the BFD message length to the preset length, and the corresponding BFD message length switching operation is performed based on the feedback from the peer.
The BFD packet length switching is realized, which avoids BFD session interruption and ensures the stability of the BFD session.
Smart Images

Figure CN112511265B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to a wired communication network, and in particular to a method, device and storage medium for switching the length of a BFD message. Background Art
[0002] The Bidirectional Forwarding Detection (BFD) protocol running in asynchronous mode allows large-sized BFD packets to be sent between the two ends of a BFD session for packet forwarding path maximum transmission unit (MTU) verification. If one end of a BFD session enables the sending of large-sized BFD packets, but the other end of the BFD session does not support the processing of large-sized BFD packets, the other end will directly discard the received large-sized BFD packets, which will cause the BFD session to be interrupted. Summary of the invention
[0003] The present application provides a method, device and storage medium for BFD message length switching, which implements BFD message length switching and avoids BFD session interruption.
[0004] The embodiment of the present application provides a method for switching the length of a BFD message, including:
[0005] When it is necessary to switch the bidirectional forwarding detection BFD message length to a preset length, a pre-switching message is sent to the second node in addition to the current BFD message; wherein a BFD session running in an asynchronous mode is established between the first node and the second node, and the pre-switching message is configured to notify the second node that the current BFD message length is to be switched to the preset length;
[0006] When receiving the reply message fed back by the second node to the pre-switching message, a corresponding BFD message length switching operation is performed.
[0007] The embodiment of the present application provides a method for switching the length of a BFD message, including:
[0008] When a pre-switching message sent by the first node is received, a reply message for the pre-switching message is fed back to the first node; wherein a BFD session running in asynchronous mode is established between the second node and the first node, and the pre-switching message is configured to notify the second node that the current BFD message length is to be switched to a preset length.
[0009] The embodiment of the present application provides a device for switching the length of a BFD message, including:
[0010] A first sending module, used for sending a pre-switching message;
[0011] A first receiving module, used for receiving a reply message;
[0012] At least one processor configured to:
[0013] When it is necessary to switch the bidirectional forwarding detection BFD message length to a preset length, a pre-switching message is sent to the second node in addition to the current BFD message; wherein a BFD session running in an asynchronous mode is established between the first node and the second node, and the pre-switching message is configured to notify the second node that the current BFD message length is to be switched to the preset length;
[0014] When receiving the reply message fed back by the second node to the pre-switching message, a corresponding BFD message length switching operation is performed.
[0015] The embodiment of the present application provides a device for switching the length of a BFD message, including:
[0016] A second receiving module, used for receiving a pre-switching message;
[0017] A second sending module, used for sending a reply message;
[0018] At least one processor configured to:
[0019] When a pre-switching message sent by the first node is received, a reply message for the pre-switching message is fed back to the first node; wherein a BFD session running in asynchronous mode is established between the second node and the first node, and the pre-switching message is configured to notify the second node that the current BFD message length is to be switched to a preset length.
[0020] An embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, any one of the methods in the embodiments of the present application is implemented.
[0021] In the embodiment of the present application, a pre-switching message is sent by a first node to a second node, thereby implementing BFD message length switching and avoiding BFD session interruption.
[0022] With regard to the above embodiments and other aspects of the present application and their implementation, further description is provided in the accompanying drawings, detailed description and claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A schematic diagram of a mandatory fixed-size segment encapsulation format of a common BFD message in an embodiment of the present application;
[0024] Figure 2 A schematic diagram of an optional security authentication message segment encapsulation format of a common BFD message in an embodiment of the present application;
[0025] Figure 3 This is a flow chart of a method for switching BFD message length in an embodiment of the present application;
[0026] Figure 4 This is a flow chart of a method for switching BFD message length in an embodiment of the present application;
[0027] Figure 5 This is a flow chart of a method for switching BFD message length in an embodiment of the present application;
[0028] Figure 6 A schematic diagram of the structure of a device for switching BFD message length in an embodiment of the present application;
[0029] Figure 7 A structural schematic diagram of a device for switching BFD message length in an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the present application more clear, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other arbitrarily without conflict.
[0031] The BFD basic protocol defined by the IETF (The Internet Engineering Task Force) standard RFC (Request For Comments) 5880 describes two working modes for implementing bidirectional forwarding detection after a BFD session is successfully established, namely, asynchronous mode and demand mode.
[0032] In asynchronous mode, network nodes at both ends of a BFD session periodically send BFD packets to each other. If one end of the BFD session does not receive a BFD packet from the other end within a certain detection time, it declares that the BFD session has changed from the Up state to the Down state, and may trigger subsequent operations such as protection switching.
[0033] In query mode, both ends of the BFD session have independent methods to confirm the connectivity between them. The two ends of the BFD session do not periodically send BFD messages to each other. Only when one end starts connectivity verification on demand will it send a group of BFD messages to the other end, and the other end will reply to the group of BFD messages. If the sending end does not receive a response message from the other end within a certain detection time, it will declare that the BFD session has changed from the running (Up) state to the terminated (Down) state, and may trigger subsequent operations such as protection switching.
[0034] The BFD basic protocol defined by IETF standard RFC 5880 stipulates that the BFD message includes a mandatory fixed-size message segment and an optional security authentication message segment. The mandatory fixed-size message segment is 24 bytes long and the encapsulation format is as follows: Figure 1 As shown in the figure, the A bit is used to identify whether the BFD message contains an optional security authentication message segment. A bit 1 indicates that the optional security authentication message segment is included, and A bit 0 indicates that the optional security authentication message segment is not included. The length of the optional security authentication message segment is not fixed and varies with the selected security authentication mechanism. Its length ranges from 2 bytes to 28 bytes. The encapsulation format is as follows: Figure 2 As shown. In summary, the BFD basic protocol RFC 5880 only allows the size of the BFD message to vary within a very small range, with a minimum size of 24 bytes and a maximum size of 52 bytes. This BFD message specified in RFC 5880 is referred to as an ordinary BFD message in the embodiment of the present application. Its size limitation makes it impossible for the BFD basic protocol to be used to verify the MTU of the message forwarding path. In order to break through the size limitation of ordinary BFD messages, the IETF standard proposal draft-ietf-bfd-large-packets proposes a large-size BFD message. The large-size BFD message can greatly increase the size of the BFD message by adding a padding segment (Padding) after the ordinary BFD message, so as to meet the purpose of using the BFD protocol to verify the MTU of the message forwarding path.
[0035] The BFD basic protocol defined in IETF standard RFC 5880 allows modification of BFD protocol parameters through a Poll / Final mechanism during a BFD session running in asynchronous mode. For example, when one end of a BFD session wants to modify the sending period of a BFD message, the Desired Min TX Interval field in the BFD message sent by the end according to the original period will be modified to the new sending period. At the same time, the P bit in the BFD message is set to 1, indicating that the sending period is to be modified. After receiving the BFD message with the P bit set to 1 and containing the new sending period, the other end will immediately reply with a BFD message with the F bit set to 1 as a response. The BFD message replied by the other end is independent of other BFD messages periodically sent by the other end. Once the BFD message with the F bit set to 1 is received from the other end, the notifying end will immediately stop sending BFD messages with the P bit set to 1 and resume sending BFD messages with the P bit set to 0. Otherwise, the notifying end will continue to send BFD messages with the P bit set to 1.
[0036] The embodiment of the present application adapts the BFD protocol parameter modification mechanism specified in the above-mentioned RFC 5880, and then applies it to the process of switching from ordinary BFD packets to large-size BFD packets, thereby overcoming the problem that the above-mentioned switching process causes the BFD session to be interrupted when the BFD session receiving end does not support the processing of large-size BFD packets.
[0037] In the embodiment of the present application, Figure 3 A flow chart of a method for switching the length of a BFD message is shown, the method comprising:
[0038] S310, when the length of the BFD message for bidirectional forwarding detection that needs to be switched is a preset length, sending a pre-switching message to the second node in addition to the current BFD message;
[0039] S320: When receiving a reply message fed back by the second node in response to the pre-switching message, perform a corresponding BFD message length switching operation.
[0040] Among them, a BFD session running in asynchronous mode is established between the first node and the second node, and the pre-switching message is set to notify the second node that the current BFD message length is to be switched to the preset length. The first node, as the local node that initiates the BFD message length switching, needs to send a pre-switching message to the second node, that is, the opposite node of the BFD session, when the BFD message length switching is required, especially when the preset length is greater than the current BFD message length. If the second node can process the pre-switching message, the second node will immediately feedback a reply message after receiving the pre-switching message. In this way, the first node can confirm that the second node can process the pre-switching message, and then it can perform the corresponding BFD message length switching operation to switch the current BFD message to a BFD message of the preset length, and the second node will not discard the pre-switching message because it cannot process the pre-switching message, resulting in a BFD session interruption.
[0041] In one embodiment, when the length of the bidirectional forwarding detection BFD message needs to be switched to a preset length, sending a pre-switching message to the second node in addition to the current BFD message includes:
[0042] When the maximum transmission unit MTU verification of the message forwarding path is started, the pre-switching message is sent to the second node in addition to the current BFD message; wherein the pre-switching message is set to have a message length of the preset length, and a first preset bit position is located at a first preset value, and the length of the current BFD message is less than the preset length.
[0043] When it is necessary to verify the MTU of the message forwarding path, the first node needs to send a large-size BFD message whose length is greater than that of an ordinary BFD message. In this case, the first node will send a pre-switching message to the second node in addition to the current BFD message. Moreover, the preset length is greater than the length of the current BFD message, and based on the notification / response mechanism, the first preset bit position in the pre-switching message is at the first preset value, thereby notifying the second node to respond to the pre-switching message to feedback a reply message. The reply message fed back by the second node can be set to have the second preset bit position at the first preset value.
[0044] In one implementation, the pre-switching message is set with the P bit position at 1.
[0045] In one embodiment, performing a corresponding BFD message length switching operation includes:
[0046] The current BFD message is replaced with a length-switched BFD message; wherein the length-switched BFD message is set to have a message length of the preset length. After the first node receives the reply message fed back by the second node, it can be determined that the conditions for switching the BFD message length have been met. At this time, the current BFD message is replaced with a length-switched BFD message, and the length-switched BFD message continues to be sent according to the period of the current BFD message, and the P bit position of the length-switched BFD message is 0.
[0047] In one embodiment, when the length of the bidirectional forwarding detection BFD message needs to be switched to a preset length, after sending a pre-switching message to the second node in addition to the current BFD message, the method further includes:
[0048] When the reply message fed back by the second node in response to the pre-switching message is not received within a preset time, corresponding fault alarm information is reported.
[0049] Among them, when the first node sends a pre-switching message, a period for sending the pre-switching message can be pre-set, and the period is independent of the current BFD message sending period, but can be greater than the current BFD message sending period. If the second node does not receive a reply message for the pre-switching message feedback within the preset time, it indicates that the conditions for switching the BFD message to a length-switched BFD message of the preset length are not met, and an alarm message of a failure in switching the BFD message length needs to be reported to the network management system. Optionally, the preset time is 3-5 times the period of the pre-switching message.
[0050] In the embodiment of the present application, Figure 4 A flow chart of a method for switching the length of a BFD message is shown, the method comprising:
[0051] S410: When a pre-switching message sent by a first node is received, a reply message for the pre-switching message is fed back to the first node.
[0052] Among them, a BFD session running in asynchronous mode is established between the second node and the first node, and the pre-switching message is set to notify the second node that the current BFD message length is to be switched to a preset length. When the second node is able to process the pre-switching message, the second node will immediately feedback a reply message after receiving the pre-switching message to inform the first node that the BFD message length can be switched to a BFD message of a preset length.
[0053] In one embodiment, the reply message is set so that the second preset bit position is at the first preset value.
[0054] Among them, based on the notification / response mechanism, the first preset bit position in the received pre-switching message is set to the first preset value, thereby notifying the second node to respond to the pre-switching message. Then, as a response, the reply message fed back by the second node can be set to the second preset bit position at the first preset value.
[0055] In one embodiment, the reply message is set with the F bit position at 1.
[0056] In an exemplary embodiment, Figure 5 A flow chart showing a method for switching the length of a BFD packet is shown, the method comprising:
[0057] S510. Both ends of a BFD session periodically send common BFD packets to each other. One end starts verification of the MTU of a packet forwarding path. The sent BFD packets need to be switched from common BFD packets to large-size BFD packets.
[0058] S520: After one end of the BFD session starts path MTU verification, it continuously sends large-size BFD packets with the P bit set to 1 for a preset period of time, independently of the periodically sent ordinary BFD packets. Here, the reason for sending ordinary BFD packets and large-size BFD packets with the P bit set to 1 at the same time is to maintain the BFD session without interruption during the switching process. If, as in the BFD protocol parameter modification mechanism specified in RFC 5880, large-size BFD packets with the P bit set to 1 replace ordinary BFD packets during the switching process, then if the other end does not support the processing of large-size BFD packets, the BFD session will be interrupted. The frequency of sending large-size BFD packets with the P bit set to 1 by the end that starts path MTU verification can be determined according to the sending capability of the local end.
[0059] S530, the end that starts the path MTU verification determines whether it has received a normal BFD message with the F bit set to 1 from the other end within a preset period of time. After the other end of the BFD session receives a large-size BFD message with the P bit set to 1, it immediately replies with an ordinary BFD message with the F bit set to 1 as a response. Here, the reason for replying with an ordinary BFD message with the F bit set to 1 instead of replying with a large-size BFD message with the F bit set to 1 is to prevent the length of the replied large-size BFD message from exceeding the MTU of the reverse message forwarding path, causing the loss of the reply message. At the same time, the other end continues to receive ordinary BFD messages to ensure that the BFD session will not be interrupted.
[0060] S540: If the end that starts the path MTU verification receives a normal BFD message with the F bit set to 1 from the other end, it indicates that the switching process is successful, and the normal BFD message is replaced by a large-size BFD message with the P bit set to 0, and the sending period is the same as the original sending period.
[0061] S550. If, after a preset period of time, the end that starts the path MTU verification does not receive the ordinary BFD message with the F bit set to 1 replied by the other end, a fault alarm is reported, and the ordinary BFD message with the P bit set to 0 is continued to be periodically sent. There are two situations in which the end that starts the path MTU verification does not receive the ordinary BFD message with the F bit set to 1 replied by the other end. One is that the other end does not support the processing of large-size BFD messages, and the other is that the length of the large-size BFD message exceeds the message forwarding path MTU. Either of these two situations will result in the failure to receive the ordinary BFD message with the F bit set to 1 replied by the other end.
[0062] Of the two ends of the BFD session, the end that starts path MTU verification sends large-size BFD packets with the P bit set to 1, which are independent of ordinary BFD packets, before switching to sending large-size BFD packets. The feasibility of switching to large-size BFD packets is determined based on whether an ordinary BFD packet with the F bit set to 1 is received from the other end in reply, while the BFD session is kept uninterrupted.
[0063] In the embodiment of the present application, Figure 6 A device for switching the length of a BFD message is shown, and the device includes:
[0064] A first sending module 610, configured to send a pre-switching message;
[0065] A first receiving module 620, configured to receive a reply message;
[0066] At least one processor configured to:
[0067] When it is necessary to switch the bidirectional forwarding detection BFD message length to a preset length, a pre-switching message is sent to the second node in addition to the current BFD message; wherein a BFD session running in an asynchronous mode is established between the first node and the second node, and the pre-switching message is configured to notify the second node that the current BFD message length is to be switched to the preset length;
[0068] When receiving the reply message fed back by the second node to the pre-switching message, a corresponding BFD message length switching operation is performed.
[0069] In one embodiment, when the length of the bidirectional forwarding detection BFD message needs to be switched to a preset length, sending a pre-switching message to the second node in addition to the current BFD message includes:
[0070] When the maximum transmission unit MTU verification of the message forwarding path is started, the pre-switching message is sent to the second node in addition to the current BFD message; wherein the pre-switching message is set to have a message length of the preset length, and a first preset bit position is located at a first preset value, and the length of the current BFD message is less than the preset length.
[0071] In one implementation, the pre-switching message is set with the P bit position at 1.
[0072] In one embodiment, performing a corresponding BFD message length switching operation includes:
[0073] The current BFD message is replaced with a length-switched BFD message; wherein the length-switched BFD message is set to have a message length equal to the preset length.
[0074] In one embodiment, when the length of the bidirectional forwarding detection BFD message needs to be switched to a preset length, after sending a pre-switching message to the second node in addition to the current BFD message, the method further includes:
[0075] When the reply message fed back by the second node in response to the pre-switching message is not received within a preset time, corresponding fault alarm information is reported.
[0076] In the embodiment of the present application, Figure 7 A device for switching the length of a BFD message is shown, and the device includes:
[0077] The second receiving module 710 is used to receive a pre-switching message;
[0078] The second sending module 720 is used to send a reply message;
[0079] At least one processor configured to:
[0080] When a pre-switching message sent by the first node is received, a reply message for the pre-switching message is fed back to the first node; wherein a BFD session running in asynchronous mode is established between the second node and the first node, and the pre-switching message is configured to notify the second node that the current BFD message length is to be switched to a preset length.
[0081] In one embodiment, the reply message is set so that the second preset bit position is at the first preset value.
[0082] In one embodiment, the reply message is set with the F bit position at 1.
[0083] An embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, any one of the methods in the embodiments of the present application is implemented.
[0084] The above description is merely an exemplary embodiment of the present application and is not intended to limit the protection scope of the present application.
[0085] It will be appreciated by those skilled in the art that the term user terminal covers any suitable type of wireless user equipment, such as a mobile phone, a portable data processing device, a portable web browser or a vehicle-mounted mobile station.
[0086] In general, various embodiments of the present application can be implemented in hardware or dedicated circuits, software, logic or any combination thereof. For example, some aspects can be implemented in hardware, while other aspects can be implemented in firmware or software that can be executed by a controller, microprocessor or other computing device, although the present application is not limited thereto.
[0087] Embodiments of the present application may be implemented by executing computer program instructions by a data processor of a mobile device, for example in a processor entity, or by hardware, or by a combination of software and hardware. The computer program instructions may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages.
[0088] The block diagram of any logic flow in the accompanying drawings of the present application can represent program steps, or can represent interconnected logic circuits, modules and functions, or can represent a combination of program steps and logic circuits, modules and functions. The computer program can be stored in a memory. The memory can have any type suitable for the local technical environment and can be implemented using any suitable data storage technology, such as but not limited to read-only memory (ROM), random access memory (RAM), optical memory device and system (digital versatile disc DVD or CD disc), etc. Computer-readable media may include non-transient storage media. The data processor can be any type suitable for the local technical environment, such as but not limited to a general-purpose computer, a special-purpose computer, a microprocessor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a programmable logic device (FGPA) and a processor based on a multi-core processor architecture.
[0089] By way of exemplary and non-limiting examples, a detailed description of exemplary embodiments of the present application has been provided above. However, various modifications and adjustments to the above embodiments will be apparent to those skilled in the art when considered in conjunction with the accompanying drawings and claims, but will not depart from the scope of the present invention. Therefore, the proper scope of the present invention will be determined according to the claims.
Claims
1. A method for switching BFD message length, characterized in that: include: When it is necessary to switch the bidirectional forwarding detection BFD message length to a preset length, a pre-switching message is sent to the second node in addition to the current BFD message; wherein a BFD session running in an asynchronous mode is established between the first node and the second node, and the pre-switching message is configured to notify the second node that the current BFD message length is to be switched to the preset length; the pre-switching message is a BFD message whose message length is the preset length; When receiving the reply message fed back by the second node to the pre-switching message, a corresponding BFD message length switching operation is performed.
2. The method according to claim 1, characterized in that When the length of the BFD message for bidirectional forwarding detection to be switched is a preset length, a pre-switching message is sent to the second node in addition to the current BFD message, including: When starting the message forwarding path maximum transmission unit MTU verification, the pre-switching message is sent to the second node in addition to the current BFD message; wherein the first preset bit position is located at a first preset value, and the length of the current BFD message is less than the preset length.
3. The method according to claim 2, characterized in that The pre-switching message is set with the P bit at 1.
4. The method according to claim 1, characterized in that Perform the corresponding BFD packet length switching operation, including: The current BFD message is replaced with a length-switched BFD message; wherein the length-switched BFD message is set to have a message length equal to the preset length.
5. The method according to any one of claims 1 to 4, characterized in that: When the length of the bidirectional forwarding detection BFD message that needs to be switched is a preset length, after sending a pre-switching message to the second node in addition to the current BFD message, the method further includes: When the reply message fed back by the second node in response to the pre-switching message is not received within a preset time, corresponding fault alarm information is reported.
6. A method for switching BFD message length, characterized in that: include: When a pre-switching message is received from the first node outside the current BFD message, a reply message for the pre-switching message is fed back to the first node; wherein a BFD session running in asynchronous mode is established between the second node and the first node, and the pre-switching message is configured to notify the second node that the current BFD message length is switched to a preset length; the pre-switching message is a BFD message whose message length is the preset length.
7. The method according to claim 6, characterized in that The reply message is set such that the second preset bit position is at the first preset value.
8. The method according to claim 7, characterized in that The reply message is set with the F bit position at 1.
9. A device for switching BFD message length, characterized in that: include: A first sending module, used for sending a pre-switching message; A first receiving module, used for receiving a reply message; At least one processor configured to: When it is necessary to switch the bidirectional forwarding detection BFD message length to a preset length, a pre-switching message is sent to the second node in addition to the current BFD message; wherein a BFD session running in an asynchronous mode is established between the first node and the second node, and the pre-switching message is configured to notify the second node that the current BFD message length is to be switched to the preset length; the pre-switching message is a BFD message whose message length is the preset length; When receiving the reply message fed back by the second node to the pre-switching message, a corresponding BFD message length switching operation is performed.
10. A device for switching BFD message length, characterized in that: include: A second receiving module, used for receiving a pre-switching message; A second sending module, used for sending a reply message; At least one processor configured to: When a pre-switching message is received from the first node outside the current BFD message, a reply message for the pre-switching message is fed back to the first node; wherein a BFD session running in asynchronous mode is established between the second node and the first node, and the pre-switching message is configured to notify the second node that the current BFD message length is switched to a preset length; the pre-switching message is a BFD message whose message length is the preset length.
11. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Method and system for negotiating bidirectional forwarding detection session identifier for pseudo wire
CN101212400A
Apparatus and method for malfunction detection
CN101252476A