Cross-cluster virtual IP address access method and apparatus, electronic device, and storage medium

By automatically managing the static routing of virtual IP addresses by matching messages in the flow table of the gateway node, the problem of cumbersome and low-efficiency cross-cluster access operations for virtual IP addresses is solved, automatic sensing and management of virtual IP addresses is realized, and access is improved. efficiency.

WO2024193076A1PCT designated stage expired Publication Date: 2024-09-26INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/132989
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-20
Filing Date
2023-11-21
Publication Date
2024-09-26

AI Technical Summary

Technical Problem

When using virtual IP addresses on virtual machines, cross-cluster access is cumbersome and inefficient, requiring manual configuration of static routes.

Method used

By matching the packets in the flow table of the gateway node, the static route of the virtual IP address is automatically added or deleted to realize the drift and update of the virtual IP address, allowing the second cluster to access the virtual IP address in the first cluster.

Benefits of technology

There is no need to manually configure static routes, which simplifies the operation process, improves the efficiency of cross-cluster access to virtual IP addresses, and realizes automatic sensing and management of virtual IP addresses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023132989_26092024_PF_FP
    Figure CN2023132989_26092024_PF_FP
Patent Text Reader

Abstract

Embodiments of the present application relate to the technical field of communications, and provide a cross-cluster virtual IP address access method and apparatus, an electronic device, and a storage medium. The method comprises: performing matching between a received message and a flow table, the message carrying a virtual IP address and an MAC address corresponding to the virtual IP address; and when the message is successfully matched with a first flow entry in the flow table, determining that the virtual IP address is drifted to a virtual machine in a first cluster, and adding a static route corresponding to the virtual IP address to a router of a second cluster, so that the second cluster may access the virtual IP address in the first cluster. In the embodiments of the present application, a cluster to which a virtual IP address is drifted is determined in a flow table-message matching mode, and a static route corresponding to the virtual IP address in another cluster is updated according to the cluster where the virtual IP address is located, so that cross-cluster virtual IP address access is realized, a worker does not need to manually configure a static route of a virtual IP address on a control plane, and the efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Method, device, electronic device and storage medium for accessing virtual IP addresses across clusters

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on March 20, 2023, with application number 202310271383.5, and application name “Method, device, electronic device and storage medium for accessing virtual IP addresses across clusters”, the entire contents of which are incorporated by reference into this application. Technical Field

[0003] The present application relates to the field of communication technology, and in particular to a method for accessing a virtual IP address across clusters, a device for accessing a virtual IP address across clusters, an electronic device, and a computer non-volatile readable storage medium. Background Art

[0004] Virtual machines within a cluster can communicate with each other through a Layer 2 network, and clusters can communicate with each other through a Layer 3 network. Layer 2 networks can communicate only through MAC (Media Access Control Address, physical address / hardware address) addressing, while Layer 3 networks require IP routing to achieve cross-segment communication, thus enabling cross-cluster communication.

[0005] However, when achieving three-layer network interconnection through the virtual IP (Internet Protocol) address on the virtual machine, after the virtual IP address is assigned to a virtual machine in a cluster, it cannot be perceived by the virtual machines in other clusters. The staff needs to manually configure the static route of the virtual IP address on the control plane before it can be perceived and used by the virtual machines in other clusters, making the operation cumbersome and inefficient.

[0006] Summary of the Invention

[0007] The embodiments of the present application provide a method, device, electronic device and storage medium for accessing a virtual IP address across clusters to solve the problems of cumbersome operation and low efficiency when staff manually configure static routes for virtual IP addresses.

[0008] The present application discloses a method for accessing a virtual IP address across clusters, which is applied to a gateway node of a first cluster, where the first cluster and a second cluster are connected via a router. The method includes:

[0009] Match the received message with the flow table; the message carries the virtual IP address and its corresponding MAC address;

[0010] When the message successfully matches the first flow table entry in the flow table, it is determined that the virtual IP address has drifted to the virtual machine in the first cluster, and a static route corresponding to the virtual IP address is added on the router of the second cluster based on the virtual IP address and its corresponding MAC address, so that the second cluster can access the virtual IP address in the first cluster.

[0011] In some embodiments of the present application, after matching the received message with the flow table, the following steps are further included:

[0012] When the message successfully matches the second flow table entry in the flow table, it is determined that the virtual IP address has drifted to the virtual machine in the second cluster, the static route corresponding to the virtual IP address on the router of the second cluster is deleted, and the static route corresponding to the virtual IP address is added on the router of the first cluster based on the virtual IP address and its corresponding MAC address.

[0013] In some embodiments of the present application, before matching the received message with the flow table, the process further includes:

[0014] Establishing a first flow table entry in the flow table, where the first flow table entry is used to detect the presence of the virtual IP address in the first cluster;

[0015] After determining that the virtual IP address has drifted to a virtual machine in the first cluster, the method further includes:

[0016] A second flow entry is established in the flow table, where the second flow entry is used to detect the presence of the virtual IP address in the second cluster.

[0017] After determining that the virtual IP address has drifted to a virtual machine in the second cluster, the method further includes:

[0018] Delete the second flow entry.

[0019] In some embodiments of the present application, before matching the received message with the flow table, the process further includes:

[0020] A first flow entry and a second flow entry are established in the flow table. The first flow entry is used to sense the presence of the virtual IP address in the first cluster, and the second flow entry is used to sense the presence of the virtual IP address in the second cluster.

[0021] In some embodiments of the present application, the flow table includes a first flow table and a second flow table, the first flow table entry is located in the first flow table, and the second flow table entry is in the second flow table.

[0022] In some embodiments of the present application, after determining that the virtual IP address has drifted to a virtual machine in the first cluster, the method further includes:

[0023] Establish a third flow table entry in the first flow table according to the virtual IP address and its corresponding MAC address;

[0024] After determining that the virtual IP address has drifted to a virtual machine in the second cluster, the method further includes:

[0025] Delete the third flow entry.

[0026] In some embodiments of the present application, after establishing the third flow table entry in the first flow table according to the virtual IP address and the MAC address, the method further includes:

[0027] When the new message successfully matches the third flow table entry, and the MAC address corresponding to the virtual IP address in the new message is different from the MAC address corresponding to the virtual IP address in the third flow table entry, it is determined that the virtual IP address has drifted in the first cluster, and the MAC address corresponding to the virtual IP address in the third flow table entry is updated according to the MAC address corresponding to the virtual IP address in the new message.

[0028] In some embodiments of the present application, when the first flow entry and the third flow entry exist at the same time, the packet is matched with the third flow entry first.

[0029] In some embodiments of the present application, the first flow table is pre-established with a fourth flow table entry, and matching the received message with the flow table includes:

[0030] When the message is sent by the first cluster, the message is matched with the fourth flow table entry;

[0031] If the message successfully matches the fourth flow table entry, it is determined that the message carries the IP address and its corresponding MAC address;

[0032] If the message fails to match the fourth flow table entry, the message is matched with the first flow table entry.

[0033] In some embodiments of the present application, after determining that the virtual IP address has drifted to a virtual machine in the second cluster, the method further includes:

[0034] Record the virtual IP address and its corresponding MAC address through the second flow table entry;

[0035] After adding a static route corresponding to the virtual IP address on the router of the first cluster according to the virtual IP address and the MAC address, the following steps are further included:

[0036] When the new message successfully matches the second flow table entry, and the MAC address corresponding to the virtual IP address in the new message is different from the MAC address corresponding to the virtual IP address in the second flow table entry, it is determined that the virtual IP address has drifted in the second cluster, and the MAC address corresponding to the virtual IP address in the second flow table entry is updated according to the MAC address corresponding to the virtual IP address in the new message.

[0037] In some embodiments of the present application, the message is an IP message or an ARP message.

[0038] In some embodiments of the present application, the ARP message is broadcast by the virtual machine when the virtual IP address drifts into the virtual machine.

[0039] In some embodiments of the present application, adding a static route corresponding to the virtual IP address on a router of the second cluster according to the virtual IP address and its corresponding MAC address includes:

[0040] Add the virtual IP address and its corresponding MAC address in the cluster shared database; so that the second cluster obtains the virtual IP address and its corresponding MAC address from the cluster shared database, and adds a static route corresponding to the virtual IP address on the router of the second cluster according to the virtual IP address and its corresponding MAC address.

[0041] In some embodiments of the present application, deleting the static route corresponding to the virtual IP address on the router of the second cluster includes:

[0042] Delete the virtual IP address and its corresponding MAC address in the cluster shared database; so that the second cluster can sense the deletion of the virtual IP address and its corresponding MAC address in the cluster shared database and delete the static route corresponding to the virtual IP address on the router of the second cluster.

[0043] In some embodiments of the present application, a static routing table is configured on the router, and the static routing table is used to store static routes corresponding to virtual IP addresses.

[0044] In some embodiments of the present application, the first cluster and the second cluster both include a first router and a second router, the first router is used to implement communication connection between the first cluster and the second cluster, and the second router is used to implement communication connection between virtual machines in the first cluster / second cluster.

[0045] In some embodiments of the present application, after determining that the virtual IP address has drifted to a virtual machine in the first cluster, the method further includes:

[0046] A mapping relationship between the virtual IP address and its corresponding MAC address is added to the second router of the first cluster.

[0047] In some embodiments of the present application, the gateway node is an l2gateway gateway node.

[0048] In some embodiments of the present application, a control agent is deployed in the l2gateway gateway node.

[0049] Some embodiments of the present application further disclose a device for accessing a virtual IP address across clusters, which is applied to a gateway node of a first cluster, where the first cluster is connected to a second cluster via a router, comprising:

[0050] A message matching module is used to match received messages with flow tables; wherein the message carries a virtual IP address and its corresponding MAC address;

[0051] The first static route adding module is used to determine that the virtual IP address drifts to the virtual machine in the first cluster when the message successfully matches the first flow table entry in the flow table, and add a static route corresponding to the virtual IP address on the router of the second cluster according to the virtual IP address and its corresponding MAC address, so that the second cluster can access the virtual IP address in the first cluster.

[0052] In some embodiments of the present application, further comprising:

[0053] The second static route adding module is used to determine that the virtual IP address drifts to the virtual machine in the second cluster when the message successfully matches the second flow table entry in the flow table, delete the static route corresponding to the virtual IP address on the router of the second cluster, and add the static route corresponding to the virtual IP address on the router of the first cluster based on the virtual IP address and its corresponding MAC address.

[0054] In some embodiments of the present application, further comprising:

[0055] a first flow table entry establishing module, configured to establish a first flow table entry in a flow table, wherein the first flow table entry is used to sense the presence of a virtual IP address in the first cluster;

[0056] a second flow table entry establishing module, configured to establish a second flow table entry in the flow table, wherein the second flow table entry is used to sense the presence of the virtual IP address in the second cluster;

[0057] The first flow table entry deletion module is used to delete the second flow table entry.

[0058] In some embodiments of the present application, further comprising:

[0059] The flow entry establishment module is used to establish a first flow entry and a second flow entry in the flow table, the first flow entry is used to sense the presence of the virtual IP address in the first cluster, and the second flow entry is used to sense the presence of the virtual IP address in the second cluster.

[0060] In some embodiments of the present application, the flow table includes a first flow table and a second flow table, the first flow table entry is located in the first flow table, and the second flow table entry is in the second flow table.

[0061] In some embodiments of the present application, further comprising:

[0062] A third flow table entry establishing module, configured to establish a third flow table entry in the first flow table according to the virtual IP address and its corresponding MAC address;

[0063] The third flow table entry deletion module is used to delete the third flow table entry.

[0064] In some embodiments of the present application, further comprising:

[0065] The static routing update module is used to determine that the virtual IP address has drifted in the first cluster when a new message successfully matches the third flow table entry and the MAC address corresponding to the virtual IP address in the new message is different from the MAC address corresponding to the virtual IP address in the third flow table entry, and update the MAC address corresponding to the virtual IP address in the third flow table entry according to the MAC address corresponding to the virtual IP address in the new message.

[0066] In some embodiments of the present application, when the first flow entry and the third flow entry exist at the same time, the packet is matched with the third flow entry first.

[0067] In some embodiments of the present application, the first flow table is pre-established with a fourth flow table entry, and the message matching module includes:

[0068] A first message matching submodule, configured to match the message with the fourth flow table entry when the message is sent by the first cluster;

[0069] An address determination submodule, configured to determine whether the message carries an IP address and its corresponding MAC address if the message successfully matches the fourth flow table entry;

[0070] The second message matching submodule is configured to match the message with the first flow table entry if the message fails to match the fourth flow table entry.

[0071] In some embodiments of the present application, further comprising:

[0072] An information recording module, configured to record the virtual IP address and its corresponding MAC address through a second flow table entry;

[0073] The static routing update module is also used to determine that the virtual IP address has drifted in the second cluster when a new message successfully matches the second flow table entry and the MAC address corresponding to the virtual IP address in the new message is different from the MAC address corresponding to the virtual IP address in the second flow table entry, and update the MAC address corresponding to the virtual IP address in the second flow table entry according to the MAC address corresponding to the virtual IP address in the new message.

[0074] In some embodiments of the present application, the message is an IP message or an ARP message.

[0075] In some embodiments of the present application, the ARP message is broadcast by the virtual machine when the virtual IP address drifts into the virtual machine.

[0076] In some embodiments of the present application, the first static route adding module includes:

[0077] The data adding submodule is used to add the virtual IP address and its corresponding MAC address in the cluster shared database; so that the second cluster can obtain the virtual IP address and its corresponding MAC address from the cluster shared database, and add the static route corresponding to the virtual IP address on the router of the second cluster according to the virtual IP address and its corresponding MAC address.

[0078] In some embodiments of the present application, the second static route adding module includes:

[0079] The data deletion submodule is used to delete the virtual IP address and its corresponding MAC address in the cluster shared database; so that after the second cluster perceives the deletion of the virtual IP address and its corresponding MAC address in the cluster shared database, it deletes the static route corresponding to the virtual IP address on the router of the second cluster.

[0080] In some embodiments of the present application, a static routing table is configured on the router, and the static routing table is used to store static routes corresponding to virtual IP addresses.

[0081] In some embodiments of the present application, the first cluster and the second cluster both include a first router and a second router, the first router is used to implement communication connection between the first cluster and the second cluster, and the second router is used to implement communication connection between virtual machines in the first cluster / second cluster.

[0082] In some embodiments of the present application, further comprising:

[0083] The mapping relationship adding module is used to add a mapping relationship between a virtual IP address and its corresponding MAC address on the second router of the first cluster.

[0084] In some embodiments of the present application, the gateway node is an l2gateway gateway node.

[0085] In some embodiments of the present application, a control agent is deployed in the l2gateway gateway node.

[0086] The embodiment of the present application further discloses an electronic device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0087] Memory for storing computer programs;

[0088] The processor is used to implement the method of the embodiment of the present application when executing the program stored in the memory.

[0089] An embodiment of the present application further discloses a computer non-volatile readable storage medium having instructions stored thereon, which, when executed by one or more processors, causes the processors to execute a method as in an embodiment of the present application.

[0090] The embodiments of the present application include the following advantages: by matching the message with the first flow table entry in the flow table, it is determined that the virtual IP address has drifted to the first cluster, and the static route corresponding to the virtual IP address in the second cluster is configured according to the cluster location of the virtual IP address, so that the virtual machines / devices in the second cluster can access the virtual IP address in the first cluster across clusters, without the need for staff to manually configure the static route of the virtual IP address on the control plane, which solves the problem of cumbersome operation and low efficiency when staff manually configure the static route of the virtual IP address. BRIEF DESCRIPTION OF THE DRAWINGS

[0091] FIG1 is a block diagram of a data plane virtual IP address communication design provided in some embodiments of the present application;

[0092] FIG2 is a flowchart of a method for accessing a virtual IP address across clusters provided in some embodiments of the present application;

[0093] FIG3 is a block diagram of a data plane virtual IP address communication design provided in some embodiments of the present application;

[0094] FIG4 is a schematic diagram of a control plane process disclosed in some embodiments of the present application;

[0095] FIG5 is a structural block diagram of a device for accessing a virtual IP address across clusters provided in some embodiments of the present application;

[0096] FIG6 is a block diagram of an electronic device provided in some embodiments of the present application;

[0097] FIG7 is a block diagram of a computer non-volatile readable storage medium provided in some embodiments of the present application. DETAILED DESCRIPTION

[0098] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0099] Currently, cross-cluster interconnection can be achieved through ovn (open source SDN controller developed for OpenvSwitch) l2gateway and ovn-ic (ovn controller for interconnecting multiple ovn clusters). Multiple clusters can use the same network segment to create ports and virtual machines. Virtual machines can communicate with each other through Layer 2. After multiple Layer 2 networks are connected through routers, they can also communicate with each other through Layer 3. However, a current prerequisite for achieving Layer 2 and Layer 3 interconnection is that the IP of the virtual machine is fixed in a certain cluster, and other clusters know the cluster where the IP is located. Once an IP is assigned to a virtual machine, it cannot be used by other virtual machines or virtual machines in other clusters without reallocation through the control plane. The scenario of virtual IP addresses cannot be implemented. For example, a high-availability application like keepalived requires a virtual IP address.

[0100] Based on this, some embodiments of the present application are designed to allow the use of virtual IP addresses in a large Layer 2 network across openstack (open source cloud computing platform management platform project) clusters. The virtual IP address can be accessed by other IP addresses in the large Layer 2 network of each cluster or other networks connected through a router.

[0101] In the network structure, there are two options: two-layer network and three-layer network. The two-layer network structure includes the core layer and the access layer, and the three-layer network structure includes the core layer, the aggregation layer, and the access layer.

[0102] The two-layer network structure mode with only the core layer and access layer is simple to operate. The switch forwards data packets according to the MAC address table. If there is a response, it will be forwarded. If not, it will be flooded, that is, the data packet will be broadcast to all ports. If the destination terminal receives a response, the switch can add the MAC address to the address table. This is the process of the switch establishing the MAC address.

[0103] Unlike a two-layer network structure, a three-layer network structure can be used to build large networks. The core layer serves as the backbone of the entire network and the data transmission channel. The aggregation layer connects the core layer of the network with the various access application layers, acting as the "media transmission" between the two layers. The access layer is primarily oriented towards end users, providing access functions (connecting workstations to the network). A two-layer network can communicate solely through MAC addressing, but only within the same collision domain. A three-layer network requires IP routing to achieve cross-segment communication, which can span multiple collision domains.

[0104] With reference to Figure 1, one of the block diagrams of a data plane virtual IP address communication design provided in some embodiments of the present application is shown. Cluster A and cluster B both use the two network segments 192.168.1.0 / 24 and 192.168.2.0 / 24. Among them, 192.168.1.10 is a virtual IP address, and at this time the virtual IP address and 192.168.1.3 are on the same virtual machine. When virtual machines in other network segments of the same cluster communicate with the virtual IP address, they only need to go through the router of this cluster (VPC Router) and ensure that the MAC_binding table of the router interface is correct. If the IP address of cluster B is to communicate with the virtual IP address, it is necessary to configure the static route for 192.168.1.10 on the router of cluster B so as to realize data transmission between the devices in cluster B and the virtual IP address based on the static route.

[0105] 2 , a flowchart of a method for accessing a virtual IP address across clusters provided in some embodiments of the present application is shown. The method includes:

[0106] Step 201: Match the received message with the flow table.

[0107] The cross-cluster access virtual IP address method is applied to the gateway node of the first cluster, and the first cluster and the second cluster are connected through a router. For example, the first cluster and the second cluster both have interconnection routers, so the communication connection between the first cluster and the second cluster can be achieved through the two interconnection routers. There may be multiple second clusters.

[0108] The information carried in the message includes the virtual IP address and its corresponding MAC address, and VLAN (Virtual Local Area Network);

[0109] The message is sent by the virtual machine to which the virtual IP address drifts, and the gateway node can perceive this data message;

[0110] The flow table is an ovs (Open vSwitch, open virtual switching standard) flow table, and the flow table is set with multiple levels of flow table entries.

[0111] Specifically, after the gateway node obtains the message, it can match the message with the flow table entry in the flow table. The flow table entry has a priority, which refers to the priority of a flow table entry. The message will first try to match the flow table entry with a high priority.

[0112] Step 202: When the message successfully matches the first flow table entry in the flow table, it is determined that the virtual IP address has drifted to the virtual machine in the first cluster, and a static route corresponding to the virtual IP address is added to the router of the second cluster based on the virtual IP address and its corresponding MAC address, so that the second cluster can access the virtual IP address in the first cluster.

[0113] The virtual IP address drifting to the virtual machine in the first cluster may be a virtual IP address drifting from another cluster (such as the second cluster) to the virtual machine in the first cluster, or a newly set virtual IP address in the virtual machine in the first cluster.

[0114] Specifically, a first flow table entry is set in the flow table, and the first flow table entry is used to sense whether the message is sent by the first cluster. After the gateway node obtains the message, the first flow table entry is matched with the message, such as matching the message, the corresponding VLAN and the network segment. After a successful match, it can be determined that the message comes from the first cluster, that is, it is determined that the virtual IP address drifts to the virtual machine in the first cluster.

[0115] Therefore, according to the virtual IP address carried in the message and its corresponding MAC address, a static route corresponding to the virtual IP address is added on the router of the second cluster, so that the virtual machines / devices in the second cluster can access the virtual IP address in the first cluster through the static route, thereby realizing data transmission with the virtual machine where the virtual IP address is located.

[0116] At the same time, if the virtual IP address drifts from the second cluster to the first cluster, then there may be a static route corresponding to the virtual IP address on the router of the first cluster. In this case, the static route corresponding to the virtual IP address on the router of the first cluster needs to be deleted to save storage resources.

[0117] In the above embodiment, by matching the message with the first flow table entry in the flow table, it is determined that the virtual IP address has drifted to the first cluster, and the static route configuration corresponding to the virtual IP address on the router in the second cluster is updated according to the cluster location of the virtual IP address, so that the virtual machines / devices in the second cluster can access the virtual IP address in the first cluster across clusters, without the need for staff to manually configure the static route of the virtual IP address on the control plane, which solves the problem of cumbersome operation and low efficiency when staff manually configure the static route of the virtual IP address.

[0118] Based on the above embodiment, a modified embodiment of the above embodiment is proposed. It should be noted that, in order to simplify the description, only the differences from the above embodiment are described in the modified embodiment.

[0119] In some embodiments of the present application, after matching the received message with the flow table, it also includes: when the message successfully matches the second flow table entry in the flow table, determining that the virtual IP address drifts to the virtual machine in the second cluster, deleting the static route corresponding to the virtual IP address on the router of the second cluster, and adding the static route corresponding to the virtual IP address on the router of the first cluster based on the virtual IP address and its corresponding MAC address.

[0120] Specifically, a second flow table entry is also set in the flow table. The second flow table entry is used to sense whether the message is sent by the second cluster. After the gateway node obtains the message, the second flow table entry is matched with the message. For example, if the message, the corresponding VLAN and the network segment are matched, after a successful match, it can be determined that the message comes from the second cluster, and therefore it is determined that the virtual IP address drifts from the first cluster to the virtual machine in the second cluster.

[0121] Then, according to the virtual IP address carried in the message and its corresponding MAC address, a static route corresponding to the virtual IP address is added on the router of the first cluster, so that the virtual machines / devices in the first cluster can access the virtual IP address through the static route, thereby realizing data transmission with the virtual machine where the virtual IP address is located.

[0122] At the same time, because the virtual IP address is not in the first cluster, the static route corresponding to the virtual IP address on the router of the second cluster needs to be deleted. If the virtual IP address is not drifted from the first cluster to the second cluster, but is newly set in a VM in the second cluster, the static route corresponding to the virtual IP address will not exist on the router of the second cluster, and there is no need to delete the static route corresponding to the virtual IP address on the router of the second cluster.

[0123] Referring again to FIG1 , at this time, the virtual IP address 192.168.1.10 is located in cluster A (the first cluster), and then the virtual IP address drifts to cluster B (the second cluster). Specifically, referring to FIG3 , a second block diagram of a data plane virtual IP address communication design provided in some embodiments of the present application is shown, in which the virtual IP address 192.168.1.10 drifts to cluster B and is in the same virtual machine as 192.168.1.7. Other clusters, such as cluster A's IP address 192.168.2.5, communicate with the virtual IP address, so the router of cluster A is configured with a static route for 192.168.1.10. The access path is: 192.168.2.5 > cluster A router (VPC Router) > cluster A interconnection router (IC Router) > cluster B interconnection router (IC Router) > cluster B router (VPC Router) > 192.168.1.10.

[0124] In the above embodiment, when the virtual IP address drifts between the first cluster and the second cluster, the cluster to which the virtual IP address drifts is determined by matching the first flow table item / the second flow table item in the flow table, and the static route configuration corresponding to the virtual IP address is updated according to the cluster location of the virtual IP address, so that virtual machines / devices in other clusters can access the virtual IP address across clusters, without the need for staff to manually configure the static route of the virtual IP address on the control plane, which solves the problem of cumbersome operation and low efficiency when staff manually configure the static route of the virtual IP address.

[0125] In some embodiments of the present application, before matching the received message with the flow table, it also includes: establishing a first flow table entry in the flow table, the first flow table entry is used to sense the appearance of the virtual IP address in the first cluster; after determining that the virtual IP address drifts to the virtual machine in the first cluster, it also includes: establishing a second flow table entry in the flow table, the second flow table entry is used to sense the appearance of the virtual IP address in the second cluster; after determining that the virtual IP address drifts to the virtual machine in the second cluster, it also includes: deleting the second flow table entry.

[0126] Specifically, before matching the received message with the flow table, that is, before the gateway node receives the message, the virtual IP address is not in the first cluster, but in the second cluster. It is necessary to establish a first flow table entry in the flow table in advance, so as to match the message sent by the first cluster through the first flow table entry and perceive the appearance of the virtual IP address in the first cluster. The virtual IP address is in the second cluster, so there is no need to establish a second flow table entry to perceive the appearance of the virtual IP address in the second cluster.

[0127] When the first flow table entry detects that the virtual IP address has drifted to a virtual machine in the first cluster, it indicates that the virtual IP address may drift to the second cluster next. Therefore, a second flow table entry needs to be established in the flow table to match the packets sent by the second cluster through the second flow table entry and detect the presence of the virtual IP address in the second cluster.

[0128] When the second flow table entry determines that the virtual IP address has drifted to the virtual machine in the second cluster, it means that the virtual IP address is already in the second cluster. At this time, there is no need to use the second flow table entry to sense the appearance of the virtual IP address in the second cluster. Therefore, the second flow table entry is deleted. After the virtual IP address drifts to the first cluster, the second flow table entry is established.

[0129] In the above embodiment, the need to use the second flow table entry next is determined based on the cluster location of the virtual IP address, and the second flow table entry is created / deleted to save storage resources.

[0130] In some embodiments of the present application, before matching the received message with the flow table, it also includes: establishing a first flow table entry and a second flow table entry in the flow table, the first flow table entry is used to sense the appearance of the virtual IP address in the first cluster, and the second flow table entry is used to sense the appearance of the virtual IP address in the second cluster.

[0131] Specifically, in addition to using the above-mentioned second flow table entry to create / delete according to the cluster location of the virtual IP address, it is also possible to simultaneously establish a first flow table entry and a second flow table entry in the flow table before matching the received message with the flow table, so as to perceive the presence of the virtual IP address in the first cluster through the first flow table entry and perceive the presence of the virtual IP address in the second cluster through the second flow table entry.

[0132] In some embodiments of the present application, the flow table includes a first flow table and a second flow table, the first flow table entry is located in the first flow table, and the second flow table entry is in the second flow table.

[0133] Specifically, two flow tables, namely a first flow table and a second flow table, can be set up respectively. A first flow table entry is established in the first flow table, and a second flow table entry is established in the second flow table. The flow table entry in the first flow table is used to match the message sent by the first cluster, and the flow table entry in the second flow table is used to match the message sent by the second cluster.

[0134] In some embodiments of the present application, after determining that the virtual IP address drifts to a virtual machine within the first cluster, it also includes: establishing a third flow table entry in the first flow table based on the virtual IP address and its corresponding MAC address; after determining that the virtual IP address drifts to a virtual machine within the second cluster, it also includes: deleting the third flow table entry.

[0135] In some embodiments of the present application, after establishing a third flow table entry in the first flow table based on the virtual IP address and the MAC address, it also includes: when a new message successfully matches the third flow table entry, and the MAC address corresponding to the virtual IP address in the new message is different from the MAC address corresponding to the virtual IP address in the third flow table entry, it is determined that the virtual IP address has drifted in the first cluster, and the MAC address corresponding to the virtual IP address in the third flow table entry is updated according to the MAC address corresponding to the virtual IP address in the new message.

[0136] In some embodiments of the present application, when the first flow entry and the third flow entry exist at the same time, the packet is matched with the third flow entry first.

[0137] Specifically, after determining that the virtual IP address has drifted to the virtual machine within the first cluster, a third flow table entry can be established in the first flow table, and the third flow table learns the virtual IP address and its corresponding MAC address in the message. When the gateway node obtains a new message sent by the first cluster, the new message will first match the third flow table entry.

[0138] When the new message matches the third flow table entry successfully, and the MAC address corresponding to the virtual IP address in the new message is different from the MAC address corresponding to the virtual IP address in the third flow table entry, it means that the virtual IP address has drifted between virtual machines in the first cluster, or the MAC address of the virtual machine where the virtual IP address is located has changed. Therefore, the MAC address corresponding to the virtual IP address in the new message should be used to replace the MAC address corresponding to the virtual IP address in the third flow table entry, so as to update the MAC address corresponding to the virtual IP address in the third flow table entry, and there is no need to match the first flow table entry subsequently.

[0139] When the new message successfully matches the third flow table entry, and the MAC address corresponding to the virtual IP address in the new message is the same as the MAC address corresponding to the virtual IP address in the third flow table entry, it indicates that the virtual IP address has not drifted, so there is no need to match the first flow table entry subsequently.

[0140] When the new message fails to match the third flow table entry, the virtual IP address in the new message is determined to be a virtual IPR address that has not been learned by the third flow table entry, and the new message is matched with the first flow table to determine whether the virtual IP address is the virtual IP address that has just drifted to the first cluster.

[0141] After determining that the virtual IP address drifts to the virtual machine in the second cluster, it means that there is no need to use the third flow table entry to sense whether the virtual IP address drifts to the virtual machine in the first cluster. Therefore, the third flow table entry can be deleted to save storage resources.

[0142] In the above embodiment, after the message successfully matches the first flow table entry, the virtual IP address drifted to the first cluster can be learned through the third flow table entry, and when the gateway node obtains a new message, the new message will be matched with the third flow table. If the new message successfully matches the third flow table, it means that the virtual IP address in the new message has been matched with the first flow table entry, so there is no need to match the new message with the first flow table entry subsequently, so as to simplify the message matching processing flow and save computing resources.

[0143] In addition, when the message is successfully connected to the third flow table, and the MAC address corresponding to the virtual IP address in the new message is different from the MAC address corresponding to the virtual IP address in the third flow table entry, it means that the virtual IP address has drifted in the virtual machine within the first cluster, so the MAC address corresponding to the virtual IP address is updated to ensure that other virtual machines / devices can access the virtual machine corresponding to the virtual IP address. There is no need for staff to manually update the MAC address corresponding to the virtual IP address, which solves the problem of cumbersome operation and low efficiency when staff manually configure the mapping relationship between the MAC address corresponding to the virtual IP address.

[0144] In some embodiments of the present application, a fourth flow table entry is pre-established in the first flow table, and the received message is matched with the flow table, including: when the message is a message sent by the first cluster, the message is matched with the fourth flow table entry; if the message is successfully matched with the fourth flow table entry, it is determined that the message carries the IP address and its corresponding MAC address; if the message fails to match the fourth flow table entry, the message is matched with the first flow table entry.

[0145] Specifically, a fourth flow table entry is pre-established in the first flow table. The fourth flow table entry is used to match the message, the corresponding VLAN and the first cluster known IP, and then jump to the next table.

[0146] When the message is sent by the first cluster, the message will first be matched with the fourth flow table entry. If the message matches the fourth flow table entry successfully, it is determined that the message carries the IP address and its corresponding MAC address, but does not carry the virtual IP address. Therefore, there is no need to match the message with the first flow table entry subsequently, so as to simplify the message matching processing flow and save computing resources.

[0147] If the message fails to match the fourth flow entry, it indicates that the message may carry a virtual IP address. Therefore, the message is matched with the first flow entry to determine whether the message contains the virtual IP address that has just drifted to the first cluster.

[0148] In the above embodiment, when the message is a message sent by the first cluster, the message will first be matched with the fourth flow table entry. If the message matches the fourth flow table entry successfully, it is determined that the message carries the IP address and its corresponding MAC address, and does not carry the virtual IP address. Therefore, there is no need to match the message with the first flow table entry subsequently, so as to simplify the message matching processing flow and save computing resources.

[0149] In some embodiments of the present application, after determining that the virtual IP address has drifted to a virtual machine in the second cluster, it also includes: recording the virtual IP address and its corresponding MAC address through a second flow table entry; after adding a static route corresponding to the virtual IP address on the router of the first cluster based on the virtual IP address and MAC address, it also includes: when a new message successfully matches the second flow table entry, and the MAC address corresponding to the virtual IP address in the new message is different from the MAC address corresponding to the virtual IP address in the second flow table entry, it is determined that the virtual IP address has drifted in the second cluster, and the MAC address corresponding to the virtual IP address in the second flow table entry is updated according to the MAC address corresponding to the virtual IP address in the new message.

[0150] Specifically, after determining that the virtual IP address drifts to a virtual machine in the second cluster, it is also necessary to learn the virtual IP address and its corresponding MAC address in the message through the second flow table entry, so as to subsequently perceive whether the virtual IP address drifts between virtual machines in the second cluster through the second flow table entry.

[0151] Specifically, after adding a static route corresponding to the virtual IP address on the router of the first cluster according to the virtual IP address and MAC address in the message, if the new message matches the second flow table entry successfully, and the MAC address corresponding to the virtual IP address in the new message is different from the MAC address corresponding to the virtual IP address in the second flow table entry, it means that the virtual IP address has drifted between virtual machines in the second cluster, or the MAC address of the virtual machine where the virtual IP address is located has changed. Therefore, the MAC address corresponding to the virtual IP address in the new message should be used to replace the MAC address corresponding to the virtual IP address in the second flow table entry, so as to update the MAC address corresponding to the virtual IP address in the second flow table entry so that other virtual machines / devices can access the virtual machine corresponding to the virtual IP address.

[0152] When the new message successfully matches the second flow table entry, and the MAC address corresponding to the virtual IP address in the new message is the same as the MAC address corresponding to the virtual IP address in the second flow table entry, it indicates that the virtual IP address has not drifted.

[0153] In the above embodiment, after the message successfully matches the second flow table entry, the virtual IP address drifted to the second cluster can be learned through the second flow table entry, and when the gateway node obtains a new message, the new message will be matched with the second flow table entry. If the new message successfully matches the second flow table entry, and the virtual IP address in the new message is the virtual IP address that has been learned in the second flow table entry, it is determined that the virtual IP address in the new message has matched the second flow table entry, and there is no need to subsequently delete the static route corresponding to the virtual IP address on the router of the second cluster, and add the static route corresponding to the virtual IP address on the router of the first cluster according to the virtual IP address and its corresponding MAC address, so as to simplify the message matching processing flow and save computing resources.

[0154] In some embodiments of the present application, the message is an IP message or an ARP message.

[0155] In some embodiments of the present application, the ARP message is broadcast by the virtual machine when the virtual IP address drifts into the virtual machine.

[0156] Specifically, when a virtual IP address drifts to a virtual machine, the virtual machine will actively broadcast a gratuitous ARP packet to announce the virtual IP address, and the gateway node can perceive this data packet. Before the virtual machine actively sends an ARP packet, it may also send a data IP packet. This IP packet also carries the virtual IP address and its corresponding MAC address, which can also inform the virtual IP address.

[0157] Correspondingly, corresponding to the IP message and the ARP message, the first flow table entry, the second flow table entry and the third flow table entry are all set to two types, which are used to match the IP message and the ARP message respectively to sense the location of the virtual IP address.

[0158] In some embodiments of the present application, a static route corresponding to the virtual IP address is added on the router of the second cluster according to the virtual IP address and its corresponding MAC address, including: adding the virtual IP address and its corresponding MAC address in the cluster shared database; so that the second cluster obtains the virtual IP address and its corresponding MAC address from the cluster shared database, and adds the static route corresponding to the virtual IP address on the router of the second cluster according to the virtual IP address and its corresponding MAC address.

[0159] Specifically, after determining that the virtual IP address has drifted to the first cluster, the virtual IP address and its corresponding MAC address need to be shared to the cluster shared database so that the second cluster can know that the virtual IP address has drifted to the first cluster, and then add a static route corresponding to the virtual IP address on the router of the second cluster based on the virtual IP address and its corresponding MAC address in the cluster shared database.

[0160] In some embodiments of the present application, deleting the static route corresponding to the virtual IP address on the router of the second cluster includes:

[0161] Delete the virtual IP address and its corresponding MAC address in the cluster shared database; so that the second cluster can sense the deletion of the virtual IP address and its corresponding MAC address in the cluster shared database and delete the static route corresponding to the virtual IP address on the router of the second cluster.

[0162] Specifically, after determining that the virtual IP address has drifted to the second cluster, the virtual IP address and its corresponding MAC address in the cluster shared database need to be deleted so that the second cluster can know that the virtual IP address has drifted to the second cluster. The router of the second cluster does not need the static route corresponding to the virtual IP address. Therefore, the static route corresponding to the virtual IP address on the router of the second cluster is deleted.

[0163] In some embodiments of the present application, a static routing table is configured on the router, and the added static routes are stored in the static routing table.

[0164] In some embodiments of the present application, the first cluster and the second cluster both include a first router and a second router, the first router is used to implement communication connection between the first cluster and the second cluster, and the second router is used to implement communication connection between virtual machines in the first cluster / second cluster.

[0165] Specifically, referring to Figures 1 and 2, the first router is an IC router. The first routers of the first cluster and the second cluster are connected to each other through a switch (Transit_Switch). The second router (VPC Router) is used to connect virtual machines in the first cluster / second cluster. The first router and the second router are also connected to each other through a switch (Logical_Switch).

[0166] In some embodiments of the present application, after determining that the virtual IP address has drifted to a virtual machine in the first cluster, the method further includes: adding a mapping relationship between the virtual IP address and its corresponding MAC address on a second router in the first cluster.

[0167] Specifically, after determining that the virtual IP address has drifted to a virtual machine in the first cluster, a mapping relationship between the virtual IP address and its corresponding MAC address needs to be added to the second router of the first cluster so that other virtual machines / devices in the first cluster can access the virtual IP address.

[0168] In addition, after the second router adds the mapping relationship between the virtual IP address and its corresponding MAC address, if the third flow table entry matches the new message, the MAC address corresponding to the virtual IP address in the new message is different from the MAC address corresponding to the virtual IP address in the third flow table entry, indicating that the virtual IP address of the virtual machine in the first cluster has drifted. According to the MAC address corresponding to the virtual IP address in the new message, the MAC address corresponding to the virtual IP address in the third flow table entry, as well as the virtual IP address and its corresponding MAC address on the second router are replaced and updated so that other virtual machines / devices can access the virtual IP address.

[0169] In some embodiments of the present application, the gateway node is an l2gateway gateway node.

[0170] In some embodiments of the present application, a control agent is deployed in the l2gateway gateway node.

[0171] In order to better understand some embodiments of the present application, an exemplary description is given below with reference to FIG. 4 .

[0172] Control surface design 1:

[0173] On the l2gateway node, configure the flow table to detect the cluster where the virtual IP address belongs and the MAC address of the virtual IP address.

[0174] Design Reason: Currently, when a virtual IP address drifts, the VM to which it drifts will proactively send a gratuitous ARP request to advertise the IP address. The l2gateway node can detect this data packet. Furthermore, as an edge node in a cluster, the l2gateway node can also detect whether the packet is sent from within the cluster or from another cluster.

[0175] Perception method: Add a control agent to the L2Gateway node. The control agent acts as the OVS controller and sends the flow table to the L2Gateway bridge.

[0176] Flow table design:

[0177] 1. Add an ovs flow table in the direction of traffic from this cluster (the first cluster). The flow table level design is as follows

[0178] Priority A: matches IP packets, corresponding VLANs, and known IP addresses in the cluster, and jumps to the next table.

[0179] Priority A, matches the ARP packet, the corresponding VLAN and the known IP address of the cluster, and jumps to the next table;

[0180] Priority B, matches the IP packet, the corresponding VLAN and the learned virtual IP address and MAC, and jumps to the next table;

[0181] Priority B, matches the ARP packet, the corresponding VLAN and the learned virtual IP address and MAC, and jumps to the next table;

[0182] Priority C matches IP packets, corresponding VLANs and network segments, sends them to the controller, and then jumps to the next table;

[0183] Priority C matches the ARP packet, the corresponding VLAN and network segment, sends it to the controller, and jumps to the next table;

[0184] The priority is A>B>C.

[0185] The priority A flow table (the fourth flow table entry) is mainly used to match known non-virtual IP addresses of the cluster to ensure that no packets are sent to the control center and no other processing is added. Therefore, the addition of this table does not increase additional performance loss.

[0186] The priority B flow table (the third flow table entry) primarily matches the learned virtual IP address of the cluster, including the MAC address. This ensures that if the MAC address corresponding to the virtual IP address is encountered, the control process can be re-sent. This flow table also improves processing performance by preventing the control process from being re-sent once the virtual IP address is learned. This ensures that the control process is only sent for the first packet.

[0187] The flow table of priority C (the first flow table entry) is mainly used to detect the appearance of the virtual IP address and send it to the control processing in a timely manner.

[0188] It should be noted that the flow table of priority B is created only after the flow table of priority C perceives the virtual IP address in this cluster.

[0189] 2. When receiving messages from other clusters (the second cluster), add an OVS flow table before forwarding them to the bridge of this cluster.

[0190] Priority D: matches the IP packet, the corresponding VLAN and the learned virtual IP address, sends it to the controller, and jumps to the next table;

[0191] Priority D, matches the ARP packet, the corresponding VLAN and the learned virtual IP address, sends it to the controller, and jumps to the next table;

[0192] Priority E, jump to the next table;

[0193] Priority D>E;

[0194] The flow table with priority D (the second flow table entry) matches packets from other clusters. Once a packet is sent from another cluster (the second cluster) to the virtual IP address originally in this cluster (the first cluster), it means that the virtual IP address has been switched to another cluster and must be sent to the control for processing in a timely manner.

[0195] Proxy Control Processing:

[0196] Obtain the VLAN, IP, and MAC information of the message based on the message.

[0197] Based on the table of the message sent, determine whether it comes from inside or outside the cluster.

[0198] If the message comes from within the cluster: Add the above priority B and priority D flow tables to the flow table, and add a MAC_binding record to the ovn-sb database. In the MAC_binding record, set the datapath to the datapath of the network, set the logical_port to the port of the l2gateway, and set the IP and MAC addresses according to the message.

[0199] If the packet is from another cluster: In the flow table, delete the flow tables for priority B and priority D related to the IP address. Also check whether ovn-sb has relevant MAC_binding records. If so, delete them.

[0200] MAC_binding record design: The current MAC_binding table is used by router interfaces to record learned MAC addresses. L2gateway interfaces do not learn and record IP and MAC information. Therefore, the design binds IP and MAC addresses to the L2gateway interface, which does not affect the original functional design and facilitates subsequent control plane filtering.

[0201] Control surface design 2:

[0202] Neutron-server uses the ovsdb protocol to monitor changes in the MAC_binding table, focusing only on logical ports that are l2gateway.

[0203] Detecting the addition of a MAC_binding: The IP address is added to the shared database (e.g., ovn-ic-nb) of each cluster, indicating that the IP address is in this cluster. Other clusters, upon detecting the IP address from the shared database, add the corresponding static routes. Check whether the network has a routing interface. If so, update the MAC_binding table associated with the routing interface.

[0204] Detection and MAC_binding deletion: The IP address is deleted from the shared database of each cluster (for example, ovn-ic-nb), indicating that the IP address has been removed from the cluster. After other clusters detect this from the shared database, they delete the corresponding static routes. Check whether the network has a routing interface. If so, delete the MAC_binding table associated with the routing interface.

[0205] The above embodiment provides a solution for implementing virtual IP addresses when interconnecting across clusters. This solution is a common high-availability solution and provides underlying guarantees for cross-cluster deployment in some NFV scenarios, thus improving the competitiveness of cloud products.

[0206] A symmetrical link is designed for cross-cluster access of virtual IP addresses, all of which pass through routers and communicate via OVN-IC. Data plane and control plane awareness are used to promptly inform all clusters of the virtual IP address's location and update relevant controls. A well-designed flow table ensures relevant awareness without compromising forwarding performance.

[0207] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the order of the actions described, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all embodiments of the present application, and the actions involved are not necessarily required by the embodiments of the present application.

[0208] 5 , a block diagram of a device for accessing a virtual IP address across clusters provided in some embodiments of the present application is shown. The device is applied to a gateway node of a first cluster, where the first cluster and the second cluster are connected via a router. The device includes:

[0209] The message matching module 501 is used to match the received message with the flow table; wherein the message carries the virtual IP address and its corresponding MAC address;

[0210] The first static route adding module 502 is used to determine that the virtual IP address drifts to the virtual machine in the first cluster when the message successfully matches the first flow table entry in the flow table, and add a static route corresponding to the virtual IP address on the router of the second cluster according to the virtual IP address and its corresponding MAC address, so that the second cluster can access the virtual IP address in the first cluster.

[0211] In some embodiments of the present application, further comprising:

[0212] The second static route adding module is used to determine that the virtual IP address drifts to the virtual machine in the second cluster when the message successfully matches the second flow table entry in the flow table, delete the static route corresponding to the virtual IP address on the router of the second cluster, and add the static route corresponding to the virtual IP address on the router of the first cluster based on the virtual IP address and its corresponding MAC address.

[0213] In some embodiments of the present application, further comprising:

[0214] a first flow table entry establishing module, configured to establish a first flow table entry in a flow table, wherein the first flow table entry is used to sense the presence of a virtual IP address in the first cluster;

[0215] a second flow table entry establishing module, configured to establish a second flow table entry in the flow table, wherein the second flow table entry is used to sense the presence of the virtual IP address in the second cluster;

[0216] The first flow table entry deletion module is used to delete the second flow table entry.

[0217] In some embodiments of the present application, further comprising:

[0218] The flow entry establishment module is used to establish a first flow entry and a second flow entry in the flow table, the first flow entry is used to sense the presence of the virtual IP address in the first cluster, and the second flow entry is used to sense the presence of the virtual IP address in the second cluster.

[0219] In some embodiments of the present application, the flow table includes a first flow table and a second flow table, the first flow table entry is located in the first flow table, and the second flow table entry is in the second flow table.

[0220] In some embodiments of the present application, further comprising:

[0221] A third flow table entry establishing module, configured to establish a third flow table entry in the first flow table according to the virtual IP address and its corresponding MAC address;

[0222] The third flow table entry deletion module is used to delete the third flow table entry.

[0223] In some embodiments of the present application, further comprising:

[0224] The static routing update module is used to determine that the virtual IP address has drifted in the first cluster when a new message successfully matches the third flow table entry and the MAC address corresponding to the virtual IP address in the new message is different from the MAC address corresponding to the virtual IP address in the third flow table entry, and update the MAC address corresponding to the virtual IP address in the third flow table entry according to the MAC address corresponding to the virtual IP address in the new message.

[0225] In some embodiments of the present application, when the first flow entry and the third flow entry exist at the same time, the packet is matched with the third flow entry first.

[0226] In some embodiments of the present application, the first flow table is pre-established with a fourth flow table entry, and the message matching module includes:

[0227] A first message matching submodule, configured to match the message with the fourth flow table entry when the message is sent by the first cluster;

[0228] An address determination submodule, configured to determine whether the message carries an IP address and its corresponding MAC address if the message successfully matches the fourth flow table entry;

[0229] The second message matching submodule is configured to match the message with the first flow table entry if the message fails to match the fourth flow table entry.

[0230] In some embodiments of the present application, further comprising:

[0231] An information recording module, configured to record the virtual IP address and its corresponding MAC address through a second flow table entry;

[0232] The static routing update module is also used to determine that the virtual IP address has drifted in the second cluster when a new message successfully matches the second flow table entry and the MAC address corresponding to the virtual IP address in the new message is different from the MAC address corresponding to the virtual IP address in the second flow table entry, and update the MAC address corresponding to the virtual IP address in the second flow table entry according to the MAC address corresponding to the virtual IP address in the new message.

[0233] In some embodiments of the present application, the message is an IP message or an ARP message.

[0234] In some embodiments of the present application, the ARP message is broadcast by the virtual machine when the virtual IP address drifts into the virtual machine.

[0235] In some embodiments of the present application, the first static route adding module includes:

[0236] The data adding submodule is used to add the virtual IP address and its corresponding MAC address in the cluster shared database; so that the second cluster can obtain the virtual IP address and its corresponding MAC address from the cluster shared database, and add the static route corresponding to the virtual IP address on the router of the second cluster according to the virtual IP address and its corresponding MAC address.

[0237] In some embodiments of the present application, the second static route adding module includes:

[0238] The data deletion submodule is used to delete the virtual IP address and its corresponding MAC address in the cluster shared database; so that after the second cluster perceives the deletion of the virtual IP address and its corresponding MAC address in the cluster shared database, it deletes the static route corresponding to the virtual IP address on the router of the second cluster.

[0239] In some embodiments of the present application, a static routing table is configured on the router, and the static routing table is used to store static routes corresponding to virtual IP addresses.

[0240] In some embodiments of the present application, the first cluster and the second cluster both include a first router and a second router, the first router is used to implement communication connection between the first cluster and the second cluster, and the second router is used to implement communication connection between virtual machines in the first cluster / second cluster.

[0241] In some embodiments of the present application, further comprising:

[0242] The mapping relationship adding module is used to add a mapping relationship between a virtual IP address and its corresponding MAC address on the second router of the first cluster.

[0243] In some embodiments of the present application, the gateway node is an l2gateway gateway node.

[0244] In some embodiments of the present application, a control agent is deployed in the l2gateway gateway node.

[0245] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0246] In addition, an embodiment of the present application also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and runnable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned data acquisition method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0247] The present application also provides a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, each process of the above-mentioned data acquisition method embodiment is implemented, and the same technical effect is achieved. To avoid repetition, it is not described here. The non-volatile computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0248] FIG6 is a schematic diagram of the hardware structure of an electronic device implementing various embodiments of the present application.

[0249] The electronic device 600 includes but is not limited to components such as a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, a processor 610, and a power supply 611. Those skilled in the art will appreciate that the electronic device structure shown in FIG6 does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown, or combine certain components, or arrange the components differently. In some embodiments of the present application, the electronic device includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle terminal, a wearable device, and a pedometer.

[0250] It should be understood that in some embodiments of the present application, the RF unit 601 may be used to receive and transmit signals during information transmission or calls. Specifically, it receives downlink data from the base station and transmits it to the processor 610 for processing; in addition, it transmits uplink data to the base station. Typically, the RF unit 601 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, and the like. Furthermore, the RF unit 601 may communicate with the network and other devices via a wireless communication system.

[0251] The electronic device provides users with wireless broadband Internet access through the network module 602, such as helping users to send and receive emails, browse web pages, and access streaming media.

[0252] The audio output unit 603 can convert audio data received by the RF unit 601 or the network module 602 or stored in the memory 609 into an audio signal and output it as sound. In addition, the audio output unit 603 can also provide audio output related to a specific function performed by the electronic device 600 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 603 includes a speaker, a buzzer, a receiver, etc.

[0253] The input unit 604 is used to receive audio or video signals. The input unit 604 may include a graphics processing unit (GPU) 6041 and a microphone 6042. The graphics processor 6041 processes image data of a still picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frames can be displayed on the display unit 606. The image frames processed by the graphics processor 6041 can be stored in the memory 609 (or other storage medium) or transmitted via the radio frequency unit 601 or the network module 602. The microphone 6042 can receive sound and process such sound into audio data. The processed audio data can be converted into a format that can be sent to a mobile communication base station via the radio frequency unit 601 in the case of a telephone call mode.

[0254] The electronic device 600 also includes at least one sensor 605, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 6061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 6061 and / or the backlight when the electronic device 600 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 605 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.

[0255] The display unit 606 is used to display information input by the user or information provided to the user. The display unit 606 may include a display panel 6061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0256] The user input unit 607 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the electronic device. Specifically, the user input unit 607 includes a touch panel 6071 and other input devices 6072. The touch panel 6071, also known as a touch screen, can collect user touch operations on or near it (such as operations performed by the user using any suitable object or accessory such as a finger, stylus, etc. on or near the touch panel 6071). The touch panel 6071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction and detects the signal caused by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 610, which receives and executes the command sent by the processor 610. In addition, the touch panel 6071 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 6071, the user input unit 607 may also include other input devices 6072. Specifically, other input devices 6072 may include but are not limited to a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be described in detail here.

[0257] Furthermore, the touch panel 6071 may be overlaid on the display panel 6061. When the touch panel 6071 detects a touch operation on or near it, it transmits the information to the processor 610 to determine the type of touch event. The processor 610 then provides a corresponding visual output on the display panel 6061 based on the type of touch event. Although in FIG6 , the touch panel 6071 and the display panel 6061 are used as two independent components to implement the input and output functions of the electronic device, in some embodiments, the touch panel 6071 and the display panel 6061 may be integrated to implement the input and output functions of the electronic device, which is not limited to this specific embodiment.

[0258] The interface unit 608 is an interface for connecting an external device to the electronic device 600. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 607 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 600, or may be used to transmit data between the electronic device 600 and an external device.

[0259] Memory 609 can be used to store software programs and various data. Memory 609 may primarily include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function (such as a sound playback function or an image playback function); the data storage area may store data generated based on the use of the mobile phone (such as audio data, a phone book, etc.). Furthermore, memory 609 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0260] The processor 610 is the control center of the electronic device. It connects all parts of the electronic device using various interfaces and circuits. By running or executing software programs and / or modules stored in the memory 609 and accessing data stored in the memory 609, it performs various functions of the electronic device and processes data, thereby providing overall monitoring of the electronic device. The processor 610 may include one or more processing units. In some embodiments, the processor 610 may integrate an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into the processor 610.

[0261] The electronic device 600 may also include a power supply 611 (such as a battery) to supply power to each component. In some embodiments, the power supply 611 may be logically connected to the processor 610 through a power management system, thereby enabling the power management system to manage functions such as charging, discharging, and power consumption.

[0262] In addition, the electronic device 600 includes some functional modules not shown, which will not be described here.

[0263] The embodiment of the present application also provides a computer non-volatile readable storage medium, as shown in FIG7 , on which a computer program 701 is stored. When the computer program 701 is executed by the processor, each process of the above-mentioned data acquisition method embodiment is implemented, and the same technical effect is achieved. To avoid repetition, it is not described here. The computer non-volatile readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0264] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0265] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, computer, resource server, air conditioner, or network device, etc.) to execute the methods of each embodiment of the present application.

[0266] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.

[0267] Those skilled in the art will appreciate that the units and algorithmic steps of each example described in conjunction with the embodiments disclosed in some embodiments of this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0268] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0269] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0270] Units described as separate components may or may not be physically separate, and 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0271] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0272] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a resource server, or a network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.

[0273] The above are only specific embodiments of the present application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A method for accessing a virtual IP address across clusters, characterized in that: Applied in a gateway node of a first cluster, the first cluster is connected to a second cluster via a router communication, the method comprising: Matching the received message with the flow table; wherein the message carries the virtual IP address and its corresponding MAC address; In response to the successful match between the message and the first flow table entry in the flow table, it is determined that the virtual IP address has drifted to the virtual machine in the first cluster, and a static route corresponding to the virtual IP address is added on the router of the second cluster based on the virtual IP address and its corresponding MAC address, so that the second cluster can access the virtual IP address in the first cluster.

2. The method according to claim 1, characterized in that After matching the received message with the flow table, the method further includes: In response to a successful match between the message and the second flow table entry in the flow table, it is determined that the virtual IP address has drifted to the virtual machine in the second cluster, the static route corresponding to the virtual IP address on the router of the second cluster is deleted, and the static route corresponding to the virtual IP address is added on the router of the first cluster based on the virtual IP address and its corresponding MAC address.

3. The method according to claim 2, characterized in that Before matching the received message with the flow table, the method further includes: Establishing a first flow table entry in the flow table, where the first flow table entry is used to sense the presence of the virtual IP address in the first cluster; After determining that the virtual IP address has drifted to a virtual machine in the first cluster, the method further includes: Establishing a second flow table entry in the flow table, wherein the second flow table entry is used to sense the presence of the virtual IP address in the second cluster; After determining that the virtual IP address has drifted to the virtual machine in the second cluster, the method further includes: Delete the second flow entry.

4. The method according to claim 2, characterized in that: Before matching the received message with the flow table, the method further includes: A first flow table entry and a second flow table entry are established in the flow table, wherein the first flow table entry is used to sense the presence of the virtual IP address in the first cluster, and the second flow table entry is used to sense the presence of the virtual IP address in the second cluster.

5. The method according to any one of claims 2 to 4, characterized in that: The flow table includes a first flow table and a second flow table, the first flow table entry is located in the first flow table, and the second flow table entry is in the second flow table.

6. The method according to claim 5, characterized in that After determining that the virtual IP address has drifted to a virtual machine in the first cluster, the method further includes: Establishing a third flow table entry in the first flow table according to the virtual IP address and its corresponding MAC address; After determining that the virtual IP address has drifted to the virtual machine in the second cluster, the method further includes: The third flow table entry is deleted.

7. The method according to claim 6, characterized in that After establishing a third flow table entry in the first flow table according to the virtual IP address and the MAC address, the method further includes: In response to a new message successfully matching the third flow table entry, and the MAC address corresponding to the virtual IP address in the new message is different from the MAC address corresponding to the virtual IP address in the third flow table entry, determining that the virtual IP address has drifted in the first cluster, and MAC address, updating the MAC address corresponding to the virtual IP address in the third flow table entry.

8. The method according to claim 6, characterized in that In response to the simultaneous existence of the first flow table entry and the third flow table entry, the message is first matched with the third flow table entry.

9. The method according to claim 5, characterized in that The first flow table is pre-established with a fourth flow table entry, and the matching of the received message with the flow table includes: In response to the message being a message sent by the first cluster, matching the message with the fourth flow table entry; If the message successfully matches the fourth flow table entry, determining that the message carries an IP address and its corresponding MAC address; If the message fails to match the fourth flow table entry, the message is matched with the first flow table entry.

10. The method according to claim 2, characterized in that After determining that the virtual IP address has drifted to the virtual machine in the second cluster, the method further includes: Record the virtual IP address and the corresponding MAC address through the second flow table entry; After adding the static route corresponding to the virtual IP address on the router of the first cluster according to the virtual IP address and the MAC address, the method further includes: In response to a new message successfully matching the second flow table entry, and the MAC address corresponding to the virtual IP address in the new message is different from the MAC address corresponding to the virtual IP address in the second flow table entry, it is determined that the virtual IP address has drifted in the second cluster, and the MAC address corresponding to the virtual IP address in the second flow table entry is updated according to the MAC address corresponding to the virtual IP address in the new message.

11. The method according to claim 1, characterized in that: The message is an IP message or an ARP message.

12. The method according to claim 11, characterized in that The ARP message is broadcasted by the virtual machine when the virtual IP address drifts to the virtual machine.

13. The method according to claim 2, characterized in that The adding a static route corresponding to the virtual IP address on the router of the second cluster according to the virtual IP address and its corresponding MAC address includes: Add the virtual IP address and its corresponding MAC address in the cluster shared database; so that the second cluster obtains the virtual IP address and its corresponding MAC address from the cluster shared database, and adds a static route corresponding to the virtual IP address on the router of the second cluster according to the virtual IP address and its corresponding MAC address.

14. The method according to claim 13, characterized in that The deleting the static route corresponding to the virtual IP address on the router of the second cluster includes: The virtual IP address and its corresponding MAC address are deleted in the cluster shared database, so that the second cluster can sense the deletion of the virtual IP address and its corresponding MAC address in the cluster shared database and delete the static route corresponding to the virtual IP address on the router of the second cluster.

15. The method according to claim 1, characterized in that The router is configured with a static routing table, and the static routing table is used to store the static routes corresponding to the virtual IP address.

16. The method according to claim 1, characterized in that The first cluster and the second cluster both include a first router and a second router, the first router is used to achieve communication connection between the first cluster and the second cluster, and the second router is used to achieve communication connection between virtual machines in the first cluster / the second cluster.

17. The method according to claim 16, characterized in that After determining that the virtual IP address has drifted to a virtual machine in the first cluster, the method further includes: A mapping relationship between the virtual IP address and its corresponding MAC address is added on the second router of the first cluster.

18. A device for accessing a virtual IP address across clusters, characterized in that: Applied in a gateway node of a first cluster, wherein the first cluster is connected to a second cluster through a router communication, including: A message matching module, used to match the received message with the flow table; wherein the message carries a virtual IP address and its corresponding MAC address; The first static route adding module is used to determine that the virtual IP address drifts to the virtual machine in the first cluster in response to the message successfully matching the first flow table entry in the flow table, and add a static route corresponding to the virtual IP address on the router of the second cluster according to the virtual IP address and its corresponding MAC address, so that the second cluster can access the virtual IP address in the first cluster.

19. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 17 when executing the program stored in the memory.

20. A computer non-volatile readable storage medium, characterized in that: Instructions are stored thereon, which, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1 to 17.

Citation Information

Patent Citations

  • Network Device And Method

    CN107040469A

  • Cross-container-cluster access processing device and method

    CN107508795A

  • Method for configuring distributed gateway, open virtual network and storage medium

    CN115277349A

  • Cross-cluster virtual IP address access method and device, electronic equipment and storage medium

    CN115987890A

  • Cross-cloud deployments

    US20210382912A1