WO2016192282A1 - 链路检测方法和装置 - Google Patents
链路检测方法和装置 Download PDFInfo
- Publication number
- WO2016192282A1 WO2016192282A1 PCT/CN2015/092858 CN2015092858W WO2016192282A1 WO 2016192282 A1 WO2016192282 A1 WO 2016192282A1 CN 2015092858 W CN2015092858 W CN 2015092858W WO 2016192282 A1 WO2016192282 A1 WO 2016192282A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- terminal
- bfd
- packet
- bfd packet
- sent
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
Definitions
- the present invention relates to the field of data communication technologies, and in particular, to a link detection method and apparatus.
- BFD Bidirectional Forwarding Detection
- a BFD session is created at both ends.
- the creation of the BFD session is not possible.
- the device will notify the hardware to configure a BFD session.
- One end is configured to receive the negotiation success packet and the other end is in the negotiation. If the configuration is successful, there will be a certain delay when creating BFD at both ends. If the one end of the configuration is not received, the device will issue a Down alarm, which may cause a switchover that should not occur. The switchover is performed because the packets received at both ends are not synchronized. The link to the main link is incorrect, and the protection link is enabled to transmit data.
- the hardware detects whether the link is correct, such as the time in the BFD packet.
- this negotiation to session creation and verification can be processed quickly.
- the CPU is configured to process too much software interface information, so that the CPU cannot process the BFD packets to be sent in time.
- the session of the BFD session that is in the INIT or the UP state is returned to the Down state due to the timeout.
- HSB Hot-standby
- switchback if a physical port has many TE-LSPs, it corresponds to a large number of BFD sessions.
- the BFD packet is not processed in a timely manner.
- the switchback is performed when the protection link is enabled to transmit data.
- the main link is detected to be normal and needs to be returned to the primary link for transmission. Therefore, the traditional BFD detection mechanism is unreliable.
- the embodiment of the invention provides a link detection method and device, which aims to improve the reliability of the BFD detection mechanism at least.
- a method for detecting a link includes the following steps: after the BFD protocol negotiation between the first terminal and the second terminal is successful, the second terminal generates a first BFD report. And sending the first BFD packet to the first terminal, and the second terminal does not receive the second BFD packet that is sent by the first terminal based on the first BFD packet, and When the number of times that the second terminal sends the first BFD packet is greater than or equal to a preset threshold, the second terminal determines that the link between the first terminal and the first terminal is faulty.
- the second terminal After the step of determining that the link between the second terminal and the first terminal is faulty, the second terminal sends a fault alarm message and stops sending BFD packets.
- the method further includes: receiving, by the second terminal, a second BFD packet that is sent by the first terminal based on the first BFD packet, and the second terminal sending the first BFD packet When the number of times is less than a preset threshold, the second terminal determines that the link between the second terminal and the first terminal is normal.
- the second terminal Receiving, by the second terminal, the second BFD packet that is sent by the first terminal based on the first BFD packet, and the number of times that the second terminal sends the first BFD packet is less than a preset And the step of determining, by the second terminal, that the link between the first terminal and the first terminal is normal, the second terminal, when receiving the second BFD packet that is fed back by the first terminal according to the first BFD packet And determining, by the first terminal, whether the second BFD packet is a keep-alive packet; if the second BFD packet is a keep-alive packet, verifying the second BFD packet, if the verification succeeds And the second terminal determines that the link between the second terminal and the first terminal is normal.
- the step of determining whether the second BFD packet fed back by the first terminal is a keep-alive packet includes: calculating, according to a period of the second BFD packet fed back by the first terminal, the second terminal The feedback time interval of each BFD packet fed back by the terminal; the second terminal determines whether the feedback time interval of each BFD packet fed back by the first terminal is less than a preset time; if the judgment result is the feedback of the first terminal When the feedback interval of each BFD packet is less than the preset time, the second BFD packet is determined to be a keep-alive packet.
- the embodiment of the present invention further provides a link detecting apparatus, where the apparatus includes: a generating module, configured to generate a first BFD report after the first terminal and the second terminal BFD protocol negotiate successfully.
- the sending module is configured to periodically send the first BFD packet to the first terminal
- the receiving module is configured to receive the second BFD packet that is sent by the first terminal based on the first BFD packet
- a determining module configured to: in the second terminal, not receiving the second BFD packet that is sent by the first terminal based on the first BFD packet, and the second terminal sending the first BFD packet When the number of times is greater than or equal to the preset threshold, it is determined that the link between the second terminal and the first terminal is faulty.
- the device further includes: an alarm module, configured to generate a fault alarm message when the BFD link fails.
- the determining module is further configured to: receive, by the second terminal, a second BFD packet that is sent by the first terminal based on the first BFD packet, and the second terminal sends the first BFD packet When the number of times is less than or equal to the preset threshold, it is determined that the link between the second terminal and the first terminal is normal.
- the determining module includes: a determining unit and a verifying unit, where the determining unit is configured to determine that the first terminal feedbacks when receiving the second BFD packet that is fed back by the first terminal according to the first BFD packet Whether the second BFD packet is a keep-alive packet; the verification unit is configured to: when the determining result of the determining unit is that the second BFD packet is a keep-alive packet, the second BFD packet Verification is performed, and if the verification is passed, it is determined that the link between the second terminal and the first terminal is normal.
- the determining unit includes a calculating subunit, a determining subunit, and a determining subunit, and the calculating subunit is configured to calculate each BFD report fed back by the first terminal based on a period of the second BFD packet fed back by the first terminal a time interval of the text; the determining subunit is configured to determine whether a feedback time interval of each BFD message fed back by the first terminal is less than a preset time; the determining subunit is configured to determine a result in the determining subunit Each of the said feedback for the first terminal When the feedback interval of the BFD packet is less than the preset time, the BFD packet is determined to be a keep-alive packet.
- the second terminal after the first terminal and the second terminal BFD protocol are successfully negotiated, the second terminal generates a first BFD packet, and periodically sends the first BFD packet to the first terminal; The second terminal does not receive the second BFD packet that is sent by the first terminal based on the first BFD packet, and the number of times that the second terminal sends the first BFD packet is greater than or equal to a preset threshold. The second terminal determines that the link between the first terminal and the first terminal has failed. In the above manner, after the negotiation succeeds, the second terminal in the embodiment of the present invention continues to send the preset number of BFD packets without waiting for the BFD packet sent by the first terminal, and then determining the BFD packet after the preset threshold BFD packet is sent.
- the second terminal determines that the link between the first terminal and the first terminal has failed. It is possible to avoid unnecessary switching caused by the first terminal and the second terminal being unsynchronized, and to improve the negotiation of the INIT due to the failure of the first terminal CPU to process the BFD packet that needs to be sent in time in the large-capacity scenario.
- FIG. 1 is a schematic flowchart of a first embodiment of a link detecting method according to the present invention
- FIG. 2 is a schematic flowchart of a second embodiment of a link detecting method according to the present invention.
- the second terminal 3 is a second BFD packet that the first terminal receives based on the first BFD packet, and the second terminal sends the first BFD packet in the second terminal in FIG.
- the second terminal determines a refinement flow chart of the step that the link between the second terminal and the first terminal is normal;
- FIG. 4 is a schematic diagram of functional modules of a first embodiment of a link detecting apparatus according to the present invention.
- FIG. 5 is a schematic diagram of a refinement function module of the judging module in FIG. 4;
- FIG. 5 is a schematic diagram of a refinement function module of the judging module in FIG. 4;
- FIG. 6 is a schematic diagram of a refinement function module of the judging unit in FIG. 5.
- FIG. 6 is a schematic diagram of a refinement function module of the judging unit in FIG. 5.
- the embodiment of the invention provides a link detection method.
- FIG. 1 is a schematic flowchart diagram of a first embodiment of a link detecting method according to the present invention.
- the link detection method of the present invention includes:
- Step S10 after the first terminal and the second terminal BFD protocol are successfully negotiated, the second terminal generates a first BFD packet, and periodically sends the first BFD packet to the first terminal.
- the BFD packet is set to the authentication parameter for the BFD session.
- the BFD session Before the BFD session is established, the BFD session is in the Down state.
- the BFD session is set to be the BFD session.
- the BFD session is reported to the CPU.
- the BFD session is set to update the BFD session parameters, or the BFD session is renegotiated.
- the BFD session is set to the Up state.
- the text is a keep-alive message, which is mainly processed by a Field-Programmable Gate Array (FPGA).
- FPGA Field-Programmable Gate Array
- the second terminal receives the pre-configured two-way. After forwarding the negotiation packet sent by the first terminal of the BFD protocol, the first terminal cannot process the negotiation packet and configure the hardware to send the BFD packet, so that the second terminal does not receive the message for a long time. In the BFD packet, the second terminal and/or the first terminal considers that the primary BFD link is faulty, and then switches to the standby BFD session link or sends a BFD fault packet.
- the first terminal actively sends a BFD negotiation packet to the second terminal that is configured with the BFD protocol.
- the second terminal verifies the BFD negotiation packet sent by the first terminal, and after the verification is passed, the second terminal configures the hardware field editable gate array FPGA to create a BFD session to generate a BFD session.
- the BFD packet is sent to the first terminal, and the BFD packet is sent to the first terminal when the field editable gate array FPGA generates a BFD packet, or the negotiation packet is verified.
- the received BFD negotiation packet sent by the first terminal and the BFD packet generated by the second terminal are sent together.
- the first terminal CPU may be occupied. If the first terminal is occupied, the first terminal hardware field editable gate array FPGA receives the negotiation success message or the pre-sent message sent by the second terminal based on the negotiation message sent by the first terminal. Set the number of BFD packets.
- the first terminal When the first terminal CPU is not occupied, the first terminal receives the BFD negotiation success message or the BFD message, and the first terminal CPU obtains the BFD negotiation success message or the BFD keep-alive message according to the received BFD negotiation message.
- the text is sent to the second terminal together.
- the first terminal can also automatically create a BFD session after the hardware field editable gate array FPGA receives the BFD negotiation success message.
- the second terminal when the second terminal receives the negotiated BFD packet sent by the first terminal, the second terminal verifies the negotiation BFD packet sent by the first terminal, and if the verification succeeds, the negotiation succeeds to the first terminal.
- the BFD packet is sent to the second terminal in the hardware field to edit the gate array FPGA to configure the BFD session.
- the hardware field editable gate array FPGA configures the BFD session to count the generated BFD keep-alive packets, and sends the generated BFD packets to the first terminal once after generating the BFD packets.
- it can also be set to 2 times and 4 times.
- the setting menu can also be entered, and the preset number of times is set for the user with different performances of the device.
- the BFD packet can be sent according to the traditional mechanism. After the BFD session is successfully sent, a BFD packet is sent to the first terminal. The first terminal is received before the preset number of BFD packets are sent. Sending a corresponding keep-alive message and/or a P-set message, but not detecting the BFD packet and/or the P-set packet sent by the first terminal, that is, before sending the preset number of BFD packets. The second terminal does not receive the BFD packet of the first terminal, and does not generate an alarm or enable other protection mechanisms, such as enabling the protection link. When the second terminal receives the preset number of BFD packets sent by the first terminal, the preset number of keep-alive messages are reported to the CPU of the second terminal.
- the first terminal CPU verifies the received negotiation success packet, and if the verification succeeds, notifies the first terminal hardware to edit the gate array FPGA to configure the BFD. Session, at this time, the first terminal starts to enter the UP state, and the hardware field can edit the gate array FPGA to configure the BFD session, generate BFD keep-alive packets, and count the generated BFD packets. After generating 3 BFD packets, Sending the generated three BFD packets to the second terminal, which may be set to 2 times or 4 times, of course, may also enter a setting menu, for different performances of the first terminal and/or the second terminal. Define settings.
- the BFD packet can be sent in the BFD session according to the traditional mechanism.
- the BFD packet is sent to the device.
- the second terminal receives a corresponding keep-alive message and/or a P-set message sent by the second terminal.
- the preset number of keep-alive messages are reported to the CPU of the first terminal.
- the hardware field editable gate array FPGA is notified to configure the BFD session. It is known in the art that the time taken to send BFD keep-alive packets is less than the preset time for detecting BFD packets in the BFD detection mechanism.
- the preset time in the BFD detection mechanism is 5 seconds. If it is not received within 5 seconds, If the BFD session is faulty, the BFD session is faulty. The time taken for the number of BFD keepalive packets is less than 5 seconds. In the specific implementation, the preset time in the BFD detection mechanism can be adjusted.
- step S20 After the preset number of BFD messages are sent, the process proceeds to step S20.
- step S20 the second terminal does not receive the second BFD packet that is sent by the first terminal based on the first BFD packet, and the second terminal sends the first BFD packet more than
- the threshold is equal to or equal to the preset threshold
- the second terminal determines that the link between the first terminal and the first terminal is faulty.
- step S10 when the number of times the second terminal sends the BFD packet to the first terminal is greater than or equal to a preset threshold, for example, in this embodiment, the first terminal CPU is occupied, and the received terminal cannot be processed in time.
- the hardware editable gate array FPGA cannot be configured to generate the BFD packet, and the second terminal is in the second terminal. Determining, by the second terminal, the second terminal and the first terminal, if the number of times the BFD packet is sent by the terminal is greater than or equal to 3 times, if the second terminal does not receive the BFD packet sent by the first terminal The link between the links has failed.
- the second terminal receives the BFD packet sent by the first terminal in the time that the second terminal sends the BFD packet of the preset threshold, but the verification fails, the foregoing may also be determined.
- the link between the second terminal and the first terminal fails.
- the protection link is enabled for data transmission, and then And sending the BFD packet with the preset threshold number, if the BFD packet of the preset threshold is sent after the protection link is sent, the second terminal is determined to be the same as the feedback BFD packet of the first terminal.
- the link between the first terminal and the first terminal fails.
- the second terminal CPU if the second terminal CPU is occupied, the received BFD packet sent by the first terminal cannot be processed, and after the first terminal sends the BFD packet with the preset threshold, if the first terminal does not receive the When the BFD packet sent by the second terminal is used, it is determined that the link between the second terminal and the first terminal is faulty, and then the first terminal automatically resends the BFD packet, and may not be sent.
- Step S30 The second terminal generates a fault alarm message and sends it to the CPU, and stops sending BFD packets.
- the first terminal and/or the second terminal generate a fault alarm message, and send a fault alarm message to the respective terminal CPU.
- the fault alarm packet can be sent to the peer end.
- the fault alarm packet can be sent according to the preset frequency, or only the fault alarm packet can be sent only before the fault state is changed, so as to reduce the fault alarm message to the CPU.
- the burden may of course not be sent.
- the first terminal resends the negotiation message to the second terminal through the CPU.
- the CPU receives the fault alarm packet and searches for the BFD information table.
- the preset BFD information table stores a BFD information index table, which mainly involves communication problems between the BFD packet and the BFD link. When the BFD link is faulty, the corresponding fault alarm packet is found and the corresponding problem is processed.
- the preset BFD information table may be used to determine whether there is a preset stop flag in the BFD packet, and if it is determined that there is a stop flag in the BFD packet, the fault alarm report is If the stop flag in the preset BFD information table is found, the BFD packet is stopped.
- the number of CPU processes it is determined according to the determination result whether the BFD packet is sent by the preset number of times. Because the task behavior of the CPU is mostly performed in the multi-process task system, the number of CPU processes can be determined. If the number of CPU processes is greater than the preset number, the CPU is occupied. At this time, the pre-transmission is performed according to the present invention. If the number of CPU processes is less than or equal to the preset number, the CPU is not occupied, and can be sent according to the traditional BFD detection mechanism.
- the second terminal after the first terminal and the second terminal BFD protocol are successfully negotiated, the second terminal generates a first BFD packet, and periodically sends the first BFD packet to the first terminal; The second terminal does not receive the second BFD packet that is sent by the first terminal based on the first BFD packet, and the number of times that the second terminal sends the first BFD packet is greater than or equal to a preset threshold. The second terminal determines that the link between the first terminal and the first terminal has failed. In the above manner, after the negotiation succeeds, the second terminal in the embodiment of the present invention continues to send the preset number of BFD packets without waiting for the BFD packet sent by the first terminal, and then determining the BFD packet after the preset threshold BFD packet is sent.
- the second terminal determines that the link between the first terminal and the first terminal has failed. It is possible to avoid unnecessary switching caused by the first terminal and the second terminal being unsynchronized, and to improve the negotiation of the INIT due to the failure of the first terminal CPU to process the BFD packet that needs to be sent in time in the large-capacity scenario.
- FIG. 2 is a schematic flowchart diagram of a second embodiment of a link detecting method according to the present invention. Based on the first embodiment, the method further includes:
- Step S40 the second terminal receives the second BFD packet that is sent by the first terminal based on the first BFD packet, and the number of times the second terminal sends the first BFD packet is less than the pre- When the threshold is set, the second terminal determines The link with the first terminal is normal.
- the second terminal accesses the received first terminal.
- the transmitted BFD packet is verified. If the verification succeeds, it is determined that the link between the second terminal and the first terminal is normal. If the verification fails, the first terminal sends a verification failure BFD packet to the first terminal, and may not send the authentication. If the first terminal negotiates the BFD packet, the BFD packet is sent, and the second terminal continues to send the BFD packet, and the second terminal performs the BFD packet received by the first terminal. verification.
- the first terminal receives the BFD packet sent by the second terminal, when the second terminal sends the preset number of the BFD packets. And verifying, determining that the link between the second terminal and the first terminal is normal.
- the first terminal and the second terminal start detecting the received BFD packet only when the preset number of BFD packets are sent.
- the CPU may be uploaded to the CPU when the preset number of BFD packets are received, and the CPU may verify the BFD packet received by the preset number of times.
- the first terminal and the second terminal CPU start to verify when the first terminal or the second terminal sends a preset number of BFD packets.
- FIG. 3 is a second BFD packet that is received by the first terminal according to the first BFD packet, and the second terminal sends the first
- the second terminal determines a refinement flow of the step of normalizing the link between the BFD packet and the first terminal. This step includes:
- Step S41 When receiving the second BFD packet that is sent by the first terminal based on the first BFD packet, determining whether the second BFD packet fed back by the first terminal is a keep-alive packet;
- the second terminal determines, according to the preset number of times of the BFD packet, the BFD packet sent by the first terminal, and determines whether the BFD packet is a keep-alive packet.
- the packet sent by the CPU is a slow packet
- the sending period is more than one second, that is, more than one second.
- the packet sent by the hardware field editable gate array FPGA is a fast packet
- the sending time is seconds. the following.
- the time for generating the BFD packet is calculated according to the time when the BFD packet is generated, or the period of the received BFD packet is calculated by the two nodes, and the BFD packet is sent.
- the BFD packet is determined to be a BFD negotiation packet.
- the BFD message generated by the CPU and/or the hardware field editable gate array FPGA can be determined by the CPU or the hardware field editable gate array FPGA, for example, according to the mark. Judge. If the result of the determination is that the BFD message is a keep-alive message, the process proceeds to step S42, otherwise, the process proceeds to step S43.
- Step S42 If the second BFD packet is a keep-alive packet, verify the second BFD packet, and if the verification succeeds, the second terminal determines that it is between the first terminal and the first terminal.
- the link is normal;
- the first terminal hardware can edit the gate array on site.
- the column FPGA generates a preset number of BFD keep-alive messages, and then sends the BFD keep-alive message to the second terminal, or the first terminal hardware field editable gate array FPGA generates a BFD keep-alive message, and sends the message to the second terminal.
- the hardware field editable gate array FPGA when the hardware field editable gate array FPGA generates three numbers of BFD keep-alive messages, the first end sends the three BFD keep-alive messages generated by the hardware field editable gate array FPGA to the first end. Two ends.
- the second terminal receives the three BFD keep-alive messages sent by the first terminal, and performs the verification of the received BFD keep-alive packets. After the verification is passed, the second terminal generates a preset number of BFD keep-alive messages, and sends the BFD keep-alive packets. Give the first terminal. Certainly, before the first terminal and the second terminal do not receive the command to stop sending the BFD packet, the generated BFD packet can be sent to the other party, and the first terminal and the second terminal CPU receive the preset number of times. When the BFD packet is sent, the keepalive packet is verified. If the verification succeeds, the link between the second terminal and the first terminal is determined to be normal. If the verification fails, it is determined that the link between the second terminal and the first terminal is abnormal.
- step S43 the traditional BFD mechanism is sent.
- the BFD packet is a BFD negotiation packet
- the first terminal and/or the second terminal are sent and processed according to the traditional BFD mechanism.
- the priority of the BFD negotiation packet is also increased, so that the second terminal preferentially processes the BFD negotiation packet.
- the core idea of the embodiment of the present invention is to start the detection when the preset number of BFD packets are received, and the method includes: at least three implementation manners: 1.
- the preset number of BFD packets is sent to the CPU.
- the second terminal receives the BFD packets sent by the first terminal in a preset time, and saves the BFD packets.
- the CPU is uploaded to the CPU when receiving the BFD packet sent by the first terminal.
- the CPU processes the received BFD packet only when it receives the preset number of BFD packets.
- the first terminal and the second terminal may be interchanged, that is, the first terminal and the second terminal have the same function.
- the embodiment of the invention further provides a link detecting device.
- FIG. 4 is a schematic diagram of functional modules of a first embodiment of a link detecting apparatus according to the present invention.
- the link detecting apparatus includes: a generating module 10, a sending module 20, a receiving module 30, and a determining module 40.
- the generating module 10 is configured to generate a first BFD packet after the negotiation between the first terminal and the second terminal BFD protocol is successful.
- the sending module 20 is configured to periodically send the first BFD packet to the first terminal.
- the receiving module 30 is configured to receive the second BFD packet that is sent by the first terminal based on the first BFD packet.
- the BFD packet is set to the authentication parameter for the BFD session.
- the BFD session Before the BFD session is established, the BFD session is in the Down state.
- the BFD session is set to be the BFD session.
- the BFD session is reported to the CPU.
- the BFD session is set to update the BFD session parameters, or the BFD session is renegotiated.
- the BFD session is set to the Up state and the BFD session is set to detect the BFD session.
- the normal BFD packet is a keep-alive packet, which is processed by the Field-Programmable Gate Array (FPGA).
- the time and port parameters included in the BFD packet are reported to the CPU for processing.
- FPGA Field-Programmable Gate Array
- the second terminal receives the pre-configured two-way. After forwarding the negotiation packet sent by the first terminal of the BFD protocol, the first terminal cannot process the negotiation packet and configure the hardware to send the BFD packet, so that the second terminal does not receive the message for a long time. In the BFD packet, the second terminal and/or the first terminal considers that the primary BFD link is faulty, and then switches to the standby BFD session link or sends a BFD fault packet.
- the first terminal actively sends a BFD negotiation packet to the second terminal that is configured with the BFD protocol.
- the second terminal verifies the BFD negotiation packet sent by the first terminal, and after the verification is passed, the second terminal configures the hardware field editable gate array FPGA to create a BFD session to generate a BFD session.
- the BFD packet is sent to the first terminal, and the BFD packet is sent to the first terminal when the field editable gate array FPGA generates a BFD packet, or the negotiation packet is verified.
- the received BFD negotiation packet sent by the first terminal and the BFD packet generated by the second terminal are sent together.
- the first terminal CPU may be occupied. If the first terminal is occupied, the first terminal hardware field editable gate array FPGA receives the negotiation success message or the pre-sent message sent by the second terminal based on the negotiation message sent by the first terminal. Set the number of BFD packets.
- the first terminal When the first terminal CPU is not occupied, the first terminal receives the BFD negotiation success message or the BFD message, and the first terminal CPU obtains the BFD negotiation success message or the BFD keep-alive message according to the received BFD negotiation message.
- the text is sent to the second terminal together.
- the first terminal can also automatically create a BFD session after the hardware field editable gate array FPGA receives the BFD negotiation success message.
- the second terminal when the second terminal receives the negotiated BFD packet sent by the first terminal, the second terminal verifies the negotiation BFD packet sent by the first terminal, and if the verification succeeds, the negotiation succeeds to the first terminal.
- the BFD packet is sent to the second terminal in the hardware field to edit the gate array FPGA to configure the BFD session.
- the hardware field editable gate array FPGA configures the BFD session to count the generated BFD keep-alive packets, and sends the generated BFD packets to the first terminal once after generating the BFD packets.
- it can also be set to 2 times and 4 times.
- the setting menu can also be entered, and the preset number of times is set for the user with different performances of the device.
- the BFD packet can be sent according to the traditional mechanism. After the negotiation succeeds, a BFD packet is generated and sent to the first terminal. Before receiving the packet, the first terminal sends a corresponding keep-alive packet and/or a P-set packet, but does not detect the BFD packet and/or the P-set packet sent by the first terminal, that is, after the packet is sent. Before the preset number of BFD packets, the second terminal does not receive the BFD packet of the first terminal, and does not generate an alarm or enable other protection mechanisms, such as enabling the protection link. When the second terminal receives the preset number of BFD packets sent by the first terminal, the preset number of keep-alive messages are reported to the CPU of the second terminal.
- the first terminal CPU verifies the received negotiation success packet, and if the verification succeeds, notifies the first terminal hardware to edit the gate array FPGA to configure the BFD. Session, at this time, the first terminal starts to enter the UP state, and the hardware field can edit the gate array FPGA to configure the BFD session, generate BFD keep-alive packets, and count the generated BFD packets. After generating 3 BFD packets, Sending the generated three BFD packets to the second terminal, which may be set to 2 times or 4 times, of course, may also enter a setting menu, for different performances of the first terminal and/or the second terminal. Define settings.
- the BFD packet can be sent in the BFD packet according to the traditional mechanism.
- the BFD packet is sent to the BFD session.
- the second terminal receives a corresponding keep-alive message and/or a P-set message sent by the second terminal.
- the preset number of keep-alive messages are reported to the CPU of the first terminal.
- the hardware field editable gate array FPGA is notified to configure the BFD session. It is known in the art that the time taken to send BFD keep-alive packets is less than the preset time for detecting BFD packets in the BFD detection mechanism.
- the preset time in the BFD detection mechanism is 5 seconds. If it is not received within 5 seconds, If the BFD session is faulty, the BFD session is faulty. The time taken for the number of BFD keepalive packets is less than 5 seconds. In the specific implementation, the preset time in the BFD detection mechanism can be adjusted.
- the determining module 40 is configured to receive, in the second terminal, the second BFD packet that is sent by the first terminal based on the first BFD packet, and the second terminal sends the first BFD packet When the number of times is greater than or equal to the preset threshold, it is determined that the link between the second terminal and the first terminal is faulty.
- the number of times the BFD packet is sent to the first terminal is greater than or equal to a preset threshold, for example, in this embodiment, the first terminal CPU is occupied, and the received second terminal cannot be processed in time.
- the BFD packet is sent to the first terminal by the second terminal after the BFD packet is sent to the first terminal after the second terminal receives the BPDU. If the number of times of the BFD packet is greater than or equal to 3 times, if the second terminal does not receive the BFD packet sent by the first terminal, determine the link between the second terminal and the first terminal. malfunction.
- the second terminal receives the BFD packet sent by the first terminal in the time that the second terminal sends the BFD packet of the preset threshold, but the verification fails, the foregoing may also be determined.
- the link between the second terminal and the first terminal fails.
- the protection link is enabled for data transmission, and then And sending the BFD packet with the preset threshold number, if the BFD packet of the preset threshold is sent after the protection link is sent, the second terminal is determined to be the same as the feedback BFD packet of the first terminal.
- the link between the first terminal and the first terminal fails.
- the second terminal CPU if the second terminal CPU is occupied, the received BFD packet sent by the first terminal cannot be processed, and after the first terminal sends the BFD packet with the preset threshold, if the first terminal does not receive the When the BFD packet sent by the second terminal is used, it is determined that the link between the second terminal and the first terminal is faulty, and then the first terminal automatically resends the BFD packet, and may not be sent.
- the determining module 40 is further configured to: receive, by the second terminal, a second BFD packet that is sent by the first terminal based on the first BFD packet, and the second terminal sends the first BFD packet When the number of times is less than a preset threshold, the second terminal determines that the link between the second terminal and the first terminal is normal.
- the second terminal sends the BFD sent by the first terminal to the received first terminal, if the second terminal receives the BFD packet sent by the first terminal in the time that the second terminal sends the preset number of the BFD packets.
- the message is verified, and if the verification is passed, it is determined that the link between the second terminal and the first terminal is normal. If the verification fails, the first terminal sends a verification failure BFD packet to the first terminal, and may not send the authentication. If the first terminal negotiates the BFD packet, the BFD packet is sent, and the second terminal continues to send the BFD packet, and the second terminal performs the BFD packet received by the first terminal. verification.
- the first terminal receives the BFD packet sent by the second terminal, when the second terminal sends the preset number of the BFD packets. And verifying, determining that the link between the second terminal and the first terminal is normal.
- the first terminal and the second terminal start detecting the received BFD packet only when the preset number of BFD packets are sent.
- the CPU may be uploaded to the CPU when the preset number of BFD packets are received, and the CPU may verify the BFD packet received by the preset number of times.
- the first terminal and the second terminal CPU start to verify when the first terminal or the second terminal sends a preset number of BFD packets.
- the device further includes an alarm module (not shown), and the alarm module is configured to determine, according to the judgment result of the determining module 330, if the BFD session link transmission failure is determined, the first terminal and The second terminal generates a fault alarm message and sends a fault alarm message to the respective terminal CPU.
- the two terminals can also send the fault alarm message to the peer end.
- the fault alarm message can also be sent according to the preset frequency, or only the fault alarm message can be sent only before the fault state is changed, so as to reduce the fault alarm report.
- the burden on the CPU may of course not be sent.
- the first terminal resends the negotiation message to the second terminal through the CPU.
- the CPU receives the fault alarm packet and searches for the BFD information table.
- the preset BFD information table stores a BFD information index table, which mainly involves communication problems between the BFD packet and the BFD link. When the BFD link is faulty, the corresponding fault alarm packet is found and the corresponding problem is processed.
- the preset BFD information table may be used to determine whether there is a preset stop flag in the BFD packet, and if it is determined that there is a stop flag in the BFD packet, the fault alarm report is If the stop flag in the preset BFD information table is found, the BFD packet is stopped.
- the number of CPU processes it is determined according to the determination result whether the BFD packet is sent by the preset number of times. Because the task behavior of the CPU is mostly performed in the multi-process task system, the number of CPU processes can be determined. If the number of CPU processes is greater than the preset number, the CPU is occupied. At this time, the pre-transmission is performed according to the present invention. If the number of CPU processes is less than or equal to the preset number, the CPU is not occupied, and can be sent according to the traditional BFD detection mechanism.
- FIG. 5 is a schematic diagram of the refinement function module of the judging module in FIG.
- the determining module 40 includes: a determining unit 41 and a verifying unit 42.
- the determining unit 41 is configured to determine whether the second BFD packet fed back by the first terminal is a keep-alive packet when receiving the second BFD packet that is fed back by the first terminal according to the first BFD packet.
- the device determines the BFD packet to be a keep-alive packet.
- the number of CPU processes can also be judged, because the task behaviors involving the CPU are mostly performed in the multi-process task system, and the number of CPU processes can be determined. If the number of CPUs is large, for example, the number of CPU processes is greater than the preset. The quantity indicates that the CPU is occupied.
- the preset number of BFD messages are sent at a preset time; if the number of CPU processes is less than or equal to the preset number, it indicates that the CPU is not occupied, then press The traditional BFD detection mechanism is sent.
- the verification unit 42 is configured to verify the second BFD message when the second BFD message is a keep-alive message, and if the verification is passed, the determining module 40 determines that the The link between the second terminal and the first terminal is normal.
- the first terminal hardware field editable gate array FPGA when the BFD message is a keep-alive message, the first terminal hardware field editable gate array FPGA generates a preset number of BFD keep-alive messages, and then sends the BFD keep-alive message to the second terminal.
- the hardware field editable gate array FPGA when the hardware field editable gate array FPGA generates three numbers of BFD keep-alive messages, the first end sends the three BFD keep-alive messages generated by the hardware field editable gate array FPGA to the first end. Second end.
- the second terminal receives the three BFD keep-alive messages sent by the first terminal, and performs the verification of the received BFD keep-alive packets.
- the second terminal After the verification is passed, the second terminal generates a preset number of BFD keep-alive messages, and sends the BFD keep-alive packets. Give the first terminal to complete the verification of the UP state. If the judgment result of the determining unit 321 is that the BFD packet is a BFD negotiation packet, the first terminal and/or the second terminal send and process according to the traditional BFD mechanism.
- the core idea of the embodiment of the present invention is to start the detection when the preset number of BFD packets are received, and the method includes: at least three implementation manners: 1.
- the preset number of BFD packets is sent to the CPU.
- the second terminal receives the BFD packets sent by the first terminal in a preset time, and saves the BFD packets.
- the CPU is uploaded to the CPU when receiving the BFD packet sent by the first terminal.
- the CPU processes the received BFD packet only when it receives the preset number of BFD packets.
- the first terminal and the second terminal may be interchanged, that is, the first terminal and the second terminal have the same function.
- FIG. 6 is a schematic diagram of the refinement function module of the judging unit in FIG.
- the determination unit 41 in the link detecting apparatus includes a calculation subunit 411, a judgment subunit 412, and a decision subunit 413.
- the calculation sub-unit 411 is configured to calculate a time interval of each BFD message fed back by the first terminal, based on a period of the second BFD message fed back by the first terminal.
- the packets sent by the CPU are slow packets, and the sending period is more than one second, that is, more than one second.
- the packets sent by the hardware field editable gate array FPGA are fast packets, and the sending time is less than the second.
- the time for generating the BFD packet is calculated according to the BFD packet generation time, or the period of the received BFD packet is calculated by the two terminals, and the calculation time of each BFD packet is calculated, and the calculation subunit may not be included in the implementation. For example, in the CPU and / or hardware field editable gate array FPGA generated BFD message as a mark, judged according to the mark.
- the determining sub-unit 412 is configured to determine whether the feedback time interval of each BFD message fed back by the first terminal is smaller than when the calculation result of the calculation of the sub-unit 411 is that the feedback time of each BFD packet is less than the preset time. Preset time.
- the determining sub-unit 413 is configured to determine that the BFD message is a keep-alive message when the determining sub-unit 412 determines that the feedback time interval of each of the BFD messages fed back by the first terminal is less than a preset time.
- the link detection method and apparatus have the following beneficial effects: after the negotiation succeeds, the second terminal continues to send the preset number of BFD packets without waiting for the first After the BFD packet sent by the terminal sends the preset threshold BFD packet, the second terminal determines that the link between the terminal and the first terminal is faulty. It is possible to avoid unnecessary switching caused by the first terminal and the second terminal being unsynchronized, and to improve the negotiation of the INIT due to the failure of the first terminal CPU to process the BFD packet that needs to be sent in time in the large-capacity scenario. The technical problem that the BFD link in the UP state returns to the Down state due to timeout, thereby improving the reliability of the BFD detection mechanism.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
本发明公开了一种链路检测方法,该方法包括以下步骤:在第一终端与第二终端BFD协议协商成功之后,所述第二终端生成第一BFD报文,并向所述第一终端定时发送所述第一BFD报文;在所述第二终端未接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文,且所述第二终端发送所述第一BFD报文的次数大于或等于预设阈值时,所述第二终端判定其与所述第一终端之间的链路发生故障。本发明还公开了一种链路检测装置。本发明能够提高BFD检测机制可靠性。
Description
本发明涉及数据通信技术领域,尤其涉及一种链路检测方法和装置。
BFD(Bidirectional Forwarding Detection,双向转发检测)是一套用来实现快速检测的国际标准协议,提供一种轻负荷、持续时间段的检测。与以往的其他检测机制相比,具有许多独到的优势。BFD会话检测分两步:首先CPU发起BFD慢速报文进行协商;如果协商成功,CPU就会配置会话创建给硬件,最终的BFD报文主要由硬件来传递。
协商成功时,两端点会创建BFD会话,但是这个创建不可能完全同时,比如第一次协商成功后,会通知硬件配置BFD会话,一端在接收到协商成功报文时配置,另一端在发送协商成功时配置,使得两端点在创建BFD时会存在一定的延时。先配置的一端由于因为未接收到另一端的报文,很可能会发出Down告警,从而引起不应该发生的倒换,倒换是指由于两端点接收到的报文不同步,让两端路由器/交换机误以为主链路链接不正常,而启用保护链路进行传输数据。
配置BFD会话到硬件后,硬件会通过接收到的BFD报文检测链接是否正常,包括CPU验证BFD报文中时间等参数是否正确。正常场景下,这个协商到会话创建以及验证,很快能处理完成。但是在大容量场景下,一旦主用的链路会话创建成功,此时大量的协议在动作,所在CPU要处理太多软件的接口信息,从而使得CPU不能及时处理需要发送的BFD报文,导致协商到INIT或者UP状态的BFD的会话因超时又重新回到Down状态,比如在HSB(Hot-standby)回切时,如果一个物理端口下配置有很多的TE-LSP,对应大量的BFD会话的创建,使得CPU不能及时处理BFD报文,回切是指启用保护链路进行传输数据时,检测到主链路正常,需要返回主链路进行传输,因此,传统的BFD检测机制不可靠。
发明内容
本发明实施例提出了一种链路检测方法和装置,旨在至少提高BFD检测机制可靠性。
为至少实现上述目的,本发明实施例提供的一种链路检测方法,所述方法包括以下步骤:在第一终端与第二终端BFD协议协商成功之后,所述第二终端生成第一BFD报文,并向所述第一终端定时发送所述第一BFD报文;在所述第二终端未接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文,且所述第二终端发送所述第一BFD报文的次数大于或等于预设阈值时,所述第二终端判定其与所述第一终端之间的链路发生故障。
所述判定所述第二终端和所述第一终端之间的链路发生故障的步骤之后包括:所述第二终端发送故障告警报文,并停止发送BFD报文。
所述方法还包括:在所述第二终端接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文,且所述第二终端发送所述第一BFD报文的次数小于预设阈值时,所述第二终端判定其与所述第一终端之间的链路正常。
所述在所述第二终端接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文,且所述第二终端发送所述第一BFD报文的次数小于预设阈值时,所述第二终端判定其与所述第一终端之间的链路正常的步骤包括:在接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文时,判断所述第一终端反馈的第二BFD报文是否为保活报文;如果所述第二BFD报文是保活报文,则对所述第二BFD报文进行验证,如果验证通过,则所述第二终端判定其与所述第一终端之间的链路正常。
所述判断所述第一终端反馈的第二BFD报文是否为保活报文的步骤包括:基于所述第一终端反馈的第二BFD报文的周期,所述第二终端计算所述第一终端反馈的每个BFD报文的反馈时间间隔;所述第二终端判断所述第一终端反馈的每个BFD报文的反馈时间间隔是否小于预置时间;如果判断结果为第一终端反馈的每个BFD报文的反馈时间间隔小于预置时间时,判定所述第二BFD报文为保活报文。
此外,为至少实现上述目的,本发明实施例还提供一种链路检测装置,所述装置包括:生成模块,设置为在第一终端与第二终端BFD协议协商成功之后,生成第一BFD报文;发送模块,设置为向所述第一终端定时发送所述第一BFD报文;接收模块,设置为接收所述第一终端基于所述第一BFD报文反馈的第二BFD报文;判断模块,设置为在所述第二终端未接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文,且所述第二终端发送所述第一BFD报文的次数大于或等于预设阈值时,判定所述第二终端和所述第一终端之间的链路发生故障。
所述装置还包括:告警模块,设置为在所述BFD链路发生故障时,生成故障告警报文。
所述判断模块还设置为在所述第二终端接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文,且所述第二终端发送所述第一BFD报文的次数小于或等于预设阈值时,判定所述第二终端和所述第一终端之间的链路正常。
所述判断模块包括:判断单元和验证单元,所述判断单元设置为在接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文时,判断所述第一终端反馈的第二BFD报文是否是保活报文;所述验证单元设置为在所述判断单元的判断结果为所述第二BFD报文是保活报文时,对所述第二BFD报文进行验证,如果验证通过,则判定所述第二终端和所述第一终端之间的链路正常。
所述判断单元包括计算子单元、判断子单元和判定子单元,所述计算子单元设置为基于第一终端反馈的第二BFD报文的周期,计算所述第一终端反馈的每个BFD报文的时间间隔;所述判断子单元设置为判断所述第一终端反馈的每个BFD报文的反馈时间间隔是否小于预置时间;所述判定子单元设置为在所述判断子单元判断结果为所述第一终端反馈的每个所述
BFD报文的反馈时间间隔小于预置时间时,判定所述BFD报文为保活报文。
本发明实施例通过在第一终端与第二终端BFD协议协商成功之后,所述第二终端生成第一BFD报文,并向所述第一终端定时发送所述第一BFD报文;在所述第二终端未接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文,且所述第二终端发送所述第一BFD报文的次数大于或等于预设阈值时,所述第二终端判定其与所述第一终端之间的链路发生故障。通过上述方式,本发明实施例第二终端在协商成功后,继续发送预置次数的BFD报文,无需等待第一终端发送的BFD报文,在发送预置阈值次BFD报文后,才判断第二终端判定其与所述第一终端之间的链路发生故障。能够避免因为第一终端和第二终端创建不同步,而引起不必要的倒换;并改善了在大容量场景下,因第一终端CPU占用不能及时处理需要发送的BFD报文,导致协商到INIT或者UP状态的BFD链路因超时又重新回到Down状态的技术问题,从而提高BFD检测机制可靠性。
图1为本发明链路检测方法第一实施例的流程示意图;
图2为本发明链路检测方法第二实施例的流程示意图;
图3为图2中在所述第二终端接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文,且所述第二终端发送所述第一BFD报文的次数小于预设阈值时,所述第二终端判定其与所述第一终端之间的链路正常的步骤的细化流程示意图;
图4为本发明链路检测装置第一实施例的功能模块示意图;
图5为图4中判断模块的细化功能模块示意图;
图6为图5中判断单元的细化功能模块示意图。
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
本发明实施例提供一种链路检测方法。
请参照图1,图1为本发明链路检测方法第一实施例的流程示意图。
在本实施例中,该本发明链路检测方法包括:
步骤S10,在第一终端与第二终端BFD协议协商成功之后,所述第二终端生成第一BFD报文,并向所述第一终端定时发送所述第一BFD报文;
BFD报文在网络数据传输中主要设置为为BFD检测机制建立验证参数,在BFD会话建立前,BFD会话处于Down状态,BFD报文设置为进行BFD会话协商,协商BFD报文需上报CPU,由CPU来处理;BFD会话建立后,设置为更新BFD会话参数,或者重新协商BFD会话,在BFD会话建立后,则认为BFD会话处于UP状态,BFD报文设置为检测BFD会话链路正常的BFD报文为保活报文,主要由硬件现场可编辑门阵列FPGA(Field-Programmable Gate Array)来处理,BFD报文中包括的时间、端口等参数需上报CPU进行处理。在传统BFD检测机制中,如果CPU由于任务调度问题,无法及时处理,就会造成CPU中大量报文堆积,影响整个BFD运行的稳定性以及降低整个系统的性能,比如第二终端接收预先配置双向转发检测BFD协议的第一终端发送的协商报文之后,由于第一终端CPU被占用,导致第一终端不能及时处理协商报文并配置硬件发送BFD报文,使得第二终端长时间未接受到BFD报文,则第二终端和/或第一终端认为主BFD链路出现故障,从而切换到备用BFD会话链路,或者发送BFD故障报文。
在需要开始进行数据传输时,第一终端主动通过CPU向预先配置BFD协议的第二终端发送BFD协商报文。第二终端接收到第一终端发送的BFD协商报文时,对第一终端发送的BFD协商报文进行验证,验证通过后,第二终端配置硬件现场可编辑门阵列FPGA创建BFD会话,以产生BFD报文,并将产生的所述BFD报文发送给第一终端,即在现场可编辑门阵列FPGA产生一条BFD报文时就发送给所述第一终端,或者将协商报文验证通过后产生的协商成功报文发送给所述第一终端,再将现场可编辑门阵列FPGA产生的所述BFD报文发送给所述第一终端,当然第二终端还可以发送P置位或者F置位报文给所述第一终端。具体实施中还可以将接收到的第一终端发送的BFD协商报文和第二终端产生的BFD报文一同发送。此时第一终端CPU可能被占用,如果第一终端被占用,则第一终端硬件现场可编辑门阵列FPGA接收到第二终端基于第一终端发送的协商报文发送的协商成功报文或者预置次数的BFD报文。
在第一终端CPU未被占用时,第一终端接收到第二终端发送的BFD协商成功报文或者BFD报文后,第一终端CPU根据接收到的BFD协商成功报文或BFD保活报文配置硬件现场可编辑门阵列FPGA建立BFD会话,以产生BFD报文,并发送给所述第二终端,当然也可以将接收到的第二终端发送的BFD报文和第一终端产生的BFD报文一起发送给第二终端。具体实施中第一终端还可以在硬件现场可编辑门阵列FPGA接收到BFD协商成功报文后,自动创建BFD会话。
比如本实施例中,第二终端接收所述第一终端发送的协商BFD报文时,对第一终端发送的协商BFD报文进行验证,如果验证通过,则向所述第一终端发送协商成功的BFD报文,并通知第二终端中硬件现场可编辑门阵列FPGA配置BFD会话。硬件现场可编辑门阵列FPGA配置BFD会话后,对产生的BFD保活报文进行计数,在产生3次BFD报文后,一次向所述第一终端发送产生的所述3个BFD报文,当然也可以设置为2次、4次,具体实施中还可以进入设置菜单,针对装置的不同性能用户自定义进行设置预置次数。在更多的实施中,在配
置BFD会话时,还可以按传统机制发送BFD报文,即在协商成功后,产生一个BFD报文,就发送给第一终端,在发送完预置次数的BFD报文之前,接收第一终端发送对应的一个保活报文和/或P置位报文,但不对第一终端发送的BFD报文和/或P置位报文进行检测,即在发送完预置次数的BFD报文之前,第二终端未接收到第一终端的BFD报文,也不会产生告警或启用其他保护机制,比如启用保护链路。在第二终端接收到第一终端发送的预置次数BFD报文时,将预置次数的保活报文上报第二终端的CPU。
第一终端在接收到第二终端协商成功的报文时,第一终端CPU对接收到的协商成功报文进行验证,如果验证通过后,则通知第一终端硬件现场可编辑门阵列FPGA配置BFD会话,此时第一终端开始进入UP状态,硬件现场可编辑门阵列FPGA配置BFD会话后,产生BFD保活报文,同时对产生的BFD报文进行计数,在产生3次BFD报文后,向所述第二终端发送产生的所述3个BFD报文,当然也可以设置为2次、4次,当然还可以进入设置菜单,针对第一终端和/或第二终端的不同性能用户自定义进行设置。在具体实施中,在进入BFD会话后,还可以按传统机制发送BFD报文中保活报文,即在接收到第二终端协商成功的报文后,产生一个BFD报文,就发送给第二终端,接收第二终端发送的对应一个保活报文和/或P置位报文。在接收到预置次数个BFD报文时,将预置次数的保活报文上报第一终端的CPU。在更多的实施中还可以在第一终端发送协商报文后,就通知硬件现场可编辑门阵列FPGA配置BFD会话。本领域人员可知,发送BFD保活报文的次数的所用的时间小于BFD检测机制中检测BFD报文的预置时间,比如BFD检测机制中预置时间为5秒,若超过5秒未接收到BFD保活报文,则认为BFD会话链路存在故障,此时BFD保活报文的次数的所用的时间小于5秒,当然具体实施中可以对BFD检测机制中预置时间进行调整。
在发送预置次数的所述BFD报文后,进入步骤S20。
步骤S20,在所述第二终端未接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文,且所述第二终端发送所述第一BFD报文的次数大于或等于预设阈值时,所述第二终端判定其与所述第一终端之间的链路发生故障。
在步骤S10中第二终端在向所述第一终端发送的所述BFD报文的次数大于或者等于预设阈值时,比如本实施例中由于第一终端CPU被占用,无法及时处理接收到的第二终端发送的BFD报文,即接收到第二终端发送的协商成功报文后未及时处理,则不能配置硬件可编辑门阵列FPGA产生BFD报文,在所述第二终端向所述第一终端发送的所述BFD报文的次数大于或者等于3次时,如果第二终端未接收到所述第一终端发送的BFD报文,则判定所述第二终端和所述第一终端之间的链路发生故障。当然如果在第二终端在发送预设阈值的所述BFD报文的时间内,所述第二终端接收到所述第一终端发送的BFD报文,但验证未通过,也可以判定所述述第二终端和所述第一终端之间的链路发生故障。具体实施中还可以设置第二终端在发送预置次数的所述BFD报文后,如果第二终端未接收到所述第一终端发送的BFD报文,则启用保护链路进行数据传输,再发送预设阈值次数的BFD报文,如果在通过保护链路进行发送预设阈值次的BFD报文后,还是未收到所述第一终端的反馈BFD报文,则判断所述第二终端和所述第一终端之间的链路发生故障。
或者,由于第二终端CPU被占用,无法处理接收到的第一终端发送的BFD报文,在第一终端在发送预设阈值次的BFD报文后,如果所述第一终端未接收到所述第二终端发送的BFD报文,则判定所述第二终端和所述第一终端之间的链路发生故障,然后第一终端自动重新发送协商BFD报文,当然也可以不发送。
步骤S30:所述第二终端生成故障告警报文发送给CPU,并停止发送BFD报文。
根据步骤S20判断的结果,如果判断到所述BFD会话链路发送故障,则第一终端和/或第二终端生成故障告警报文,并向各自终端CPU发送故障告警报文,当然两终端还可以向对端发送故障告警报文,具体实施中还可以按着预置频率发送故障告警报文,或者在故障状态未改变之前只发送一次故障告警报文,以减少故障告警报文对CPU的负担,当然也可以不发送,比如第一终端通过CPU向第二终端重新发送协商报文。CPU接收到所述故障告警报文,可以在预设BFD信息表中查找,预设BFD信息表是存储有BFD信息索引表,主要涉及BFD报文和BFD链接的通讯问题,当检测到所述BFD链路发生故障时,查找到的对应故障告警报文,并对该告警报文对应的问题进行处理。在更多的实施中可以首先根据所述预设BFD信息表,判断所述BFD报文中是否存在预置的停止标记,如果判断所述BFD报文中存在停止标记,在所述故障告警报文中找到对应预设BFD信息表中的停止标记,则停止发送BFD报文。
在另一实施中还可以通过判断CPU进程数量,根据判断结果确定是否按预置次数发送BFD报文。因为有CPU参与的任务行为,大多是在多进程任务系统中进行的,可以通过判断CPU进程数量,如果CPU进程数量大于预置数量,则说明CPU被占用,此时,按本发明中发送预置次数的BFD报文;如果CPU进程数小于或等于预置数量,则说明CPU未被占用,则可以按传统BFD检测机制发送。
本发明实施例通过在第一终端与第二终端BFD协议协商成功之后,所述第二终端生成第一BFD报文,并向所述第一终端定时发送所述第一BFD报文;在所述第二终端未接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文,且所述第二终端发送所述第一BFD报文的次数大于或等于预设阈值时,所述第二终端判定其与所述第一终端之间的链路发生故障。通过上述方式,本发明实施例第二终端在协商成功后,继续发送预置次数的BFD报文,无需等待第一终端发送的BFD报文,在发送预置阈值次BFD报文后,才判断第二终端判定其与所述第一终端之间的链路发生故障。能够避免因为第一终端和第二终端创建不同步,而引起不必要的倒换;并改善了在大容量场景下,因第一终端CPU占用不能及时处理需要发送的BFD报文,导致协商到INIT或者UP状态的BFD链路因超时又重新回到Down状态的技术问题,从而提高BFD检测机制可靠性。
请参阅图2,图2为本发明链路检测方法第二实施例的流程示意图。基于第一实施例,所述方法还包括:
步骤S40,在所述第二终端接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文,且所述第二终端发送所述第一BFD报文的次数小于预设阈值时,所述第二终端判定其
与所述第一终端之间的链路正常。
在步骤S20中第二终端在发送预置次数的所述BFD报文的时间内,如果第二终端接收到所述第一终端发送的BFD报文,则第二终端对接收到的第一终端发送的BFD报文进行验证,如果验证通过,则判定所述第二终端和所述第一终端之间的链路正常。如果验证第一终端协商BFD报文时,验证失败,则向所述第一终端发送验证失败BFD报文,当然也可以不发送。如果验证第一终端协商BFD报文时,验证通过,则继续发送BFD报文,所述第二终端并在接收到第一终端发送的预置次数BFD报文时,对接收的BFD报文进行验证。
或者,在第一终端CPU被占用时,第一终端在第二终端发送预置次数的所述BFD报文的时间内,如果所述第一终端接收到所述第二终端发送的BFD报文,并通过验证,则判定所述第二终端和所述第一终端之间的链路正常。
第一终端和第二终端都是在发送预置次数的BFD报文时,才开始检测接收到的BFD报文。在第一终端和第二终端CPU未被占用时,可以在接收到预置次数的BFD报文时,再上传到CPU,CPU再对接收到预置次数的BFD报文进行验证;当然也可以在每次接收到BFD报文时,上传到CPU,第一终端和第二终端CPU在第一终端或第二终端发送预置次数的BFD报文时才开始验证。
请参照图3,图3为图2中在所述第二终端接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文,且所述第二终端发送所述第一BFD报文的次数小于预设阈值时,所述第二终端判定其与所述第一终端之间的链路正常的步骤的细化流程示意图。该步骤包括:
步骤S41,在接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文时,判断所述第一终端反馈的第二BFD报文是否为保活报文;
协商成功之后,第二终端在发送预置次数的所述BFD报文期间,对接收到所述第一终端发送的BFD报文进行判断,判断所述BFD报文是否为保活报文。比如,一般CPU发送的报文为慢速报文,其发送周期在秒级以上,即一秒以上;通过硬件现场可编辑门阵列FPGA发送的报文为快速报文,其发送时间为秒级以下。本实施例中通过根据所述BFD报文产生时间,或者两端节点对接收到的BFD报文的周期,进行计算,计算每个BFD报文的发送时间,如果计算得到每个BFD报文发送时间为秒级以上,则判断所述BFD报文为BFD协商报文,否则为BFD保活报文。具体实施中还可以通过判断所述报文是由CPU产生还是硬件现场可编辑门阵列FPGA产生,比如在CPU和/或硬件现场可编辑门阵列FPGA产生的BFD报文作一个标记,根据标记进行判断。在判断结果为所述BFD报文是保活报文时,进入步骤S42,否则进入步骤S43。
步骤S42,如果所述第二BFD报文是保活报文,则对所述第二BFD报文进行验证,如果验证通过,则所述第二终端判定其与所述第一终端之间的链路正常;
根据步骤S41判断结果,在所述BFD报文是保活报文时,第一终端硬件现场可编辑门阵
列FPGA产生了预置个数的BFD保活报文时,再发送给第二终端,或者第一终端硬件现场可编辑门阵列FPGA每产生一个BFD保活报文时,发送给所述第二终端。比如本实施例中在硬件现场可编辑门阵列FPGA产生了3个数的BFD保活报文时,第一端再将硬件现场可编辑门阵列FPGA产生的3个BFD保活报文发送给第二端。第二终端接收到第一终端发送的3个BFD保活报文,对接收的BFD保活报文进行验证,验证通过后,第二终端产生预置个数对应的BFD保活报文,发送给第一终端。当然在第一终端和第二终端未接收到停止发送BFD报文的命令之前,可以一直将产生的每个BFD报文发送给对方,在第一终端和第二终端CPU接收到预置次数的BFD报文时,对所述保活报文进行验证,如果验证通过,则判定所述第二终端和所述第一终端之间的链路正常。如果验证未通过,则判定所述第二终端和所述第一终端之间的链路不正常。
步骤S43,按传统BFD机制发送。
根据步骤S41的判断结果,如果判断结果为所述BFD报文是BFD协商报文,则第一终端和/或第二终端按传统BFD机制发送和处理。当然还可以提高BFD协商报文的优先级,使得第二终端优先处理所述BFD协商报文。
本发明实施例核心思想是在接收到预置次数BFD报文时,才开始检测,包括至少3种实现方式:一、第二终端接收到第一终端一次发送的预置次数BFD报文时,将接收到的预置次数BFD报文上传CPU;二、第二终端在预置时间内接收到第一终端发送的BFD报文,并保存,在保存预置次数BFD报文后,再上传给CPU;三、第二终端接收到第一终端发送的每个BFD报文时都上传CPU。CPU在接收到预置次数BFD报文时,才对接收的BFD报文进行处理。同时本领域人员可以知,上述第一终端和第二终端可以互换,即第一终端和第二终端具有同样的功能。
本发明实施例进一步提供一种链路检测装置。
请参照图4,图4为本发明链路检测装置第一实施例的功能模块示意图。
在本实施例中,该链路检测装置包括:生成模块10、发送模块20、接收模块30和判断模块40。
生成模块10设置为在第一终端与第二终端BFD协议协商成功之后,生成第一BFD报文。
发送模块20,设置为向所述第一终端定时发送所述第一BFD报文。
接收模块30,设置为接收所述第一终端基于所述第一BFD报文反馈的第二BFD报文。
BFD报文在网络数据传输中主要设置为为BFD检测机制建立验证参数,在BFD会话建立前,BFD会话处于Down状态,BFD报文设置为进行BFD会话协商,协商BFD报文需上报CPU,由CPU来处理;BFD会话建立后,设置为更新BFD会话参数,或者重新协商BFD会话,在BFD会话建立后,则认为BFD会话处于UP状态,BFD报文设置为检测BFD会话
链路正常的BFD报文为保活报文,主要由硬件现场可编辑门阵列FPGA(Field-Programmable Gate Array)来处理,BFD报文中包括的时间、端口等参数需上报CPU进行处理。在传统BFD检测机制中,如果CPU由于任务调度问题,无法及时处理,就会造成CPU中大量报文堆积,影响整个BFD运行的稳定性以及降低整个系统的性能,比如第二终端接收预先配置双向转发检测BFD协议的第一终端发送的协商报文之后,由于第一终端CPU被占用,导致第一终端不能及时处理协商报文并配置硬件发送BFD报文,使得第二终端长时间未接受到BFD报文,则第二终端和/或第一终端认为主BFD链路出现故障,从而切换到备用BFD会话链路,或者发送BFD故障报文。
在需要开始进行数据传输时,第一终端主动通过CPU向预先配置BFD协议的第二终端发送BFD协商报文。第二终端接收到第一终端发送的BFD协商报文时,对第一终端发送的BFD协商报文进行验证,验证通过后,第二终端配置硬件现场可编辑门阵列FPGA创建BFD会话,以产生BFD报文,并将产生的所述BFD报文发送给第一终端,即在现场可编辑门阵列FPGA产生一条BFD报文时就发送给所述第一终端,或者将协商报文验证通过后产生的协商成功报文发送给所述第一终端,再将现场可编辑门阵列FPGA产生的所述BFD报文发送给所述第一终端,当然第二终端还可以发送P置位或者F置位报文给所述第一终端。具体实施中还可以将接收到的第一终端发送的BFD协商报文和第二终端产生的BFD报文一同发送。此时第一终端CPU可能被占用,如果第一终端被占用,则第一终端硬件现场可编辑门阵列FPGA接收到第二终端基于第一终端发送的协商报文发送的协商成功报文或者预置次数的BFD报文。
在第一终端CPU未被占用时,第一终端接收到第二终端发送的BFD协商成功报文或者BFD报文后,第一终端CPU根据接收到的BFD协商成功报文或BFD保活报文配置硬件现场可编辑门阵列FPGA建立BFD会话,以产生BFD报文,并发送给所述第二终端,当然也可以将接收到的第二终端发送的BFD报文和第一终端产生的BFD报文一起发送给第二终端。具体实施中第一终端还可以在硬件现场可编辑门阵列FPGA接收到BFD协商成功报文后,自动创建BFD会话。
比如本实施例中,第二终端接收所述第一终端发送的协商BFD报文时,对第一终端发送的协商BFD报文进行验证,如果验证通过,则向所述第一终端发送协商成功的BFD报文,并通知第二终端中硬件现场可编辑门阵列FPGA配置BFD会话。硬件现场可编辑门阵列FPGA配置BFD会话后,对产生的BFD保活报文进行计数,在产生3次BFD报文后,一次向所述第一终端发送产生的所述3个BFD报文,当然也可以设置为2次、4次,具体实施中还可以进入设置菜单,针对装置的不同性能用户自定义进行设置预置次数。在更多的实施中,在配置BFD会话时,还可以按传统机制发送BFD报文,即在协商成功后,产生一个BFD报文,就发送给第一终端,在发送完预置次数的BFD报文之前,接收第一终端发送对应的一个保活报文和/或P置位报文,但不对第一终端发送的BFD报文和/或P置位报文进行检测,即在发送完预置次数的BFD报文之前,第二终端未接收到第一终端的BFD报文,也不会产生告警或启用其他保护机制,比如启用保护链路。在第二终端接收到第一终端发送的预置次数BFD报文时,将预置次数的保活报文上报第二终端的CPU。
第一终端在接收到第二终端协商成功的报文时,第一终端CPU对接收到的协商成功报文进行验证,如果验证通过后,则通知第一终端硬件现场可编辑门阵列FPGA配置BFD会话,此时第一终端开始进入UP状态,硬件现场可编辑门阵列FPGA配置BFD会话后,产生BFD保活报文,同时对产生的BFD报文进行计数,在产生3次BFD报文后,向所述第二终端发送产生的所述3个BFD报文,当然也可以设置为2次、4次,当然还可以进入设置菜单,针对第一终端和/或第二终端的不同性能用户自定义进行设置。在具体实施中,在进入BFD会话后,还可以按传统机制发送BFD报文中保活报文,即在在接收到第二终端协商成功的报文后,产生一个BFD报文,就发送给第二终端,接收第二终端发送的对应一个保活报文和/或P置位报文。在接收到预置次数个BFD报文时,将预置次数的保活报文上报第一终端的CPU。在更多的实施中还可以在第一终端发送协商报文后,就通知硬件现场可编辑门阵列FPGA配置BFD会话。本领域人员可知,发送BFD保活报文的次数的所用的时间小于BFD检测机制中检测BFD报文的预置时间,比如BFD检测机制中预置时间为5秒,若超过5秒未接收到BFD保活报文,则认为BFD会话链路存在故障,此时BFD保活报文的次数的所用的时间小于5秒,当然具体实施中可以对BFD检测机制中预置时间进行调整。
判断模块40,设置为在所述第二终端未接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文,且所述第二终端发送所述第一BFD报文的次数大于或等于预设阈值时,判定所述第二终端和所述第一终端之间的链路发生故障。
第二终端在向所述第一终端发送的所述BFD报文的次数大于或者等于预设阈值时,比如本实施例中由于第一终端CPU被占用,无法及时处理接收到的第二终端发送的BFD报文,即接收到第二终端发送的协商成功报文后未及时处理,则不能配置硬件可编辑门阵列FPGA产生BFD报文,在所述第二终端向所述第一终端发送的所述BFD报文的次数大于或者等于3次时,如果第二终端未接收到所述第一终端发送的BFD报文,则判定所述第二终端和所述第一终端之间的链路发生故障。当然如果在第二终端在发送预设阈值的所述BFD报文的时间内,所述第二终端接收到所述第一终端发送的BFD报文,但验证未通过,也可以判定所述述第二终端和所述第一终端之间的链路发生故障。具体实施中还可以设置第二终端在发送预置次数的所述BFD报文后,如果第二终端未接收到所述第一终端发送的BFD报文,则启用保护链路进行数据传输,再发送预设阈值次数的BFD报文,如果在通过保护链路进行发送预设阈值次的BFD报文后,还是未收到所述第一终端的反馈BFD报文,则判断所述第二终端和所述第一终端之间的链路发生故障。
或者,由于第二终端CPU被占用,无法处理接收到的第一终端发送的BFD报文,在第一终端在发送预设阈值次的BFD报文后,如果所述第一终端未接收到所述第二终端发送的BFD报文,则判定所述第二终端和所述第一终端之间的链路发生故障,然后第一终端自动重新发送协商BFD报文,当然也可以不发送。
判断模块40,还设置为在所述第二终端接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文,且所述第二终端发送所述第一BFD报文的次数小于预设阈值时,所述第二终端判定其与所述第一终端之间的链路正常。
在第二终端在发送预置次数的所述BFD报文的时间内,如果第二终端接收到所述第一终端发送的BFD报文,则第二终端对接收到的第一终端发送的BFD报文进行验证,如果验证通过,则判定所述第二终端和所述第一终端之间的链路正常。如果验证第一终端协商BFD报文时,验证失败,则向所述第一终端发送验证失败BFD报文,当然也可以不发送。如果验证第一终端协商BFD报文时,验证通过,则继续发送BFD报文,所述第二终端并在接收到第一终端发送的预置次数BFD报文时,对接收的BFD报文进行验证。
或者,在第一终端CPU被占用时,第一终端在第二终端发送预置次数的所述BFD报文的时间内,如果所述第一终端接收到所述第二终端发送的BFD报文,并通过验证,则判定所述第二终端和所述第一终端之间的链路正常。
第一终端和第二终端都是在发送预置次数的BFD报文时,才开始检测接收到的BFD报文。在第一终端和第二终端CPU未被占用时,可以在接收到预置次数的BFD报文时,再上传到CPU,CPU再对接收到预置次数的BFD报文进行验证;当然也可以在每次接收到BFD报文时,上传到CPU,第一终端和第二终端CPU在第一终端或第二终端发送预置次数的BFD报文时才开始验证。
在一优选实施中,所述装置还包括告警模块(图未示),所述告警模块设置为根据判断模块330的判断结果,如果判断到所述BFD会话链路发送故障,则第一终端和/或第二终端生成故障告警报文,并向各自终端CPU发送故障告警报文。当然两终端还可以向对端发送故障告警报文,具体实施中还可以按着预置频率发送故障告警报文,或者在故障状态未改变之前只发送一次故障告警报文,以减少故障告警报文对CPU的负担,当然也可以不发送,比如第一终端通过CPU向第二终端重新发送协商报文。CPU接收到所述故障告警报文,可以在预设BFD信息表中查找,预设BFD信息表是存储有BFD信息索引表,主要涉及BFD报文和BFD链接的通讯问题,当检测到所述BFD链路发生故障时,查找到的对应故障告警报文,并对该告警报文对应的问题进行处理。在更多的实施中可以首先根据所述预设BFD信息表,判断所述BFD报文中是否存在预置的停止标记,如果判断所述BFD报文中存在停止标记,在所述故障告警报文中找到对应预设BFD信息表中的停止标记,则停止发送BFD报文。
在另一实施中还可以通过判断CPU进程数量,根据判断结果确定是否按预置次数发送BFD报文。因为有CPU参与的任务行为,大多是在多进程任务系统中进行的,可以通过判断CPU进程数量,如果CPU进程数量大于预置数量,则说明CPU被占用,此时,按本发明中发送预置次数的BFD报文;如果CPU进程数小于或等于预置数量,则说明CPU未被占用,则可以按传统BFD检测机制发送。
请参照图5,图5为图4中判断模块的细化功能模块示意图。
基于本发明链路检测装置第一实施例,判断模块40包括:判断单元41和验证单元42。
判断单元41设置为在接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文时,判断所述第一终端反馈的第二BFD报文是否是保活报文。
协商成功之后,在接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文时,对发送的BFD报文进行判断,判断所述BFD报文是否为保活报文。在具体实施中还可以判断CPU进程数量,因为有CPU参与的任务行为,大多是在多进程任务系统中进行的,可以通过判断CPU进程数量,如果CPU进行数量多,比如CPU进程数大于预置数量,则说明CPU被占用,此时,按本发明实施例中相隔预置时间发送预置次数的BFD报文;如果CPU进程数小于或等于预置数量,则说明CPU未被占用,则按传统BFD检测机制发送。
验证单元42设置为在所述判断单元的判断结果为所述第二BFD报文是保活报文时,对所述第二BFD报文进行验证,如果验证通过,则判断模块40判定所述第二终端和所述第一终端之间的链路正常。
根据判断单元41的判断结果为所述BFD报文是保活报文时,第一终端硬件现场可编辑门阵列FPGA产生了预置个数的BFD保活报文时,再发送给第二终端,比如本实施例中在硬件现场可编辑门阵列FPGA产生了3个数的BFD保活报文时,第一端再将硬件现场可编辑门阵列FPGA产生的3个BFD保活报文发送给第二端。第二终端接收到第一终端发送的3个BFD保活报文,对接收的BFD保活报文进行验证,验证通过后,第二终端产生预置个数对应的BFD保活报文,发送给第一终端,以完成UP状态的验证。如果判断单元321的判断结果为所述BFD报文是BFD协商报文,则第一终端和/或第二终端按传统BFD机制发送和处理。
本发明实施例核心思想是在接收到预置次数BFD报文时,才开始检测,包括至少3种实现方式:一、第二终端接收到第一终端一次发送的预置次数BFD报文时,将接收到的预置次数BFD报文上传CPU;二、第二终端在预置时间内接收到第一终端发送的BFD报文,并保存,在保存预置次数BFD报文后,再上传给CPU;三、第二终端接收到第一终端发送的每个BFD报文时都上传CPU。CPU在接收到预置次数BFD报文时,才对接收的BFD报文进行处理。同时本领域人员可以知,上述第一终端和第二终端可以互换,即第一终端和第二终端具有同样的功能。
请参照图6,图6为图5中判断单元的细化功能模块示意图。基于上述实施例,所述链路检测装置中判断单元41包括计算子单元411、判断子单元412和判定子单元413。
计算子单元411设置为基于第一终端反馈的第二BFD报文的周期,计算所述第一终端反馈的每个BFD报文的时间间隔。
一般CPU发送的报文为慢速报文,其发送周期在秒级以上,即一秒以上;通过硬件现场可编辑门阵列FPGA发送的报文为快速报文,其发送时间为秒级以下。本实施例中通过根据所述BFD报文产生时间,或者两终端对接收到的BFD报文的周期,进行计算,计算每个BFD报文的发送时间,具体实施中还可以不包括计算子单元,比如在CPU和/或硬件现场可编辑门阵列FPGA产生的BFD报文作一个标记,根据标记进行判断。
判断子单元412设置为在在计算子单元411计算结果为每个所述BFD报文的反馈时间小于预置时间时,判断所述第一终端反馈的每个BFD报文的反馈时间间隔是否小于预置时间。
判定子单元413设置为在判断子单元412判断结果为所述第一终端反馈的每个所述BFD报文的反馈时间间隔小于预置时间时,判定所述BFD报文为保活报文。
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。
如上所述,本发明实施例提供的一种链路检测方法和装置,具有以下有益效果:本发明实施例第二终端在协商成功后,继续发送预置次数的BFD报文,无需等待第一终端发送的BFD报文,在发送预置阈值次BFD报文后,才判断第二终端判定其与所述第一终端之间的链路发生故障。能够避免因为第一终端和第二终端创建不同步,而引起不必要的倒换;并改善了在大容量场景下,因第一终端CPU占用不能及时处理需要发送的BFD报文,导致协商到INIT或者UP状态的BFD链路因超时又重新回到Down状态的技术问题,从而提高BFD检测机制可靠性。
Claims (10)
- 一种链路检测方法,所述方法包括以下步骤:在第一终端与第二终端BFD协议协商成功之后,所述第二终端生成第一BFD报文,并向所述第一终端定时发送所述第一BFD报文;在所述第二终端未接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文,且所述第二终端发送所述第一BFD报文的次数大于或等于预设阈值时,所述第二终端判定其与所述第一终端之间的链路发生故障。
- 如权利要求1所述的方法,其中,所述判定所述第二终端和所述第一终端之间的链路发生故障的步骤之后包括:所述第二终端生成故障告警报文,并停止发送BFD报文。
- 如权利要求1所述的方法,其中,所述方法还包括:在所述第二终端接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文,且所述第二终端发送所述第一BFD报文的次数小于预设阈值时,所述第二终端判定其与所述第一终端之间的链路正常。
- 如权利要求3所述的方法,其中,所述在所述第二终端接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文,且所述第二终端发送所述第一BFD报文的次数小于预设阈值时,所述第二终端判定其与所述第一终端之间的链路正常的步骤包括:在接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文时,判断所述第一终端反馈的第二BFD报文是否为保活报文;如果所述第二BFD报文是保活报文,则对所述第二BFD报文进行验证,如果验证通过,则所述第二终端判定其与所述第一终端之间的链路正常。
- 如权利要求4所述的方法,其中,所述判断所述第一终端反馈的第二BFD报文是否为保活报文的步骤包括:基于所述第一终端反馈的第二BFD报文的周期,所述第二终端计算所述第一终端反馈的每个BFD报文的反馈时间间隔;所述第二终端判断所述第一终端反馈的每个BFD报文的反馈时间间隔是否小于预置时间;如果判断结果为第一终端反馈的每个BFD报文的反馈时间间隔小于预置时间时,判定所述第二BFD报文为保活报文。
- 一种链路检测装置,所述装置包括:生成模块,设置为在第一终端与第二终端BFD协议协商成功之后,生成第一BFD报文;发送模块,设置为向所述第一终端定时发送所述第一BFD报文;接收模块,设置为接收所述第一终端基于所述第一BFD报文反馈的第二BFD报文;判断模块,设置为在所述第二终端未接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文,且所述第二终端发送所述第一BFD报文的次数大于或等于预设阈值时,判定所述第二终端和所述第一终端之间的链路发生故障。
- 如权利要求6所述的装置,其中,所述装置还包括:告警模块,设置为在所述链路发生故障时,生成故障告警报文。
- 如权利要求6所述的装置,其中,所述判断模块还设置为在所述第二终端接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文,且所述第二终端发送所述第一BFD报文的次数小于或等于预设阈值时,判定所述第二终端和所述第一终端之间的链路正常。
- 如权利要求8所述的装置,其中,所述判断模块包括:判断单元和验证单元,所述判断单元设置为在接收到所述第一终端基于所述第一BFD报文反馈的第二BFD报文时,判断所述第一终端反馈的第二BFD报文是否是保活报文;所述验证单元设置为在所述判断单元的判断结果为所述第二BFD报文是保活报文时,对所述第二BFD报文进行验证,如果验证通过,则判定所述第二终端和所述第一终端之间的链路正常。
- 如权利要求9所述的装置,其中,所述判断单元包括计算子单元、判断子单元和判定子单元,所述计算子单元设置为基于第一终端反馈的第二BFD报文的周期,计算所述第一终端反馈的每个BFD报文的时间间隔;所述判断子单元设置为判断所述第一终端反馈的每个BFD报文的反馈时间间隔是否小于预置时间;所述判定子单元设置为在所述判断子单元判断结果为所述第一终端反馈的每个所述BFD报文的反馈时间间隔小于预置时间时,判定所述BFD报文为保活报文。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510299031.6 | 2015-06-03 | ||
CN201510299031.6A CN106301986A (zh) | 2015-06-03 | 2015-06-03 | 链路检测方法和装置 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2016192282A1 true WO2016192282A1 (zh) | 2016-12-08 |
Family
ID=57440077
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2015/092858 WO2016192282A1 (zh) | 2015-06-03 | 2015-10-26 | 链路检测方法和装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106301986A (zh) |
WO (1) | WO2016192282A1 (zh) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111327562A (zh) * | 2018-12-13 | 2020-06-23 | 海能达通信股份有限公司 | 一种会话的检测方法、会话系统及存储介质 |
CN111682982A (zh) * | 2020-06-03 | 2020-09-18 | 北京东土军悦科技有限公司 | 路径的故障检测方法、装置、设备、系统及存储介质 |
CN113055224A (zh) * | 2021-02-05 | 2021-06-29 | 新华三信息安全技术有限公司 | 一种设备内报文转发故障检测及装置 |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109474489B (zh) * | 2018-11-02 | 2021-04-20 | 新华三信息安全技术有限公司 | 一种链路检测方法、装置及网络设备 |
CN110149222A (zh) * | 2019-04-30 | 2019-08-20 | 浙江亿邦通信科技有限公司 | Bfd功能的实现方法 |
CN110971459B (zh) * | 2019-11-29 | 2020-07-14 | 新华三半导体技术有限公司 | 会话故障检测方法、装置、终端设备及可读存储介质 |
CN114697999A (zh) * | 2020-12-28 | 2022-07-01 | 华为技术有限公司 | 一种冗余路径创建方法、装置及系统 |
CN114114342A (zh) * | 2021-11-24 | 2022-03-01 | 中电科星河北斗技术(西安)有限公司 | 一种rdss短报文发送闭环监测方法、装置及存储介质 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA2320327A1 (en) * | 1998-02-12 | 1999-08-19 | Ericsson Inc. | Reliable continuously operating fixed cellular terminal |
CN101163060A (zh) * | 2007-11-30 | 2008-04-16 | 杭州华三通信技术有限公司 | Bfd会话建立方法、bfd会话建立装置及路由设备 |
CN102347855A (zh) * | 2011-07-21 | 2012-02-08 | 福建星网锐捷网络有限公司 | 双向转发检测实现方法、装置及网络设备 |
-
2015
- 2015-06-03 CN CN201510299031.6A patent/CN106301986A/zh not_active Withdrawn
- 2015-10-26 WO PCT/CN2015/092858 patent/WO2016192282A1/zh active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA2320327A1 (en) * | 1998-02-12 | 1999-08-19 | Ericsson Inc. | Reliable continuously operating fixed cellular terminal |
CN101163060A (zh) * | 2007-11-30 | 2008-04-16 | 杭州华三通信技术有限公司 | Bfd会话建立方法、bfd会话建立装置及路由设备 |
CN102347855A (zh) * | 2011-07-21 | 2012-02-08 | 福建星网锐捷网络有限公司 | 双向转发检测实现方法、装置及网络设备 |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111327562A (zh) * | 2018-12-13 | 2020-06-23 | 海能达通信股份有限公司 | 一种会话的检测方法、会话系统及存储介质 |
CN111682982A (zh) * | 2020-06-03 | 2020-09-18 | 北京东土军悦科技有限公司 | 路径的故障检测方法、装置、设备、系统及存储介质 |
CN111682982B (zh) * | 2020-06-03 | 2022-09-27 | 北京东土军悦科技有限公司 | 路径的故障检测方法、装置、设备、系统及存储介质 |
CN113055224A (zh) * | 2021-02-05 | 2021-06-29 | 新华三信息安全技术有限公司 | 一种设备内报文转发故障检测及装置 |
CN113055224B (zh) * | 2021-02-05 | 2022-05-27 | 新华三信息安全技术有限公司 | 一种设备内报文转发故障检测及装置 |
Also Published As
Publication number | Publication date |
---|---|
CN106301986A (zh) | 2017-01-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2016192282A1 (zh) | 链路检测方法和装置 | |
US10931742B2 (en) | State replication of virtual network function instances | |
WO2021169377A1 (zh) | 配网方法、装置和计算机设备 | |
CN109286593B (zh) | 传输重连的方法及装置、计算机设备及存储介质 | |
EP2696542A1 (en) | Method, ToR switch, and system for implementing protection switchover based on TRILL network | |
CN106603261B (zh) | 热备份方法、第一主用设备、备用设备和通信系统 | |
CN104283711B (zh) | 基于双向转发检测bfd的故障检测方法、节点及系统 | |
WO2018161550A1 (zh) | 物联网家电设备离线恢复方法和联网模块 | |
CN107277058B (zh) | 一种基于bfd协议的接口认证方法及系统 | |
WO2014036724A1 (zh) | 一种操作维护通道的故障恢复方法和网络管理终端 | |
EP2874355A2 (en) | Method and device for bidirectional forwarding detection under condition of parameter update | |
CN104468168A (zh) | 网络故障恢复方法、控制服务器及交换机 | |
CN105703967B (zh) | 一种检测标签交换路径连通性的方法及装置 | |
WO2017000438A1 (zh) | 一种提高交换网链路中业务检测可靠性的方法及装置 | |
WO2016154921A1 (zh) | 一种数据业务的数据传输方法及装置 | |
CN108462612A (zh) | 调整rtp媒体流传输的方法、装置、电子设备和存储介质 | |
WO2016082343A1 (zh) | 故障检测方法及装置 | |
CN106304071B (zh) | 一种网络接入认证方法、接入认证设备及系统 | |
WO2016187980A1 (zh) | 一种bfd建链的方法及其装置、路由器 | |
US9769140B1 (en) | Authentication support for autonomous requests | |
KR101587332B1 (ko) | 컨트롤러와 네트워크 장치 간 연결 상태 확인 방법 | |
WO2015158058A1 (zh) | 一种实现呼叫保存和恢复的方法及系统 | |
CN102065072B (zh) | 一种快速建立pppoe链路层连接的方法和装置 | |
CN105519049A (zh) | 一种报文传输方法、装置及系统 | |
CN106375353B (zh) | 建链处理方法及装置 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 15893930 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 15893930 Country of ref document: EP Kind code of ref document: A1 |