Cross-cloud network subnet traffic diversion method, computer equipment, readable storage medium and program product

By using virtual switches to obtain and forward the next hop IP address information of traffic packets in the cloud network system, the problem of cross-subnet traffic diversion in the cloud network system is solved, and the smooth forwarding of traffic data is achieved.

CN119520395AActive Publication Date: 2025-02-25CHINA TELECOM CLOUD TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411702204.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-02-25
Estimated Expiration
2044-11-26

AI Technical Summary

Technical Problem

There is a problem of traffic diversion across subnets in cloud network systems, which makes traffic data unable to be forwarded from one subnet to another.

Method used

By introducing the virtual switch of the first subnet device and the second subnet device into the cloud network system, the next hop IP address information of the traffic data packet is obtained, and the traffic data packet is sent to the target subnet device based on the information until the local address identification corresponding to the destination IP address is found.

Benefits of technology

The traffic diversion across subnets is realized, avoiding the problem of cyclic forwarding of traffic data on the local subnet, and ensuring that traffic data can be smoothly forwarded from the source subnet to the target subnet.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520395A_ABST
    Figure CN119520395A_ABST
Patent Text Reader

Abstract

The invention relates to a cross-cloud network subnet traffic diversion method, computer equipment, a computer readable storage medium and a computer program product. The method is applied to a cloud network system, and the cloud network system comprises a first sub-network device and a second sub-network device. The method comprises the following steps: acquiring first next-hop IP address information of a traffic data packet through a first virtual switch of first sub-network equipment, and sending the traffic data packet to second sub-network equipment according to the next-hop IP address information; performing routing address query through a second virtual switch of a second subnet device, and querying second next hop IP address information of the traffic data packet; and if it is detected that the second next-hop IP address information is the local address identifier of the second sub-network device, forwarding the traffic data packet to the target sub-network device based on the destination IP address information of the traffic data packet. By adopting the method, the problem of cross-subnet flow diversion in a cloud network system can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud network technology, and in particular to a method for directing traffic across cloud network subnets, a computer device, a computer-readable storage medium, and a computer program product. Background Art

[0002] With the development of cloud network technology, there has been a need to divert traffic across cloud network subnets. That is, subnet A needs to first send traffic data to subnet B, and then subnet B forwards the traffic data to subnet C, thereby realizing cross-subnet traffic diversion.

[0003] In traditional technology, cloud network systems usually maintain two levels of forwarding tables. The first-level table maintains the mapping relationship between subnets and routing tables, and the second-level table is the routing table. In this way, when diverting traffic, subnet A will find the corresponding routing table based on the first-level table, and then find the next-hop IP address as subnet B's IP address based on the destination IP address information. Based on subnet B's IP address, subnet A can send traffic data to subnet B.

[0004] Then, for subnet B, subnet B will also find the corresponding routing table based on the first-level table, and then subnet B will find the next-hop IP address based on the destination IP address information, which is also the IP (Internet Protocol) address of subnet B. In this way, the next hop of the traffic data is still subnet B, thus forming a closed loop. The traffic data cannot be sent to subnet C, so the cloud network system has the problem of cross-subnet traffic diversion. Summary of the invention

[0005] Based on this, it is necessary to provide a cross-cloud network subnet traffic diversion method, computer equipment, computer-readable storage medium and computer program product that can solve the cross-subnet traffic diversion problem in a cloud network system in response to the above technical problems.

[0006] In a first aspect, the present application provides a method for traffic diversion across cloud network subnets, which is applied to a cloud network system, wherein the cloud network system includes a first subnet device and a second subnet device; the method includes:

[0007] If the first subnet device detects a traffic data packet, the first next-hop IP address information of the traffic data packet is obtained through the first virtual switch of the first subnet device, and the traffic data packet is sent to the second subnet device according to the next-hop IP address information;

[0008] Performing a routing address query through the second virtual switch of the second subnet device to query the second next-hop IP address information of the traffic data packet;

[0009] If it is detected that the second next-hop IP address information is the local address identifier of the second subnet device, the traffic data packet is forwarded to the target subnet device based on the destination IP address information of the traffic data packet.

[0010] In one embodiment, obtaining the first next-hop IP address information of the traffic data packet through the first virtual switch of the first subnet device, and sending the traffic data packet to the second subnet device according to the next-hop IP address information includes:

[0011] Based on the MAC (Media Access Control Address) address information of the first gateway of the first subnet device, a routing table search is performed locally through the first virtual switch of the first subnet device;

[0012] If the search is successful, the first next-hop IP address information is searched in the first routing table found through the first subnet device according to the destination IP address information of the traffic data packet;

[0013] According to the first next-hop IP address information, the traffic data packet is sent to the second subnet device through the first virtual switch.

[0014] In one embodiment, the cloud network system further includes a clustered gateway; after the first virtual switch of the first subnet device performs a routing table lookup locally, the system further includes:

[0015] If the search fails, the traffic data packet is forwarded to the cluster gateway;

[0016] Based on the MAC address information of the first gateway, a first routing table is obtained by globally searching through the clustered gateway, and according to the destination IP address information, the first next-hop IP address information is searched in the first routing table;

[0017] Based on the first next-hop IP address information, the traffic data packet is sent to the second subnet device through the cluster gateway.

[0018] In one embodiment, performing a routing address query through the second virtual switch of the second subnet device to query the second next hop IP address information of the traffic data packet includes:

[0019] Based on the MAC address information of the second gateway of the second subnet device, performing a routing table search through the second virtual switch of the second subnet device;

[0020] If the search is successful, the second next-hop IP address information of the traffic data packet is obtained by searching in the found second routing table according to the destination IP address information of the traffic data packet.

[0021] In one embodiment, forwarding the traffic data packet to a target subnet device based on the destination IP address information of the traffic data packet includes:

[0022] Detecting, by the second virtual switch, whether the second next-hop IP address information is the local address identifier of the second subnet device;

[0023] If the second next-hop IP address information is the local address identifier of the second subnet device, the traffic data packet is forwarded to the target subnet device through the second virtual switch according to the destination IP address information.

[0024] In one embodiment, after performing routing table lookup through the second virtual switch of the second subnet device, the method further includes:

[0025] If the search fails, forwarding the traffic data packet to the cluster gateway based on the MAC address information of the second gateway;

[0026] Based on the MAC address information of the second gateway, obtain a second routing table through a global search by the clustered gateway;

[0027] According to the destination IP address information, the second next-hop IP address information is queried in the second routing table through the cluster gateway.

[0028] In one embodiment, the cloud network system further includes a clustered gateway; forwarding the traffic data packet to a target subnet device based on the destination IP address information of the traffic data packet includes:

[0029] Detecting, by the cluster gateway, whether the second next-hop IP address information is the local address identifier of the second subnet device;

[0030] If the second next-hop IP address information is the local address identifier of the second subnet device, the traffic data packet is forwarded to the target subnet device through the cluster gateway according to the destination IP address information.

[0031] In a second aspect, the present application further provides a cross-cloud network subnet traffic diversion device, which is applied to a cloud network system, wherein the cloud network system includes a first subnet device and a second subnet device; the device includes:

[0032] A first forwarding module is used for obtaining the first next-hop IP address information of the traffic data packet through the first virtual switch of the first subnet device if the first subnet device detects the traffic data packet, and sending the traffic data packet to the second subnet device according to the next-hop IP address information;

[0033] A routing module, used for querying the routing address through the second virtual switch of the second subnet device to query the second next-hop IP address information of the traffic data packet;

[0034] The second forwarding module is used to forward the traffic data packet to the target subnet device based on the destination IP address information of the traffic data packet if it is detected that the second next-hop IP address information is the local address identifier of the second subnet device.

[0035] In one embodiment, the first forwarding module is further configured to:

[0036] Based on the first gateway MAC address information of the first subnet device, a routing table search is performed locally through the first virtual switch of the first subnet device; if the search is successful, the first next-hop IP address information is queried in the first routing table found through the first subnet device according to the destination IP address information of the traffic data packet; based on the first next-hop IP address information, the traffic data packet is sent to the second subnet device through the first virtual switch.

[0037] In one embodiment, the cloud network system further includes a clustered gateway; and the first forwarding module is further configured to:

[0038] If the search fails, the traffic data packet is forwarded to the cluster gateway; based on the MAC address information of the first gateway, the first routing table is obtained by the global search through the cluster gateway, and according to the destination IP address information, the first next-hop IP address information is queried in the first routing table; based on the first next-hop IP address information, the traffic data packet is sent to the second subnet device through the cluster gateway.

[0039] In one embodiment, the routing module is further configured to:

[0040] Based on the second gateway MAC address information of the second subnet device, a routing table search is performed through the second virtual switch of the second subnet device; if the search is successful, the second next-hop IP address information of the traffic data packet is obtained by querying the second routing table found according to the destination IP address information of the traffic data packet.

[0041] In one embodiment, the second forwarding module is further used for:

[0042] The second virtual switch is used to detect whether the second next-hop IP address information is the local address identifier of the second subnet device; if the second next-hop IP address information is the local address identifier of the second subnet device, the traffic data packet is forwarded to the target subnet device through the second virtual switch according to the destination IP address information.

[0043] In one embodiment, the routing module is further configured to:

[0044] If the search fails, the traffic data packet is forwarded to the cluster gateway based on the MAC address information of the second gateway; based on the MAC address information of the second gateway, the second routing table is obtained by global search through the cluster gateway; according to the destination IP address information, the second next-hop IP address information is queried in the second routing table through the cluster gateway.

[0045] In one embodiment, the cloud network system further includes a cluster gateway; and the second forwarding module is further used for:

[0046] The cluster gateway is used to detect whether the second next-hop IP address information is the local address identifier of the second subnet device; if the second next-hop IP address information is the local address identifier of the second subnet device, the traffic data packet is forwarded to the target subnet device through the cluster gateway according to the destination IP address information.

[0047] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0048] According to the traffic diversion request of the cross-cloud network subnet, the traffic diversion type of the cross-cloud network subnet for this cross-cloud network subnet traffic diversion is detected, and the first chain length of the target backup chain is detected; when the traffic diversion type of the cross-cloud network subnet is incremental backup, if the first chain length is greater than a first preset length threshold, incremental backup is performed on the created blank backup chain; if the first chain length is not greater than the first preset length threshold, incremental backup is performed on the target backup chain.

[0049] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0050] According to the traffic diversion request of the cross-cloud network subnet, the traffic diversion type of the cross-cloud network subnet for this cross-cloud network subnet traffic diversion is detected, and the first chain length of the target backup chain is detected; when the traffic diversion type of the cross-cloud network subnet is incremental backup, if the first chain length is greater than a first preset length threshold, incremental backup is performed on the created blank backup chain; if the first chain length is not greater than the first preset length threshold, incremental backup is performed on the target backup chain.

[0051] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0052] According to the traffic diversion request of the cross-cloud network subnet, the traffic diversion type of the cross-cloud network subnet for this cross-cloud network subnet traffic diversion is detected, and the first chain length of the target backup chain is detected; when the traffic diversion type of the cross-cloud network subnet is incremental backup, if the first chain length is greater than a first preset length threshold, incremental backup is performed on the created blank backup chain; if the first chain length is not greater than the first preset length threshold, incremental backup is performed on the target backup chain.

[0053] The above-mentioned traffic diversion method, computer device, computer-readable storage medium and computer program product across cloud network subnets, if the first subnet device detects a traffic data packet, obtains the first next-hop IP address information of the traffic data packet through the first virtual switch of the first subnet device, and sends the traffic data packet to the second subnet device according to the next-hop IP address information. After the traffic data packet arrives at the second subnet device, a routing address query can be performed through the second virtual switch of the second subnet device to query the second next-hop IP address information of the traffic data packet. When it is detected that the second next-hop IP address information is the local address identifier of the second subnet device, the second subnet device will forward the traffic data packet directly to the target subnet device based on the destination IP address information of the traffic data packet, rather than forwarding the traffic data packet locally. Therefore, it can avoid the situation where the next hop of the traffic data is still the second subnet device, and thus solve the problem of traffic diversion across subnets in the cloud network system. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0055] Figure 1A schematic diagram of a flow chart of a method for directing traffic across cloud network subnets in one embodiment of the present application;

[0056] Figure 2 A schematic diagram of a process of sending a traffic data packet to a second subnet device in one embodiment of the present application;

[0057] Figure 3 A schematic diagram of a process for querying the second next-hop IP address information of a traffic data packet in one embodiment of the present application;

[0058] Figure 4 This is a structural block diagram of a traffic diversion device across cloud network subnets in one embodiment of the present application;

[0059] Figure 5 This is a diagram of the internal structure of a computer device in one embodiment of the present application. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0061] In an exemplary embodiment, Figure 1 As shown, a method for directing traffic across cloud network subnets is provided, which is applied to a cloud network system, wherein the cloud network system includes a first subnet device and a second subnet device, and includes the following steps 202 to 206. Among them:

[0062] Step 202: If the first subnet device detects a traffic data packet, the first next-hop IP address information of the traffic data packet is obtained through the first virtual switch of the first subnet device, and the traffic data packet is sent to the second subnet device according to the next-hop IP address information.

[0063] Among them, the cloud network system includes a first subnet device, a second subnet device, a target subnet device and a clustered cloud gateway. The first subnet device, the second subnet device and the target subnet device all belong to different subnets. The first subnet device is deployed with a first host machine and a first virtual switch corresponding to the first host machine, and the second subnet device is deployed with a second host machine and a second virtual switch corresponding to the second host machine; the first virtual switch and the second virtual switch maintain local routing tables in the cloud network system, and the clustered gateway maintains a global routing table in the cloud network system.

[0064] The purpose of traffic diversion in this embodiment is to first send the traffic data packet of the first subnet device to the second subnet device, and then have the second subnet device forward it to the target subnet device.

[0065] As an example, step 202 includes: if a traffic data packet of the first host machine is detected, the first gateway MAC address information of the first subnet device is obtained from the traffic data packet through the first virtual switch of the first host machine, and a routing table search is performed according to the first gateway MAC address information, and the first next-hop IP address information is obtained from the first routing table found; based on the first next-hop IP address information, the traffic data packet is sent to the second subnet device through the first switch.

[0066] It should be noted that the first next-hop IP address information may be the IP address of the second host machine in the second subnet device.

[0067] Step 204: perform a routing address query through the second virtual switch of the second subnet device to query the second next-hop IP address information of the traffic data packet.

[0068] Step 206: If it is detected that the second next-hop IP address information is the local address identifier of the second subnet device, the traffic data packet is forwarded to the target subnet device based on the destination IP address information of the traffic data packet.

[0069] Among them, the local address is marked as a local address, and the local address indicates that data is forwarded inside the computer.

[0070] As an example, steps 204 to 206 include: if the second subnet device receives a traffic data packet, obtaining the second gateway MAC address information of the second subnet device from the traffic data packet through the second virtual switch of the second host machine, and performing a routing table search based on the second gateway MAC address information, and obtaining the second next-hop IP address information from the found second routing table; detecting whether the second next-hop IP address information is a local address identifier, if the second next-hop IP address information is a local address identifier, obtaining the destination IP address information in the second routing table, and forwarding the traffic data packet to the target subnet device based on the second virtual switch according to the destination IP address information, wherein the destination IP address information is the IP address of the host machine in the target subnet device.

[0071] In the above embodiment, if the first subnet device detects a traffic data packet, it obtains the first next-hop IP address information of the traffic data packet through the first virtual switch of the first subnet device, and sends the traffic data packet to the second subnet device according to the next-hop IP address information. After the traffic data packet arrives at the second subnet device, a routing address query can be performed through the second virtual switch of the second subnet device to query the second next-hop IP address information of the traffic data packet. When it is detected that the second next-hop IP address information is the local address identifier of the second subnet device, the second subnet device will forward the traffic data packet directly to the target subnet device based on the destination IP address information of the traffic data packet, rather than forwarding the traffic data packet locally. Therefore, it can avoid the situation where the next hop of the traffic data is still the second subnet device, and thus solve the problem of cross-subnet traffic diversion in the cloud network system.

[0072] In one embodiment, referring to Figure 2 , obtaining the first next-hop IP address information of the traffic data packet through the first virtual switch of the first subnet device, and sending the traffic data packet to the second subnet device according to the next-hop IP address information, including:

[0073] Step 302: Based on the MAC address information of the first gateway of the first subnet device, a routing table search is performed locally through the first virtual switch of the first subnet device.

[0074] It should be noted that a two-level forwarding table is maintained in this embodiment. The first-level table stores the mapping relationship between the gateway MAC address information and the subnet routing table. The second-level table is the subnet routing table, which stores the mapping relationship between the destination IP address information of the traffic data packet and the next-hop IP address.

[0075] It should be noted that in this embodiment, the virtual switch maintains a portion of the subnet routing table in the cloud network system, while the cluster gateway maintains a full amount of subnet routing tables.

[0076] As an example, step 302 includes: obtaining first gateway MAC address information of the first subnet device from the traffic data packet, and performing a routing table search in the first virtual switch of the first subnet device according to the first gateway MAC address information.

[0077] Step 304: If the search is successful, the first next-hop IP address information is searched in the first routing table found through the first subnet device according to the destination IP address information of the traffic data packet.

[0078] Step 306: Send the traffic data packet to the second subnet device through the first virtual switch according to the first next-hop IP address information.

[0079] As an example, steps 304 to 306 include: if the search is successful, it means that the first virtual switch maintains a first routing table corresponding to the first gateway MAC address information; obtain the destination IP address information from the traffic data packet, and query the corresponding first next-hop IP address information from the first routing table based on the destination IP address information; based on the first next-hop IP address information, directly send the traffic data packet to the second subnet device through the first virtual switch.

[0080] In one embodiment, the cloud network system further includes a clustered gateway; after performing a routing table lookup locally through the first virtual switch of the first subnet device, further includes:

[0081] If the search fails, the traffic data packet is forwarded to the cluster gateway; based on the MAC address information of the first gateway, the first routing table is obtained through the global search through the cluster gateway, and the first next-hop IP address information is queried in the first routing table according to the destination IP address information; based on the first next-hop IP address information, the traffic data packet is sent to the second subnet device through the cluster gateway.

[0082] Specifically, if the search fails, it means that the first routing table corresponding to the MAC address information of the first gateway is not maintained in the first virtual switch; based on the MAC address information of the first gateway, the traffic data packet is sent to the cluster gateway through the first virtual switch; based on the MAC address information of the first gateway, the first routing table is obtained by global query through the cluster gateway; through the cluster gateway, the destination IP address information is obtained from the traffic data packet, and according to the destination IP address information, the corresponding first next-hop IP address information is queried from the first routing table; according to the first next-hop IP address information, the traffic data packet is sent to the second subnet device through the cluster gateway.

[0083] In the above embodiment, a first virtual switch and a clustered gateway are simultaneously provided in the cloud network system, so that if the first virtual switch successfully routes, the first virtual switch can directly forward the traffic data packet to the next hop, that is, forward it to the second subnet device, thereby ensuring the forwarding efficiency of the traffic data packet; if the first virtual machine fails to route, the first virtual switch sends the traffic data packet to the clustered gateway, and the clustered gateway performs routing in the global cloud network, so that the clustered gateway forwards the traffic data packet to the second subnet device, thereby ensuring the forwarding success rate of the traffic data packet. Therefore, in this embodiment, both the forwarding efficiency and the forwarding success rate of forwarding the traffic data packet from the first subnet device to the second subnet device are taken into account.

[0084] In one embodiment, referring to Figure 3, query the routing address through the second virtual switch of the second subnet device to query the second next hop IP address information of the traffic data packet, including:

[0085] Step 402: Based on the second gateway MAC address information of the second subnet device, a routing table search is performed through the second virtual switch of the second subnet device.

[0086] As an example, step 402 includes: obtaining the second gateway MAC address information of the second subnet device from the traffic data packet through the second virtual switch of the second subnet device, and performing a routing table search in the second virtual switch according to the second gateway MAC address information.

[0087] Step 404: If the search is successful, the second next hop IP address information of the traffic data packet is searched in the found second routing table according to the destination IP address information of the traffic data packet.

[0088] As an example, step 404 includes: if the search is successful, it means that the second virtual switch maintains a second routing table corresponding to the second gateway MAC address information, and then obtains the destination IP address information from the traffic data packet, and searches for the corresponding second next-hop IP address information in the second routing table based on the destination IP address information.

[0089] Based on this, the traffic data packet is forwarded to the target subnet device based on the destination IP address information of the traffic data packet, including:

[0090] The second virtual switch is used to detect whether the second next-hop IP address information is the local address identifier of the second subnet device; if the second next-hop IP address information is the local address identifier of the second subnet device, the traffic data packet is forwarded to the target subnet device through the second virtual switch according to the destination IP address information.

[0091] Specifically, through the second virtual switch, it is detected that the second next-hop IP address information occurs as the local address identifier of the second subnet device, that is, whether it is a local address; if the second next-hop IP address information is the local address identifier of the second subnet device; according to the destination IP address information, the traffic data packet is forwarded to the target subnet device through the second virtual switch, wherein the target IP address information is the IP address of the target subnet device.

[0092] In one embodiment, after performing a routing table lookup through the second virtual switch of the second subnet device, the method further includes:

[0093] If the search fails, the traffic data packet is forwarded to the cluster gateway based on the MAC address information of the second gateway; based on the MAC address information of the second gateway, the second routing table is obtained by global search through the cluster gateway; according to the destination IP address information, the second next-hop IP address information is queried in the second routing table through the cluster gateway.

[0094] Specifically, if the second virtual switch fails to perform a routing table search based on the second gateway MAC address information, it means that the second routing table corresponding to the second gateway MAC address information is not maintained in the second virtual switch, and then based on the second gateway MAC address information, the traffic data packet is forwarded to the cluster gateway through the second virtual switch; based on the second gateway MAC address information, the second routing table is globally searched through the cluster gateway; based on the second gateway MAC address information, the corresponding second next-hop IP address information is searched in the second routing table through the cluster gateway based on the second gateway MAC address information.

[0095] Based on this, the cloud network system also includes a clustered gateway; based on the destination IP address information of the traffic data packet, the traffic data packet is forwarded to the target subnet device, including:

[0096] The cluster gateway is used to detect whether the second next-hop IP address information is the local address identifier of the second subnet device; if the second next-hop IP address information is the local address identifier of the second subnet device, the traffic data packet is forwarded to the target subnet device through the cluster gateway according to the destination IP address information.

[0097] Specifically, through the cluster gateway, detect whether the second next-hop IP address information is the local address identifier of the second subnet device, that is, whether it is a local address; if the second next-hop IP address information is the local address identifier of the second subnet device; according to the destination IP address information, forward the traffic data packet to the target subnet device through the cluster gateway, wherein the target IP address information is the IP address of the target subnet device.

[0098] In the above embodiment, a second virtual switch and a cluster gateway are simultaneously set up in the cloud network system, so that if the second virtual switch routes successfully, then when the second next-hop IP address information obtained by routing is the local address identifier of the second subnet device, the second virtual switch can directly forward the traffic data packet to the target subnet device, thereby ensuring the forwarding efficiency of the traffic data packet; if the second virtual machine routing fails, the second virtual switch sends the traffic data packet to the cluster gateway, and the cluster gateway performs routing in the cloud network globally. When the second next-hop IP address information obtained by routing is the local address identifier of the second subnet device, the cluster gateway forwards the traffic data packet to the target subnet device, thereby ensuring the forwarding success rate of the traffic data packet. Therefore, in this embodiment, both the forwarding efficiency and the forwarding success rate of the traffic data packet from the second subnet device to the target subnet device are taken into account.

[0099] In a complete embodiment, if a traffic data packet of a first host machine is detected, the first gateway MAC address information of a first subnet device is obtained from the traffic data packet through the first virtual switch of the first host machine, and a routing table search is performed in the first virtual switch of the first subnet device according to the first gateway MAC address information; if the search is successful, it means that a first routing table corresponding to the first gateway MAC address information is maintained in the first virtual switch; the destination IP address information is obtained from the traffic data packet, and the corresponding first next-hop IP address information is queried from the first routing table according to the destination IP address information; according to the first next-hop IP address information, the traffic data packet is directly sent to the second subnet device through the first virtual switch; if the search fails, the traffic data packet is forwarded to the cluster gateway; based on the first gateway MAC address information, the first routing table is globally searched through the cluster gateway, and the first next-hop IP address information is queried in the first routing table according to the destination IP address information; based on the first next-hop IP address information, the traffic data packet is sent to the second subnet device through the cluster gateway.

[0100] Furthermore, after the traffic data packet arrives at the second subnet device, the second gateway MAC address information of the second subnet device is obtained from the traffic data packet through the second virtual switch of the second subnet device, and a routing table search is performed in the second virtual switch according to the second gateway MAC address information; if the search is successful, it means that a second routing table corresponding to the second gateway MAC address information is maintained in the second virtual switch, and then the destination IP address information is obtained from the traffic data packet, and according to the destination IP address information, the corresponding second next-hop IP address information is searched in the second routing table; through the second virtual switch, it is detected whether the second next-hop IP address information occurs as the local address identifier of the second subnet device, that is, whether it is a local address; if the second next-hop IP address information is the local address identifier of the second subnet device; according to the destination IP address information, the traffic data packet is forwarded to the target subnet device through the second virtual switch, wherein the target IP address information is the IP address of the target subnet device.

[0101] If the second virtual switch fails to perform routing table search based on the second gateway MAC address information, it means that the second routing table corresponding to the second gateway MAC address information is not maintained in the second virtual switch, and then based on the second gateway MAC address information, the traffic data packet is forwarded to the cluster gateway through the second virtual switch; based on the second gateway MAC address information, the second routing table is globally searched through the cluster gateway; through the cluster gateway, the corresponding second next-hop IP address information is searched in the second routing table based on the second gateway MAC address information; through the cluster gateway, the second next-hop IP address information is detected as the local address identifier of the second subnet device, that is, whether it is a local address; if the second next-hop IP address information is the local address identifier of the second subnet device; according to the destination IP address information, the traffic data packet is forwarded to the target subnet device through the cluster gateway, wherein the target IP address information is the IP address of the target subnet device.

[0102] In the above embodiment, when it is detected that the second next-hop IP address information is the local address identifier of the second subnet device, the second subnet device or the cluster gateway will forward the traffic data packet directly to the target subnet device based on the destination IP address information of the traffic data packet, rather than forwarding the traffic data packet locally. Therefore, it can avoid the situation where the next hop of the traffic data is still the second subnet device, thereby solving the problem of cross-subnet traffic diversion in the cloud network system.

[0103] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0104] Based on the same inventive concept, the embodiment of the present application also provides a cross-cloud network subnet traffic diversion device for implementing the cross-cloud network subnet traffic diversion method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of one or more cross-cloud network subnet traffic diversion devices provided below can be referred to the limitations of the cross-cloud network subnet traffic diversion method above, and will not be repeated here.

[0105] In an exemplary embodiment, Figure 4 As shown, a cross-cloud network subnet traffic diversion device is provided, which is applied to a cloud network system, wherein the cloud network system includes a first subnet device and a second subnet device; the device includes: a first forwarding module 502, a routing module 504 and a second forwarding module 506, wherein:

[0106] The first forwarding module 502 is used for obtaining the first next-hop IP address information of the traffic data packet through the first virtual switch of the first subnet device if the first subnet device detects the traffic data packet, and sending the traffic data packet to the second subnet device according to the next-hop IP address information;

[0107] A routing module 504 is used to query the second next-hop IP address information of the traffic data packet by performing a routing address query through the second virtual switch of the second subnet device;

[0108] The second forwarding module 506 is used to forward the traffic data packet to the target subnet device based on the destination IP address information of the traffic data packet if it is detected that the second next-hop IP address information is the local address identifier of the second subnet device.

[0109] In one embodiment, the first forwarding module is further configured to:

[0110] Based on the first gateway MAC address information of the first subnet device, a routing table search is performed locally through the first virtual switch of the first subnet device; if the search is successful, the first next-hop IP address information is queried in the first routing table found through the first subnet device according to the destination IP address information of the traffic data packet; based on the first next-hop IP address information, the traffic data packet is sent to the second subnet device through the first virtual switch.

[0111] In one embodiment, the cloud network system further includes a clustered gateway; and the first forwarding module is further configured to:

[0112] If the search fails, the traffic data packet is forwarded to the cluster gateway; based on the MAC address information of the first gateway, the first routing table is obtained by the global search through the cluster gateway, and according to the destination IP address information, the first next-hop IP address information is queried in the first routing table; based on the first next-hop IP address information, the traffic data packet is sent to the second subnet device through the cluster gateway.

[0113] In one embodiment, the routing module is further used to:

[0114] Based on the second gateway MAC address information of the second subnet device, a routing table search is performed through the second virtual switch of the second subnet device; if the search is successful, the second next-hop IP address information of the traffic data packet is obtained by querying the second routing table found according to the destination IP address information of the traffic data packet.

[0115] In one embodiment, the second forwarding module is further used for:

[0116] The second virtual switch is used to detect whether the second next-hop IP address information is the local address identifier of the second subnet device; if the second next-hop IP address information is the local address identifier of the second subnet device, the traffic data packet is forwarded to the target subnet device through the second virtual switch according to the destination IP address information.

[0117] In one embodiment, the routing module is further used to:

[0118] If the search fails, the traffic data packet is forwarded to the cluster gateway based on the MAC address information of the second gateway; based on the MAC address information of the second gateway, the second routing table is obtained by global search through the cluster gateway; according to the destination IP address information, the second next-hop IP address information is queried in the second routing table through the cluster gateway.

[0119] In one embodiment, the cloud network system further includes a cluster gateway; and the second forwarding module is further used for:

[0120] The cluster gateway is used to detect whether the second next-hop IP address information is the local address identifier of the second subnet device; if the second next-hop IP address information is the local address identifier of the second subnet device, the traffic data packet is forwarded to the target subnet device through the cluster gateway according to the destination IP address information.

[0121] Each module in the above-mentioned cross-cloud network subnet traffic diversion device can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0122] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a method for diverting traffic across cloud network subnets is implemented. Those skilled in the art can understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0123] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0124] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0125] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0126] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0127] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0128] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for diverting traffic across cloud network subnets, characterized in that: Applied to a cloud network system, the cloud network system includes a first subnet device and a second subnet device; the method includes: If the first subnet device detects a traffic data packet, the first next-hop IP address information of the traffic data packet is obtained through the first virtual switch of the first subnet device, and the traffic data packet is sent to the second subnet device according to the next-hop IP address information; Performing a routing address query through the second virtual switch of the second subnet device to query the second next-hop IP address information of the traffic data packet; If it is detected that the second next-hop IP address information is the local address identifier of the second subnet device, the traffic data packet is forwarded to the target subnet device based on the destination IP address information of the traffic data packet.

2. The method according to claim 1, characterized in that: The method of obtaining the first next-hop IP address information of the traffic data packet through the first virtual switch of the first subnet device, and sending the traffic data packet to the second subnet device according to the next-hop IP address information, includes: Based on the MAC address information of the first gateway of the first subnet device, performing a routing table search locally through the first virtual switch of the first subnet device; If the search is successful, the first next-hop IP address information is searched in the first routing table found through the first subnet device according to the destination IP address information of the traffic data packet; According to the first next-hop IP address information, the traffic data packet is sent to the second subnet device through the first virtual switch.

3. The method according to claim 2, characterized in that The cloud network system further includes a clustered gateway; after the first virtual switch of the first subnet device performs a routing table lookup locally, the system further includes: If the search fails, the traffic data packet is forwarded to the cluster gateway; Based on the MAC address information of the first gateway, a first routing table is obtained by globally searching through the clustered gateway, and according to the destination IP address information, the first next-hop IP address information is searched in the first routing table; Based on the first next-hop IP address information, the traffic data packet is sent to the second subnet device through the cluster gateway.

4. The method according to claim 1, characterized in that The querying of the routing address by the second virtual switch of the second subnet device to query the second next hop IP address information of the traffic data packet includes: Based on the MAC address information of the second gateway of the second subnet device, performing a routing table search through the second virtual switch of the second subnet device; If the search is successful, the second next-hop IP address information of the traffic data packet is obtained by searching in the found second routing table according to the destination IP address information of the traffic data packet.

5. The method according to claim 4, characterized in that The forwarding of the traffic data packet to the target subnet device based on the destination IP address information of the traffic data packet includes: Detecting, by the second virtual switch, whether the second next-hop IP address information is the local address identifier of the second subnet device; If the second next-hop IP address information is the local address identifier of the second subnet device, the traffic data packet is forwarded to the target subnet device through the second virtual switch according to the destination IP address information.

6. The method according to claim 4, characterized in that After performing routing table lookup through the second virtual switch of the second subnet device, the method further includes: If the search fails, forwarding the traffic data packet to the cluster gateway based on the MAC address information of the second gateway; Based on the MAC address information of the second gateway, obtain a second routing table through a global search by the clustered gateway; According to the destination IP address information, the second next-hop IP address information is queried in the second routing table through the cluster gateway.

7. The method according to claim 6, characterized in that The cloud network system further includes a clustered gateway; forwarding the traffic data packet to a target subnet device based on the destination IP address information of the traffic data packet, including: Detecting, by the cluster gateway, whether the second next-hop IP address information is the local address identifier of the second subnet device; If the second next-hop IP address information is the local address identifier of the second subnet device, the traffic data packet is forwarded to the target subnet device through the cluster gateway according to the destination IP address information.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Networking method and network system

    CN104660479A

  • Data forwarding method and system, and related device

    CN106789667A

  • Data forwarding method and system in virtual network

    CN107453992A

  • Method and system for achieving VPC peer-to-peer connection in public cloud platform based on openstack

    CN110401588A

  • Service network access method and device, equipment and storage medium

    CN116016448A