Disaster recovery standby network construction method for host intelligent routing
A method for intelligent host routing in disaster recovery networks addresses network disconnection crises by real-time path monitoring and automatic switching, ensuring high availability and cost-effectiveness for small and medium-sized organizations and home users.
Patent Information
- Application Number
- CN202411137914.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-12-10
AI Technical Summary
Existing network systems with disaster recovery functions, especially for small and medium-sized organizations and home users, face network disconnection crises due to the lack of automatic switching between redundant Internet access paths, as they rely on Windows operating systems that cannot dynamically reroute traffic when the primary path fails.
Implement a method for constructing a disaster recovery standby network with intelligent host routing, involving real-time monitoring of redundant network paths using a TCP/IP communication mechanism independent of the Windows kernel, establishing a heartbeat mechanism, and employing an intelligent routing algorithm to automatically switch traffic to the best available path.
Ensures high availability of the network by autonomously selecting the optimal network path during failures, reducing reliance on expensive hardware and maintaining network connectivity, while being cost-effective and user-friendly for cost-sensitive users.
Smart Images

Figure CN119109766A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method for constructing a disaster recovery standby network with intelligent host routing. Background Art
[0002] With the continuous development of information technology in human society, computer networks have been used more and more widely. Computer networks have in fact become an important infrastructure for people's social production and life, and people's dependence on the network is increasing. However, in real life, network interruptions occur from time to time due to various reasons such as lightning, typhoons, fires, floods, power outages, digging of optical cables, deliberate sabotage and operational errors. Network interruptions eventually lead to business interruptions, economic losses and other adverse effects. Various network outage crises are also common. In fact, no matter how big or small an enterprise is, it cannot afford business losses such as service interruptions.
[0003] With the development of the times, people's demand for high-availability networks is becoming stronger and stronger. In the past, due to the high cost of building high-availability networks, cost-sensitive users had to choose to give up. Now, with the continuous development of computer network technology, the construction cost of computer networks is becoming more and more affordable. 5G / 4G wireless networks are now widely popular, and some telecom operators even provide free broadband services to specific users. At present, building a computer network with redundant Internet access paths is no longer out of reach. Building a high-availability disaster recovery backup network system based on redundant Internet access paths has become an era topic with great practical significance and application value.
[0004] Currently, most of the network systems with disaster recovery functions on the market are built based on expensive, difficult to use, and high-end routers, firewalls, and other devices on the network side, such as multi-WAN port routers, routers that support VRRP protocol, and routers that support dynamic routing protocols such as RIP, OSPF, and BGP. However, in real life, many small and medium-sized organizations and home users are sensitive to network construction costs and ease of use. If the original broadband routers of general telecom operators or ordinary home and commercial routers are used to build a disaster recovery backup network system, since the heartbeat mechanism cannot be implemented between devices, when the main network path fails, the network traffic needs to be manually operated to switch to the backup network path.
[0005] Generally, in order to access the Internet, users will apply to telecom operators for a wired broadband line. If, in order to improve the availability of the network, a new wired broadband line is added for free from a telecom operator, or a new wireless Internet line is added through the 5G / 4G wireless network, then two Internet lines will be available at the same time. If two new Internet lines are added at the same time, then three Internet lines will be available at the same time. The network topology at this time is as follows: Figure 1 As shown in the figure, with redundant Internet access paths, when a disaster such as a network outage occurs on the primary Internet access path, the network traffic can be switched to other backup network paths.
[0006] The Internet mainly uses TCP / IP protocol for communication. Currently, the PCs that access the Internet mainly use Windows series operating systems, and some servers also use Windows Server series operating systems. Windows operating systems use the host routing table as the basis for TCP / IP protocol communication. Usually, Windows operating systems mainly communicate with the Internet based on the default route (a static route) in the host routing table. In the disaster recovery backup network system built with general telecommunications operators' original broadband routers or ordinary home and commercial routers based on cost considerations, by default, there is no interaction of routing-related messages between Internet routers and between Windows operating systems and Internet routers. When the main network path is blocked, the Windows operating system kernel cannot automatically switch traffic to the backup network path. Although the network system has redundant paths, there will still be a network disconnection crisis. Summary of the invention
[0007] The purpose of the present invention is to provide a method for constructing a disaster recovery standby network with intelligent host routing, so as to solve the technical problem that although the network system of the existing Windows series operating system has redundant Internet access paths, there will still be a network disconnection crisis.
[0008] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0009] A method for constructing a disaster recovery standby network with intelligent host routing, the method comprising the following steps:
[0010] Step 1: Analyze the underlying principles of redundant network path status monitoring;
[0011] Step 2: Establish a heartbeat mechanism between the host and each redundant network path;
[0012] Step 3: Design the host intelligent routing algorithm;
[0013] Step 4: Implement network load balancing.
[0014] Furthermore, the specific process of step 1 is:
[0015] Windows applications implement Internet communication by calling TCP / IP services provided by the system kernel. During the communication process, even if there are several redundant gateways that can reach the Internet on the LAN where the Windows host is located, the network traffic of the host can only be transmitted through the default gateway selected by the routing table. The network detection program cannot monitor the line status of several redundant network paths at the same time. In order to monitor the line status of several redundant network paths at the same time, it is necessary to establish a TCP / IP communication method independent of the Windows kernel.
[0016] The Internet Control Message Protocol in the TCP / IP protocol suite defines an echo function, which is implemented using two messages: echo request and echo reply. A host sends an echo request message to the destination host, and the destination host must send an echo reply message after receiving it. In this way, it is possible to test whether the destination host is reachable and whether the network line is unobstructed. The line status of each redundant network path can be monitored through ICMP echo query messages.
[0017] Based on SharpPcap's .NET library and Packet.Net class library, a TCP / IP communication program independent of the Windows kernel is designed to implement the functions of sending data packets to the remote host and receiving the remote host's response data packets. By sending ICMP echo request messages to Internet hosts on different redundant network paths and monitoring the ICMP echo reply messages returned along different network paths, the network status of each redundant network path can be monitored.
[0018] The host perceives the status of each redundant network path in real time. When it senses that the main network path has failed, the host runs an intelligent routing algorithm to select the best path from the available backup network paths as a new communication line to resolve the network disconnection crisis.
[0019] Furthermore, the specific process of step 2 is:
[0020] Step 2.1: Construct an ICMP echo request message for monitoring the status of each redundant network path;
[0021] Step 2.2: Encapsulate the ICMP echo request message into an IP datagram;
[0022] Step 2.3: Encapsulate the IP datagram into an Ethernet frame and send it to the designated gateway;
[0023] Step 2.4: Monitor whether the ICMP echo reply message arrives on each redundant network path.
[0024] Furthermore, the specific process of step 2.1 is:
[0025] When constructing an ICMP echo request message, the ID field is used to identify the gateway of each redundant network path, the Code field is assigned a value of 0, the Sequence field is used to identify several different echo request messages sent in succession through the same gateway, the sequence field value of the latter echo request message is 1 plus the sequence field value of the previous message, and the number of messages sent in succession is set to 4 or more. The Payload field is filled with the IP address of the corresponding redundant network path gateway to check the echo reply message to determine whether the message is an echo reply message sent back by the destination host from the corresponding redundant network path, so as to implement a method for determining the source gateway of the data packet at the ICMP protocol layer.
[0026] Furthermore, the specific process of step 2.2 is:
[0027] When constructing an IP datagram, the local IP address is used as the source address of the IP datagram, an Internet host is selected as the destination host for inquiry, the host's IP address is used as the destination IP address of the IP datagram, the constructed ICMP echo request message data packet is assigned to the payload field of the IP datagram, and then the upper layer protocol, message length, and checksum information of the IP datagram are updated to construct the corresponding IP datagram.
[0028] Furthermore, the specific process of step 2.3 is:
[0029] When constructing an Ethernet frame, first create an ARP class object in SharpPcap, and resolve the gateway's IP address to obtain the gateway's physical address by calling the Resolve method of the ARP class object. If the resolution fails, it means that the gateway is faulty. If the physical address can be resolved normally, the physical address is used as the destination address of the Ethernet frame to be constructed, and the physical address of the local network card is used as the source address of the Ethernet frame. The type field is set to the type value of the IP datagram, and then the constructed IP datagram is assigned to the payload field of the Ethernet frame, and the IP datagram is encapsulated into an Ethernet frame.
[0030] After the encapsulated Ethernet frame is sent out through the network card, the gateway whose physical address is the destination address of the Ethernet frame will receive the frame. After receiving the Ethernet frame, the gateway decapsulates it to obtain the IP datagram. After checking that the destination address of the IP datagram is not itself, it forwards the IP datagram along the Internet access path and finally delivers it to the corresponding Internet host.
[0031] Furthermore, the specific process of step 2.4 is as follows:
[0032] After the Internet host receives the ICMP echo request message forwarded from the Internet access network path, it will send an ICMP echo reply message back to the source host from the original Internet access path. By setting the Filter property of the SharpPcap.LibPcap.LibPcapLiveDevice object to "icmp", the ICMP traffic can be captured by SharpPcap. After N Ethernet frames encapsulating ICMP echo request messages are sent to the gateway of each Internet access path, N ≥ 4, before the response times out, by checking the source address and destination address of the Ethernet frame of the captured ICMP traffic, the source IP address and destination IP address of the IP datagram, and the Type, Code, ID, Sequence, and Payload fields of the ICMP message, the response of the ICMP echo request message sent by the Internet destination host to each redundant Internet access path is monitored. By calculating and counting the corresponding echo reply message packet loss rate and RTT (Round-Trip Time), the status of each redundant Internet access path is determined.
[0033] By creating a System.Timers.Timer object, ICMP echo request messages are periodically sent to the Internet host through the gateway of each redundant Internet access path, and the ICMP traffic received by the host is continuously checked, and the ICMP echo reply messages sent back by the Internet host are monitored. A heartbeat mechanism is established between the Internet host and each redundant Internet access path, so that the host can monitor the status of each redundant Internet access path in real time;
[0034] If no corresponding ICMP echo reply message is detected on a certain Internet access path, that is, the packet loss rate reaches 100%, it means that the Internet access path is no longer accessible. If the primary Internet access path is blocked, the intelligent routing algorithm will be run immediately to select the best available path from the backup Internet access paths as the new primary Internet access path, and switch the network traffic to the new primary Internet access path to ensure that the network system has high availability.
[0035] Furthermore, the specific process of step 3 is:
[0036] Step 3.1: Design the host intelligent routing system initialization process
[0037] The Windows system selects one of several redundant network paths for communication based on the default route. To facilitate the description and selection of network paths, in a disaster recovery backup network with several redundant Internet access paths, based on business application needs and actual use experience of each Internet access path, various factors such as network bandwidth, delay, delay jitter, and network availability are comprehensively considered, and the network quality of each Internet access path is scored in a quantitative way and set in the software as the priority of Internet access path selection;
[0038] When the disaster recovery backup network system is initialized after the Windows system is started, the software detects the status of each Internet access path through the heartbeat mechanism, sorts the network paths that can work normally according to their priorities, selects the path with the highest priority as the main network path, and the other paths as backup network paths. In the Windows host routing table, the gateway of the default route points to the Internet access router of the main network path, so that network traffic is transmitted through the main network path;
[0039] Step 3.2: Design a host intelligent path selection disaster recovery method
[0040] When the software detects a failure in the primary network path through the heartbeat mechanism, it selects the path with the highest priority from the remaining backup network paths that can work normally as the new primary network path. If all network paths are blocked, the primary network path remains unchanged.
[0041] Next, the software modifies the default route of the host routing table, points the gateway of the default route to the Internet router of the newly selected primary network path, and quickly switches the network traffic to be transmitted through the newly selected primary network path. The specific implementation is divided into two steps: the first is that the software calls cmd.exe to run the system command route delete 0.0.0.0 to delete the original default route; the second is that the software calls cmd.exe to run the system command route add 0.0.0.0mask0.0.0.0X.XXX, where XXXX is the gateway IP of the newly selected primary network path, and points the gateway of the default route to the router of the newly selected primary network path;
[0042] Step 3.3: Design a host intelligent routing disaster recovery method
[0043] When the software detects through the heartbeat mechanism that a backup network path has recovered from a network outage disaster, it compares the priority of the network path with the priority of the existing primary network path. If the priority is higher than the existing primary network path, the newly restored higher priority network path is selected as the new primary network path, and the existing primary network path is converted to the backup network path role. Otherwise, the primary and backup roles of the system's network paths remain unchanged;
[0044] If the primary network path changes, the software will then modify the default routing gateway in the host routing table and point it to the Internet router of the newly selected primary network path to switch network traffic to the restored higher priority network path, so that the disaster recovery backup network system will always choose the available network path with the best quality for communication, thereby ensuring that the Internet host can always have the best Internet quality. The specific implementation is still divided into two steps: first, the software calls cmd.exe to run the system command route delete0.0.0.0; second, the software calls cmd.exe to run the system command route add0.0.0.0mask 0.0.0.0XXXX, where XXXX is the gateway IP of the newly selected primary network path;
[0045] Based on the host's ability to automatically sense the state and state changes of the network environment through software, it can fully automatically and autonomously analyze and judge changes in the network environment, make correct decisions and respond in a timely manner. For each change in the network environment, it can automatically and autonomously select the optimal network path as the main network path based on the changed network environment, and manage the switching of the primary and backup roles of each redundant Internet network path, while completing the switching of Internet network traffic. This can ensure that the Internet host can always select the optimal network path from the current network environment to access the Internet. Compared with the default host routing method of the Windows system, it shows strong intelligence.
[0046] Furthermore, the specific process of step 4 is:
[0047] In a disaster recovery backup network system that works in a master-slave mode, the network traffic of the host is transmitted through the primary network path, and the backup network paths are all in an idle (i.e., standby) state, which will result in insufficient network bandwidth utilization of the entire network system. In an environment where several hosts are online at the same time, different priorities are set for the same online network path on different hosts according to the established host intelligent routing algorithm, so that the primary network paths selected by each host at the same time are different, so that the network traffic of different hosts at the same time is transmitted through different network paths, and finally network load sharing is achieved according to the established host intelligent routing algorithm, and the network bandwidth utilization of the entire disaster recovery backup network system is improved while maintaining the disaster recovery backup function.
[0048] The present invention has the following beneficial effects due to the adoption of the above technical solution:
[0049] In the case of multiple redundant Internet access paths, the present invention has a very high availability of the disaster recovery backup network system, which can solve the network disconnection crisis. The present disaster recovery backup network system innovatively uses the host to monitor the status of each redundant network path in real time through software, and performs automatic intelligent routing, and no longer relies on hardware devices such as expensive routers with high difficulty and high positioning. It only needs to use the broadband Internet access router originally equipped by the telecommunications operator. Compared with the scheme of using hardware devices such as expensive routers with high positioning to realize the disaster recovery backup function, the hardware scheme has a high cost and the cost has an incompressible rigidity, while the software cost of the software scheme is mainly concentrated in the development stage, and the development cost is not high. With the continuous expansion of the scale of software use, the software use cost allocated to each Internet host can become very low. If the software is open source, the software use cost can also be 0, so the present disaster recovery backup network system has the advantage of very low cost. At the same time, the use of the software is also very simple. After setting the parameters, it can be automatically started and run. For some small and medium-sized institutions and home users who are more sensitive to cost, the present disaster recovery backup network system has a high promotion and application value in the occasions where it is hoped to complete high-availability network computing at low cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a network topology diagram of a disaster recovery standby network with redundant Internet access network paths of the present invention;
[0051] Figure 2 It is a diagram showing the normal operation effect of the host intelligent routing software of the present invention and the effect after running the disaster recovery algorithm;
[0052] Figure 3 This is a diagram showing the effect of the host intelligent routing software running a disaster recovery algorithm when a main network path fails;
[0053] Figure 4 This is a diagram showing the effect of implementing load sharing in the disaster recovery standby network of the present invention. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and preferred embodiments. However, it should be noted that many details listed in the specification are only for the purpose of enabling the reader to have a thorough understanding of one or more aspects of the present invention, and these aspects of the present invention can be implemented even without these specific details.
[0055] A method for constructing a disaster recovery standby network with intelligent host routing, the method comprising the following steps:
[0056] Step 1: Analysis of the underlying principles of redundant network path status monitoring:
[0057] Generally speaking, Windows applications usually implement Internet communication by calling the TCP / IP service provided by the system kernel. During the communication process, even if there are multiple redundant gateways that can reach the Internet on the LAN where the Windows host is located, the host's network traffic can only be transmitted through the default gateway selected by the routing table. Using general network detection programs, it is impossible to monitor the line status of multiple redundant network paths at the same time. In order to monitor the line status of multiple redundant network paths at the same time, it is necessary to establish a TCP / IP communication method independent of the Windows kernel.
[0058] The Internet Control Message Protocol (ICMP) in the TCP / IP protocol suite defines an echo function, which is implemented using two messages: echo request and echo reply. A host sends an echo request message to the destination host, and the destination host must send an echo reply message after receiving it. In this way, it is possible to test whether the destination host is reachable and whether the network line is unobstructed. The Ping service commonly used in the application layer uses this function. It is a good and feasible method to monitor the line status of each redundant network path through ICMP echo inquiry messages.
[0059] SharpPcap is a fully managed, cross-platform (Windows, Mac, Linux) .NET library with functions such as capturing, filtering, and sending packets; Packet.Net class library can be used to build and parse Ethernet frames, IP datagrams, ICMP packets, and other packets. Based on the above library, you can design a TCP / IP communication program independent of the Windows kernel to implement the functions of sending packets to remote hosts and receiving response packets from remote hosts. By sending ICMP echo request messages to Internet hosts on different redundant network paths and monitoring the ICMP echo reply messages returned along different network paths, the network status of each redundant network path can be monitored.
[0060] If a heartbeat mechanism is implemented between the host and each redundant network path through software, the host can sense the status of each redundant network path in real time. When the host senses that the main network path has failed, it can solve the network disconnection crisis by running an intelligent routing algorithm to select the best path from the available backup network paths as the new communication line.
[0061] Step 2: Establish a heartbeat mechanism between the host and each redundant network path
[0062] 2.1 Constructing ICMP echo request messages to monitor the status of each redundant network path
[0063] When constructing an ICMP echo request message, the ID field can be used to identify the gateway of each redundant network path, the Code field is assigned a value of 0, and the Sequence field is used to identify multiple different echo request messages sent in succession through the same gateway. The sequence field value of the subsequent echo request message is 1 plus the sequence field value of the previous message. The number of messages sent in succession can be set to 4 or more. The Payload field can be filled with the IP address of the corresponding redundant network path gateway to check the echo reply message and determine whether the message is an echo reply message sent back by the destination host from the corresponding redundant network path, so as to implement a method for determining the source gateway of a data packet at the ICMP protocol layer.
[0064] 2.2 Encapsulate ICMP echo request message into IP datagram
[0065] When constructing an IP datagram, the local IP address is used as the source address of the IP datagram, and an Internet host with extremely high availability (such as www.baidu.com) is selected as the destination host for inquiry, and its IP address is used as the destination IP address of the IP datagram. The constructed ICMP echo request message data packet is assigned to the payload field of the IP datagram, and then the upper layer protocol, message length, checksum and other information of the IP datagram are updated to construct the corresponding IP datagram.
[0066] 2.3 Encapsulate IP datagram into Ethernet frame and send it to the designated gateway
[0067] When constructing an Ethernet frame, we can first create an ARP class object in SharpPcap. Under normal circumstances, the IP address of the gateway can be resolved to obtain the physical address of the gateway by calling the Resolve method of the ARP class object. If the resolution is unsuccessful, it means that the gateway is faulty. If the physical address can be resolved normally, the physical address will be used as the destination address of the Ethernet frame to be constructed, and the physical address of the local network card will be used as the source address of the Ethernet frame. The type field is set to the type value of the IP datagram, and the constructed IP datagram is assigned to the payload field of the Ethernet frame to encapsulate the IP datagram into an Ethernet frame.
[0068] After the encapsulated Ethernet frame is sent out through the network card, under normal circumstances, the gateway whose physical address is the destination address of the Ethernet frame will receive the frame. After receiving the Ethernet frame, the gateway will decapsulate it to obtain the IP datagram. After checking that the destination address of the IP datagram is not itself, it will forward the IP datagram along its Internet access path and finally deliver it to the corresponding Internet host.
[0069] 2.4 Monitor the arrival of ICMP echo reply messages on each redundant network path
[0070] Under normal circumstances, after an Internet host receives an ICMP echo request message forwarded from an Internet access path, it will send an ICMP echo reply message back to the source host from the original Internet access path. Set the Filter property of the SharpPcap.LibPcap.LibPcapLiveDevice object to "icmp" to capture ICMP traffic through SharpPcap. After sending N (N≥4) Ethernet frames encapsulating ICMP echo request messages to the gateway of each Internet access path, before the response times out, by checking the source address and destination address of the Ethernet frame of the captured ICMP traffic, the source IP address and destination IP address of the IP datagram, and the Type, Code, ID, Sequence, and Payload fields of the ICMP message, the response of the Internet destination host to the ICMP echo request message sent out by each redundant Internet access path can be monitored. By calculating and counting the corresponding echo reply message packet loss rate and RTT (Round-Trip Time), the status of each redundant Internet access path can be determined.
[0071] By creating a System.Timers.Timer object, periodically sending ICMP echo request messages to the Internet host through the gateway of each redundant Internet access path, continuously checking the ICMP traffic received by the host, and monitoring the ICMP echo reply messages sent back by the Internet host, a heartbeat mechanism can be established between the Internet host and each redundant Internet access path, so that the host can monitor (perceive) the status of each redundant Internet access path in real time.
[0072] If no corresponding ICMP echo reply message is detected on a certain Internet access path, that is, the packet loss rate reaches 100%, it means that the Internet access path is no longer accessible. If the primary Internet access path is blocked, the intelligent routing algorithm will be run immediately to select the best available path from the backup Internet access paths as the new primary Internet access path, and switch the network traffic to the new primary Internet access path to ensure that the network system has high availability.
[0073] Step 3: Host intelligent routing algorithm and its implementation
[0074] 3.1 Host Intelligent Routing System Initialization Algorithm
[0075] Generally, Windows systems select one of multiple redundant network paths for communication based on the default route. To facilitate the description and selection of network paths, in a disaster recovery backup network with multiple redundant Internet access paths, network administrators can consider various factors such as network bandwidth, delay, delay jitter, and network availability based on business application needs and actual experience of each Internet access path, and use a quantitative method to score the network quality of each Internet access path and set it in the software, so as to serve as the priority of Internet access path selection (such as Figure 2 As shown, a 100-point system is used for quantification, with the priority of telecom fiber broadband set to 90, the priority of mobile fiber broadband set to 80, and the priority of telecom 5G wireless Internet lines set to 60).
[0076] When the disaster recovery backup network system is initialized after the Windows system is started, the software can detect the status of each Internet path through the heartbeat mechanism, sort the network paths that can work normally according to the priority, and select the path with the highest priority as the main network path, and the other paths as backup network paths (such as Figure 2 As shown in the figure, the path with the highest priority (priority 90) is selected from the three paths that can work normally as the main network path, and the other two paths (priorities 80 and 60) are used as backup network paths). In the Windows host routing table, the gateway of the default route is pointed to the Internet router of the main network path so that network traffic can be transmitted through the main network path.
[0077] 3.2 Host Intelligent Path Selection Disaster Recovery Algorithm
[0078] When the software detects a failure in the primary network path through the heartbeat mechanism, it selects the path with the highest priority from the remaining backup network paths that can work normally as the new primary network path. If all network paths are blocked, the primary network path remains unchanged. Figure 3 As shown, when the original primary network path with a priority of 90 fails, the software selects the backup network path with the highest priority (priority of 80) from the remaining backup network paths that can work normally as the new primary network path, and the original primary network path (the path with a priority of 90) is converted into the backup network path role.
[0079] Next, the software modifies the default route of the host routing table, points the gateway of the default route to the newly selected Internet router of the primary network path, and quickly switches the network traffic to be transmitted through the newly selected primary network path. The specific implementation is divided into two steps: 1. The software calls cmd.exe to run the system command "route delete 0.0.0.0" to delete the original default route; 2. The software calls cmd.exe to run the system command "route add 0.0.0.0mask 0.0.0.0XXXX", where "XXXX" is the gateway IP of the newly selected primary network path, and points the gateway of the default route to the router of the newly selected primary network path.
[0080] 3.3 Host Intelligent Routing Disaster Recovery Algorithm
[0081] When the software detects through the heartbeat mechanism that a backup network path has recovered from a network outage disaster, the priority of the network path is compared with the priority of the existing primary network path. If it is higher than the existing primary network path, the newly restored higher priority network path is selected as the new primary network path, and the existing primary network path is converted to the backup network path role. Otherwise, the primary and backup roles of the system's network paths remain unchanged.
[0082] If the primary network path changes, the software will then modify the default routing gateway in the host routing table and point it to the newly selected primary network path's Internet access router to switch network traffic to the restored higher priority network path, so that the disaster recovery backup network system will always choose the available best quality network path for communication, thereby ensuring that the Internet access host can always have the best Internet access quality. The specific implementation is still divided into two steps: ⒈ The software calls cmd.exe to run the system command "route delete 0.0.0.0"; ⒉ The software calls cmd.exe to run the system command "route add0.0.0.0mask 0.0.0.0XXXX", where "XXXX" is the gateway IP of the newly selected primary network path.
[0083] For example, when the host intelligent routing software detects Figure 3 When the faulty telecommunications fiber broadband line with a priority of 90 shown in the figure recovers from a network outage disaster, its priority is compared with the priority of the existing primary network path (mobile fiber broadband with a priority of 80), and the network path with a higher priority (the path with a priority of 90) is selected as the new primary network path. At the same time, the existing primary network path (the path with a priority of 80) is converted to the backup network path role. The effect after running the disaster recovery algorithm is as follows: Figure 2 shown.
[0084] This host intelligent routing algorithm can automatically and autonomously analyze and judge the changes in the network environment (various redundant Internet access network paths) and make correct decisions and timely responses based on the host's ability to automatically perceive the status and changes of the network environment (various redundant Internet access network paths) through software. For each change in the network environment, it can automatically and autonomously select the optimal network path as the main network path based on the changed network environment, manage the switching of the primary and backup roles of each redundant Internet access network path, and complete the switching of Internet access network traffic at the same time, which can ensure that the Internet access host can always select the optimal network path from the current network environment (the changed network environment) to access the Internet. Compared with the default host routing method of the Windows system, it shows strong intelligence.
[0085] Step 4: Implement network load balancing
[0086] In a disaster recovery backup network system that works in a master-slave mode, the network traffic of the host is usually transmitted through the primary network path, and the backup network paths are in an idle (i.e., standby) state, which will result in insufficient network bandwidth utilization of the entire network system. In an environment where multiple hosts are online at the same time, we can set different priorities for the same online network path on different hosts according to the established host intelligent routing algorithm and management strategy, so that the primary network paths selected by each host at the same time can be different, so that the network traffic of different hosts at the same time can be transmitted through different network paths, and finally realize network load sharing according to the established management strategy, and improve the network bandwidth utilization of the entire disaster recovery backup network system while maintaining the disaster recovery backup function.
[0087] like Figure 4 As shown in (a), on the Internet host with IP address 192.168.1.10, the priority of China Telecom fiber broadband is set to 90, the priority of China Mobile fiber broadband is set to 80, and the priority of China Telecom 5G wireless Internet access is set to 60. When all redundant network paths can work normally, the main network path selected by the software is the China Telecom fiber broadband line, and the network traffic is transmitted using the China Telecom fiber broadband line; on another Internet host with IP address 192.168.1.20, as shown in Figure 4 As shown in (b), the priority of telecommunications fiber broadband is set to 80, the priority of mobile fiber broadband is set to 90, and the priority of telecommunications 5G wireless Internet access is set to 60. When all redundant network paths can work normally, the main network path selected by the software is the mobile fiber broadband line, and network traffic is transmitted using the mobile fiber broadband line. While maintaining the disaster recovery and standby functions, the system realizes network load sharing and improves the utilization of network bandwidth.
[0088] The author uses Visual Studio 2019 based on C# language and SharpPcap 6.3.0 to design and implement the host intelligent routing software of the disaster recovery backup network system. The Npcap 1.79 is installed on Windows 7, 8, 10, 11 and Windows Server 2012, 2016, 2019, 2022 and other operating systems. The test is passed and the software runs stably. The software can automatically select the best new main network path from the backup network path within a few seconds when the main network path fails, and successfully switch the network traffic to the new main network path; when the communication of the backup network path with a higher priority is restored, the network traffic can be automatically restored to the new main network path with a higher priority within a few seconds, realizing the automatic intelligent scheduling and management of the disaster recovery backup network system with multiple redundant Internet access network paths. By setting different priorities for the same redundant network path on different hosts, the disaster recovery backup network system also realizes the load sharing of network traffic.
[0089] In the case of multiple redundant Internet access paths, this disaster recovery backup network system has very high availability and can solve the network disconnection crisis. This disaster recovery backup network system innovatively uses the host to monitor the status of each redundant network path in real time through software, and performs automatic intelligent routing. It no longer relies on expensive, difficult to use, and high-end hardware devices such as routers. It only needs to use the broadband Internet routers originally provided by telecom operators. Compared with the solution of using expensive and high-end hardware devices such as routers to achieve disaster recovery and backup functions, the hardware solution has a high cost and the cost has incompressible rigidity, while the software cost of the software solution is mainly concentrated in the development stage, and the development cost is not high. With the continuous expansion of the scale of software use, the software use cost allocated to each Internet host can become very low. If the software is open source, the software use cost can also be 0. Therefore, this disaster recovery backup network system has the advantage of very low cost. At the same time, the software is also very easy to use. After setting the parameters, it can be turned on and run automatically. This disaster recovery backup network system has a high promotion and application value for some small and medium-sized institutions and home users who are more sensitive to cost and want to complete high-availability network computing at a low cost.
[0090] A TCP / IP communication mechanism independent of the Windows kernel has been established, and a heartbeat mechanism that can monitor the status of multiple redundant network paths at the same time has been established. By running an intelligent routing algorithm, when a network disconnection disaster occurs on the main network path, the host can automatically and intelligently switch network traffic to the optimal backup network path. When the original main network path returns to normal, the network can be automatically and intelligently restored to its original optimal state. A low-cost and highly available disaster recovery backup network system has been built, which can solve the network disconnection crisis and has a high promotion and application value in situations where high-availability network computing is expected to be completed at a low cost.
[0091] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for constructing a disaster recovery standby network with intelligent host routing. Features: The method comprises the following steps: Step 1: Analyze the underlying principles of redundant network path status monitoring; Step 2: Establish a heartbeat mechanism between the host and each redundant network path; Step 3: Design the host intelligent routing algorithm; Step 4: Implement network load balancing.
2. According to the method for constructing a disaster recovery standby network with intelligent host routing according to claim 1, Features: The specific process of step 1 is: Windows applications implement Internet communication by calling TCP / IP services provided by the system kernel. During the communication process, even if there are several redundant gateways that can reach the Internet on the LAN where the Windows host is located, the network traffic of the host can only be transmitted through the default gateway selected by the routing table. The network detection program cannot monitor the line status of several redundant network paths at the same time. In order to monitor the line status of several redundant network paths at the same time, it is necessary to establish a TCP / IP communication method independent of the Windows kernel. The Internet Control Message Protocol in the TCP / IP protocol suite defines an echo function, which is implemented using two messages: echo request and echo reply. A host sends an echo request message to the destination host, and the destination host must send an echo reply message after receiving it. In this way, it is possible to test whether the destination host is reachable and whether the network line is unobstructed. The line status of each redundant network path can be monitored through ICMP echo query messages. Based on SharpPcap's .NET library and Packet.Net class library, a TCP / IP communication program independent of the Windows kernel is designed to implement the functions of sending data packets to the remote host and receiving the remote host's response data packets. By sending ICMP echo request messages to Internet hosts on different redundant network paths and monitoring the ICMP echo reply messages returned along different network paths, the network status of each redundant network path can be monitored. The host perceives the status of each redundant network path in real time. When it senses that the main network path has failed, the host runs an intelligent routing algorithm to select the best path from the available backup network paths as a new communication line to resolve the network disconnection crisis.
3. According to claim 1, a method for constructing a disaster recovery standby network with intelligent host routing, Features: The specific process of step 2 is: Step 2.1: Construct an ICMP echo request message for monitoring the status of each redundant network path; Step 2.2: Encapsulate the ICMP echo request message into an IP datagram; Step 2.3: Encapsulate the IP datagram into an Ethernet frame and send it to the designated gateway; Step 2.4: Monitor whether the ICMP echo reply message arrives on each redundant network path.
4. According to claim 3, a method for constructing a disaster recovery standby network with intelligent host routing, Features: The specific process of step 2.1 is: When constructing an ICMP echo request message, the ID field is used to identify the gateway of each redundant network path, the Code field is assigned a value of 0, the Sequence field is used to identify several different echo request messages sent in succession through the same gateway, the sequence field value of the latter echo request message is 1 plus the sequence field value of the previous message, and the number of messages sent in succession is set to 4 or more. The Payload field is filled with the IP address of the corresponding redundant network path gateway to check the echo reply message to determine whether the message is an echo reply message sent back by the destination host from the corresponding redundant network path, so as to implement a method for determining the source gateway of the data packet at the ICMP protocol layer.
5. According to the method for constructing a disaster recovery standby network with intelligent host routing as described in claim 3, Features: The specific process of step 2.2 is: When constructing an IP datagram, the local IP address is used as the source address of the IP datagram, an Internet host is selected as the destination host for inquiry, the host's IP address is used as the destination IP address of the IP datagram, the constructed ICMP echo request message data packet is assigned to the payload field of the IP datagram, and then the upper layer protocol, message length, and checksum information of the IP datagram are updated to construct the corresponding IP datagram.
6. According to claim 3, a method for constructing a disaster recovery standby network with intelligent host routing, Features: The specific process of step 2.3 is: When constructing an Ethernet frame, first create an ARP class object in SharpPcap, and resolve the gateway's IP address to obtain the gateway's physical address by calling the Resolve method of the ARP class object. If the resolution fails, it means that the gateway is faulty. If the physical address can be resolved normally, the physical address is used as the destination address of the Ethernet frame to be constructed, and the physical address of the local network card is used as the source address of the Ethernet frame. The type field is set to the type value of the IP datagram, and then the constructed IP datagram is assigned to the payload field of the Ethernet frame, and the IP datagram is encapsulated into an Ethernet frame. After the encapsulated Ethernet frame is sent out through the network card, the gateway whose physical address is the destination address of the Ethernet frame will receive the frame. After receiving the Ethernet frame, the gateway decapsulates it to obtain the IP datagram. After checking that the destination address of the IP datagram is not itself, it forwards the IP datagram along the Internet access path and finally delivers it to the corresponding Internet host.
7. According to claim 3, a method for constructing a disaster recovery standby network with intelligent host routing, Features: The specific process of step 2.4 is: After the Internet host receives the ICMP echo request message forwarded from the Internet access network path, it will send an ICMP echo reply message back to the source host from the original Internet access path. By setting the Filter property of the SharpPcap.LibPcap.LibPcapLiveDevice object to icmp, the ICMP traffic can be captured by SharpPcap. After N Ethernet frames encapsulating ICMP echo request messages are sent to the gateway of each Internet access path, N ≥ 4, before the response times out, by checking the source address and destination address of the Ethernet frame of the captured ICMP traffic, the source IP address and destination IP address of the IP datagram, and the Type, Code, ID, Sequence, and Payload fields of the ICMP message, the response of the ICMP echo request message sent by the Internet destination host to each redundant Internet access path is monitored. By calculating and counting the corresponding echo reply message packet loss rate and round-trip delay RTT, the status of each redundant Internet access path is determined. By creating a System.Timers.Timer object, ICMP echo request messages are periodically sent to the Internet host through the gateway of each redundant Internet access path, and the ICMP traffic received by the host is continuously checked, and the ICMP echo reply messages sent back by the Internet host are monitored. A heartbeat mechanism is established between the Internet host and each redundant Internet access path, so that the host can monitor the status of each redundant Internet access path in real time; If no corresponding ICMP echo reply message is detected on a certain Internet access path, that is, the packet loss rate reaches 100%, it means that the Internet access path is no longer accessible. If the primary Internet access path is blocked, the intelligent routing algorithm will be run immediately to select the best available path from the backup Internet access paths as the new primary Internet access path, and switch the network traffic to the new primary Internet access path to ensure that the network system has high availability.
8. According to claim 1, a method for constructing a disaster recovery standby network with intelligent host routing, Features: The specific process of step 3 is: Step 3.1: Design host intelligent routing system initialization The Windows system selects one of several redundant network paths for communication based on the default route. To facilitate the description and selection of network paths, in a disaster recovery backup network with several redundant Internet access paths, based on business application needs and actual use experience of each Internet access path, the network quality of each Internet access path is scored in a quantitative way and set in the software according to factors such as network bandwidth, delay, delay jitter, and network availability. This is used as the priority for Internet access path selection. When the disaster recovery backup network system is initialized after the Windows system is started, the software detects the status of each Internet access path through the heartbeat mechanism, sorts the network paths that can work normally according to their priorities, selects the path with the highest priority as the main network path, and the other paths as backup network paths. In the Windows host routing table, the gateway of the default route points to the Internet access router of the main network path, so that network traffic is transmitted through the main network path; Step 3.2: Design a host intelligent path selection disaster recovery method When the software detects a failure in the primary network path through the heartbeat mechanism, it selects the path with the highest priority from the remaining backup network paths that can work normally as the new primary network path. If all network paths are blocked, the primary network path remains unchanged. Next, the software modifies the default route of the host routing table, points the gateway of the default route to the Internet router of the newly selected primary network path, and quickly switches the network traffic to be transmitted through the newly selected primary network path. The specific implementation is divided into two steps: first, the software calls cmd.exe to run the system command route delete 0.0.0.0 to delete the original default route; second, the software calls cmd.exe to run the system command route add 0.0.0.0mask 0.0.0.0XXXX, where XXXX is the gateway IP of the newly selected primary network path, and points the gateway of the default route to the router of the newly selected primary network path; Step 3.3: Design a host intelligent routing disaster recovery method When the software detects through the heartbeat mechanism that a backup network path has recovered from a network outage disaster, it compares the priority of the network path with the priority of the existing primary network path. If the priority is higher than the existing primary network path, the newly restored higher priority network path is selected as the new primary network path, and the existing primary network path is converted to the backup network path role. Otherwise, the primary and backup roles of the system's network paths remain unchanged; If the primary network path changes, the software will then modify the default routing gateway in the host routing table and point the default routing gateway in the host routing table to the Internet router of the newly selected primary network path, so as to switch the network traffic to the restored higher priority network path, so that the disaster recovery backup network system will always choose the available network path with the best quality for communication, thereby ensuring that the Internet host can always have the best Internet quality. The specific implementation is still divided into two steps: first, the software calls cmd.exe to run the system command route delete 0.0.0.0; second, the software calls cmd.exe to run the system command route add 0.0.0.0mask 0.0.0.0XXXX, where XXXX is the gateway IP of the newly selected primary network path; Based on the host's ability to automatically sense the state and state changes of the network environment through software, it can fully automatically and autonomously analyze and judge changes in the network environment, make correct decisions and respond in a timely manner. For each change in the network environment, it can automatically and autonomously select the optimal network path as the main network path based on the changed network environment, and manage the switching of the primary and backup roles of each redundant Internet network path, while completing the switching of Internet network traffic. This can ensure that the Internet host can always select the optimal network path from the current network environment to access the Internet. Compared with the default host routing method of the Windows system, it shows strong intelligence.
9. The method for constructing a disaster recovery standby network with intelligent host routing according to claim 1, Features: The specific process of step 4 is: In a disaster recovery backup network system that works in a master-slave mode, the network traffic of the host is transmitted through the primary network path, and the backup network paths are idle, which will lead to insufficient network bandwidth utilization of the entire network system. In an environment where several hosts are connected to the Internet at the same time, different priorities are set for the same Internet access network path on different hosts according to the established host intelligent routing algorithm, so that the primary network paths selected by each host at the same time are different, so that the network traffic of different hosts at the same time is transmitted through different network paths, and finally network load sharing is achieved according to the established host intelligent routing algorithm. On the premise of maintaining the disaster recovery backup function, the network bandwidth utilization of the entire disaster recovery backup network system is improved.
