CN110913028B - Method, device and system for processing virtual address - Google Patents

Method, device and system for processing virtual address Download PDF

Info

Publication number
CN110913028B
CN110913028B CN201811076704.1A CN201811076704A CN110913028B CN 110913028 B CN110913028 B CN 110913028B CN 201811076704 A CN201811076704 A CN 201811076704A CN 110913028 B CN110913028 B CN 110913028B
Authority
CN
China
Prior art keywords
virtual
address
physical machine
virtual switch
machine
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811076704.1A
Other languages
Chinese (zh)
Other versions
CN110913028A (en
Inventor
胡宝海
顾琪玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201811076704.1A priority Critical patent/CN110913028B/en
Publication of CN110913028A publication Critical patent/CN110913028A/en
Application granted granted Critical
Publication of CN110913028B publication Critical patent/CN110913028B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • H04L61/103Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5053Lease time; Renewal aspects

Abstract

The application discloses a method, a device and a system for processing a virtual address. Wherein, the method comprises the following steps: the virtual switch carries out address resolution protocol statistics on the virtual address to obtain a statistic value; the virtual switch acquires a physical machine corresponding to the virtual address from the data forwarding gateway; and the virtual switch processes the virtual machine based on the physical machine corresponding to the statistical value and the virtual address. The method and the device solve the technical problem that the processing method of the virtual address in the prior art is low in efficiency.

Description

Method, device and system for processing virtual address
Technical Field
The present application relates to the field of private networks, and in particular, to a method, an apparatus, and a system for processing a virtual address.
Background
An advanced functionality failover that enterprise users typically use in conventional networks. One key technology for implementing failover is that two or more nodes notify the host in the subnet and the mac Address corresponding to the virtual IP of the routing switching device that a switch has occurred by using a broadcast free ARP (Address Resolution Protocol). However, most cloud manufacturers do not support the broadcast function of gratuitous ARP in a VPC environment after adopting an SDN (Software Defined Network) architecture.
In order to meet the above requirements of conventional enterprise users, the prior art provides an ec2aws command line toolkit, and when a problem occurs in monitoring, a user calls these APIs (Application Programming interfaces) to move a second private IP on a eni network card (elastic network card) among multiple ec2 instances, but based on the above scheme, virtual IP address switching needs a long time, which may be up to 30-45 seconds or longer.
Aiming at the problem of low efficiency of the processing method of the virtual address in the prior art, an effective solution is not provided at present.
Disclosure of Invention
The embodiment of the application provides a method, a device and a system for processing a virtual address, so as to at least solve the technical problem that the processing method of the virtual address in the prior art is low in efficiency.
According to an aspect of the embodiments of the present application, there is provided a method for processing a virtual address, including: the virtual switch carries out address resolution protocol statistics on the virtual address to obtain a statistic value; the virtual switch acquires a physical machine corresponding to the virtual address from the data forwarding gateway; and the virtual switch processes the virtual machine based on the physical machine corresponding to the statistic value and the virtual address.
According to another aspect of the embodiments of the present application, there is also provided an apparatus for processing a virtual address, including: the statistical module is used for carrying out address resolution protocol statistics on the virtual address to obtain a statistical value; the acquisition module is used for acquiring a physical machine corresponding to the virtual address from the data forwarding gateway; and the processing module is used for processing the virtual machine based on the physical machine corresponding to the statistical value and the virtual address.
According to another aspect of the embodiments of the present application, there is also provided a virtual address processing system, including: the data forwarding gateway is used for storing the corresponding relation between the virtual address and the physical machine; and the virtual switch is used for carrying out address resolution protocol statistics on the virtual address to obtain a statistical value, acquiring a physical machine corresponding to the virtual address from the data forwarding gateway, and processing the virtual machine based on the statistical value and the physical machine corresponding to the virtual address.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program, wherein when the program runs, a device on which the storage medium is located is controlled to perform the following steps: the virtual switch carries out address resolution protocol statistics on the virtual address to obtain a statistic value; the virtual switch acquires a physical machine corresponding to the virtual address from the data forwarding gateway; and the virtual switch processes the virtual machine based on the physical machine corresponding to the statistic value and the virtual address.
According to another aspect of the embodiments of the present application, there is also provided a mobile device, including: a processor for executing the program, wherein the following steps are performed when the program is executed: the virtual switch carries out address resolution protocol statistics on the virtual address to obtain a statistic value; the virtual switch acquires a physical machine corresponding to the virtual address from the data forwarding gateway; and the virtual switch processes the virtual machine based on the physical machine corresponding to the statistic value and the virtual address.
According to another aspect of the embodiments of the present application, there is also provided a virtual address processing system, including: a processor; and a memory coupled to the processor for providing instructions to the processor for processing the following processing steps: the virtual switch carries out address resolution protocol statistics on the virtual address to obtain a statistic value; the virtual switch acquires a physical machine corresponding to the virtual address from the data forwarding gateway; and the virtual switch processes the virtual machine based on the physical machine corresponding to the statistic value and the virtual address.
In the embodiment of the application, the virtual switch performs address resolution protocol statistics on the virtual address to obtain a statistical value, acquires the physical machine corresponding to the virtual address from the data forwarding gateway, and further processes the virtual machine based on the statistical value and the physical machine corresponding to the virtual address to achieve the purpose of fast switching of the virtual address. It is easy to notice that the virtual switch processes the virtual machines according to the statistical value counted by the address resolution protocol and the physical machines corresponding to the virtual addresses acquired from the data forwarding gateway, compared with the prior art, the control system does not need to manage/query the states of each virtual machine and the havip at regular time, the arp statistical method is faster than the AWS toolkit, and the arp statistical function and the state comparison are realized through the virtual switch, the load of the control system cannot increase exponentially, so that the inconsistency of the experience is reduced, the identity recognition accuracy is improved, and the technical effect of the experience of the user is improved. Therefore, the technical problem that the processing method of the virtual address in the prior art is low in efficiency is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a block diagram of a hardware structure of a computer terminal (or a mobile device) for implementing a processing method of a virtual address according to an embodiment of the present application;
fig. 2 is a schematic diagram of a computer terminal as a transmitting end according to an embodiment of the present application;
FIG. 3 is a flow chart of a method for processing a virtual address according to an embodiment of the present application;
FIG. 4 is a diagram illustrating an alternative call sequence for a havip handoff according to an embodiment of the present application;
FIG. 5 is a flow diagram of an alternative daemon working logic according to an embodiment of the application;
FIG. 6 is a schematic diagram of a virtual address processing apparatus according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a virtual address processing system according to an embodiment of the present application; and
fig. 8 is a block diagram of a computer terminal according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
First, some terms or terms appearing in the description of the embodiments of the present application are applicable to the following explanations:
virtual switch: in the Private network vpc (virtual Private cloud), it is used to connect different virtual machines.
A network computer: the Network Computer, NC, belongs to thin client, and the server provides programs or storage on the Network.
ARP free: different from a general ARP request, the ARP request is a special message, a source IP address and a destination IP address carried in the message are both local IP addresses, a source mac address is a local mac address, and a destination mac address is a broadcast mac address of all 0.
XGW: and the X Gateway is used for representing various gateways for processing data forwarding of the VPC network node.
Example 1
There is also provided, in accordance with an embodiment of the present application, an embodiment of a method for processing a virtual address, where it is noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer-executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
The method provided by the embodiment 1 of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Fig. 1 shows a hardware configuration block diagram of a computer terminal (or mobile device) for implementing a processing method of a virtual address. As shown in fig. 1, the computer terminal 10 (or mobile device 10) may include one or more (shown as 102a, 102b, … …, 102 n) processors 102 (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. Besides, the method can also comprise the following steps: a display, an input/output interface (I/O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of the I/O interface), a network interface, a power source, and/or a camera. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the electronic device. For example, the computer terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
It should be noted that the one or more processors 102 and/or other data processing circuitry described above may be referred to generally herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part in software, hardware, firmware, or any combination thereof. Further, the data processing circuit may be a single stand-alone processing module, or incorporated in whole or in part into any of the other elements in the computer terminal 10 (or mobile device). As referred to in the embodiments of the application, the data processing circuit acts as a processor control (e.g. selection of a variable resistance termination path connected to the interface).
The memory 104 may be used to store software programs and modules of application software, such as program instructions/data storage devices corresponding to the virtual address processing method in the embodiment of the present application, and the processor 102 executes various functional applications and data processing, i.e., implements the virtual address processing method described above, by running the software programs and modules stored in the memory 104. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
The display may be, for example, a touch screen type Liquid Crystal Display (LCD) that may enable a user to interact with a user interface of the computer terminal 10 (or mobile device).
Fig. 1 shows a block diagram of a hardware structure, which may be taken as an exemplary block diagram of not only the computer terminal 10 (or the mobile device) described above, but also an exemplary block diagram of the server described above, and in an alternative embodiment, fig. 2 shows an embodiment in which the computer terminal 10 (or the mobile device) shown in fig. 1 is taken as a block diagram, and the embodiment uses the computer terminal 10 (or the mobile device) described above as a sending end. As shown in fig. 2, the computer terminal 10 (or mobile device) may be connected via a data network connection or electronically to one or more servers, such as a cloud server. In an alternative embodiment, the computer terminal 10 (or mobile device) may be any mobile computing device or the like. The data network connection may be a local area network connection, a wide area network connection, an internet connection, or other type of data network connection. The computer terminal 10 (or mobile device) may execute to connect to a network service executed by a server (e.g., a secure server) or a group of servers. A web server is a network-based user service such as social networking, cloud resources, email, online payment, or other online applications.
Under the above operating environment, the present application provides a processing method of virtual addresses as shown in fig. 3. Fig. 3 is a flowchart of a processing method of a virtual address according to an embodiment of the present application. As shown in fig. 3, the method includes:
step S32, the virtual switch performs address resolution protocol statistics on the virtual address to obtain a statistical value.
Specifically, as with the ASW, a High available virtual address (height VIP) may be regarded as a secondary private ip of the virtual machine instance, but in order to implement fast switching of the height, the virtual switch may count the arp on the height, so as to determine whether the height is on a virtual machine in the physical machine where the virtual switch is located, that is, whether the height belongs to the virtual machine. For example, the virtual switch may send an arp-request message to the virtual machine at regular time, and if the havip belongs to the virtual machine, the virtual switch may reply the arp-request message to the virtual switch, so that the virtual switch may perform arp statistics on the arp-request message to obtain a statistical value of the arp statistics.
In step S34, the virtual switch acquires the physical machine corresponding to the virtual address from the data forwarding gateway.
Specifically, the data forwarding gateway may be XGW, and the physical machine may be an NC in the private network VPC. XGW stores vm-nc list, that is, XGW stores the corresponding relationship between havip and nc. The virtual switch can acquire which physical machine the havip is on by querying XGW, so that whether the state of the havip managed by the control system is consistent with the internal state of the virtual machine can be determined without the need for the control system to manage/query the state of each virtual machine and the state of the havip by itself.
Step S36, the virtual switch processes the virtual machine based on the physical machine corresponding to the statistical value and the virtual address.
Specifically, the virtual switch may determine whether a havip belongs to the virtual machine through a statistical value of arp statistics, thereby determining whether the virtual machine is in a master state or a slave state, and further process the virtual machine or other virtual machines according to the statistical value, so as to ensure that all virtual machines in the slave state can know an ip address of the virtual machine in the master state.
In addition, the virtual switch can process the control system through the statistical value of the arp statistics and the obtained physical machine where the havip is located, so that the state managed by the control system is consistent with the state in the virtual machine.
It should be noted that, the execution sequence of the step S32 and the step S34 may be to execute the step S32 first and then execute the step S34, or execute the step S32 and the step S34 at the same time, which is not specifically limited in this application.
In the method provided in embodiment 1 of the present application, the virtual switch performs address resolution protocol statistics on the virtual address to obtain a statistical value, and obtains a physical machine corresponding to the virtual address from the data forwarding gateway, and further processes the virtual machine based on the statistical value and the physical machine corresponding to the virtual address, so as to achieve the purpose of fast switching of the virtual address.
It is easy to notice that the virtual switch processes the virtual machines according to the statistical value counted by the address resolution protocol and the physical machines corresponding to the virtual addresses acquired from the data forwarding gateway, compared with the prior art, the control system does not need to manage/query the states of each virtual machine and the havip at regular time, the arp statistical method is faster than the AWS toolkit, and the arp statistical function and the state comparison are realized through the virtual switch, the load of the control system cannot increase exponentially, so that the inconsistency of the experience is reduced, the identity recognition accuracy is improved, and the technical effect of the experience of the user is improved.
Therefore, the solution of embodiment 1 provided by the present application solves the technical problem that the processing method of the virtual address in the prior art is low in efficiency.
In the above embodiments of the present application, the method further includes the following steps:
in step S362, the virtual switch determines whether the statistic is greater than a preset value, and whether the physical machine corresponding to the virtual address is the physical machine to which the virtual switch belongs.
Specifically, a preset value may be set according to an experiment to distinguish whether a havip belongs to the virtual machine, for example, the virtual switch sends an arp-request packet to the virtual machine at regular time, and since the virtual machine does not reply the arp-reply packet when the havip does not belong to the virtual machine, a statistical value of arp statistics obtained by the virtual switch is 0. Therefore, the above preset value may be 0.
Step S364, if the statistic value is greater than the preset value, the virtual switch processes the virtual machine.
Specifically, if the statistical value of the arp statistics is greater than 0, it indicates that the virtual switch receives an arp-reply packet sent by the virtual machine, that is, the havip belongs to the virtual machine, and it may be further determined that the virtual machine is in a master state and other virtual machines are in a slave state, so that the virtual switch may only process the virtual machine in the slave state.
Optionally, when the statistical value is less than or equal to the preset value, the virtual switch does not process the virtual machine or the control system.
Specifically, if the statistical value of the arp statistics is 0, it indicates that the virtual switch has not received an arp-reply packet sent by the virtual machine, that is, the havip does not belong to the virtual machine, and it may be further determined that the virtual machine is in a slave state, and the virtual switch does not perform any processing.
Step S366, if the statistical value is greater than the preset value and the physical machine corresponding to the virtual address is not the physical machine to which the virtual switch belongs, the virtual switch processes the control system.
Specifically, since the virtual switch does not perform any processing when the statistical value of the arp statistics is 0, it may be further determined whether the physical machine where the havip is located is the physical machine where the virtual switch is located, that is, whether the havip is located on the physical machine, when the statistical value of the arp statistics is greater than 0. If the physical machine is in the control system, the state managed by the control system is consistent with the state in the virtual machine. Otherwise, the state of the control system is not updated, so that the virtual switch can process the control system and update the state of the control system.
In the above embodiment of the present application, in step S364, the virtual switch processes the virtual machine, including:
step S3642, the virtual switch determines that the virtual machine corresponding to the virtual address is in the master state, and sends a notification message to the virtual machine in the slave state, where the notification message includes: and the network address of the virtual machine corresponding to the virtual address.
Specifically, the notification message may be a havinpnotify message, where the message carries an ip address of the virtual machine in the master state. Under the condition that the statistical value of the arp statistics is greater than 0, the virtual switch can determine the virtual machine corresponding to the havip, that is, the virtual machine to which the havip belongs is in the master state, and simultaneously send a havip notification message to notify the virtual machine in the slave state and notify the ip address of the virtual machine in the master state.
It should be noted that, if the virtual switch continuously determines that the statistical value of the arp statistics is greater than 0, the virtual switch continuously sends a havip notify message to the physical machine where the slave virtual machine is located.
In the above embodiment of the present application, after receiving the notification packet, the slave-state virtual machine configures a relay route in the physical machine to which the virtual machine belongs, where the relay route forwards the received packet to the physical machine to which the virtual machine belongs.
Alternatively, the data packet may be sent by a physical machine that does not update the virtual machine location cache.
Specifically, in order to further reduce the switching time of the havip, after receiving the havip notify message, the virtual machine may configure a relay route in the local physical machine, where the relay route may relay a data packet that is sent by the VM-location cache and is not updated in time, and forward the data packet to the NC where the VM is located in the state of the mater. Therefore, when failover occurs, the physical machine which is not in time to update the traffic sent to the virtual machine in the slave state can be forwarded to the virtual machine in the master state again.
It should be noted that, the virtual machine in the master state may configure a direct route in the local physical machine where the virtual machine is located, and point the location of the havip to the virtual machine.
In the above embodiment of the present application, in step S366, the virtual switch processes the control system, including:
step S3662, the virtual switch sends a call request to the control system, where after receiving the call request, the control system controls the physical machine corresponding to the virtual address in the data forwarding gateway to update to the physical machine to which the virtual switch belongs.
Specifically, when the virtual switch determines that the state of the control system is not updated, the virtual switch may call an API of the control system to notify the update state of the control system, and after receiving the call request, the control system may allocate the dispatch to XGW, and direct the location of the havip to the physical machine. The virtual switch detects that the states of the two are consistent in the subsequent time, and therefore the API notification management and control are not called any more.
In the above embodiment of the present application, in step S32, the virtual switch performs address resolution protocol statistics on the virtual address to obtain a statistical value, including:
step S322, the virtual switch sends an address resolution protocol request to the virtual machine corresponding to the virtual address.
In step S324, the virtual switch receives an arp response returned by the virtual machine based on the arp request.
Step S326, the virtual switch obtains a statistic value based on the address resolution protocol response.
Specifically, on a data level, the virtual machine sends an arp-request message to the virtual machine, and queries whether the havip is on the virtual machine. If the virtual machine replies an arp-reply message to the virtual switch, the virtual switch can obtain the statistical value of arp statistics according to whether the arp-reply message is received or not, and if the arp-reply message is received, the statistical value is greater than 0; and if the arp-reply message is not received, the statistic value is 0.
In the above embodiment of the present application, the method further includes:
in step S38, the virtual switch obtains the gratuitous arp packet sent by the virtual machine.
Step S310, the virtual switch processes the virtual machine based on the toll free address resolution protocol data packet.
Specifically, when failover occurs, the virtual machine may also actively send a free arp packet, and the virtual switch can capture the event, so that after receiving the free arp, the virtual switch may send a havingnotify message to notify the virtual machine in the slave state, and notify the ip address of the virtual machine in the master state.
It should be noted that, if the virtual switch continuously receives a free arp, the virtual switch continuously sends a havip notify message to the physical machine where the virtual machine in the slave state is located.
In the above embodiment of the present application, the other physical machines except the physical machine to which the virtual switch belongs obtain the physical machine corresponding to the virtual address from the data forwarding gateway, and update the virtual machine location caches in the other physical machines.
Specifically, other physical machines on the VPC may periodically query XGW for the physical machine where the havip is located, and thus, a time later, the vm-location cache on the physical machine is also updated, so that the traffic can be sent to the new physical machine.
In the above embodiment of the present application, the virtual switch performs address resolution protocol statistics on the virtual address through the started preset process, so as to obtain a statistical value.
Specifically, the preset process may be a daemon process started by the virtual switch in the user mode, and the daemon process may collect statistics of arp statistics of havip.
In the above embodiments of the present application, the virtual switch performs address resolution protocol statistics on the virtual address at regular time, and obtains the physical machine corresponding to the virtual address at regular time.
Specifically, the virtual switch may send an arp-request message to the virtual machine at intervals of 10 seconds, and collect statistics of arp statistics of havip through the daemon. Meanwhile, the virtual switch will periodically query XGW for the physical machine where havip is located.
In the above embodiments of the present application, the virtual switch receives virtual address information sent by the control system, where the virtual address information is sent by the control system when a node is added or deleted.
Specifically, for each havip, the control system issues the havip information to the virtual switch on the physical machine when the user adds or deletes the ha node. For a havip under a single VPC, information for a group of havips (node1, node2 …) is available.
For example, fig. 4 shows the call sequence when a havip switch occurs, and as shown in fig. 4, the ip address of NC1 is 10.10.10.1, the ip address of NC2 is 10.10.10.2, the ip address of ECS1 on NC1 is 192.168.0.1, and the ip address of ECS3 on NC2 is 192.168.0.2. ECS1 on NC1 is in the master state and ECS1 on NC2 is in the slave state, so that the virtual switch on NC1 can send a havip notify to NC2, informing that the ip address of the virtual machine in the master state is 192.168.0.1. In addition, NC1 adds a direct route havip locally to ECS1 on NC1, and NC2 adds a relay route havip locally to ECS1 on NC 1. Meanwhile, the virtual switch on NC1 may inform the controller with call-api, VPC controller updates the vm-NC table on XGW, pointing the location of havip to ECS1 in NC1, vm-NC table is updated to 192.168.0.1 on 10.10.10.1. In addition, NC1 and NC2 may synchronize vm-location to XGW.
As can be seen from the above, when a havip switch occurs, all the operations are completed by each physical machine NC, and the VPC controller (i.e., the control system described above) only needs to update the vm-NC table on XGW after the API is called.
As shown in fig. 5, the daemon process work logic on the virtual switch is as follows: the virtual switch sends arp-request to the virtual machine at regular time, and statistics are collected; at the same time, the virtual switch synchronizes vm-location state from XGW in time. If the arp statistic is larger than 0, continuously sending a havip notify notification to an NC where the VM in the slave state is located, and locally adding a havip- > VM route; meanwhile, if the havip is not on the physical machine, calling a controller API to update the vm-nc table on XGW; if havip is on the physical machine, it is determined that the controller state is up-to-date and no processing is required. And if the arp statistic is equal to 0, adding a relay route after receiving the havip notify notification, and meanwhile, determining that the state of the controller is up-to-date no matter whether the havip is on the physical machine or not, and not needing any processing.
By the scheme, the method for fast switching the havip based on the ARP statistics and the relay routing is simple in structure, the switching time can be controlled within 5 seconds, the switching time is obviously shortened, and the controller is only responsible for informing XGW of the state when switching is performed again, so that the load is not exponentially increased, and large-scale virtual IP service can be provided in the environment of a cloud network.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
Example 2
According to an embodiment of the present application, there is also provided a virtual address processing apparatus for implementing the virtual address processing method, as shown in fig. 6, the apparatus 600 includes: a statistics module 602, an acquisition module 604, and a processing module 606.
The statistical module 602 is configured to perform address resolution protocol statistics on the virtual address to obtain a statistical value; the obtaining module 604 is configured to obtain a physical machine corresponding to the virtual address from the data forwarding gateway; the processing module 606 is configured to process the virtual machine based on the physical machine corresponding to the statistical value and the virtual address.
Specifically, the data forwarding gateway may be XGW, and the physical machine may be an NC in the private network VPC. XGW stores vm-nc list, that is, XGW stores the corresponding relationship between havip and nc.
It should be noted here that the statistical module 602, the obtaining module 604, and the processing module 606 correspond to steps S32 to S36 in embodiment 1, and the three modules are the same as the corresponding steps in the implementation example and application scenario, but are not limited to the disclosure in embodiment 1. It should be noted that the above modules may be operated in the computer terminal 10 provided in embodiment 1 as a part of the apparatus.
In the method provided by embodiment 2 of the present application, the virtual switch performs address resolution protocol statistics on the virtual address through the statistics module to obtain a statistical value, and obtains the physical machine corresponding to the virtual address from the data forwarding gateway through the acquisition module, and further processes the virtual machine through the processing module based on the statistical value and the physical machine corresponding to the virtual address, so as to achieve the purpose of fast switching of the virtual address.
It is easy to notice that the virtual switch processes the virtual machines according to the statistical value counted by the address resolution protocol and the physical machines corresponding to the virtual addresses acquired from the data forwarding gateway, compared with the prior art, the control system does not need to manage/query the states of each virtual machine and the havip at regular time, the arp statistical method is faster than the AWS toolkit, and the arp statistical function and the state comparison are realized through the virtual switch, the load of the control system cannot increase exponentially, so that the inconsistency of the experience is reduced, the identity recognition accuracy is improved, and the technical effect of the experience of the user is improved.
Therefore, the solution of the foregoing embodiment 2 provided by the present application solves the technical problem that the processing method of the virtual address in the prior art is low in efficiency.
In the above embodiment of the present application, the apparatus further includes: the device comprises a judgment submodule, a first processing submodule and a second processing submodule.
The judging submodule is used for judging whether the statistical value is larger than a preset value or not and whether the physical machine corresponding to the virtual address is the physical machine to which the virtual switch belongs or not; the first processing submodule is used for processing the virtual machine if the statistic value is larger than a preset value; and the second processing submodule is used for processing the control system if the statistical value is greater than the preset value and the physical machine corresponding to the virtual address is not the physical machine to which the virtual switch belongs.
Specifically, a preset value may be set according to an experiment, so as to distinguish whether the havip belongs to the virtual machine, for example, the virtual switch sends an arp-request message to the virtual machine at regular time, because the virtual machine does not reply the arp-request message when the havip does not belong to the virtual machine, the statistical value of the arp statistics obtained by the virtual switch is 0. Therefore, the above preset value may be 0.
Optionally, the apparatus further comprises: and a third processing submodule.
And the third processing submodule is used for not processing the virtual machine or the control system when the statistical value is less than or equal to the preset value.
It should be noted here that the above-mentioned determining sub-module, the first processing sub-module and the second processing sub-module correspond to steps S362 to S366 in embodiment 1, and the three sub-modules are the same as the corresponding steps in the implementation example and application scenario, but are not limited to the disclosure in embodiment 1. It should be noted that the above modules may be operated in the computer terminal 10 provided in embodiment 1 as a part of the apparatus.
In the foregoing embodiment of the present application, the first processing sub-module is configured to further determine that a virtual machine corresponding to the virtual address is in a master state, and send a notification message to the virtual machine in a slave state, where the notification message includes: and the network address of the virtual machine corresponding to the virtual address.
It should be noted here that the above-mentioned first processing sub-module corresponds to step S3642 in embodiment 1, and the sub-module is the same as the example and application scenario realized by the corresponding step, but is not limited to the disclosure of embodiment 1. It should be noted that the above modules may be operated in the computer terminal 10 provided in embodiment 1 as a part of the apparatus.
In the above embodiment of the present application, the second processing sub-module includes: and a sending unit.
The sending unit is used for sending a call request to the control system, wherein the control system controls the physical machine corresponding to the virtual address in the data forwarding gateway to be updated to the physical machine to which the virtual switch belongs after receiving the call request.
It should be noted here that the above-mentioned sending unit corresponds to step S3662 in embodiment 1, and the unit is the same as the example and application scenario realized by the corresponding step, but is not limited to the disclosure of embodiment 1. It should be noted that the above modules may be operated in the computer terminal 10 provided in embodiment 1 as a part of the apparatus.
In the above embodiments of the present application, the statistical module includes: the device comprises a sending submodule, a receiving submodule and a counting submodule.
The sending submodule is used for sending an address resolution protocol request to a virtual machine corresponding to the virtual address; the receiving submodule is used for receiving an address resolution protocol response returned by the virtual machine based on the address resolution protocol request; the statistic submodule is used for responding based on the address resolution protocol to obtain a statistic value.
It should be noted here that the sending submodule, the receiving submodule, and the statistics submodule correspond to steps S322 to S326 in embodiment 1, and the three submodules are the same as the corresponding steps in the implementation example and application scenario, but are not limited to the disclosure in embodiment 1. It should be noted that the above modules may be operated in the computer terminal 10 provided in embodiment 1 as a part of the apparatus.
In the above embodiment of the present application, the obtaining module is further configured to obtain a free arp data packet sent by the virtual machine; the processing module is further used for processing the virtual machine based on the free address resolution protocol data packet.
It should be noted here that the above-mentioned acquiring module and processing module correspond to step S38 to step S310 in embodiment 1, and the two sub-modules are the same as the example and application scenarios realized by the corresponding steps, but are not limited to the disclosure of embodiment 1. It should be noted that the above modules may be operated in the computer terminal 10 provided in embodiment 1 as a part of the apparatus.
In the embodiment of the present application, the statistics module is configured to perform address resolution protocol statistics on the virtual address through the started preset process to obtain a statistical value.
In the above embodiment of the present application, the statistical module is configured to perform address resolution protocol statistics on the virtual address at regular time; the acquisition module is used for acquiring the physical machine corresponding to the virtual address at regular time.
In the above embodiment of the present application, the apparatus further includes: and a receiving module.
The receiving module is further configured to receive virtual address information sent by the control system, where the virtual address information is sent by the control system when a node is added or deleted.
Example 3
According to an embodiment of the present application, there is also provided a system for processing a virtual address, as shown in fig. 7, the system including: a data forwarding gateway 72, a virtual switch 74, and a virtual machine 76.
The data forwarding gateway 72 is configured to store a corresponding relationship between a virtual address and a physical machine; the virtual switch 74 is configured to perform address resolution protocol statistics on the virtual address to obtain a statistical value, acquire a physical machine corresponding to the virtual address from the data forwarding gateway, and process the virtual machine 76 based on the statistical value and the physical machine corresponding to the virtual address.
Specifically, like the ASW, a high available virtual address (havip) may be regarded as a secondary private ip of the virtual machine instance, but to implement fast switching of the havip, the virtual switch may count the arp on the havip, so as to determine whether the havip is on a virtual machine in the physical machine where the virtual switch is located, that is, whether the havip belongs to the virtual machine. For example, the virtual switch may send an arp-request message to the virtual machine at regular time, and if the havip belongs to the virtual machine, the virtual switch may reply the arp-request message to the virtual switch, so that the virtual switch may perform arp statistics on the arp-request message to obtain a statistical value of the arp statistics.
The data forwarding gateway may be XGW and the physical machine may be an NC in the private network VPC. XGW stores vm-nc list, that is, XGW stores the corresponding relationship between havip and nc. The virtual switch can acquire which physical machine the havip is on by querying XGW, so that whether the state of the havip managed by the control system is consistent with the internal state of the virtual machine can be determined without the need for the control system to manage/query the state of each virtual machine and the state of the havip by itself.
The virtual switch can determine whether the havip belongs to the virtual machine through the statistical value of the arp statistics, thereby determining whether the virtual machine is in a master state or a slave state, and further processing the virtual machine or other virtual machines according to the statistical value to ensure that all the virtual machines in the slave state can know the ip address of the virtual machine in the master state.
In addition, the virtual switch can process the control system through the statistical value of the arp statistics and the obtained physical machine to which the havip belongs, so that the state managed by the control system is consistent with the state in the virtual machine.
In the method provided by the foregoing embodiment 3 of the present application, the virtual switch performs address resolution protocol statistics on the virtual address to obtain a statistical value, and obtains a physical machine corresponding to the virtual address from the data forwarding gateway, and further processes the virtual machine based on the statistical value and the physical machine corresponding to the virtual address, so as to achieve the purpose of fast switching of the virtual address.
It is easy to notice that the virtual switch processes the virtual machines according to the statistical value counted by the address resolution protocol and the physical machines corresponding to the virtual addresses acquired from the data forwarding gateway, compared with the prior art, the control system does not need to manage/query the states of each virtual machine and the havip at regular time, the arp statistical method is faster than the AWS toolkit, and the arp statistical function and the state comparison are realized through the virtual switch, the load of the control system cannot increase exponentially, so that the inconsistency of the experience is reduced, the identity recognition accuracy is improved, and the technical effect of the experience of the user is improved.
Therefore, the solution of the above embodiment 3 provided by the present application solves the technical problem that the processing method of the virtual address in the prior art is low in efficiency.
In the above embodiment of the present application, the virtual switch is configured to determine whether the statistic value is greater than the preset value, and whether the physical machine corresponding to the virtual address is a physical machine to which the virtual switch belongs, if the statistic value is greater than the preset value, the virtual machine is processed, and if the statistic value is greater than the preset value, and the physical machine corresponding to the virtual address is not a physical machine to which the virtual switch belongs, the control system is processed.
Specifically, a preset value may be set according to an experiment, so as to distinguish whether the havip belongs to the virtual machine, for example, the virtual switch sends an arp-request message to the virtual machine at regular time, because the virtual machine does not reply the arp-request message when the havip does not belong to the virtual machine, the statistical value of the arp statistics obtained by the virtual switch is 0. Therefore, the above preset value may be 0.
If the statistical value of the arp statistics is greater than 0, it indicates that the virtual switch receives an arp-reply message sent by the virtual machine, that is, the havip belongs to the virtual machine, and it can be further determined that the virtual machine is in a master state and other virtual machines are in a slave state, so that the virtual switch can only process the virtual machine in the slave state.
Optionally, the virtual switch is configured to not process the virtual machine or the control system when the statistical value is less than or equal to the preset value.
Specifically, if the statistical value of the arp statistics is 0, it indicates that the virtual switch has not received an arp-reply packet sent by the virtual machine, that is, the havip does not belong to the virtual machine, and it may be further determined that the virtual machine is in a slave state, and the virtual switch does not perform any processing.
Since the virtual switch does not perform any processing when the statistical value of the arp statistics is 0, it can be further determined whether the physical machine where the havip is located is the physical machine where the virtual switch is located, that is, whether the havip is located on the physical machine, when the statistical value of the arp statistics is greater than 0. If the physical machine is in the control system, the state managed by the control system is consistent with the state in the virtual machine. Otherwise, the state of the control system is not updated, so that the virtual switch can process the control system and update the state of the control system.
In the above embodiment of the present application, the virtual switch is further configured to determine that the virtual machine corresponding to the virtual address is in a master state, and send a notification message to the virtual machine in a slave state, where the notification message includes: and the network address of the virtual machine corresponding to the virtual address.
In the foregoing embodiment of the present application, the slave-state virtual machine is configured to configure a relay route in the physical machine to which the virtual machine belongs after receiving the notification packet, where the relay route forwards the received packet to the physical machine to which the virtual machine belongs.
Alternatively, the data packet may be sent by a physical machine that does not update the virtual machine location cache.
In the above embodiment of the present application, the virtual switch is further configured to send a call request to the control system; and the control system is used for controlling the physical machine corresponding to the virtual address in the data forwarding gateway to be updated to the physical machine to which the virtual switch belongs after receiving the calling request.
In the above embodiment of the present application, the virtual switch is further configured to send an address resolution protocol request to a virtual machine corresponding to the virtual address, receive an address resolution protocol response returned by the virtual machine based on the address resolution protocol request, and obtain the statistical value based on the address resolution protocol response.
In the above embodiment of the present application, the virtual machine is configured to send a gratuitous address resolution protocol data packet to the virtual switch; the virtual switch is further configured to process the virtual machine based on the gratuitous address resolution protocol data packet.
In the above embodiment of the present application, other physical machines except the physical machine to which the virtual switch belongs are used to obtain the physical machine corresponding to the virtual address from the data forwarding gateway, and update the virtual machine location caches in the other physical machines.
In the above embodiments of the present application, the virtual switch includes: a preset process that has been started.
The preset process is used for carrying out address resolution protocol statistics on the virtual address to obtain a statistic value.
In the above embodiment of the present application, the virtual switch is further configured to perform address resolution protocol statistics on the virtual address at regular time, and obtain the physical machine corresponding to the virtual address at regular time.
In the above embodiments of the present application, the control system is further configured to send the virtual address information to the virtual switch when a node is added or deleted.
Example 4
According to an embodiment of the present application, there is also provided a virtual address processing system, including:
a processor; and
a memory coupled to the processor for providing instructions to the processor for processing the following processing steps: the virtual switch carries out address resolution protocol statistics on the virtual address to obtain a statistic value; the virtual switch acquires a physical machine corresponding to the virtual address from the data forwarding gateway; and the virtual switch processes the virtual machine based on the physical machine corresponding to the statistic value and the virtual address.
In the method provided in embodiment 4 of the present application, the virtual switch performs address resolution protocol statistics on the virtual address to obtain a statistical value, and obtains a physical machine corresponding to the virtual address from the data forwarding gateway, and further processes the virtual machine based on the statistical value and the physical machine corresponding to the virtual address, so as to achieve the purpose of fast switching of the virtual address.
It is easy to notice that the virtual switch processes the virtual machines according to the statistical value counted by the address resolution protocol and the physical machines corresponding to the virtual addresses acquired from the data forwarding gateway, compared with the prior art, the control system does not need to manage/query the states of each virtual machine and the havip at regular time, the arp statistical method is faster than the AWS toolkit, and the arp statistical function and the state comparison are realized through the virtual switch, the load of the control system cannot increase exponentially, so that the inconsistency of the experience is reduced, the identity recognition accuracy is improved, and the technical effect of the experience of the user is improved.
Therefore, the solution of the foregoing embodiment 4 provided by the present application solves the technical problem in the prior art that the processing method of the virtual address is low in efficiency.
Example 5
The embodiment of the application can provide a computer terminal, and the computer terminal can be any one computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal may also be replaced with a terminal device such as a mobile terminal.
Optionally, in this embodiment, the computer terminal may be located in at least one network device of a plurality of network devices of a computer network.
In this embodiment, the computer terminal may execute the program code of the following steps in the processing method of the virtual address: the virtual switch carries out address resolution protocol statistics on the virtual address to obtain a statistic value; the virtual switch acquires a physical machine corresponding to the virtual address from the data forwarding gateway; and the virtual switch processes the virtual machine based on the physical machine corresponding to the statistic value and the virtual address.
Optionally, fig. 8 is a block diagram of a computer terminal according to an embodiment of the present application. As shown in fig. 8, the computer terminal a may include: one or more processors 802 (only one of which is shown), and a memory 804.
The memory may be configured to store software programs and modules, such as program instructions/modules corresponding to the virtual address processing method and apparatus in the embodiments of the present application, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implements the virtual address processing method described above. The memory may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory may further include memory remotely located from the processor, and these remote memories may be connected to terminal a through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The processor can call the information and application program stored in the memory through the transmission device to execute the following steps: the virtual switch carries out address resolution protocol statistics on the virtual address to obtain a statistic value; the virtual switch acquires a physical machine corresponding to the virtual address from the data forwarding gateway; and the virtual switch processes the virtual machine based on the physical machine corresponding to the statistic value and the virtual address.
Optionally, the processor may further execute the program code of the following steps: the virtual switch judges whether the statistic value is larger than a preset value or not and whether the physical machine corresponding to the virtual address is the physical machine to which the virtual switch belongs or not; if the statistic value is larger than the preset value, the virtual switch processes the virtual machine; and if the statistical value is larger than the preset value and the physical machine corresponding to the virtual address is not the physical machine to which the virtual switch belongs, the virtual switch processes the control system.
Optionally, the processor may further execute the program code of the following steps: the virtual switch determines that the virtual machine corresponding to the virtual address is in a master state, and sends a notification message to the virtual machine in a slave state, wherein the notification message includes: the network address of the virtual machine corresponding to the virtual address.
Optionally, the processor may further execute the program code of the following steps: after receiving the notification message, the slave virtual machine configures a relay route in the physical machine to which the virtual machine belongs, wherein the relay route forwards the received data packet to the physical machine to which the virtual machine belongs.
Optionally, the processor may further execute the program code of the following steps: the data packet is sent by the physical machine which does not update the virtual machine location cache.
Optionally, the processor may further execute the program code of the following steps: and the virtual switch sends a calling request to the control system, wherein the control system controls the physical machine corresponding to the virtual address in the data forwarding gateway to be updated to the physical machine to which the virtual switch belongs after receiving the calling request.
Optionally, the processor may further execute the program code of the following steps: and when the statistic value is less than or equal to the preset value, the virtual switch does not process the virtual machine or the control system.
Optionally, the processor may further execute the program code of the following steps: the virtual switch sends an address resolution protocol request to a virtual machine corresponding to the virtual address; the virtual switch receives an address resolution protocol response returned by the virtual machine based on the address resolution protocol request; the virtual switch obtains a statistical value based on the address resolution protocol response.
Optionally, the processor may further execute the program code of the following steps: the virtual switch acquires a free address resolution protocol data packet sent by the virtual machine; the virtual switch processes the virtual machine based on the toll-free ARP packet.
Optionally, the processor may further execute the program code of the following steps: and other physical machines except the physical machine to which the virtual switch belongs acquire the physical machine corresponding to the virtual address from the data forwarding gateway, and update the virtual machine position caches in the other physical machines.
Optionally, the processor may further execute the program code of the following steps: and the virtual switch carries out address resolution protocol statistics on the virtual address through the started preset process to obtain a statistic value.
Optionally, the processor may further execute the program code of the following steps: the virtual switch carries out address resolution protocol statistics on the virtual address at regular time, and obtains the physical machine corresponding to the virtual address at regular time.
Optionally, the processor may further execute the program code of the following steps: the virtual switch receives virtual address information sent by the control system, wherein the virtual address information is sent by the control system under the condition of adding or deleting nodes.
By adopting the embodiment of the application, the virtual switch carries out address resolution protocol statistics on the virtual address to obtain the statistical value, obtains the physical machine corresponding to the virtual address from the data forwarding gateway, and further processes the virtual machine based on the statistical value and the physical machine corresponding to the virtual address to realize the purpose of fast switching of the virtual address.
It is easy to notice that the virtual switch processes the virtual machines according to the statistical value counted by the address resolution protocol and the physical machines corresponding to the virtual addresses acquired from the data forwarding gateway, compared with the prior art, the control system does not need to manage/query the states of each virtual machine and the havip at regular time, the arp statistical method is faster than the AWS toolkit speed, and the arp statistical function and the state comparison are realized through the virtual switch, so that the load of the control system does not increase exponentially, the inconsistency of experience is reduced, the identity recognition accuracy is improved, and the technical effect of the experience of users is improved.
Therefore, the method and the device for processing the virtual address solve the technical problem that a virtual address processing method in the prior art is low in efficiency.
It can be understood by those skilled in the art that the structure shown in fig. 8 is only an illustration, and the computer terminal may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palmtop computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 8 is a diagram illustrating a structure of the electronic device. For example, the computer terminal a may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in fig. 8, or have a different configuration than shown in fig. 8.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
Example 4
Embodiments of the present application also provide a storage medium. Optionally, in this embodiment, the storage medium may be configured to store a program code executed by the processing method for a virtual address provided in the first embodiment.
Optionally, in this embodiment, the storage medium may be located in any one of computer terminals in a computer terminal group in a computer network, or in any one of mobile terminals in a mobile terminal group.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: the virtual switch carries out address resolution protocol statistics on the virtual address to obtain a statistic value; the virtual switch acquires a physical machine corresponding to the virtual address from the data forwarding gateway; and the virtual switch processes the virtual machine based on the physical machine corresponding to the statistic value and the virtual address.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to the related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (17)

1. A virtual address processing method comprises the following steps:
the virtual switch counts the address resolution protocol response corresponding to the virtual address to obtain a statistical value;
the virtual switch acquires a physical machine corresponding to the virtual address from a data forwarding gateway;
the virtual switch processes the virtual machine based on the statistic value and the physical machine corresponding to the virtual address;
the virtual switch judges whether the statistic value is larger than a preset value or not and whether a physical machine corresponding to the virtual address is a physical machine to which the virtual switch belongs or not;
if the statistic value is larger than the preset value, the virtual switch processes the virtual machine, so that the virtual machine in the slave state determines the network address of the virtual machine in the master state;
and if the statistical value is larger than the preset value and the physical machine corresponding to the virtual address is not the physical machine to which the virtual switch belongs, the virtual switch processes a control system, so that the physical machine corresponding to the virtual address in the data forwarding gateway is updated to be the physical machine to which the virtual switch belongs.
2. The method of claim 1, wherein the virtual switch processes the virtual machine, comprising:
the virtual switch determines that the virtual machine corresponding to the virtual address is in a master state, and sends a notification message to the virtual machine in the slave state, where the notification message includes: and the network address of the virtual machine corresponding to the virtual address.
3. The method according to claim 2, wherein the slave virtual machine configures a relay route in the physical machine to which the virtual machine belongs after receiving the notification packet, wherein the relay route forwards the received packet to the physical machine to which the virtual machine belongs.
4. The method of claim 3, wherein the data packet is sent by a physical machine that does not update a virtual machine location cache.
5. The method of claim 1, wherein the virtual switch processes the control system, comprising:
and the virtual switch sends a calling request to the control system, wherein the control system controls the physical machine corresponding to the virtual address in the data forwarding gateway to be updated to the physical machine to which the virtual switch belongs after receiving the calling request.
6. The method of claim 1, wherein the virtual switch does not process the virtual machine or the control system when the statistical value is less than or equal to the preset value.
7. The method of claim 1, wherein the step of counting the arp responses corresponding to the virtual addresses by the virtual switch to obtain a statistical value comprises:
the virtual switch sends an address resolution protocol request to a virtual machine corresponding to the virtual address;
the virtual switch receives the ARP response returned by the virtual machine based on the ARP request;
the virtual switch obtains the statistical value based on the address resolution protocol response.
8. The method of claim 1, wherein the method further comprises:
the virtual switch acquires a toll-free address resolution protocol data packet sent by the virtual machine;
and the virtual switch processes the virtual machine based on the free address resolution protocol data packet.
9. The method according to claim 1, wherein the other physical machines except the physical machine to which the virtual switch belongs acquire the physical machine corresponding to the virtual address from the data forwarding gateway, and update virtual machine location caches in the other physical machines.
10. The method of claim 1, wherein the virtual switch performs address resolution protocol statistics on the virtual address through a preset process that has been started, so as to obtain the statistical value.
11. The method of claim 1, wherein the virtual switch performs address resolution protocol statistics on the virtual address at regular time, and acquires a physical machine corresponding to the virtual address at regular time.
12. The method of claim 1, wherein the virtual switch receives virtual address information sent by a control system, wherein the virtual address information is sent by the control system with the addition or deletion of a node.
13. An apparatus for processing a virtual address, comprising:
the statistical module is used for carrying out statistics on the address resolution protocol response corresponding to the virtual address by the virtual switch to obtain a statistical value;
the acquisition module is used for acquiring the physical machine corresponding to the virtual address from the data forwarding gateway;
the processing module is used for processing the virtual machine based on the statistic value and the physical machine corresponding to the virtual address;
the judging submodule is used for judging whether the statistic value is larger than a preset value or not and whether the physical machine corresponding to the virtual address is the physical machine to which the virtual switch belongs or not;
the first processing submodule is used for processing the virtual machine if the statistic value is larger than the preset value, so that the virtual machine in the slave state determines the network address of the virtual machine in the master state;
and a second processing sub-module, configured to, if the statistical value is greater than the preset value and the physical machine corresponding to the virtual address is not the physical machine to which the virtual switch belongs, process the control system, so that the physical machine corresponding to the virtual address in the data forwarding gateway is updated to the physical machine to which the virtual switch belongs.
14. A system for processing virtual addresses, comprising:
the data forwarding gateway is used for storing the corresponding relation between the virtual address and the physical machine;
the virtual switch is used for counting the address resolution protocol response corresponding to the virtual address to obtain a statistical value, acquiring a physical machine corresponding to the virtual address from the data forwarding gateway, and processing the virtual machine based on the statistical value and the physical machine corresponding to the virtual address;
the virtual switch is further configured to determine whether the statistic value is greater than a preset value, and whether the physical machine corresponding to the virtual address is a physical machine to which the virtual switch belongs, if the statistic value is greater than the preset value, process the virtual machine, so that the virtual machine in the slave state determines the network address of the virtual machine in the master state, and if the statistic value is greater than the preset value, and the physical machine corresponding to the virtual address is not the physical machine to which the virtual switch belongs, process the control system, so that the physical machine corresponding to the virtual address in the data forwarding gateway is updated to be the physical machine to which the virtual switch belongs.
15. A storage medium comprising a stored program, wherein the program, when executed, controls an apparatus on which the storage medium is located to perform the steps of: the virtual switch counts the address resolution protocol response corresponding to the virtual address to obtain a statistical value; the virtual switch acquires a physical machine corresponding to the virtual address from a data forwarding gateway; the virtual switch processes the virtual machine based on the statistic value and the physical machine corresponding to the virtual address; the virtual switch judges whether the statistic value is larger than a preset value or not and whether a physical machine corresponding to the virtual address is a physical machine to which the virtual switch belongs or not; if the statistic value is larger than the preset value, the virtual switch processes the virtual machine, so that the virtual machine in the slave state determines the network address of the virtual machine in the master state; and if the statistical value is larger than the preset value and the physical machine corresponding to the virtual address is not the physical machine to which the virtual switch belongs, the virtual switch processes a control system, so that the physical machine corresponding to the virtual address in the data forwarding gateway is updated to be the physical machine to which the virtual switch belongs.
16. A mobile device, comprising: a processor for executing a program, wherein the following steps are performed when the program is executed: the virtual switch counts the address resolution protocol response corresponding to the virtual address to obtain a statistic value; the virtual switch acquires a physical machine corresponding to the virtual address from a data forwarding gateway; the virtual switch processes the virtual machine based on the statistic value and the physical machine corresponding to the virtual address; the virtual switch judges whether the statistic value is larger than a preset value or not and whether a physical machine corresponding to the virtual address is a physical machine to which the virtual switch belongs or not; if the statistic value is larger than the preset value, the virtual switch processes the virtual machine, so that the virtual machine in the slave state determines the network address of the virtual machine in the master state; and if the statistical value is larger than the preset value and the physical machine corresponding to the virtual address is not the physical machine to which the virtual switch belongs, the virtual switch processes a control system, so that the physical machine corresponding to the virtual address in the data forwarding gateway is updated to be the physical machine to which the virtual switch belongs.
17. A system for processing virtual addresses, comprising:
a processor; and
a memory coupled to the processor for providing instructions to the processor for processing the following processing steps: the virtual switch counts the address resolution protocol response corresponding to the virtual address to obtain a statistical value; the virtual switch acquires a physical machine corresponding to the virtual address from a data forwarding gateway; the virtual switch processes the virtual machine based on the statistic value and the physical machine corresponding to the virtual address; the virtual switch judges whether the statistic value is larger than a preset value or not and whether a physical machine corresponding to the virtual address is a physical machine to which the virtual switch belongs or not; if the statistic value is larger than the preset value, the virtual switch processes the virtual machine, so that the virtual machine in the slave state determines the network address of the virtual machine in the master state; and if the statistical value is larger than the preset value and the physical machine corresponding to the virtual address is not the physical machine to which the virtual switch belongs, the virtual switch processes a control system, so that the physical machine corresponding to the virtual address in the data forwarding gateway is updated to be the physical machine to which the virtual switch belongs.
CN201811076704.1A 2018-09-14 2018-09-14 Method, device and system for processing virtual address Active CN110913028B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811076704.1A CN110913028B (en) 2018-09-14 2018-09-14 Method, device and system for processing virtual address

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811076704.1A CN110913028B (en) 2018-09-14 2018-09-14 Method, device and system for processing virtual address

Publications (2)

Publication Number Publication Date
CN110913028A CN110913028A (en) 2020-03-24
CN110913028B true CN110913028B (en) 2022-06-14

Family

ID=69812405

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811076704.1A Active CN110913028B (en) 2018-09-14 2018-09-14 Method, device and system for processing virtual address

Country Status (1)

Country Link
CN (1) CN110913028B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113691436B (en) * 2021-09-07 2023-04-18 中国联合网络通信集团有限公司 Virtual machine migration method and virtual machine migration device
CN114500452B (en) * 2022-01-27 2024-03-22 洛阳市众信佳智能网络科技有限公司 Method, device and equipment for determining virtual system IP address in bridge mode
CN115225634B (en) * 2022-06-17 2023-10-20 北京百度网讯科技有限公司 Data forwarding method, device and computer program product under virtual network

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9471356B2 (en) * 2013-06-12 2016-10-18 Dell Products L.P. Systems and methods for providing VLAN-independent gateways in a network virtualization overlay implementation
CN106034037B (en) * 2015-03-13 2019-04-16 腾讯科技(深圳)有限公司 A kind of disaster tolerance switching method and device based on virtual machine
CN107786677B (en) * 2016-08-24 2021-06-22 迈普通信技术股份有限公司 ARP (Address resolution protocol) table item updating method and VTEP (virtual terminal equipment)
CN108259629B (en) * 2016-12-28 2021-07-23 阿里巴巴集团控股有限公司 Virtual internet protocol address switching method and device

Also Published As

Publication number Publication date
CN110913028A (en) 2020-03-24

Similar Documents

Publication Publication Date Title
KR102392120B1 (en) Processing method, device and system for nf component abnormality
EP3157230B1 (en) Method for acquiring identifier of terminal in network, management network element and storage medium
CN108024270B (en) Information sending method, unit and system
CN101316236B (en) Vrrp backup group load sharing method and router
CN110913028B (en) Method, device and system for processing virtual address
EP3827577B1 (en) System and method for intelligently managing sessions in a mobile network
US10602475B2 (en) Method and system for device location management
US11233694B2 (en) Method and device for processing communication path
CN105991363B (en) Monitoring processing method and device
CN110875857B (en) Method, device and system for reporting disconnected network state
CN112469055A (en) Equipment network distribution method, related equipment and storage medium
CN110932876B (en) Communication system, method and device
CN109561054B (en) Data transmission method, controller and access device
CN104426816B (en) A kind of virtual machine communication method and device
CN106411574B (en) Management control method and device
CN109510717B (en) Method, device, equipment and storage medium for acquiring information of node equipment
CN112492030B (en) Data storage method, device, computer equipment and storage medium
CN113872799A (en) Method, node and system for managing node
CN113596792A (en) Binding method and device of electronic equipment, storage medium and electronic device
US20160241427A1 (en) Service Sending, Receiving Methods and Devices
CN107294989B (en) Method and device for preventing ARP gateway spoofing
US20180302244A1 (en) Gateway selection method, device, and system
CN114301989A (en) Information transmission method, device and system
CN112311904A (en) Method, device, storage medium and domain name management system for updating domain name record
CN111200514A (en) Network element information processing method and device, network platform and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40026488

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant