CN116708129A - Method, device and storage medium for link fault detection and quick recovery - Google Patents
Method, device and storage medium for link fault detection and quick recovery Download PDFInfo
- Publication number
- CN116708129A CN116708129A CN202310665999.0A CN202310665999A CN116708129A CN 116708129 A CN116708129 A CN 116708129A CN 202310665999 A CN202310665999 A CN 202310665999A CN 116708129 A CN116708129 A CN 116708129A
- Authority
- CN
- China
- Prior art keywords
- wan
- connection
- link
- packet
- main
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 81
- 238000000034 method Methods 0.000 title claims abstract description 34
- 238000011084 recovery Methods 0.000 title claims description 20
- 230000004044 response Effects 0.000 claims abstract description 37
- 238000012544 monitoring process Methods 0.000 claims abstract description 6
- 230000000903 blocking effect Effects 0.000 claims description 18
- 238000004590 computer program Methods 0.000 claims description 18
- 238000004458 analytical method Methods 0.000 claims description 4
- 230000007246 mechanism Effects 0.000 abstract description 6
- 230000006870 function Effects 0.000 description 3
- 230000002159 abnormal effect Effects 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000011144 upstream manufacturing Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000009977 dual effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0631—Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0677—Localisation of faults
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/50—Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application discloses a method, a device and a storage medium for detecting and quickly recovering link faults, wherein the method comprises the following steps: controlling a main WAN to send Ping packet detection to a preset public network IP address at regular time; monitoring a connection event of the main WAN; when a connection disconnection event of a main WAN is received or a Ping response of a public network IP address is not received within a preset time, the control route management module switches a link to a standby WAN; when a connecting event of a main WAN is received or after a link is switched to a standby WAN, continuously sending Ping packets to the main WAN for detection; when receiving the Ping response of the main WAN, the control route management module switches the link to the main WAN; after the link is switched, the connection record database is reset, and the TCP connection in an active state in the connection record database is cut off, so that the state of the main WAN connection is detected in real time, the accuracy and the efficiency of link fault detection are improved by using Ping detection, the service interruption time is shortened by using a TCP protocol anomaly mechanism, and the stability of the network is improved.
Description
Technical Field
The present application relates to the field of computer networks, and in particular, to a method, an apparatus, and a storage medium for detecting and quickly recovering a link failure.
Background
At present, the method for ensuring the stability of the network in the prior art is mainly a dual WAN link backup mode, but when the links are switched, service interruption phenomena of tens of seconds of an application layer can be caused due to the delay of network transmission and the limitation of a link protocol, for example, dual-machine hot standby is high in cost, when NAT session synchronization is not configured or the exit IP between gateways is inconsistent, the switching can cause TCP service retransmission timeout, the final connection is disconnected, the process consumes longer, and the application service interruption is obvious. In addition, the prior art only detects the state of the upstream interface and whether the upstream next hop route is reachable, and cannot ensure that the Internet is finally available.
Therefore, the prior art has the defects of overlong detection and switching time of the link, low accuracy and low efficiency of link fault detection and influence on the stability of the network.
Disclosure of Invention
The application provides a method, a device and a storage medium for link failure detection and quick recovery, which are used for realizing that the accuracy and the efficiency of link failure detection are improved by detecting the state of a main WAN in real time and utilizing concurrent Ping detection, and an application is actively informed to execute recovery operation by utilizing a TCP protocol anomaly mechanism when a link is switched, so that the service interruption time is shortened, and the stability of a network is improved.
The application provides a method for detecting and quickly recovering link faults, which is applied to a router, wherein the router is connected with a main WAN and a standby WAN; the main WAN is a fixed network broadband interface, and the standby WAN is a mobile network interface;
the method comprises the following steps:
controlling a main WAN to send a Ping packet to a preset public network IP address at regular time, detecting and receiving a Ping response of the public network IP address; monitoring a connection event of the main WAN;
when a connection disconnection event of a main WAN is received or a Ping response of the public network IP address is not received within a preset time, the control route management module switches a link to a standby WAN;
when a connecting event of a main WAN is received or after the link is switched to a standby WAN, continuously sending Ping packet detection to the main WAN; when receiving the Ping response of the main WAN, controlling a route management module to switch a link to the main WAN;
resetting a connection record database after the link is switched, and cutting off the TCP connection in an active state in the connection record database; the connection record database is used for recording entry data of the TCP connection data packet.
As a preferred scheme, the application monitors the connection/disconnection event of the main WAN port in real time, ensures that the main WAN port can be quickly switched to the standby WAN port when the physical link fails, and does not need to actively detect overtime and switch; detecting the link fault through Ping detection, and improving the accuracy and efficiency of the link fault detection by utilizing Ping detection; in addition, the TCP connection is actively cut off when the link is switched, so that the down-hanging device can quickly execute connection recovery operation, an application is actively informed of executing the recovery operation by using a TCP protocol exception mechanism, service interruption time is shortened, and network stability is improved.
As a preferred scheme, sending Ping packet detection to a preset public network IP address specifically includes:
information splicing is carried out on at least one echo request Ping packet, and the spliced echo request Ping packet is sent to a preset public network IP address; the preset public network IP addresses are public network IP addresses appointed by a plurality of users;
when a response packet of at least one echo request Ping packet is received within a preset time, returning a normal detection result of a link of the preset public network IP address;
and when the response packet of the echo request Ping packet is not received within the preset time, returning the detection result of the link fault of the preset public network IP address.
As a preferred solution, sending Ping packet detection to the primary WAN specifically includes:
sending a loopback request Ping packet through a main WAN;
when a response packet of the echo request Ping packet is received within a preset time, returning a normal detection result of the link of the main WAN;
and when the response packet of the loopback request Ping packet is not received within the preset time, returning the detection result of the link failure of the main WAN.
As a preferred scheme, the application realizes the detection of the wide area network hosts appointed by a plurality of users in parallel by carrying out information splicing on at least one loopback request Ping packet, shortens the fault detection time, solves the problem of misjudgment and misswitching caused by single-point faults of the external network hosts, and improves the accuracy and the efficiency of link fault detection by utilizing concurrent Ping detection.
Preferably, the router connects the primary WAN and the standby WAN, and further includes:
the router is connected with the down-hanging device, and the main WAN and the standby WAN are connected with the Internet; the down-hanging device initiates TCP connection to the Internet through the router; the down-hanging device is a device for accessing the LAN port of the router.
Preferably, before recording the entry data of the TCP connection packet, the method further comprises:
acquiring a data packet connected with a TCP, and carrying out multi-layer analysis on the data packet by taking a quintuple as an index to generate entry data; the entry data includes: last active time, source IP address, destination IP address, TCP protocol type sum, TCP protocol content.
As a preferred solution, the connection record database is used for recording entry data of the TCP connection data packet, specifically: judging whether the entry data exist in a connection record database according to the entry data of the TCP connection data packet;
if the connection record database does not exist, extracting TCP Flags of the data packet of the TCP connection, and judging whether the data packet is a SYN packet; if yes, inserting the item data into the connection record database; if not, cutting off the TCP connection; if the connection record database exists, updating the entry data of the corresponding record in the connection record database.
As a preferred scheme, the TCP connection data is stored and managed by utilizing the connection database, the record of the TCP connection is stored in the database through a program, and the connection database is updated and maintained in time.
As a preferred solution, the connection record database is reset, specifically:
and calling an interface for resetting the content of the database, and clearing the content of the connection record database.
As a preferred scheme, the method cuts off the TCP connection in the active state in the connection record database, specifically: and calling a connection blocking module to enable the connection blocking module to generate a TCP RST packet opposite to an outbound connection of the TCP connection in a router for the TCP connection with active state, and transmitting the TCP RST packet to an off-hook device.
As a preferred scheme, the application actively cuts off the TCP connection by constructing the TCP RST message from the Internet direction, and triggers the perception of the internal program of the hanging-down equipment on the abnormal TCP connection, so that the connection recovery operation can be quickly executed.
Correspondingly, the application also provides a device for detecting and quickly recovering the link fault, which is applied to a router, wherein the router is connected with a main WAN and a standby WAN; the main WAN is a fixed network broadband interface, and the standby WAN is a mobile network interface;
the device comprises: the device comprises a passive detection module, an active detection module, a connection recording module and a connection blocking module;
the passive detection module is used for monitoring the connection event of the main WAN, and when receiving the connection disconnection event of the main WAN, the control route management module switches the link to the standby WAN; when a connecting event of a main WAN is received, continuously sending Ping packet detection to the main WAN; when receiving the Ping response of the main WAN, controlling a route management module to switch a link to the main WAN;
the active detection module is used for controlling the main WAN to send Ping packets to a preset public network IP address at regular time, detecting and receiving Ping responses of the public network IP address; when the Ping response of the public network IP address is not received within the preset time, the control route management module switches the link to the standby WAN; after the link is switched to the standby WAN, continuously sending Ping packet detection to the main WAN; when receiving the Ping response of the main WAN, controlling a route management module to switch a link to the main WAN;
the connection record module is used for resetting the connection record database; the connection record database is used for recording entry data of the TCP connection data packet;
the connection blocking module is used for cutting off the TCP connection in an active state in the connection record database.
As a preferred scheme, the active detection module of the device monitors the connection/disconnection event of the main WAN port in real time, ensures that the device can be rapidly switched to the standby WAN port when the physical link fault occurs, and does not need to perform switching after active detection overtime; the passive detection module detects the link fault through Ping detection, and accuracy and efficiency of the link fault detection are improved through Ping detection; in addition, the record storage of TCP connection is realized through a connection record module; when the link is switched, the TCP connection is actively cut off through the connection blocking module, so that the down-hanging device can quickly execute connection recovery operation, an application is actively informed of executing the recovery operation by utilizing a TCP protocol abnormality mechanism, service interruption time is shortened, and network stability is improved.
Accordingly, the present application also provides a computer-readable storage medium including a stored computer program; the computer program controls the equipment of the computer readable storage medium to execute the method for detecting and quickly recovering the link fault according to the content of the application when running.
Drawings
FIG. 1 is a flow chart of an embodiment of a method for link failure detection and fast recovery provided by the present application;
fig. 2 is a schematic structural diagram of an embodiment of a link failure detection and fast recovery apparatus according to the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Example 1
Referring to fig. 1, a method for detecting and quickly recovering link failure provided by an embodiment of the present application is applied to a router, where the router connects a main WAN and a standby WAN; the main WAN is a fixed network broadband interface, and the standby WAN is a mobile network interface;
the method comprises the steps of S101-S103:
step S101: monitoring a connection event of a main WAN, and controlling a route management module to switch a link to a standby WAN when receiving a connection disconnection event of the main WAN; when a connecting event of a main WAN is received, continuously sending Ping packet detection to the main WAN; when receiving the Ping response of the main WAN, controlling a route management module to switch a link to the main WAN; in this embodiment, sending Ping packet detection to the primary WAN specifically includes:
sending a loopback request Ping packet through a main WAN;
when a response packet of the echo request Ping packet is received within a preset time, returning a normal detection result of the link of the main WAN;
and when the response packet of the loopback request Ping packet is not received within the preset time, returning the detection result of the link failure of the main WAN.
In this embodiment, the preset time is 2 seconds, and when no Ping response is received for 2 seconds, the detection result of the link failure of the primary WAN is returned, and the route management module is notified to switch to the standby WAN.
Step S102: controlling a main WAN to send a Ping packet to a preset public network IP address at regular time, detecting and receiving a Ping response of the public network IP address; when the Ping response of the public network IP address is not received within the preset time, the control route management module switches the link to the standby WAN; after the link is switched to the standby WAN, continuously sending Ping packet detection to the main WAN; when receiving the Ping response of the main WAN, controlling a route management module to switch a link to the main WAN; in this embodiment, sending Ping packet detection to a preset public network IP address specifically includes:
information splicing is carried out on at least one echo request Ping packet, and the spliced echo request Ping packet is sent to a preset public network IP address; the preset public network IP addresses are public network IP addresses appointed by a plurality of users;
when a response packet of at least one echo request Ping packet is received within a preset time, returning a normal detection result of a link of the preset public network IP address;
and when the response packet of the echo request Ping packet is not received within the preset time, returning the detection result of the link fault of the preset public network IP address.
In this embodiment, by performing information splicing on a plurality of echo request Ping packets, the spliced echo request Ping packets are sent to a preset public network IP address, so as to implement parallel detection on wide area network hosts designated by a plurality of users, shorten the fault detection time, and solve the problem of misjudgment and misswitching caused by single-point faults of the external network hosts.
Step S103: resetting a connection record database after the link is switched, and cutting off the TCP connection in an active state in the connection record database; the connection record database is used for recording entry data of the TCP connection data packet.
In this embodiment, the router connects the primary WAN and the standby WAN, and further includes:
the router is connected with the down-hanging device, and the main WAN and the standby WAN are connected with the Internet; the down-hanging device initiates TCP connection to the Internet through the router; the down-hanging device is a device for accessing the LAN port of the router.
In this embodiment, before recording entry data of the TCP connection packet, the method further includes:
acquiring a data packet connected with a TCP, and carrying out multi-layer analysis on the data packet by taking a quintuple as an index to generate entry data; the entry data includes: last active time, source IP address, destination IP address, TCP protocol type sum, TCP protocol content.
In this embodiment, the five-tuple is used as an index to perform multi-layer analysis on the data packet, and the content of the generated entry is as follows:
1. last active time;
2. extracting network layer (L3): a source IP address, a destination IP address;
3. extracting a protocol type of a transmission layer (L4), and extracting for a TCP protocol: source port, destination port, sequence number (Seq), acknowledgement number (Ack), connection status (SYN SENT, ESTABLISHED, CLOSE _wait, etc.).
In this embodiment, the connection record database is used for recording entry data of a TCP connection data packet, specifically: judging whether the entry data exist in a connection record database according to the entry data of the TCP connection data packet;
if the connection record database does not exist, extracting TCP Flags of the data packet of the TCP connection, and judging whether the data packet is a SYN packet; if yes, inserting the item data into the connection record database; if not, cutting off the TCP connection;
if the connection record database exists, updating the entry data of the corresponding record in the connection record database.
In this embodiment, if the five-tuple of the received TCP packet does not exist in the database, extracting the TCP Flags of the packet, determining whether the packet is a SYN packet, and if so, inserting the entry into the database; otherwise, the TCP packet is judged to be from a TCP connection which is established but not tracked by the connection record module, and the connection blocking module is called to cut off. If the five-tuple database of the received TCP packet exists, then it is determined that the connection is an established connection, and the information (Seq, ack, etc.) of the corresponding record entry in the database is updated.
In this embodiment, the connection record database is reset, specifically:
and calling an interface for resetting the content of the database, and clearing the content of the connection record database.
In this embodiment, before the interface for resetting the database content is called, the connection blocking module will be called to reset the TCP connection in the database in an active state.
In this embodiment, the cutting off the TCP connection in the connection record database in an active state specifically includes: and calling a connection blocking module to enable the connection blocking module to generate a TCP RST packet opposite to an outbound connection of the TCP connection in a router for the TCP connection with active state, and transmitting the TCP RST packet to an off-hook device.
In this embodiment, the connection blocking module is invoked when a connection entry is deleted.
In this embodiment, for an active connection with a TCP connection state of ESTABLISHED, a TCP RST packet opposite to an outbound connection is generated inside a router and sent to an down-link device, so as to actively cut off the TCP connection of the down-link device, and trigger the internal program of the down-link device to perceive an abnormal TCP connection, so that the connection recovery operation can be quickly executed.
The implementation of the embodiment of the application has the following effects:
the application monitors the connection/disconnection event of the main WAN port in real time, ensures that the main WAN port can be rapidly switched to the standby WAN port when the physical link fails, and does not need to actively detect overtime and switch; detecting the link fault through Ping detection, and improving the accuracy and efficiency of the link fault detection by utilizing Ping detection; in addition, the TCP connection is actively cut off when the link is switched, so that the down-hanging device can quickly execute connection recovery operation, an application is actively informed of executing the recovery operation by using a TCP protocol exception mechanism, service interruption time is shortened, and network stability is improved.
Example two
Referring to fig. 2, a device for detecting and quickly recovering link failure provided by an embodiment of the present application is applied to a router, where the router connects a main WAN and a standby WAN; the main WAN is a fixed network broadband interface, and the standby WAN is a mobile network interface;
the device comprises: the device comprises a passive detection module 201, an active detection module 202, a connection recording module 203 and a connection blocking module 204;
the passive detection module 201 is configured to monitor a connection event of the primary WAN, and when receiving a connection disconnection event of the primary WAN, control the route management module to switch the link to the standby WAN; when a connecting event of a main WAN is received, continuously sending Ping packet detection to the main WAN; when receiving the Ping response of the main WAN, controlling a route management module to switch a link to the main WAN;
the active detection module 202 is configured to control the main WAN to send Ping packets to a preset public network IP address at regular time, detect the Ping packets, and receive Ping responses of the public network IP address; when the Ping response of the public network IP address is not received within the preset time, the control route management module switches the link to the standby WAN; after the link is switched to the standby WAN, continuously sending Ping packet detection to the main WAN; when receiving the Ping response of the main WAN, controlling a route management module to switch a link to the main WAN;
the connection record module 203 is configured to reset a connection record database; the connection record database is used for recording entry data of the TCP connection data packet;
the connection blocking module 204 is configured to cut off the TCP connection in the active state in the connection record database.
After the link is switched, a connection record module is called to reset a connection record database, and a connection blocking module is called to cut off the TCP connection in an active state in the connection record database; the connection record database is used for recording entry data of the TCP connection data packet.
The above-mentioned device for detecting and quickly recovering link failure can implement a method for detecting and quickly recovering link failure according to the above-mentioned method embodiment. The options in the method embodiments described above are also applicable to this embodiment and will not be described in detail here. The rest of the embodiments of the present application may refer to the content of the above method embodiments, and in this embodiment, no further description is given.
The implementation of the embodiment of the application has the following effects:
the active detection module of the device monitors the connection/disconnection event of the main WAN port in real time, ensures that the device can be rapidly switched to the standby WAN port when the physical link fails, and does not need to switch after the active detection is overtime; the passive detection module detects the link fault through Ping detection, and accuracy and efficiency of the link fault detection are improved through Ping detection; in addition, the record storage of TCP connection is realized through a connection record module; when the link is switched, the TCP connection is actively cut off through the connection blocking module, so that the down-hanging device can quickly execute connection recovery operation, an application is actively informed of executing the recovery operation by utilizing a TCP protocol abnormality mechanism, service interruption time is shortened, and network stability is improved.
Example III
Correspondingly, the application further provides a computer readable storage medium, which comprises a stored computer program, wherein the computer program controls equipment where the computer readable storage medium is located to execute the method for detecting and quickly recovering the link failure according to any one of the embodiments.
The computer program may be divided into one or more modules/units, which are stored in the memory and executed by the processor to accomplish the present application, for example. The one or more modules/units may be a series of computer program instruction segments capable of performing the specified functions, which instruction segments are used for describing the execution of the computer program in the terminal device.
The terminal equipment can be computing equipment such as a desktop computer, a notebook computer, a palm computer, a cloud server and the like. The terminal device may include, but is not limited to, a processor, a memory.
The processor may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, which is a control center of the terminal device, and which connects various parts of the entire terminal device using various interfaces and lines.
The memory may be used to store the computer program and/or the module, and the processor may implement various functions of the terminal device by running or executing the computer program and/or the module stored in the memory and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the mobile terminal, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
Wherein the terminal device integrated modules/units may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as stand alone products. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth.
The foregoing embodiments have been provided for the purpose of illustrating the general principles of the present application, and are not to be construed as limiting the scope of the application. It should be noted that any modifications, equivalent substitutions, improvements, etc. made by those skilled in the art without departing from the spirit and principles of the present application are intended to be included in the scope of the present application.
Claims (10)
1. The method for detecting and quickly recovering the link failure is characterized by being applied to a router, wherein the router is connected with a main WAN and a standby WAN; the main WAN is a fixed network broadband interface, and the standby WAN is a mobile network interface;
the method comprises the following steps:
controlling a main WAN to send a Ping packet to a preset public network IP address at regular time, detecting and receiving a Ping response of the public network IP address; monitoring a connection event of the main WAN;
when a connection disconnection event of a main WAN is received or a Ping response of the public network IP address is not received within a preset time, the control route management module switches a link to a standby WAN;
when a connecting event of a main WAN is received or after the link is switched to a standby WAN, continuously sending Ping packet detection to the main WAN; when receiving the Ping response of the main WAN, controlling a route management module to switch a link to the main WAN;
resetting a connection record database after the link is switched, and cutting off the TCP connection in an active state in the connection record database; the connection record database is used for recording entry data of the TCP connection data packet.
2. The method for detecting and quickly recovering link failure according to claim 1, wherein the sending Ping packet to the preset public network IP address is specifically:
information splicing is carried out on at least one echo request Ping packet, and the spliced echo request Ping packet is sent to a preset public network IP address; the preset public network IP addresses are public network IP addresses appointed by a plurality of users;
when a response packet of at least one echo request Ping packet is received within a preset time, returning a normal detection result of a link of the preset public network IP address;
and when the response packet of the echo request Ping packet is not received within the preset time, returning the detection result of the link fault of the preset public network IP address.
3. The method for link failure detection and fast recovery according to claim 1, wherein said sending Ping packet detection to said primary WAN is specifically:
sending a loopback request Ping packet through a main WAN;
when a response packet of the echo request Ping packet is received within a preset time, returning a normal detection result of the link of the main WAN;
and when the response packet of the loopback request Ping packet is not received within the preset time, returning the detection result of the link failure of the main WAN.
4. The method for link failure detection and fast recovery according to claim 1, wherein the router connects a primary WAN and a backup WAN, further comprising:
the router is connected with the down-hanging device, and the main WAN and the standby WAN are connected with the Internet; the down-hanging device initiates TCP connection to the Internet through the router; the down-hanging device is a device for accessing the LAN port of the router.
5. The method for detecting and quickly recovering from a link failure according to claim 4, wherein said recording the entry data of the TCP connection packet further comprises:
acquiring a data packet connected with a TCP, and carrying out multi-layer analysis on the data packet by taking a quintuple as an index to generate entry data; the entry data includes: last active time, source IP address, destination IP address, TCP protocol type sum, TCP protocol content.
6. The method for detecting and quickly recovering from link failure according to claim 5, wherein the connection record database is used for recording entry data of a TCP connection data packet, specifically:
judging whether the entry data exist in a connection record database according to the entry data of the TCP connection data packet;
if the connection record database does not exist, extracting TCP Flags of the data packet of the TCP connection, and judging whether the data packet is a SYN packet; if yes, inserting the item data into the connection record database; if not, cutting off the TCP connection;
if the connection record database exists, updating the entry data of the corresponding record in the connection record database.
7. The method for link failure detection and fast recovery according to claim 6, wherein the resetting connection record database is specifically:
and calling an interface for resetting the content of the database, and clearing the content of the connection record database.
8. The method for detecting and quickly recovering from link failure according to claim 4, wherein said cutting off the TCP connection in the active state in said connection record database is specifically:
and calling a connection blocking module to enable the connection blocking module to generate a TCP RST packet opposite to an outbound connection of the TCP connection in a router for the TCP connection with active state, and transmitting the TCP RST packet to an off-hook device.
9. The device for detecting and quickly recovering the link failure is characterized by being applied to a router, wherein the router is connected with a main WAN and a standby WAN; the main WAN is a fixed network broadband interface, and the standby WAN is a mobile network interface;
the device comprises: the device comprises a passive detection module, an active detection module, a connection recording module and a connection blocking module;
the passive detection module is used for monitoring the connection event of the main WAN, and when receiving the connection disconnection event of the main WAN, the control route management module switches the link to the standby WAN; when a connecting event of a main WAN is received, continuously sending Ping packet detection to the main WAN; when receiving the Ping response of the main WAN, controlling a route management module to switch a link to the main WAN;
the active detection module is used for controlling the main WAN to send Ping packets to a preset public network IP address at regular time, detecting and receiving Ping responses of the public network IP address; when the Ping response of the public network IP address is not received within the preset time, the control route management module switches the link to the standby WAN; after the link is switched to the standby WAN, continuously sending Ping packet detection to the main WAN; when receiving the Ping response of the main WAN, controlling a route management module to switch a link to the main WAN;
the connection record module is used for resetting the connection record database; the connection record database is used for recording entry data of the TCP connection data packet;
the connection blocking module is used for cutting off the TCP connection in an active state in the connection record database.
10. A computer readable storage medium, wherein the computer readable storage medium comprises a stored computer program; wherein said computer program, when run, controls a device on which said computer readable storage medium resides to perform a method of link failure detection and fast recovery as claimed in any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310665999.0A CN116708129A (en) | 2023-06-07 | 2023-06-07 | Method, device and storage medium for link fault detection and quick recovery |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310665999.0A CN116708129A (en) | 2023-06-07 | 2023-06-07 | Method, device and storage medium for link fault detection and quick recovery |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116708129A true CN116708129A (en) | 2023-09-05 |
Family
ID=87830659
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310665999.0A Pending CN116708129A (en) | 2023-06-07 | 2023-06-07 | Method, device and storage medium for link fault detection and quick recovery |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116708129A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117354196A (en) * | 2023-12-06 | 2024-01-05 | 广州通则康威科技股份有限公司 | Link detection method and device based on network interface |
-
2023
- 2023-06-07 CN CN202310665999.0A patent/CN116708129A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117354196A (en) * | 2023-12-06 | 2024-01-05 | 广州通则康威科技股份有限公司 | Link detection method and device based on network interface |
CN117354196B (en) * | 2023-12-06 | 2024-03-12 | 广州通则康威科技股份有限公司 | Link detection method and device based on network interface |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108965123B (en) | Link switching method and network communication system | |
CN112866004B (en) | Control plane equipment switching method and device and transfer control separation system | |
CN111277630B (en) | Routing control method and device, electronic equipment and storage medium | |
CN114172794B (en) | Network fault positioning method and server | |
US20060159011A1 (en) | Detecting unavailable network connections | |
WO2021128977A1 (en) | Fault diagnosis method and apparatus | |
US20210314246A1 (en) | Data packet loss detection | |
CN112398689B (en) | Network recovery method and device, storage medium and electronic equipment | |
US9485156B2 (en) | Method and system for generic application liveliness monitoring for business resiliency | |
CN116708129A (en) | Method, device and storage medium for link fault detection and quick recovery | |
CN115499489B (en) | Method, device, equipment and readable medium for managing sub-network in link | |
CN106656615A (en) | Message processing method and apparatus based on TRACERT command | |
CN110932878A (en) | Management method, equipment and system of distributed network | |
CN112217718A (en) | Service processing method, device, equipment and storage medium | |
CN113824595B (en) | Link switching control method and device and gateway equipment | |
CN104158735A (en) | Network data package distribution method and device | |
CN111130941B (en) | Network error detection method and device and computer readable storage medium | |
JP6463703B2 (en) | Network monitoring apparatus and network monitoring method | |
CN115361310A (en) | Link detection method and device of firewall | |
CN117955903A (en) | Device management method, device, system and storage medium | |
CN105007143A (en) | Call preservation and recovery method and system | |
CN106161051B (en) | Custom end intelligent route selection | |
CN114513398A (en) | Network equipment alarm processing method, device, equipment and storage medium | |
US11799944B1 (en) | Intelligent multi-path call home | |
WO2003090106A1 (en) | Method, apparatus, and computer program product for redundant network |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 510000 room 1301, No. 37, Jinlong street, Xiangjiang financial and business center, Nansha District, Guangzhou City, Guangdong Province (office only) Applicant after: Guangzhou Tongze Kangwei Technology Co.,Ltd. Address before: 510000 room 1301, No. 37, Jinlong street, Xiangjiang financial and business center, Nansha District, Guangzhou City, Guangdong Province (office only) Applicant before: Guangzhou Tongze Kangwei Intelligent Technology Co.,Ltd. |