IP Library Granted Patent US 12701100
Granted Patent B2
US 12701100 · App. 19/163,614 · Granted Aug 4, 2026

Method and apparatus for accessing a virtual IP address across clusters, electronic device, and storage medium

Inventors: Heng Zhou (Suzhou, CN); Haizhong Qin (Suzhou, CN)
Assignee: SUZHOU METABRAIN INTELLIGENT TECHNOLOGY CO., LTD.
H04L61/5007H04L45/745
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12701100
App. No.
19/163,614
Granted
Aug 4, 2026
Kind
B2
Abstract

A method for accessing a virtual IP address across clusters is provided. The method is applied to a gateway node of a first cluster, where the first cluster is connected to a second cluster through a router, and the method includes: matching a received packet with a flow table, where the packet carries a virtual IP address and a MAC address corresponding to the virtual IP address; and in response to the packet being successfully matched with a first flow entry in the flow table, determining that the virtual IP address drifts into a virtual machine in the first cluster, and adding static routing corresponding to the virtual IP address to a router of the second cluster according to the virtual IP address and the MAC address corresponding to the virtual IP address to enable the second cluster to access the virtual IP address in the first cluster.

Claims (45)

1 . A method for accessing a virtual internet protocol (IP) address across clusters, applied to a gateway node of a first cluster, wherein the first cluster is connected to a second cluster through a router, and the method comprises:

matching a received packet with a flow table, wherein the packet carries a virtual IP address and a media access control (MAC) address corresponding to the virtual IP address; and

in response to the packet being successfully matched with a first flow entry in the flow table, determining that the virtual IP address drifts into a virtual machine in the first cluster, and adding static routing corresponding to the virtual IP address to a router of the second cluster according to the virtual IP address and the MAC address corresponding to the virtual IP address to enable the second cluster to access the virtual IP address in the first cluster.

2 . The method according to claim 1 , wherein after matching the received packet with the flow table, the method further comprises:

in response to the packet being successfully matched with a second flow entry in the flow table, determining that the virtual IP address drifts into a virtual machine in the second cluster, deleting the static routing corresponding to the virtual IP address on the router of the second cluster, and adding the static routing corresponding to the virtual IP address to a router of the first cluster according to the virtual IP address and the MAC address corresponding to the virtual IP address.

3 . The method according to claim 2 , wherein the flow table comprises a first flow table and a second flow table, the first flow entry is located in the first flow table, and the second flow entry is located in the second flow table.

4 . The method according to claim 3 , wherein after determining that the virtual IP address drifts into the virtual machine in the first cluster, the method further comprises:

establishing a third flow entry in the first flow table according to the virtual IP address and the MAC address corresponding to the virtual IP address; and

after determining that the virtual IP address drifts into the virtual machine in the second cluster, the method further comprises:

deleting the third flow entry.

5 . The method according to claim 4 , wherein after establishing the third flow entry in the first flow table according to the virtual IP address and the MAC address, the method further comprises:

in response to a new packet being successfully matched with the third flow entry and a MAC address corresponding to the virtual IP address in the new packet being different from a MAC address corresponding to the virtual IP address in the third flow entry, determining that the virtual IP address drifts in the first cluster, and updating the MAC address corresponding to the virtual IP address in the third flow entry according to the MAC address corresponding to the virtual IP address in the new packet.

6 . The method according to claim 4 , wherein the packet is first matched with the third flow entry in response to a coexistence of the first flow entry and the third flow entry.

7 . The method according to claim 3 , wherein the first flow table is pre-established with a fourth flow entry, and matching the received packet with the flow table comprises:

matching the packet with the fourth flow entry in response to the packet being sent by the first cluster;

determining that the packet carries an IP address and the MAC address corresponding to the IP address under the condition that the matching between the packet and the fourth flow entry succeeds; and

matching the packet with the first flow entry under the condition that the matching between the packet and the fourth flow entry fails.

8 . The method according to claim 2 , wherein adding the static routing corresponding to the virtual IP address to the router of the second cluster according to the virtual IP address and the MAC address corresponding to the virtual IP address comprises:

adding the virtual IP address and the MAC address corresponding to the virtual IP address to a cluster shared database to enable the second cluster to obtain the virtual IP address and the MAC address corresponding to the virtual IP address from the cluster shared database, and adding the static routing corresponding to the virtual IP address to the router of the second cluster according to the virtual IP address and the MAC address corresponding to the virtual IP address.

9 . The method according to claim 8 , wherein deleting the static routing corresponding to the virtual IP address on the router of the second cluster comprises:

deleting the virtual IP address and the MAC address corresponding to the virtual IP address from the cluster shared database to enable the second cluster to delete the static routing corresponding to the virtual IP address on the router of the second cluster after sensing that the virtual IP address and the MAC address corresponding to the virtual IP address in the cluster shared database are deleted.

10 . The method according to claim 2 , wherein before matching the received packet with the flow table, the method further comprises:

establishing the first flow entry in the flow table, wherein the first flow entry is configured to sense an occurrence of the virtual IP address in the first cluster;

after determining that the virtual IP address drifts into the virtual machine in the first cluster, the method further comprises:

establishing the second flow entry in the flow table, wherein the second flow entry is configured to sense an occurrence of the virtual IP address in the second cluster; and

after determining that the virtual IP address drifts into the virtual machine in the second cluster, the method further comprises:

deleting the second flow entry.

11 . The method according to claim 2 , wherein before matching the received packet with the flow table, the method further comprises:

establishing the first flow entry and the second flow entry in the flow table, wherein the first flow entry is configured to sense an occurrence of the virtual IP address in the first cluster, and the second flow entry is configured to sense an occurrence of the virtual IP address in the second cluster.

12 . The method according to claim 2 , wherein after determining that the virtual IP address drifts into the virtual machine in the second cluster, the method further comprises:

recording the virtual IP address and the MAC address corresponding to the virtual IP address through the second flow entry; and

after adding the static routing corresponding to the virtual IP address to the router of the first cluster according to the virtual IP address and the MAC address, the method further comprises:

in response to a new packet being successfully matched with the second flow entry and a MAC address corresponding to the virtual IP address in the new packet being different from a MAC address corresponding to the virtual IP address in the second flow entry, determining that the virtual IP address drifts in the second cluster, and updating the MAC address corresponding to the virtual IP address in the second flow entry according to the MAC address corresponding to the virtual IP address in the new packet.

13 . The method according to claim 1 , wherein the packet comprises an IP packet or an address resolution protocol (ARP) packet.

14 . The method according to claim 13 , wherein the ARP packet is broadcast by the virtual machine when the virtual IP address drifts into the virtual machine.

15 . The method according to claim 1 , wherein each of the first cluster and the second cluster comprises a first router and a second router, wherein the first router is configured to realize communication connection between the first cluster and the second cluster, and the second router is configured to realize communication connection between virtual machines in the first cluster or the second cluster.

16 . The method according to claim 15 , wherein after determining that the virtual IP address drifts into the virtual machine in the first cluster, the method further comprises:

adding a mapping relationship between the virtual IP address and the MAC address corresponding to the virtual IP address to the second router of the first cluster.

17 . 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 through the communication bus;

the memory is configured to store computer programs; and

the processor is configured to implement the method according to claim 1 when executing the computer programs stored on the memory.

18 . The electronic device according to claim 17 , wherein the processor is further configured to implement operations comprising:

in response to the packet being successfully matched with a second flow entry in the flow table, determining that the virtual IP address drifts into a virtual machine in the second cluster, deleting the static routing corresponding to the virtual IP address on the router of the second cluster, and adding the static routing corresponding to the virtual IP address to a router of the first cluster according to the virtual IP address and the MAC address corresponding to the virtual IP address.

19 . The method according to claim 1 , wherein the router is configured with a static routing table, and the static routing table is configured to store the static routing corresponding to the virtual IP address.

20 . A computer non-transitory readable storage medium having instructions stored thereon, wherein the instructions, when executed by one or more processors, cause the processors to perform the method according to claim 1 .