A dual-active method, device, switch and system in routing processing

CN122698549APending Publication Date: 2026-09-04CLOUDNINE INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610608166.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-06
Publication Date
2026-09-04

AI Technical Summary

Technical Problem

例如,请继续参考图1,网关192.168.0.1如果失效,那么原先使用192.168.0.1作为网关的终端设备,必须手工更改网关为192.168.0.2才能继续和外网通信,这使得备份网关存在的价值大为降低

Benefits of technology

[0016]Based on the above, the beneficial effects of this application include: forming an asymmetric interconnection structure by link aggregating the first and second ports of the switch to create a link aggregation port, while keeping the corresponding ports on the router side non-aggregated. Utilizing Layer 2 isolation between the aggregated member ports, the primary and backup control announcement messages of the two routers become mutually unreachable, thus maintaining the primary device status and forwarding capability for both. Simultaneously, the switch can distribute terminal uplink data among the member ports according to the link aggregation load balancing rules, enabling simultaneous forwarding by both gateways. Without modifying the terminal gateway configuration or adding to the gateway-side configuration, dual-active operation and load balancing are achieved, improving bandwidth utilization and network reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122698549A_ABST
    Figure CN122698549A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a dual-active method and device in route processing, a switch and a system, and relate to the technical field of route communication. A first port and a second port of a switch are aggregated to form a link aggregation port; the first port is a port connected to a first router, and the second port is a port connected to a second router; when an address query resolution response is acquired, one copy of the address query resolution response is sent to each target device in a transmission direction corresponding to the address query resolution response; uplink data from a terminal device is received and sent to a router through the link aggregation port; and downlink data from the router is received and sent to a corresponding terminal device according to a target address of the downlink data. Through link aggregation of switch ports, a gateway dual-active scheme with multiple gateways available at the same time and redundancy capability can be implemented, network reliability is improved, and operation and maintenance costs are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of routing communication technology, and more specifically, to a dual-active method, apparatus, switch, and system for routing processing. Background Technology

[0002] In a LAN (Local Area Network), communication between terminal devices and external networks relies on a gateway (router). Specifically, when a terminal device needs to access an external network, it sends a data packet to the gateway, which then forwards it to the external network, thus completing the communication between the terminal device and the external network. When the gateway device fails or the link drops, communication between the terminal and the external network will be interrupted, affecting service stability.

[0003] To improve gateway reliability, existing technologies often employ the method of adding a backup gateway, that is, deploying a second gateway (router) within the same LAN to form a dual-gateway backup structure. For example, please refer to... Figure 1 The diagram shows a switch connected to routers R1 and R2, and terminal devices 1-4. Router R1 is the primary router (gateway address: 192.168.0.1), and router R2 is the backup router (gateway address: 192.168.0.2). Terminal devices 1 and 2 have a gateway address of 192.168.0.1, and terminal devices 3 and 4 have a gateway address of 192.168.0.2. However, in this backup scheme, each terminal device is only allowed to be configured with one default gateway address. This means that when switching to the backup gateway is required, the network administrator needs to manually intervene in the configuration of each terminal, increasing maintenance difficulty. Worse still, when the primary gateway fails, or when any of the gateways fails, the administrator must manually change the local configuration of the terminal. For example, please refer to [link to documentation]. Figure 1 If the gateway 192.168.0.1 fails, then the terminal devices that originally used 192.168.0.1 as the gateway must manually change the gateway to 192.168.0.2 in order to continue communicating with the external network, which greatly reduces the value of the backup gateway.

[0004] Therefore, there is an urgent need for a gateway active-active solution that can enable multiple gateways to be available simultaneously and have redundancy capabilities without relying on manual modification of gateway configuration, so as to improve network reliability and reduce operation and maintenance costs. Summary of the Invention

[0005] In view of this, the purpose of this application is to provide a dual-active method, device, switch and system in routing processing, which can realize a dual-active gateway scheme with multiple gateways available at the same time and having redundancy through link aggregation of switch ports, thereby improving network reliability and reducing operation and maintenance costs.

[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows: Firstly, this application provides a dual-active method for routing processing, applied to a switch, wherein the switch is connected to at least a first router and a second router. The method includes: link aggregating a first port and a second port of the switch to form a link-aggregated port; wherein the first port is a port connected to the first router, and the second port is a port connected to the second router; upon receiving an address query resolution response, sending an address query resolution response to each target device in the transmission direction corresponding to the address query resolution response; receiving uplink data from terminal devices and sending it to the router through the link-aggregated port; receiving downlink data from the router and sending it to the corresponding terminal device according to the destination address of the downlink data.

[0007] In an optional embodiment, link aggregation is performed on the first port and the second port of the switch to form a link aggregation port. This includes adding the first port and the second port of the switch to the same aggregation group to form a link aggregation port, so that the link aggregation port forms an asymmetric interconnection structure with the first corresponding port and the second corresponding port. The first corresponding port is the port on the first router that is connected to the first port, and the second corresponding port is the port on the second router that is connected to the second port. The asymmetric interconnection structure means that the first port and the second port form a link aggregation state, and the first corresponding port and the second corresponding port remain in a non-link aggregation state.

[0008] In an optional embodiment, the asymmetric interconnect structure is used to prevent control messages from the first router from being sent to the second router, or to prevent control messages from the second router from being sent to the first router, so that both the first router and the second router remain in the master device state.

[0009] In an optional embodiment, the switch is also connected to multiple terminal devices, receives uplink data from the terminal devices, and sends it to the router through the link aggregation port, including: receiving uplink data from multiple terminal devices; and sending uplink data to the first router or the second router through the link aggregation port according to the load balancing rules.

[0010] In an optional embodiment, when an address query resolution response is obtained, sending an address query resolution response to each target device in the transmission direction corresponding to the address query resolution response includes: when an address query resolution response from a terminal device is obtained, copying the address query resolution response to obtain multiple address query resolution responses; and sending an address query resolution response to each of the first router and the second router based on the multiple address query resolution responses.

[0011] In an optional embodiment, the address query resolution response is copied to obtain multiple address query resolution responses, including: determining a message matching rule; wherein the message matching rule indicates that the address query resolution response from the terminal device is sent to the processor instead; and using the processor, the received address query resolution response is copied to obtain multiple address query resolution responses.

[0012] In an optional embodiment, the number of multiple address query resolution responses is the same as the number of routers connected to the switch.

[0013] Secondly, this application provides a dual-active device for routing processing, applied to a switch, the switch being connected to at least a first router and a second router; the device includes a transceiver module and a processing module; wherein, the processing module is used to perform link aggregation on the first port and the second port of the switch to form a link aggregation port; wherein, the first port is a port connected to the first router, and the second port is a port connected to the second router; the transceiver module is used to send an address query resolution response to each target device in the transmission direction corresponding to the address query resolution response when an address query resolution response is obtained; the transceiver module is also used to receive uplink data from terminal devices and send it to the router through the link aggregation port; the transceiver module is also used to receive downlink data from the router and send it to the corresponding terminal device according to the target address of the downlink data.

[0014] Thirdly, this application provides a switch that is connected to multiple terminal devices, a first router, and a second router. The switch includes a processor, a memory, and a network interface that is communicatively connected to the processor. The memory stores a computer program, and when the computer program is executed by the processor, it causes the switch to perform a dual-active method as described in any embodiment of the first aspect.

[0015] Fourthly, this application provides a dual-active system for routing processing, the system including multiple terminal devices, a switch, a first router and a second router, the switch being connected to the multiple terminal devices, the first router and the second router respectively; wherein, the switch is configured to perform a dual-active method as described in any embodiment of the first aspect.

[0016] Based on the above, the beneficial effects of this application include: forming an asymmetric interconnection structure by link aggregating the first and second ports of the switch to create a link aggregation port, while keeping the corresponding ports on the router side non-aggregated. Utilizing Layer 2 isolation between the aggregated member ports, the primary and backup control announcement messages of the two routers become mutually unreachable, thus maintaining the primary device status and forwarding capability for both. Simultaneously, the switch can distribute terminal uplink data among the member ports according to the link aggregation load balancing rules, enabling simultaneous forwarding by both gateways. Without modifying the terminal gateway configuration or adding to the gateway-side configuration, dual-active operation and load balancing are achieved, improving bandwidth utilization and network reliability.

[0017] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, embodiments of this application are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This diagram illustrates the interconnection of switches, routers, and terminal devices. Figure 1 ; Figure 2 This diagram illustrates the interconnection of switches, routers, and terminal devices. Figure 2 ; Figure 3 This diagram illustrates the interconnection of switches, routers, and terminal devices. Figure 3 ; Figure 4 This diagram illustrates the interconnection of switches, routers, and terminal devices. Figure 4 ; Figure 5 This diagram illustrates the interconnection of switches, routers, and terminal devices. Figure 5 ; Figure 6 A block diagram of a dual-active system in routing processing provided in an embodiment of this application; Figure 7 A flowchart of a dual-active method in routing processing provided in an embodiment of this application; Figure 8 This is a schematic diagram illustrating the characteristics between link aggregation member ports provided in the embodiments of this application; Figure 9A schematic diagram of the asymmetric interconnect structure configuration provided in the embodiments of this application; Figure 10 Another schematic diagram of the asymmetric interconnect structure configuration provided in the embodiments of this application; Figure 11 This is another block diagram of a dual-active system in routing processing provided in an embodiment of this application; Figure 12 This is a schematic diagram illustrating the interconnection of switches, routers, and terminal devices provided in the embodiments of this application. Figure 1 ; Figure 13 This illustration shows the interconnection of switches, routers, and terminal devices provided in an embodiment of this application. Figure 2 ; Figure 14 This diagram illustrates the address query resolution response of a switch provided in an embodiment of this application. Figure 15 This illustration shows the interconnection of switches, routers, and terminal devices provided in an embodiment of this application. Figure 3 . Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0021] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0022] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0023] Furthermore, the terms "first" and "second" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.

[0024] It should be noted that, where there is no conflict, the features in the embodiments of this application can be combined with each other.

[0025] Before introducing the embodiments of this application, the English abbreviations and Chinese explanations shown in Table 1 below are provided for reference: Table 1

[0026] Before introducing the embodiments of this application, we will first introduce the technical problems discovered by the inventors in the process of researching existing gateway technologies and the reasons for their formation: refer to Figure 1 The technical problem illustrated is addressed by the VRRP protocol, which aims to solve this issue. Specifically, it virtualizes multiple physical routers into a single logical router, enabling redundant backup and automatic failover of the default gateway.

[0027] Please refer to Figure 2 The switches and routers R1 and R2, along with terminal devices 1-4, are connected. Router R1's gateway is 192.168.0.1, and router R2's gateway is 192.168.0.2 (backup). For Figure 2 Routers R1 and R2 in the configuration virtualize gateways 192.168.0.1 and 192.168.0.2 into a single logical gateway 192.168.0.254, providing this virtual gateway address to the outside world. In this scenario, terminal devices 1-4 only see one virtual gateway, and therefore only need to configure their gateways to this virtual gateway address to achieve external communication. Two or more gateways sharing a single virtual gateway form a backup group, meaning that these gateways within the same group can back each other up.

[0028] The core mechanism of the VRRP protocol is that each physical router in the backup group competes for master / backup election by periodically exchanging VRRP advertisement messages (also known as master / backup control advertisement messages). The one with higher priority becomes the master device, and the rest become backup devices. That is, in reality, only one physical router is actually working.

[0029] For example, please refer to Figure 3 The switches and routers R1 and R2, as well as terminal devices 1-4, are connected. The gateway of router R1 is 192.168.0.1, the gateway of router R2 is 192.168.0.2 (backup), and the logical gateway of routers R1 and R2 is set to 192.168.0.254.

[0030] Initially, both routers, R1 and R2, consider themselves the master device. Then, they exchange advertisement messages and compare priorities; for example, router R1 advertises a priority of 100, and router R2 advertises a priority of 80. After receiving each other's messages, router R1 remains the master, and router R2 becomes the backup. Afterward, both routers maintain their master and backup states by continuously sending VRRP messages.

[0031] Once router R1 becomes the Master, it takes over the virtual gateway identity and "owns" the virtual IP (e.g., 192.168.0.254). It then learns and responds to ARP requests from terminals as this virtual gateway and participates in traffic forwarding. Router R2, acting as the Backup, no longer responds to ARP requests from terminals and does not participate in traffic forwarding; it is essentially silenced.

[0032] Please refer to Figure 4 The system connects switches and routers R1 and R2, as well as terminal devices 1-4. Router R1's gateway is 192.168.0.1, router R2's gateway is 192.168.0.2, and the logical gateway for routers R1 and R2 is set to 192.168.0.254. In this scenario, the original primary router R1 fails. The backup router R2 (192.168.0.2) cannot receive VRRP packets from 192.168.0.1. In this situation, its priority becomes optimal, and it becomes the Master, "owning" the virtual gateway identity of 192.168.0.254. It then begins learning / responding to ARP packets from the terminals and forwarding traffic.

[0033] For the terminal, regardless of the physical gateway, since it uses the virtual identity 192.168.0.254, the gateway never changes, and there is no need to manually modify the gateway address. This achieves automatic switching and backup of multiple gateways, greatly reducing maintenance costs. However, the inventors discovered in further analysis that traditional VRRP has obvious underutilization of resources: at any given time only the Master participates in forwarding, while the Backup's forwarding capacity remains idle for a long time, resulting in limited overall bandwidth utilization and device utilization of the gateway.

[0034] To address this issue, the forwarding capabilities of backup devices are utilized to some extent. In network practice, load balancing schemes based on multiple backup groups have emerged.

[0035] For example, please refer to Figure 5The switches and routers R1 and R2, along with terminal devices 1-4, are connected. Two backup groups are created on routers R1 and R2, each configured with a different virtual gateway IP. This allows different terminals to select different virtual gateways, thus directing traffic to the Master of each backup group, achieving a degree of active-active architecture and traffic load balancing. Specifically, router R1's gateway is 192.168.0.1 (virtual IP 192.168.0.254), router R2's gateway is 192.168.0.2 (virtual IP 192.168.0.253), terminal devices 1 and 2 are configured with a gateway of 192.168.0.254, and terminal devices 3 and 4 are configured with a gateway of 192.168.0.253.

[0036] However, the above solution has at least two limitations: 1. It requires an additional protection group to be added to the router configuration. If a single Layer 3 interface of a certain type of device only supports one VRRP protection group, this solution cannot be implemented. 2. This is the biggest drawback of the solution: some terminals use one virtual gateway IP and some terminals use another virtual gateway IP. If the network administrator intends to distribute traffic to both gateways to achieve load balancing, the network configuration of each terminal must be intervened and planned (i.e., configured with different gateway IPs). This will increase network management costs and is actually difficult to implement and maintain in networks with a large number of terminals.

[0037] This application provides a dual-active method, device, switch, and system for routing processing, which is a superior VRRP dual-active solution. It achieves simultaneous availability of multiple gateways and load balancing without increasing configuration and management / maintenance costs, while retaining the implementation logic of standard VRRP, maintaining compatibility with existing VRRP networking schemes, and incurring additional configuration and management / maintenance costs.

[0038] This application achieves the above objectives by creatively utilizing link aggregation on the switch side to form an asymmetric interconnection structure, and in conjunction with an address resolution-related packet processing mechanism. The following will provide a detailed description of this application in conjunction with the accompanying drawings and specific embodiments.

[0039] Please refer to Figure 6 , Figure 6 This is a block diagram of a dual-active system in routing processing provided in an embodiment of this application. The system includes multiple terminal devices (terminal devices 1-4 are used as examples in the figure), a switch, a first router (R1), and a second router (R2); of course, the number of terminal devices and routers in the figure are only examples, and this application does not limit the number of terminal devices or routers.

[0040] Terminal devices 1-4 are connected to the switch to send uplink service data and receive downlink service data within the local area network. Terminal devices can be devices with network communication capabilities, including but not limited to: personal computers (PCs), laptops, servers, industrial control computers, surveillance cameras, IoT terminals (sensors, smart meters, environmental monitoring terminals, etc.), and wireless terminals (mobile phones, tablets).

[0041] Switches are used to forward data between terminal devices and routers, and to implement active-active forwarding and load balancing between the first and second routers. Switches can be network devices with data forwarding capabilities and support functions such as link aggregation.

[0042] The first and second routers are each connected to a switch and serve as external forwarding gateways for the terminal devices. They forward uplink data from the terminal devices to the external network and forward downlink data from the external network to the corresponding terminal devices. Both the first and second routers can run VRRP and are used to provide virtual gateway addresses and perform uplink and downlink data forwarding.

[0043] Please refer to Figure 7 , Figure 7 A flowchart of a dual-active method in routing processing provided in this application embodiment is applied to... Figure 6 The switch in the system shown may include the following steps: The S701 performs link aggregation on the first and second ports of the switch to form a link aggregation port.

[0044] The first port is the port connected to the first router, and the second port is the port connected to the second router.

[0045] In this embodiment, by performing link aggregation on the ports (including the first port and the second port) on the switch side, an asymmetric interconnection structure is formed with aggregation on the switch side and non-aggregation on the router side, thereby simultaneously achieving the following objectives: Objective 1, to enable both the first router and the second router to maintain the master device status and have forwarding capabilities; Objective 2, to enable load sharing of uplink traffic from the terminal device to the virtual gateway between the two routers.

[0046] Specifically: Link aggregation is used to increase bandwidth by bundling multiple ports. Please refer to [link to relevant documentation]. Figure 8 , Figure 8 This is a schematic diagram illustrating the characteristics between member ports of a link aggregation port provided in an embodiment of this application. The link aggregation port has the following characteristics: 1. Layer 2 isolation between member ports: Because multiple ports are bundled together and used as a single logical port, traffic cannot flow back from one member port to another. In other words, the member ports of the aggregation port are Layer 2 isolated from each other, such as... Figure 8As shown in A; 2. Ingress traffic load balancing characteristics: For ingress traffic, link aggregation has the ability to perform load balancing, such as... Figure 8 As shown in B.

[0047] Unlike the traditional “symmetric configuration at both ends of link aggregation” approach, this embodiment aggregates the first port and the second port on the switch side, while the corresponding ports on the first router and the second router sides remain independent non-aggregated ports, thus forming an asymmetric interconnection structure.

[0048] Please refer to Figure 9 , Figure 9 This is a schematic diagram illustrating the asymmetric interconnection structure configuration provided in an embodiment of this application. A switch is connected to routers R1 and R2. The switch has a first port A1 and a second port B1. The first port A1 is connected to the first corresponding port of router R1, and the second port B1 is connected to the second corresponding port of router R2. Link aggregation is performed on the first port A1 and the second port B1 of the switch to form a link aggregation port C1.

[0049] Please refer to Figure 10 , Figure 10 This is another schematic diagram illustrating the asymmetric interconnection structure configuration provided in this application embodiment. Based on the Layer 2 isolation characteristic between member ports, master / standby control advertisement messages (e.g., VRRP advertisement messages) between routers R1 and R2 cannot be forwarded between the two routers via a switch. This results in neither router receiving the other's advertisement messages, thus both maintaining the master state. This ensures that both the first and second routers maintain the master state and possess forwarding capabilities.

[0050] Please also refer to Figure 11 , Figure 11 This is another block diagram of a dual-active system in routing processing provided in this application embodiment. The switch is connected to routers R1 and R2, and terminal devices 1-4. Router R1 has a real IP address of 192.168.0.1 and a virtual IP address of 192.168.0.254; router R2 has a real IP address of 192.168.0.2 and a virtual IP address of 192.168.0.254; the first port A1 and the second port B1 in the switch are linked together to form link aggregation port C1. Since link aggregation port C1 has load balancing capabilities for inbound traffic, when terminal devices 1-4 send uplink data to the virtual gateway address (192.168.0.254), the switch will distribute the uplink data to either the first router R1 or the second router R2 according to load balancing rules, so that the uplink traffic is forwarded by either the first router R1 or the second router R2, thereby achieving load balancing for northbound traffic.

[0051] As can be seen from the above description, S701 performs link aggregation on the first port and the second port of the switch to form a link aggregation port. Specifically, it may include the following steps: adding the first port and the second port of the switch to the same aggregation group to form a link aggregation port, so that the link aggregation port forms an asymmetric interconnection structure with the first corresponding port and the second corresponding port.

[0052] Wherein, the first corresponding port is the port on the first router that is connected to the first port, and the second corresponding port is the port on the second router that is connected to the second port; the asymmetric interconnection structure means that the first port and the second port form a link aggregation state, and the first corresponding port and the second corresponding port maintain a non-link aggregation state.

[0053] As can be seen from the above description, optionally, the asymmetric interconnection structure is used to prevent control messages from the first router from being sent to the second router, or to prevent control messages from the second router from being sent to the first router, so that both the first router and the second router remain in the master device state.

[0054] It is understood that the control message may be the primary / backup control announcement message mentioned above (e.g., VRRP announcement message).

[0055] S702, upon receiving an address query resolution response, sends an address query resolution response to each target device in the transmission direction corresponding to the address query resolution response.

[0056] (This explains the transmission direction corresponding to the address lookup and resolution response.) In this embodiment, S702 is used to solve the problem that in an asymmetric interconnection structure, the address query resolution response may route to a non-initiating router, causing the corresponding router to be unable to learn the terminal address information. For details, please refer to the description of the following embodiments.

[0057] The S703 receives uplink data from terminal devices and sends it to the router through the link aggregation port.

[0058] In an optional embodiment, the switch is also connected to multiple terminal devices. S703, receiving uplink data from the terminal devices and sending it to the router through the link aggregation port may include the following steps: receiving uplink data from multiple terminal devices; sending uplink data to the first router or the second router through the link aggregation port according to the load balancing rules.

[0059] For details on how to implement load balancing rules, please refer to relevant traffic load balancing methods; they will not be elaborated upon here.

[0060] The S704 receives downlink data from the router and sends it to the corresponding terminal device according to the destination address of the downlink data.

[0061] As can be understood, this embodiment forms an asymmetric interconnection structure through link aggregation on the switch side. Without changing the original hardware and software functions, VRRP logic, network topology, and configuration on the router side, it enables both routers to have forwarding capabilities in master device mode, and utilizes the load-sharing capability of link aggregation to distribute uplink traffic between the two routers. The asymmetric interconnection structure can be implemented on the switch side by configuring link aggregation on the first and second ports, resulting in low implementation cost and easy deployment.

[0062] Through the above-described S702, the embodiments of this application can also solve the problem that in an asymmetric interconnection structure, the address query resolution response may route to a non-initiating router, causing the corresponding router to be unable to learn the terminal address information, thus achieving: after traffic load balancing, the gateway correctly learns the terminal ARP. Specific details are as follows: First, we analyze the differences in the address resolution process under asymmetric interconnect structures. Please refer to [reference needed]. Figure 12 , Figure 12 This is a schematic diagram illustrating the interconnection of switches, routers, and terminal devices provided in the embodiments of this application. Figure 1 The switch is connected to routers R1 and R2, as well as terminal devices 1-4. Router R1 has a real IP address of 192.168.0.1 and a virtual IP address of 192.168.0.254. Router R2 has a real IP address of 192.168.0.2 and a virtual IP address of 192.168.0.254. Terminal devices 1-4 have a gateway address of 192.168.0.254. The first port A1 and the second port B1 of the switch have been linked together to form the link aggregation port C1.

[0063] When terminal devices 1-4 need to communicate with the external network, they first initiate an address resolution request for the virtual gateway address (e.g., an ARP query packet). When this ARP query packet is forwarded via the link aggregation port C1 of the switch, the switch can select any member port according to the load balancing rules of the link aggregation to send the ARP query packet to either the first router R1 or the second router R2. Assuming it's sent to the first router R1, it will reply with the identity 192.168.0.254 (shown by the solid line). Of course, random load balancing might also send the ARP query packet to the second router R2 (shown by the dashed line), because it also considers itself the Master and therefore replies with the identity 192.168.0.254. In other words, regardless of which path the load balancing takes, the ARP reply obtained by the terminal is the same. Thus, terminal devices 1-4 can reliably obtain the ARP of the virtual gateway.

[0064] However, please refer to Figure 13 , Figure 13 This is a schematic diagram illustrating the interconnection of switches, routers, and terminal devices provided in the embodiments of this application. Figure 2 The switch is connected to routers R1 and R2, as well as terminal devices 1-4. Router R1 has a real IP address of 192.168.0.1 and a virtual IP address of 192.168.0.254. Router R2 has a real IP address of 192.168.0.2 and a virtual IP address of 192.168.0.254. Terminal devices 1-4 have a gateway address of 192.168.0.254. The first port A1 and the second port B1 of the switch have been linked together to form the link aggregation port C1.

[0065] When a router (R1 in the diagram) needs to learn the address information of a terminal device, router R1 will send an address query and resolution request to the terminal device (Device 2 in the diagram). In an asymmetric interconnection structure, the address query and resolution response returned by terminal device 2 may be forwarded to another router if the response packet is still forwarded to a member port according to the load balancing rules of link aggregation after entering the switch. This would prevent the initiating router R1 from receiving the response packet and thus prevent it from learning the address resolution result of the terminal device. Consequently, this results in the terminal being able to learn the gateway normally, while the gateway is unable to stably learn the terminal's address.

[0066] To address this issue (in an asymmetric interconnection structure, address query resolution responses may be routed to routers other than the initiating router, preventing those routers from learning terminal address information), this embodiment implements a "capture-copy-multi-port distribution" processing mechanism on the switch side for address query resolution response packets from terminal devices. This ensures that the address query resolution response can be simultaneously delivered to each member port of the link aggregation port, thereby guaranteeing that the router initiating the query will receive the response packet and complete the terminal address learning.

[0067] Specifically, such as Figure 14 As shown, the switch is connected to routers R1 and R2 and terminal devices 1-4 (terminal devices 1-4 are not shown); the first port A1 and the second port B1 in the switch have been linked together to form the link aggregation port C1. The switch also includes a CPU and received ARP packets (i.e., address query resolution responses).

[0068] The switch can issue packet matching rules (e.g., in the form of ACLs) at the ports connected to terminal devices to match address query and resolution response packets from the terminal devices, and then forward the matched packets to the CPU. After receiving the address query and resolution response, the CPU obtains the number N of member ports of the link aggregation port and the identifier of each member port, copies the address query and resolution response N times, and then sends the corresponding copied packets from each of the N member ports.

[0069] For example, the above processing may include: 1. Configure message matching rules at the port connecting to the terminal device to capture / retransmit address query resolution response messages from the terminal device to the processor; 2. Obtain the number N of member ports of the link aggregation port; 3. Obtain the identifier of each member port of the link aggregation port; 4. Copy the captured address query resolution response messages N times; 5. Send the N messages from each member port of the link aggregation port respectively.

[0070] Please refer to Figure 15 The switch is connected to routers R1 and R2, and terminal devices 1-4. Router R1 has a real IP address of 192.168.0.1 and a virtual IP address of 192.168.0.254; router R2 has a real IP address of 192.168.0.2 and a virtual IP address of 192.168.0.254; and terminal devices 1-4 have a gateway configured with 192.168.0.254. The first port A1 and the second port B1 of the switch are linked together to form link aggregation port C1. The switch is configured with packet matching rules, which indicate that address query and resolution responses from terminal devices should be redirected to the processor. By distributing address query and resolution responses from terminal devices across the member ports of the link aggregation port, it is ensured that regardless of which router initiates the address query and resolution request, the response packet returned by the terminal device can be received, thus resolving the router-side ARP learning failure problem caused by load balancing in asymmetric interconnection structures. It should be noted that the number of routers connected to the switch is not limited to two, and the member port distribution mechanism described above also applies to scenarios with multiple routers.

[0071] As can be seen from the above description, in S702, when an address query resolution response is obtained, an address query resolution response is sent to each target device in the transmission direction corresponding to the address query resolution response. Specifically, this may include the following steps: when an address query resolution response is obtained from a terminal device, the address query resolution response is copied to obtain multiple address query resolution responses; based on the multiple address query resolution responses, an address query resolution response is sent to each of the first router and the second router.

[0072] Optionally, the number of address query resolution responses is the same as the number of routers connected to the switch.

[0073] As explained above, copying the address query resolution response to obtain multiple address query resolution responses can specifically include the following steps: determining the message matching rules; wherein, the message matching rules indicate that the address query resolution response from the terminal device should be sent to the processor instead; and using the processor, copying the received address query resolution response to obtain multiple address query resolution responses.

[0074] Based on the above embodiments, the beneficial effects of this application are as follows: By link aggregating the first and second ports of the switch to form a link aggregation port, and keeping the corresponding ports on the router side non-aggregated, an asymmetric interconnection structure is formed. Utilizing Layer 2 isolation between the aggregated member ports, the primary and backup control announcement messages of the two routers become mutually unreachable, thus maintaining the primary device state and forwarding capability, improving the available bandwidth and utilization of the gateway device. Simultaneously, the switch can distribute terminal uplink data among member ports according to the link aggregation load balancing rules, enabling dual gateways to simultaneously carry forwarding data. Without modifying the terminal gateway configuration or adding to the gateway-side configuration, dual-active and load balancing are achieved, improving bandwidth utilization and network reliability. Only minor software modifications are needed on the terminal access-side device (the switch in this application) to achieve VRRP dual-active, without updating the gateway device or changing the original topology and network configuration, protecting the original investment and reducing usage costs and maintenance difficulty.

[0075] In order to perform the corresponding steps in the above embodiments and various possible methods, an implementation method of a dual-active device in routing processing is also given below. This dual-active device in routing processing can be applied to the switch of the above system and can be used to perform the various steps in the above method embodiments.

[0076] It should be noted that the dual-active device in routing processing provided in this embodiment has the same basic principle and technical effect as the above embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the above embodiments. The dual-active device in routing processing may include: a transceiver module and a processing module.

[0077] The processing module is used to perform link aggregation on the first port and the second port of the switch to form a link aggregation port; wherein the first port is the port connected to the first router, and the second port is the port connected to the second router. The transceiver module is used to send an address query resolution response to each target device in the transmission direction corresponding to the address query resolution response when an address query resolution response is received; the transceiver module is also used to receive uplink data from terminal devices and send it to the router through the link aggregation port; the transceiver module is also used to receive downlink data from the router and send it to the corresponding terminal device according to the target address of the downlink data.

[0078] In an optional implementation, the above modules can be stored in a memory as software or firmware, or embedded in the switch of the system, and the system can perform the corresponding operations. The data and program code required to execute each module can also be stored in the memory.

[0079] It should be understood that the transceiver module and the processing module are used to support the switch of the above system in performing the relevant steps in the foregoing method embodiments, and / or to implement other processes for implementing the technology described herein, such as the method flow described in any of the above method embodiments.

[0080] Based on the above embodiments, this application also provides a computer-readable storage medium storing a computer program, which, when run by a processor, can execute the various steps in the above method embodiments.

[0081] Specifically, the storage medium can be a general-purpose storage medium, such as a removable disk or hard disk. When the computer program on the storage medium is run, it can execute the methods described in the above embodiments, thereby solving the problems existing in the prior art.

[0082] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0083] Furthermore, the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0084] Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0085] In this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any such actual relationship or order between these entities or operations.

[0086] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A dual-active method in routing processing, characterized in that, Applied to a switch, wherein the switch is connected to at least a first router and a second router, the method includes: The first port and the second port of the switch are linked together to form a link aggregation port; wherein, the first port is the port connected to the first router, and the second port is the port connected to the second router; Upon receiving an address query resolution response, a copy of the address query resolution response is sent to each target device in the transmission direction corresponding to the address query resolution response; Receive uplink data from the terminal device and send it to the router through the link aggregation port; Receive downlink data from the router and send it to the corresponding terminal device according to the destination address of the downlink data.

2. The dual-active method in routing processing according to claim 1, characterized in that, The step of link aggregating the first port and the second port of the switch to form a link-aggregated port includes: The first port and the second port of the switch are added to the same aggregation group to form the link aggregation port, so that the link aggregation port forms an asymmetric interconnection structure with the first corresponding port and the second corresponding port. Wherein, the first corresponding port is the port on the first router that is connected to the first port, and the second corresponding port is the port on the second router that is connected to the second port; the asymmetric interconnection structure means that the first port and the second port form a link aggregation state, and the first corresponding port and the second corresponding port maintain a non-link aggregation state.

3. The dual-active method in routing processing according to claim 2, characterized in that, The asymmetric interconnect structure is used to prevent control messages from the first router from being sent to the second router, or to prevent control messages from the second router from being sent to the first router, so that both the first router and the second router remain in the master device state.

4. The dual-active method in routing processing according to claim 3, characterized in that, The switch is also connected to multiple terminal devices. Receiving uplink data from the terminal devices and sending it to the router through the link aggregation port includes: Receive uplink data from the plurality of terminal devices; According to the load balancing rules, the uplink data is sent to the first router or the second router through the link aggregation port.

5. The dual-active method in routing processing according to claim 1, characterized in that, The step of sending a copy of the address query resolution response to each target device in the transmission direction corresponding to the address query resolution response upon receiving the response includes: Upon receiving an address query resolution response from a terminal device, the address query resolution response is copied to obtain multiple address query resolution responses. Based on the multiple address query resolution responses, an address query resolution response is sent to each of the first router and the second router.

6. The dual-active method in routing processing according to claim 5, characterized in that, The address query resolution response is copied to obtain multiple address query resolution responses, including: Determine the message matching rules; wherein, the message matching rules indicate that the address query parsing response from the terminal device will be sent to the processor instead; The processor is used to copy the received address query resolution response to obtain multiple address query resolution responses.

7. The dual-active method in routing processing according to claim 4, characterized in that, The number of address query resolution responses is the same as the number of routers connected to the switch.

8. A dual-active device in routing processing, characterized in that, The device is applied to a switch, which is connected to at least a first router and a second router; the device includes a transceiver module and a processing module; wherein... The processing module is used to perform link aggregation on the first port and the second port of the switch to form a link aggregation port; wherein, the first port is the port connected to the first router, and the second port is the port connected to the second router; The transceiver module is used to send a copy of the address query resolution response to each target device in the transmission direction corresponding to the address query resolution response when the address query resolution response is obtained; The transceiver module is also used to receive uplink data from the terminal device and send it to the router through the link aggregation port; The transceiver module is also used to receive downlink data from the router and send it to the corresponding terminal device according to the destination address of the downlink data.

9. A switch, characterized in that, The switch is connected to multiple terminal devices, a first router, and a second router. The switch includes a processor, a memory, and a network interface communicatively connected to the processor, wherein: The memory stores a computer program that, when executed by the processor, causes the switch to perform the dual-active method in the routing process as described in any one of claims 1 to 7.

10. A dual-active system for routing processing, characterized in that, The system includes multiple terminal devices, a switch, a first router, and a second router, wherein the switch is connected to the multiple terminal devices, the first router, and the second router respectively. The switch is configured to perform the active-active method in the routing process as described in any one of claims 1 to 7.