A method, device and storage medium for link fault detection and fast recovery
By monitoring WAN connection status in real time and using concurrent Ping detection, the problem of service interruption during link switching was solved, achieving rapid recovery and improved network stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-07
- Publication Date
- 2026-03-31
AI Technical Summary
Existing technologies suffer from long service interruption times, low detection accuracy and efficiency during link switching, and cannot ensure network stability.
By monitoring WAN connection status in real time and utilizing concurrent Ping detection, the accuracy and efficiency of link failure detection are improved. When switching links, applications are proactively notified to perform recovery operations, thereby shortening the duration of service interruption.
It enables rapid switching to a backup WAN in the event of a physical link failure, shortening service interruption time and improving network stability, as well as the accuracy and efficiency of link failure detection.
Smart Images

Figure CN116708129B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer network technology, and in particular to a method, apparatus and storage medium for link fault detection and rapid recovery. Background Technology
[0002] Currently, the main method for ensuring network stability is dual-WAN link backup. However, during link switching, network transmission latency and link protocol limitations can lead to service interruptions of tens of seconds at the application layer. For example, dual-machine hot standby is costly; when NAT session synchronization is not configured or the exit IPs between gateways are inconsistent, switching can cause TCP retransmission timeouts, ultimately resulting in connection termination. This process is time-consuming and causes significant application service interruption. Furthermore, existing technologies only check the status of upstream interfaces and the reachability of the upstream next-hop route, failing to guarantee the eventual availability of the Internet.
[0003] Therefore, existing technologies take too long to detect and switch links, resulting in low accuracy and efficiency in link fault detection, which affects network stability. Summary of the Invention
[0004] This invention provides a method, apparatus, and storage medium for link fault detection and rapid recovery. It enables real-time detection of the status of the main WAN connection, improves the accuracy and efficiency of link fault detection by using concurrent Ping detection, and actively notifies applications to perform recovery operations during link switching using the TCP protocol exception mechanism, thereby shortening service interruption time and improving network stability.
[0005] This invention provides a method for link failure detection and rapid recovery, applied in a router, wherein the router connects a main WAN and a backup WAN; the main WAN is a fixed broadband interface and the backup WAN is a mobile network interface;
[0006] The method includes:
[0007] Control the main WAN to periodically send Ping packets to a preset public IP address to detect and receive Ping responses from the public IP address; monitor the connection events of the main WAN;
[0008] When a connection disconnection event is received from the main WAN or when no Ping response is received from the public IP address within a preset time, the control routing management module switches the link to the backup WAN.
[0009] When a connection event is received from the primary WAN or when the link is switched to the backup WAN, Ping packets are continuously sent to the primary WAN for detection; when a Ping response is received from the primary WAN, the routing management module is controlled to switch the link back to the primary WAN.
[0010] After the link is switched, the connection record database is reset and the active TCP connections in the connection record database are disconnected; the connection record database is used to record entry data of TCP connection data packets.
[0011] As a preferred embodiment, this invention monitors the connection / disconnection events of the main WAN port in real time, ensuring a rapid switch to the backup WAN port in the event of a physical link failure, without the need for active timeout detection before switching. It also uses Ping detection to improve the accuracy and efficiency of link failure detection. Furthermore, it actively disconnects TCP connections during link switching, enabling downstream devices to quickly perform connection recovery operations. It also proactively notifies applications of recovery operations using TCP protocol exception mechanisms, shortening service interruption time and improving network stability.
[0012] As a preferred solution, a Ping packet is sent to a preset public IP address for testing, specifically:
[0013] At least one echo request Ping packet is concatenated, and the concatenated echo request Ping packet is sent to a preset public IP address; the preset public IP address is a number of public IP addresses specified by users.
[0014] If at least one response packet of a Ping request is received within a preset time, the detection result that the link to the preset public IP address is normal is returned.
[0015] If no response packet is received for the Ping request within the preset time, the detection result of the link failure of the preset public IP address is returned.
[0016] As a preferred approach, sending Ping packets to the main WAN for detection is specifically as follows:
[0017] Send the echo request Ping packet through the main WAN;
[0018] If a response packet to the Ping request is received within a preset time, the detection result that the main WAN link is normal is returned.
[0019] If no response packet is received for the Ping request within a preset time, the detection result of the main WAN link failure is returned.
[0020] As a preferred embodiment, this invention enables parallel detection of multiple user-specified WAN hosts by splicing information from at least one Ping request packet, thereby shortening the fault detection time and solving the problem of misjudgment and incorrect switching caused by single point of failure of external network hosts. This invention utilizes concurrent Ping detection to improve the accuracy and efficiency of link fault detection.
[0021] As a preferred option, the router connects the main WAN and the backup WAN, and also includes:
[0022] The router is connected to downstream devices, and both the main WAN and backup WAN are connected to the Internet; the downstream devices initiate TCP connections to the Internet through the router; the downstream devices are devices connected to the router's LAN port.
[0023] As a preferred embodiment, before recording the entry data for TCP connection packets, the following is also included:
[0024] The data packets of the TCP connection are obtained, and the data packets are parsed in multiple layers using the five-tuple as an index to generate entry data. The entry data includes: last active time, source IP address, destination IP address, TCP protocol type, and TCP protocol content.
[0025] As a preferred embodiment, the connection record database is used to record entry data of TCP connection data packets, specifically: determining whether the entry data exists in the connection record database based on the entry data of the TCP connection data packets;
[0026] If the connection record database does not exist, extract the TCP Flags of the data packets of the TCP connection and determine whether it is a SYN packet; if yes, insert the entry data into the connection record database; if no, terminate the TCP connection; if the connection record database exists, update the entry data of the corresponding record in the connection record database.
[0027] As a preferred embodiment, the present invention utilizes a connection database to store and manage TCP connection data. The program stores TCP connection records in the database and updates and maintains the connection database in a timely manner.
[0028] As a preferred solution, the connection record database is reset, specifically as follows:
[0029] Call the API to reset database content and clear the contents of the connection record database.
[0030] As a preferred solution, the active TCP connections in the connection record database are cut off. Specifically, the connection blocking module is invoked so that the connection blocking module generates a TCP RST packet inside the router that is the opposite of the outbound connection of the active TCP connection, and sends the TCP RST packet to the downstream device.
[0031] As a preferred embodiment, the present invention constructs a TCP RST message from the Internet to actively sever the TCP connection, triggering the internal program of the downstream device to detect the abnormal TCP connection, enabling it to quickly perform connection recovery operations.
[0032] Accordingly, the present invention also provides a device for link fault detection and rapid recovery, applied to a router, wherein the router connects a main WAN and a backup WAN; the main WAN is a fixed broadband interface and the backup WAN is a mobile network interface;
[0033] The device includes: a passive detection module, an active detection module, a connection recording module, and a connection blocking module;
[0034] The passive detection module is used to monitor the connection events of the main WAN. When it receives a connection disconnection event of the main WAN, it controls the routing management module to switch the link to the backup WAN. When it receives a connection connection event of the main WAN, it continuously sends Ping packets to the main WAN for detection. When it receives a Ping response from the main WAN, it controls the routing management module to switch the link to the main WAN.
[0035] The active detection module is used to control the main WAN to periodically send Ping packets to a preset public IP address for detection and receive Ping responses from the public IP address; when no Ping response is received from the public IP address within a preset time, the routing management module is controlled to switch the link to the backup WAN; after the link is switched to the backup WAN, Ping packets are continuously sent to the main WAN for detection; when a Ping response is received from the main WAN, the routing management module is controlled to switch the link back to the main WAN.
[0036] The connection record module is used to reset the connection record database; the connection record database is used to record entry data for TCP connection packets;
[0037] The connection blocking module is used to cut off active TCP connections in the connection record database.
[0038] As a preferred embodiment, the active detection module of the present invention monitors the connection / disconnection events of the main WAN port in real time, ensuring that it can quickly switch to the backup WAN port when a physical link failure occurs, without needing to switch after active detection timeout; the passive detection module detects link failures through Ping detection, improving the accuracy and efficiency of link failure detection; in addition, the connection recording module stores TCP connection records; during link switching, the connection blocking module actively cuts off the TCP connection, enabling the downstream device to quickly perform connection recovery operations, and actively notifies the application to perform recovery operations using the TCP protocol exception mechanism, shortening the service interruption time and improving network stability.
[0039] Accordingly, the present invention also provides a computer-readable storage medium comprising a stored computer program; wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform a method for link fault detection and rapid recovery as described in the present invention. Attached Figure Description
[0040] Figure 1 This is a flowchart illustrating an embodiment of a link fault detection and rapid recovery method provided by the present invention;
[0041] Figure 2 This is a schematic diagram of an embodiment of the link fault detection and rapid recovery device provided by the present invention. Detailed Implementation
[0042] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0043] Example 1
[0044] Please refer to Figure 1 This invention provides a method for link fault detection and rapid recovery, applied in a router, wherein the router connects a main WAN and a backup WAN; the main WAN is a fixed broadband interface and the backup WAN is a mobile network interface.
[0045] The method includes steps S101-S103:
[0046] Step S101: Monitor the connection events of the main WAN. When a connection disconnection event is received from the main WAN, control the routing management module to switch the link to the backup WAN. When a connection connection event is received from the main WAN, continuously send Ping packets to the main WAN for detection. When a Ping response is received from the main WAN, control the routing management module to switch the link back to the main WAN. In this embodiment, sending Ping packets to the main WAN for detection specifically involves:
[0047] Send the echo request Ping packet through the main WAN;
[0048] If a response packet to the Ping request is received within a preset time, the detection result that the main WAN link is normal is returned.
[0049] If no response packet is received for the Ping request within a preset time, the detection result of the main WAN link failure is returned.
[0050] In this embodiment, the preset time is 2 seconds. If no Ping response is received within 2 seconds, the detection result of the link failure of the main WAN is returned, and the routing management module is notified to switch to the backup WAN.
[0051] Step S102: Control the main WAN to periodically send Ping packets to a preset public IP address for detection and receive Ping responses from the public IP address; when no Ping response is received from the public IP address within a preset time, control the routing management module to switch the link to the backup WAN; after the link is switched to the backup WAN, continuously send Ping packets to the main WAN for detection; when a Ping response is received from the main WAN, control the routing management module to switch the link back to the main WAN; in this embodiment, sending Ping packets to the preset public IP address for detection specifically includes:
[0052] At least one echo request Ping packet is concatenated, and the concatenated echo request Ping packet is sent to a preset public IP address; the preset public IP address is a number of public IP addresses specified by users.
[0053] If at least one response packet of a Ping request is received within a preset time, the detection result that the link to the preset public IP address is normal is returned.
[0054] If no response packet is received for the Ping request within the preset time, the detection result of the link failure of the preset public IP address is returned.
[0055] In this embodiment, by concatenating information from multiple Ping echo request packets, the concatenated Ping echo request packets are sent to a preset public IP address, enabling parallel detection of multiple user-specified WAN hosts, shortening fault detection time, and solving the problem of misjudgment and incorrect switching caused by single point of failure of external hosts.
[0056] Step S103: After the link is switched, reset the connection record database and disconnect the active TCP connections in the connection record database; the connection record database is used to record entry data of TCP connection data packets.
[0057] In this embodiment, the router connects the main WAN and the backup WAN, and further includes:
[0058] The router is connected to downstream devices, and both the main WAN and backup WAN are connected to the Internet; the downstream devices initiate TCP connections to the Internet through the router; the downstream devices are devices connected to the router's LAN port.
[0059] In this embodiment, before recording the entry data of TCP connection packets, the method further includes:
[0060] The data packets of the TCP connection are obtained, and the data packets are parsed in multiple layers using the five-tuple as an index to generate entry data. The entry data includes: last active time, source IP address, destination IP address, TCP protocol type, and TCP protocol content.
[0061] In this embodiment, the data packet is parsed in multiple layers using a 5-tuple as an index, generating the following entry content:
[0062] 1. Last active time;
[0063] 2. Extract the source IP address and destination IP address from the network layer (L3);
[0064] 3. Extract the protocol type of the transport layer (L4), and for the TCP protocol, extract: source port, destination port, sequence number (Seq), acknowledgment number (Ack), connection state (SYN_SENT, ESTABLISHED, CLOSE_WAIT, etc.).
[0065] In this embodiment, the connection record database is used to record entry data of TCP connection data packets. Specifically, it is determined whether the entry data exists in the connection record database based on the entry data of the TCP connection data packets.
[0066] If the connection record database does not exist, extract the TCP Flags of the data packets of the TCP connection and determine whether it is a SYN packet; if yes, insert the entry data into the connection record database; if no, terminate the TCP connection.
[0067] If a connection record database exists, then update the entry data of the corresponding record in the connection record database.
[0068] In this embodiment, if the 5-tuple of the received TCP packet does not exist in the database, the TCPFlags of the packet are extracted to determine if it is a SYN packet. If so, the entry is inserted into the database; otherwise, it is determined that the TCP packet comes from an established TCP connection that has not been tracked by the connection record module, and the connection blocking module is invoked to terminate it. If the 5-tuple of the received TCP packet already exists in the database, it is determined that this is an established connection, and the information (Seq, Ack, etc.) of the corresponding record entry in the database is updated.
[0069] In this embodiment, resetting the connection record database specifically involves:
[0070] Call the API to reset database content and clear the contents of the connection record database.
[0071] In this embodiment, before calling the interface to reset the database content, the connection blocking module is first called to reset the active TCP connections in the database.
[0072] In this embodiment, cutting off active TCP connections in the connection record database specifically involves: calling the connection blocking module to generate a TCP RST packet inside the router that is the opposite of the outbound connection of the active TCP connection, and sending the TCP RST packet to the downstream device.
[0073] In this embodiment, the connection blocking module is invoked when deleting a connection entry.
[0074] In this embodiment, for active connections with a TCP connection state of ESTABLISHED, a TCP RST packet opposite to that of the outbound connection is generated inside the router and sent to the downstream device. The purpose is to actively cut off the TCP connection of the downstream device, trigger the internal program of the downstream device to detect the abnormal TCP connection, and enable it to quickly perform connection recovery operation.
[0075] Implementing the embodiments of the present invention has the following effects:
[0076] This invention monitors the connection / disconnection events of the main WAN port in real time, ensuring a rapid switch to the backup WAN port in the event of a physical link failure, without the need for active timeout detection before switching. It also uses Ping detection to improve the accuracy and efficiency of link failure detection. Furthermore, it proactively disconnects TCP connections during link switching, enabling downstream devices to quickly perform connection recovery operations. It also utilizes the TCP protocol exception mechanism to proactively notify applications to perform recovery operations, shortening service interruption time and improving network stability.
[0077] Example 2
[0078] Please refer to Figure 2 This invention provides a link failure detection and rapid recovery device, which is applied to a router. The router connects a main WAN and a backup WAN. The main WAN is a fixed broadband interface, and the backup WAN is a mobile network interface.
[0079] The device includes: a passive detection module 201, an active detection module 202, a connection recording module 203, and a connection blocking module 204;
[0080] The passive detection module 201 is used to monitor the connection events of the main WAN. When it receives a connection disconnection event of the main WAN, it controls the routing management module to switch the link to the backup WAN. When it receives a connection connection event of the main WAN, it continuously sends Ping packets to the main WAN for detection. When it receives a Ping response from the main WAN, it controls the routing management module to switch the link to the main WAN.
[0081] The active detection module 202 is used to control the main WAN to periodically send Ping packets to a preset public IP address for detection and receive Ping responses from the public IP address; when no Ping response is received from the public IP address within a preset time, the routing management module is controlled to switch the link to the backup WAN; after the link is switched to the backup WAN, Ping packets are continuously sent to the main WAN for detection; when a Ping response is received from the main WAN, the routing management module is controlled to switch the link back to the main WAN;
[0082] The connection record module 203 is used to reset the connection record database; the connection record database is used to record entry data of TCP connection packets;
[0083] The connection blocking module 204 is used to cut off active TCP connections in the connection record database.
[0084] After the link is switched, the connection record module is invoked to reset the connection record database, and the connection blocking module is invoked to cut off the active TCP connections in the connection record database; the connection record database is used to record the entry data of TCP connection data packets.
[0085] The aforementioned apparatus for link fault detection and rapid recovery can implement one of the link fault detection and rapid recovery methods described in the above method embodiments. The options in the above method embodiments are also applicable to this embodiment, and will not be detailed here. The remaining content of this application's embodiments can be referred to the content of the above method embodiments, and will not be repeated in this embodiment.
[0086] Implementing the embodiments of the present invention has the following effects:
[0087] The active detection module of this invention monitors the connection / disconnection events of the main WAN port in real time, ensuring a rapid switch to the backup WAN port in the event of a physical link failure, without requiring active detection timeout before switching. The passive detection module detects link failures through Ping detection, improving the accuracy and efficiency of link failure detection. In addition, a connection recording module stores TCP connection records. During link switching, a connection blocking module actively cuts off TCP connections, enabling downstream devices to quickly perform connection recovery operations. It also proactively notifies applications to perform recovery operations using the TCP protocol exception mechanism, shortening service interruption time and improving network stability.
[0088] Example 3
[0089] Accordingly, the present invention also provides a computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform a link fault detection and rapid recovery method as described in any of the above embodiments.
[0090] For example, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.
[0091] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0092] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.
[0093] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc.; the data storage area may store data created based on 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 hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0094] Wherein, if the modules / units integrated in the terminal device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, it can implement the steps of the various method embodiments described above. Wherein, the computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0095] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A method of link fault detection and fast recovery, characterized by, The application is applied to a router connected with a main WAN and a backup WAN. The main WAN is a fixed network broadband interface, and the backup WAN is a mobile network interface. The method comprises: controlling the main WAN to send a Ping packet to a preset public network IP address to detect and receive a Ping response of the public network IP address; controlling the router management module to switch the link to the backup WAN when a disconnection event of the main WAN is received or when no Ping response of the public network IP address is received within a preset time; controlling the router management module to switch the link to the main WAN when a connection event of the main WAN is received or after the link is switched to the backup WAN; resetting a connection record database after the link is switched, and cutting off TCP connections in an active state in the connection record database; The router is connected with the main WAN and the backup WAN, and further comprises: The router is connected with a hanging device, and the main WAN and the backup WAN are connected with the Internet; the hanging device initiates a TCP connection to the Internet through the router; and the hanging device is a device connected with a LAN port of the router. Before the entry data of the TCP connection data packet is recorded, the method further comprises: obtaining the TCP connection data packet, performing multi-layer analysis on the data packet by taking a five-tuple as an index, and generating entry data; The connection record database is used to record the entry data of the TCP connection data packet, and specifically comprises: determining whether the entry data exists in the connection record database according to the entry data of the TCP connection data packet; if the entry data does not exist in the connection record database, extracting TCP Flags of the TCP connection data packet and determining whether the TCP Flags are SYN packets; if yes, inserting the entry data into the connection record database; and if no, cutting off the TCP connection; if the entry data exists in the connection record database, updating the corresponding record entry data in the connection record database; The resetting of the connection record database specifically comprises: calling an interface for resetting database content and emptying the content of the connection record database.
2. The method of link fault detection and fast failure according to claim 1, wherein, The sending of the Ping packet to the preset public network IP address specifically comprises: performing information splicing on at least one echo request Ping packet, and sending the spliced echo request Ping packet to the preset public network IP address; the preset public network IP address is a plurality of user-specified public network IP addresses; when at least one echo request Ping packet response packet is received within a preset time, a detection result of a normal link of the preset public network IP address is returned; when no echo request Ping packet response packet is received within a preset time, a detection result of a link fault of the preset public network IP address is returned.
3. The method of link fault detection and rapid recovery as claimed in claim 1, wherein, The sending of the Ping packet to the main WAN specifically comprises: sending an echo request Ping packet through the main WAN. When a reply packet of the echo request Ping packet is received within a preset time, a detection result that the link of the main WAN is normal is returned. When a reply packet of the echo request Ping packet is not received within a preset time, a detection result that the link of the main WAN is faulty is returned.
4. The method of link fault detection and rapid recovery as claimed in claim 1, wherein, The entry data comprises a last active time, a source IP address, a destination IP address, a TCP protocol type and TCP protocol content.
5. The method of link fault detection and rapid recovery as claimed in claim 1, wherein, The cutting off of the TCP connection in an active state in the connection record database comprises: The connection blocking module is called to generate a TCP RST packet opposite to the outbound connection of the TCP connection in the router, and the TCP RST packet is sent to the device hung down.
6. An apparatus for link fault detection and fast failure recovery, the apparatus comprising: The application is applied to a router connected with a main WAN and a backup WAN. The main WAN is a fixed network broadband interface, and the backup WAN is a mobile network interface. The device comprises a passive detection module, an active detection module, a connection record module and a connection blocking module. The passive detection module is used for listening to a connection event of the main WAN, and when a connection disconnection event of the main WAN is received, the router management module is controlled to switch the link to the backup WAN; when a connection connection event of the main WAN is received, the Ping packet detection to the main WAN is continuously sent; when a Ping response of the main WAN is received, the router management module is controlled to switch the link to the main WAN. The active detection module is used for controlling the main WAN to send a Ping packet detection to a preset public network IP address 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 a preset time, the router management module is controlled to switch the link to the backup WAN; when the link is switched to the backup WAN, the Ping packet detection to the main WAN is continuously sent; when the Ping response of the main WAN is received, the router management module is controlled to switch the link to the main WAN. The connection record module is used for resetting a connection record database; and the connection record database is used for recording entry data of a 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. The router is connected with the main WAN and the backup WAN, and further comprises: The router is connected with the device hung down, and the main WAN and the backup WAN are connected with the Internet; the device hung down initiates a TCP connection to the Internet through the router; and the device hung down is a device connected with a LAN port of the router. Before the entry data of the TCP connection data packet is recorded, the following steps are further comprised: The data packet of the TCP connection is acquired, and the data packet is multi-layer parsed by taking a five-tuple as an index to generate the entry data. The connection record database is used for recording the entry data of the TCP connection data packet, and specifically comprises: The entry data of the TCP connection data packet is acquired, and the entry data is determined whether to exist in the connection record database. If the connection record database does not exist, extracting TCP Flags of the packet of the TCP connection, and judging whether it is a SYN packet; if yes, inserting the entry data into the connection record database; if no, cutting off the TCP connection; If the connection record database exists, updating entry data of the corresponding record in the connection record database; The resetting connection record database specifically comprises: Calling an interface of resetting database content, and emptying the content of the connection record database.
7. A computer readable storage medium characterized in that, The computer readable storage medium comprises a stored computer program; wherein the computer program, when running, controls a device where the computer readable storage medium is located to execute the method for link fault detection and fast recovery according to any one of claims 1 to 5.
Citation Information
Patent Citations
Automatic router 4G interface and wired interface selection method
CN107979532A
Data service management method and device, computer readable medium and terminal equipment
CN111935705A