CN109714238B - Method and equipment for realizing communication between virtual machines - Google Patents

Method and equipment for realizing communication between virtual machines Download PDF

Info

Publication number
CN109714238B
CN109714238B CN201811513715.1A CN201811513715A CN109714238B CN 109714238 B CN109714238 B CN 109714238B CN 201811513715 A CN201811513715 A CN 201811513715A CN 109714238 B CN109714238 B CN 109714238B
Authority
CN
China
Prior art keywords
virtual machine
message
information
bridge
routing
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
CN201811513715.1A
Other languages
Chinese (zh)
Other versions
CN109714238A (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.)
Shanghai Zstack Information Technology Co ltd
Original Assignee
Shanghai Zstack Information Technology Co 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 Shanghai Zstack Information Technology Co ltd filed Critical Shanghai Zstack Information Technology Co ltd
Priority to CN201811513715.1A priority Critical patent/CN109714238B/en
Publication of CN109714238A publication Critical patent/CN109714238A/en
Application granted granted Critical
Publication of CN109714238B publication Critical patent/CN109714238B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The method comprises the steps that an agent which is positioned on the same host machine with the virtual machine captures optimized message information sent to the virtual machine by a main agent; establishing a routing network bridge for connecting a first virtual local area network interface network bridge and a second virtual local area network interface network bridge based on the optimized message information, wherein the virtual machines comprise a first virtual machine and a second virtual machine; determining an address conversion rule and a flow guiding rule of flow forwarded by the routing network bridge, wherein the flow comprises a message and message feedback information; and finishing the communication between the virtual machines according to the address conversion rule and the flow guide rule. The probability of making mistakes can be reduced, the network reliability is improved, the traditional route is not interfered, and the traditional equipment can be conveniently accessed. In addition, the method has lower delay, does not depend on a database, and preferentially ensures that the user service is not influenced under any condition.

Description

Method and equipment for realizing communication between virtual machines
Technical Field
The present application relates to the field of computers, and in particular, to a method and an apparatus for implementing communication between virtual machines.
Background
With the rapid development of internet technology and the increasing demand of users for the internet, larger data centers with various capabilities are being built to meet the demand. Among other things, the development of virtualization technology has made it possible to implement a large number of Virtual Machines (VMs) in a data center, which can essentially operate as physical machines and perform various functions such as a Web server or a database server. When two Virtual Machines (VM) belonging to different networks respectively belong to different network segments, direct communication cannot be realized. The traditional implementation mode is that direct flow between two virtual machines can be completed only by routing through an intermediate cloud route, but when the cloud route is connected with a large number of virtual machines and a large flow exists on the cloud route, the cloud route becomes a bottleneck, when relevant links of the cloud route are jittered, the network of all connected virtual machines is abnormal, and the route forwarding also increases time delay. In the prior art, an OpenStack mode can be adopted, but the error rate is high due to the complex path and logic, a virtual router is required to be implemented on each computing node for each three-layer network, so that a lot of load is increased, all rules and virtual routes are well established no matter whether communication needs exist, waste is increased, in addition, as no centralized route exists, the virtual machine is communicated with non-cloud platform resources, once distributed routes have problems, messages cannot be sent to the centralized route, and the problems of network availability and the like are reduced.
Disclosure of Invention
An object of the present application is to provide a method and an apparatus for implementing communication between virtual machines, which solve the problems in the prior art that delay is increased due to forwarding using a route, error rate is high due to complex logic of a path, and network availability is low.
According to an aspect of the present application, there is provided a method for implementing inter-virtual machine communication, the method including:
capturing optimized message information sent to the virtual machine by an agent on the same host as the virtual machine;
establishing a routing network bridge for connecting a first virtual local area network interface network bridge and a second virtual local area network interface network bridge based on the optimized message information, wherein the virtual machines comprise a first virtual machine and a second virtual machine;
determining an address conversion rule and a flow guiding rule of flow forwarded by the routing network bridge, wherein the flow comprises a message and message feedback information;
and finishing the communication between the virtual machines according to the address conversion rule and the flow guide rule.
Further, the address translation rule includes:
when the first virtual machine sends a message to the second virtual machine, modifying the destination MAC address of the message from the MAC address of the routing gateway corresponding to the first virtual machine to the MAC address of the second virtual machine;
when the second virtual machine sends message feedback information to the first virtual machine, modifying the destination MAC address of the message feedback information from the MAC address of the routing gateway corresponding to the second virtual machine to the MAC address of the first virtual machine.
Further, the diversion rule includes:
when the first virtual machine sends a message to the second virtual machine, the message is forwarded to the second virtual local area network interface network bridge by the first virtual local area network interface network bridge through the routing network bridge;
when the second virtual machine sends message feedback information to the first virtual machine, the second virtual local area network interface bridge forwards the message feedback information to the first virtual local area network interface bridge through the routing bridge.
Further, the optimized message information is determined by the master agent according to the routing information of the first message.
Further, before capturing the optimized message information sent by the master agent to the virtual machine, an agent located on the same host as the virtual machine includes:
and capturing the routing information of the first message through the master agent, wherein the master agent and the first message pass through a route on the same host, and the route records the routing information of the first message in a connection tracking table.
Further, the routing information of the first packet includes: the sending routing information of the first message and the feedback routing information of the first message,
the routing information of the first message comprises the path state information which is sent to the first virtual local area network interface by the first virtual machine, forwarded by the gateway of the route and then sent from the second virtual local area network interface to the second virtual machine;
the feedback routing information of the first message comprises channel state information which is sent to the second virtual local area network interface by the second virtual machine and is transmitted from the first virtual local area network interface to the first virtual machine after being forwarded by the gateway of the route.
Further, after creating a routing bridge for connecting the first vlan interface bridge and the second vlan interface bridge based on the optimized packet information, the method includes:
identifying traffic on a virtual local area network interface bridge sending the traffic to direct the traffic to the routing bridge;
and matching the MAC address and the port through the routing bridge, and forwarding the flow to a virtual local area network interface bridge for receiving the flow.
Further, the determining, by the master agent, the optimized packet information according to the routing information of the first packet includes:
and the master agent determines optimized message information based on the routing information of the first message and a preset trigger condition.
Further, the trigger condition includes any one of:
the path state information in the sending routing information of the first message and the path state information in the feedback routing information of the first message are both in an intercommunication state;
traffic between the first virtual machine and the second virtual machine is degraded.
Further, before creating a routing bridge for connecting the first vlan interface bridge and the second vlan interface bridge based on the optimized packet information, the method includes:
the main agent sends checking instruction information to the virtual machine based on the routing information of the first message;
an agent on the same host as the virtual machine captures the inspection instruction information and feeds back an inspection result to the main agent according to the inspection instruction information;
and the main agent sends optimized message information to the virtual machine according to the check result and a preset protocol format.
According to another aspect of the present application, there is also provided a computer readable medium having stored thereon computer readable instructions executable by a processor to implement the aforementioned method for implementing inter-virtual machine communication.
According to still another aspect of the present application, there is also provided an apparatus for implementing inter-virtual machine communication, wherein the apparatus includes:
one or more processors; and
a memory storing computer readable instructions that, when executed, cause the processor to perform the operations of the aforementioned method for implementing inter-virtual machine communication.
Compared with the prior art, the method and the device have the advantages that the agent located on the same host machine as the virtual machine captures the optimized message information sent to the virtual machine by the main agent; establishing a routing network bridge for connecting a first virtual local area network interface network bridge and a second virtual local area network interface network bridge based on the optimized message information, wherein the virtual machines comprise a first virtual machine and a second virtual machine; determining an address conversion rule and a flow guiding rule of flow forwarded by the routing network bridge, wherein the flow comprises a message and message feedback information; and finishing the communication between the virtual machines according to the address conversion rule and the flow guide rule. The rules and the configuration are fewer than those of the existing mode, so that the error probability can be reduced; when the rule of the distributed routing fails or problems occur, the traffic can be degraded to the traditional path, the network is ensured to be available, meanwhile, the traditional routing is not interfered, and the traditional equipment can be conveniently accessed. In addition, the method has lower delay, does not depend on a database, and preferentially ensures that the user service is not influenced under any condition.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 illustrates a flow diagram of a method for implementing inter-virtual machine communication provided by an aspect of the present application;
fig. 2 is a schematic diagram illustrating a path for implementing communication between virtual machines according to an embodiment of the present application.
The same or similar reference numbers in the drawings identify the same or similar elements.
Detailed Description
The present application is described in further detail below with reference to the attached figures.
In a typical configuration of the present application, the terminal, the device serving the network, and the trusted party each include one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
Fig. 1 shows a flowchart of a method for implementing inter-virtual machine communication according to an aspect of the present application, where the method includes: step S11 to step S14,
in step S11, an agent on the same host as the virtual machine captures optimized message information sent by a master agent to the virtual machine; here, the master Agent is a router network Agent, and may send a control command to the virtual machine, and a network Agent (computer node network Agent) located on a physical machine where the virtual machine is located captures the control command, and the computer node network Agent replies a message to the router network Agent. In an SDN network, cloud routing is distributed routing. And the main agent sends the optimized message information to the virtual machine, and the agent positioned on the same host machine on the virtual machine captures the optimized message information.
Next, in step S12, a routing bridge for connecting the first vlan interface bridge and the second vlan interface bridge is created based on the optimized packet information, where the virtual machines include a first virtual machine and a second virtual machine; after capturing the optimized message information, the agent on the same host as the virtual machine creates a routing bridge connecting the first virtual machine lan interface bridge (VLAN1 bridge) and the second virtual lan interface bridge (VLAN2 bridge), wherein the first virtual lan interface bridge is the first virtual machine lan interface bridge, and the second virtual lan interface bridge is the second virtual machine lan interface bridge.
In step S13, an address translation rule and a flow guiding rule for a traffic forwarded by the routing bridge are determined, where the traffic includes a packet and packet feedback information; after the routing bridge is created, determining an address conversion rule and a diversion rule when the direct flow of the virtual machine is forwarded through the routing bridge, wherein when the first virtual machine sends a message to the second virtual machine, the flow is the message, when the second virtual machine sends message feedback information to the first virtual machine according to the received message, the flow is the message feedback information, the address conversion rule is used for modifying addresses (such as MAC addresses) of the virtual machine sending the flow and the virtual machine receiving the flow so as to facilitate the forwarding of the flow through the established routing bridge, and the diversion rule is used for introducing the flow into the routing bridge, so that the transmission of the flow between the virtual machines is realized through the routing bridge.
In step S14, communication between the virtual machines is completed according to the address translation rules and the flow guiding rules. Here, a message path between the virtual machines is established according to the determined address conversion rule and the flow guiding rule, and a message sent from the first virtual machine to the second virtual machine reaches the second virtual machine according to the message path, so that forwarding through cloud routing is avoided, matching rules and configuration are few, and the probability of errors is reduced.
Specifically, the address translation rule includes: when the first virtual machine sends a message to the second virtual machine, modifying the destination MAC address of the message from the MAC address of the routing gateway corresponding to the first virtual machine to the MAC address of the second virtual machine; when the second virtual machine sends message feedback information to the first virtual machine, modifying the destination MAC address of the message feedback information from the MAC address of the routing gateway corresponding to the second virtual machine to the MAC address of the first virtual machine. Here, when the first virtual machine (VM1) sends a message to the second virtual machine (VM2), an address translation rule is issued to modify the destination MAC address of traffic from VM1 to VM2 from the MAC address of the cloud routing gateway corresponding to the first virtual machine to the MAC address of VM 2; when the second virtual machine VM2 returns the feedback information of the message, the address conversion rule modifies the destination MAC address of the traffic from VM2 to VM1 from the MAC address of the cloud routing gateway corresponding to the second virtual machine to the MAC address of VM1, for example, the first virtual machine is located on the 10.0.1.0/24 network, the second virtual machine is located on the 10.0.2.0/24 network, when the first virtual machine sends the message to the second virtual machine, the traditional path is forwarded through the cloud routing, the cloud routing includes gateway 10.0.1.1 and gateway 10.0.2.1, where the gateway 10.0.1.1 is the destination MAC address when the first virtual machine sends the message to the second virtual machine, the gateway 10.0.2.1 is the destination MAC address when the second virtual machine returns the information to the first virtual machine, when the routing bridge is established, the destination MAC address of the traffic from the first virtual machine to the second virtual machine needs to be modified from the MAC address of the gateway 10.0.1.1 to the second virtual machine when the first virtual machine sends the subsequent message to the second virtual machine, likewise, when the second virtual machine returns information, the destination MAC address of traffic from the second virtual machine to the first virtual machine needs to be modified by the gateway 10.0.2.1 to the MAC address of the first virtual machine.
Specifically, the diversion rule includes: when the first virtual machine sends a message to the second virtual machine, the message is forwarded to the second virtual local area network interface network bridge by the first virtual local area network interface network bridge through the routing network bridge; when the second virtual machine sends message feedback information to the first virtual machine, the second virtual local area network interface bridge forwards the message feedback information to the first virtual local area network interface bridge through the routing bridge. Here, when the first virtual machine VM1 sends a packet to the second virtual machine VM2, the packet traffic needs to be directed from the VLAN1 bridge to the routing bridge, and forwarded to the VLAN2 bridge through the routing bridge. When the second virtual machine VM2 returns information to the first virtual machine VM1, the traffic of the returned information is directed from the VLAN2 bridge to the routing bridge, through which it is forwarded to the VLAN1 bridge.
In an embodiment of the present application, the optimized packet information is determined by the master agent according to the routing information of the first packet. Specifically, the method comprises the following steps: and capturing the routing information of the first message through the master agent, wherein the master agent and the first message pass through a route on the same host, and the route records the routing information of the first message in a connection tracking table. Here, the first packet is a first packet sent when communication is performed between virtual machines located in different networks, the virtual machines need to forward the first packet through a cloud route because the MAC address of the other virtual machine cannot be found when sending the first packet, the first packet is routed when forwarding the first packet through the cloud route, and a master Agent (Agent) located on the same host as the cloud route through which the first packet passes captures the routing process, so as to obtain routing information. And the cloud routing records the routing information of the first message in a connection tracking table.
In an embodiment of the present application, the routing information of the first packet includes: sending routing information of the first message and feedback routing information of the first message, wherein the sending routing information of the first message comprises channel state information which is sent to the first virtual local area network interface by the first virtual machine and is forwarded from the second virtual local area network interface to the second virtual machine by the gateway of the route; the feedback routing information of the first message comprises channel state information which is sent to the second virtual local area network interface by the second virtual machine and is transmitted from the first virtual local area network interface to the first virtual machine after being forwarded by the gateway of the route. Here, as shown in fig. 2, when the virtual machine 1 is located on the physical machine 1, the virtual machine 2 is located on the physical machine 2, the cloud route is located on the physical machine 3, and when the virtual machine 1 located on the network 10.0.1.11/24 sends a message to the virtual machine 2 located on the network 10.0.2.12/24, the path taken by the first message is from the virtual network card to the first physical network card on the physical machine 1 through the VLAN1 bridge and the VLAN subinterface in sequence, to the VLAN1 subinterface through the third physical network card on the physical machine 3, to the VLAN bridge, and to the gateway 10.0.1.1 on the cloud route, and is forwarded through the gateway 10.0.2.1 on the cloud route, to the third physical network card through the virtual network card, the VLAN2, and the VLAN subinterface in sequence, to the physical network card (the second physical network card) on the physical machine 2 on the virtual machine 2 through the third physical network card, to the virtual network card 2 through the VLAN2 subinterface, the VLAN bridge, the path forwarded by the cloud route is recorded in a connection tracking table; similarly, when the information returned from the virtual machine 2 reaches the virtual machine 1, the information is also forwarded through the cloud route, and the returned path is also recorded in the connection tracking table. The method comprises the steps that a main agent judges whether a path of flow from a virtual machine 1 to the virtual machine 2 forwarded through a cloud route is in a path state or not and whether a path of flow returned from the virtual machine 2 to the virtual machine 1 forwarded through the cloud route is in the path state or not, when the paths are in the path states, an instruction of a subsequent message walking optimization path (a second message path) can be sent to the virtual machine, and the subsequent message walking optimization path is established, wherein the optimization path is a path determined by establishing a routing bridge and a determined address conversion rule and a flow guide rule.
In an embodiment of the present application, after a routing bridge for connecting a first virtual local area network interface bridge and a second virtual local area network interface bridge is created based on optimized message information sent by a host agent to a virtual machine, the traffic is identified on the virtual local area network interface bridge sending the traffic, so as to guide the traffic to the routing bridge; matching the MAC address and the bridge interface through the routing bridge, and forwarding the flow to the virtual local area network interface bridge receiving the flow. Here, when VM1 sends a packet to VM2, VM1 is a virtual machine that sends traffic, VLAN1 bridge is a virtual lan interface bridge that sends traffic, VM2 is a virtual machine that receives traffic, VLAN2 bridge is a virtual lan interface bridge that receives traffic, and after the traffic is identified by VLAN1 bridge, the traffic is directed from VLAN1 bridge to routing bridge, which forwards the traffic to VLAN2 bridge by MAC address and port matching. Similarly, when VM2 returns information to VM1, VLAN2 bridge of VM2 is the VLAN1 bridge that sends traffic, and the return path is the MAC address and bridge interface match forwarded to VLAN1 bridge via the routing bridge.
In an embodiment of the present application, the master agent determines optimized packet information based on the routing information of the first packet and a preset trigger condition. Wherein the trigger condition comprises any one of: the path state information in the sending routing information of the first message and the path state information in the feedback routing information of the first message are both in an intercommunication state; traffic between the first virtual machine and the second virtual machine is degraded.
The route that the first message passes through is a first route, route information is determined according to the first route, the route information is further analyzed, whether the first route is normal or not is determined, if the first route is normal, a preset trigger condition is met, and a subsequent message is triggered to pass through a second message route, wherein the second message route is a route that does not pass through a router, but is used for feeding back optimized message information to a virtual machine associated with the first message through a master agent, a routing bridge is created, and forwarding is performed through the routing bridge so as to perform communication between the first virtual machine and the second virtual machine. In the embodiment described in the present application, the information of the packet is obtained in a bypass manner, which is a manner of monitoring through a proxy, and does not depend on a database, so that it is preferentially ensured that the user service is not affected in any situation. The triggering condition also comprises the condition that the flow between the first virtual machine and the second virtual machine is degraded, when the flow is degraded, the path where the message travels is reduced to a first path, and if the flow between the first virtual machine and the second virtual machine is still in an active state, the message is triggered again to travel an optimized path. And then the method can be used for optimizing active connections only, not doing unnecessary optimization actions, and only causing traffic degradation under the worst network condition without interrupting a communication link between the virtual machines. It should be noted that, when the path state information of the first packet is in the disabled state, the virtual machine is powered off or security group isolation is performed.
In an embodiment of the present application, the method includes: step S10, the master agent sends check instruction information to the virtual machine based on the routing information of the first packet; an agent on the same host as the virtual machine captures the inspection instruction information and feeds back an inspection result to the main agent according to the inspection instruction information; and the main agent sends optimized message information to the virtual machine according to the check result and a preset protocol format. The method comprises the steps that a main agent on the cloud route sends a check instruction to computing nodes to check whether each computing node is normal or not and whether a network agent on each computing node is alive or not, the network agent on each computing node captures the check instruction in an intercepting mode, the check result is replied after the check is normal or not, and when the check result is normal, the main agent sends optimized message information to a virtual machine according to a preset protocol format. The preset protocol format is based on an IP protocol, a network agent on a computing node monitors all traffic which enters the computing node and is in the preset protocol format, and a network agent on a router monitors all traffic which enters the router and is in the preset protocol format, so that the network agent on the router only needs to send a message in the preset protocol format to a virtual machine needing to optimize the traffic, and the message is intercepted and analyzed on a physical machine, so that a control instruction is sent to a correct computing node through the preset protocol format on the premise that the computing node where the virtual machine is located is not known, and the correctness is guaranteed by the operation of a network bottom layer, so that the risks of database information errors, outdating and the like are avoided. The computing nodes are hosts where a first virtual machine and a second virtual machine in the distributed network are located.
In an embodiment of the present application, with reference to fig. 2, the virtual machine 1 sends the first packet to the virtual machine 2, and first sends the first packet to the gateway 10.0.1.1 through the VLAN1, the first packet is forwarded to the VLAN2 through the cloud route so as to reach the virtual machine 2, the virtual machine 2 replies the packet through the same path, and the connection tracking table on the cloud route records the connection. The method comprises the steps that a network agent (a main agent) on a cloud route sends a check instruction to virtual machines (a virtual machine 1 and a virtual machine 2) on a computing node to check whether the network agents (the network agent 1 and the network agent 2) on the computing node are alive or not, when the network agents (the network agent 1 and the network agent 2) are alive, the main agent sends optimization message information to the virtual machine 1 and the virtual machine 2, the network agent 1 and the network agent 2 obtain the instruction of the optimization message information in an intercepting mode, therefore, the network agent 1 on the computing node where the virtual machine 1 is located can create a routing bridge, the VLAN1 and the VLAN2 bridge are connected, address conversion rules are sent, the destination MAC address of traffic from the virtual machine 1 to the VM2 is modified to the MAC address of the virtual machine 2 from the MAC of the cloud routing 10.0.1.1, flow guiding rules are sent, the traffic from the VLAN1 to the routing bridge of the virtual machine 2 is guided to the VLAN routing bridge, and then the traffic is forwarded to the VLAN 2. Similarly, the network agent 2 on the computing node where the virtual machine 2 is located creates a routing bridge and establishes a path for traffic from the virtual machine 2 to the virtual machine 1 according to the address translation rule and the flow guiding rule. The path followed by the subsequent message is the path forwarded by the routing bridge.
According to the method for realizing communication between the virtual machines, the rules and configuration are few, the error probability can be reduced, when the rules of the distributed routing are invalid or have problems, the flow can be degraded to the traditional path, the network availability is ensured, meanwhile, the traditional routing is not interfered, and the traditional equipment can be conveniently accessed. In addition, the method has lower delay, does not depend on a database, and preferentially ensures that the user service is not influenced under any condition.
The embodiment described in the present application is based on an SDN Network, where the SDN Network is a Software Defined Network (Software Defined Network) and is a novel Network innovation architecture, and the Network traffic is flexibly controlled by decoupling a control plane and a data plane of a Network device.
In addition, the embodiment of the present application also provides a computer readable medium, on which computer readable instructions are stored, and the computer readable instructions can be executed by a processor to implement the method for implementing communication between virtual machines described in the foregoing.
According to still another aspect of the present application, there is also provided an apparatus for implementing inter-virtual machine communication, wherein the apparatus includes:
one or more processors; and
a memory storing computer readable instructions that, when executed, cause the processor to perform the operations of the aforementioned method.
For example, the computer readable instructions, when executed, cause the one or more processors to:
capturing optimized message information sent to the virtual machine by an agent on the same host as the virtual machine;
establishing a routing network bridge for connecting a first virtual local area network interface network bridge and a second virtual local area network interface network bridge based on the optimized message information, wherein the virtual machines comprise a first virtual machine and a second virtual machine;
determining an address conversion rule and a flow guiding rule of flow forwarded by the routing network bridge, wherein the flow comprises a message and message feedback information;
and finishing the communication between the virtual machines according to the address conversion rule and the flow guide rule.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.
It should be noted that the present application may be implemented in software and/or a combination of software and hardware, for example, implemented using Application Specific Integrated Circuits (ASICs), general purpose computers or any other similar hardware devices. In one embodiment, the software programs of the present application may be executed by a processor to implement the steps or functions described above. Likewise, the software programs (including associated data structures) of the present application may be stored in a computer readable recording medium, such as RAM memory, magnetic or optical drive or diskette and the like. Additionally, some of the steps or functions of the present application may be implemented in hardware, for example, as circuitry that cooperates with the processor to perform various steps or functions.
In addition, some of the present application may be implemented as a computer program product, such as computer program instructions, which when executed by a computer, may invoke or provide methods and/or techniques in accordance with the present application through the operation of the computer. Program instructions which invoke the methods of the present application may be stored on a fixed or removable recording medium and/or transmitted via a data stream on a broadcast or other signal-bearing medium and/or stored within a working memory of a computer device operating in accordance with the program instructions. An embodiment according to the present application comprises an apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to perform a method and/or a solution according to the aforementioned embodiments of the present application.
It will be evident to those skilled in the art that the present application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the apparatus claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.

Claims (12)

1. A method for implementing inter-virtual machine communication, wherein the method comprises:
capturing optimized message information sent to the virtual machine by an agent on the same host as the virtual machine;
establishing a routing network bridge for connecting a first virtual local area network interface network bridge and a second virtual local area network interface network bridge based on the optimized message information, wherein the virtual machines comprise a first virtual machine and a second virtual machine;
determining an address conversion rule and a flow guiding rule of flow forwarded by the routing network bridge, wherein the flow comprises a message and message feedback information;
and finishing the communication between the virtual machines according to the address conversion rule and the flow guide rule.
2. The method of claim 1, wherein the address translation rule comprises:
when the first virtual machine sends a message to the second virtual machine, modifying the destination MAC address of the message from the MAC address of the routing gateway corresponding to the first virtual machine to the MAC address of the second virtual machine;
when the second virtual machine sends message feedback information to the first virtual machine, modifying the destination MAC address of the message feedback information from the MAC address of the routing gateway corresponding to the second virtual machine to the MAC address of the first virtual machine.
3. The method of claim 1, wherein the diversion rules comprise:
when the first virtual machine sends a message to the second virtual machine, the message is forwarded to the second virtual local area network interface network bridge by the first virtual local area network interface network bridge through the routing network bridge;
when the second virtual machine sends message feedback information to the first virtual machine, the second virtual local area network interface bridge forwards the message feedback information to the first virtual local area network interface bridge through the routing bridge.
4. The method of claim 1, wherein the optimized packet information is determined by the master agent based on routing information of the first packet.
5. The method of claim 4, wherein before capturing the optimized message information sent by the host agent to the virtual machine by the agent on the same host as the virtual machine, the method comprises:
and capturing the routing information of the first message through the master agent, wherein the master agent and the first message pass through a route on the same host, and the route records the routing information of the first message in a connection tracking table.
6. The method of claim 5, wherein the routing information of the first packet comprises: the sending routing information of the first message and the feedback routing information of the first message,
the routing information of the first message comprises the path state information which is sent to the first virtual local area network interface by the first virtual machine, forwarded by the gateway of the route and then sent from the second virtual local area network interface to the second virtual machine;
the feedback routing information of the first message comprises channel state information which is sent to the second virtual local area network interface by the second virtual machine and is transmitted from the first virtual local area network interface to the first virtual machine after being forwarded by the gateway of the route.
7. The method of claim 1, wherein creating a routing bridge for connecting a first virtual local area network interface bridge and a second virtual local area network interface bridge based on the optimized packet information comprises:
identifying traffic on a virtual local area network interface bridge sending the traffic to direct the traffic to the routing bridge;
matching the MAC address and the bridge interface through the routing bridge, and forwarding the flow to the virtual local area network interface bridge receiving the flow.
8. The method of claim 4, wherein the optimized packet information is determined by the master agent based on routing information for the first packet, comprising:
and the master agent determines optimized message information based on the routing information of the first message and a preset trigger condition.
9. The method of claim 8, wherein the preset trigger condition comprises any one of:
the path state information in the sending routing information of the first message and the path state information in the feedback routing information of the first message are both in an intercommunication state;
traffic between the first virtual machine and the second virtual machine is degraded.
10. The method of claim 4, wherein prior to creating a routing bridge for connecting a first virtual local area network interface bridge and a second virtual local area network interface bridge based on the optimized packet information, comprising:
the main agent sends checking instruction information to the virtual machine based on the routing information of the first message;
an agent on the same host as the virtual machine captures the inspection instruction information and feeds back an inspection result to the main agent according to the inspection instruction information;
and the main agent sends optimized message information to the virtual machine according to the check result and a preset protocol format.
11. An apparatus for implementing inter-virtual machine communication, wherein the apparatus comprises:
one or more processors; and
memory storing computer readable instructions that, when executed, cause the processor to perform the operations of the method of any of claims 1 to 10.
12. A computer readable medium having computer readable instructions stored thereon which are executable by a processor to implement the method of any one of claims 1 to 10.
CN201811513715.1A 2018-12-11 2018-12-11 Method and equipment for realizing communication between virtual machines Active CN109714238B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811513715.1A CN109714238B (en) 2018-12-11 2018-12-11 Method and equipment for realizing communication between virtual machines

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811513715.1A CN109714238B (en) 2018-12-11 2018-12-11 Method and equipment for realizing communication between virtual machines

Publications (2)

Publication Number Publication Date
CN109714238A CN109714238A (en) 2019-05-03
CN109714238B true CN109714238B (en) 2021-08-10

Family

ID=66255599

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811513715.1A Active CN109714238B (en) 2018-12-11 2018-12-11 Method and equipment for realizing communication between virtual machines

Country Status (1)

Country Link
CN (1) CN109714238B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112468353B (en) * 2019-09-09 2023-11-21 华为数字技术(苏州)有限公司 Network reachability detection method and device
CN113709052B (en) * 2020-05-21 2024-02-27 中移(苏州)软件技术有限公司 Processing method and device of network message, electronic equipment and storage medium
CN113709200B (en) * 2020-05-21 2023-11-28 阿里巴巴集团控股有限公司 Method and device for establishing communication connection
CN112217689B (en) * 2020-09-11 2022-05-31 苏州浪潮智能科技有限公司 Network message tracking method and system based on OpenStack
CN113612689A (en) * 2021-08-11 2021-11-05 优刻得科技股份有限公司 Message forwarding method, system, device and medium
CN114039811B (en) * 2021-10-18 2023-07-25 南京邮电大学 Quick communication method in local area network
CN115150327A (en) * 2022-06-29 2022-10-04 济南浪潮数据技术有限公司 Interface setting method, device, equipment and medium
CN115396323B (en) * 2022-08-12 2024-03-12 徐州恒佳电子科技有限公司 Port real-time data stream visualization method and system based on finite state machine
CN116599901B (en) * 2023-06-13 2024-01-23 苏州浪潮智能科技有限公司 Service scheduling method, device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101465863A (en) * 2009-01-14 2009-06-24 北京航空航天大学 Method for implementing high-efficiency network I/O in kernel virtual machine circumstance
CN102075434A (en) * 2011-01-28 2011-05-25 华中科技大学 Communication method in virtual cluster
CN102801599A (en) * 2012-07-26 2012-11-28 华为技术有限公司 Communication method and system
CN103780674A (en) * 2013-11-13 2014-05-07 南京中兴新软件有限责任公司 Virtual machine communication method and apparatus based on hardware simulation

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090296726A1 (en) * 2008-06-03 2009-12-03 Brocade Communications Systems, Inc. ACCESS CONTROL LIST MANAGEMENT IN AN FCoE ENVIRONMENT

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101465863A (en) * 2009-01-14 2009-06-24 北京航空航天大学 Method for implementing high-efficiency network I/O in kernel virtual machine circumstance
CN102075434A (en) * 2011-01-28 2011-05-25 华中科技大学 Communication method in virtual cluster
CN102801599A (en) * 2012-07-26 2012-11-28 华为技术有限公司 Communication method and system
CN103780674A (en) * 2013-11-13 2014-05-07 南京中兴新软件有限责任公司 Virtual machine communication method and apparatus based on hardware simulation

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
《虚拟机迁移系统网络连接重定向技术》;温抿雄;《计算机应用研究》;20090515;第26卷(第5期);第1839-1843页 *

Also Published As

Publication number Publication date
CN109714238A (en) 2019-05-03

Similar Documents

Publication Publication Date Title
CN109714238B (en) Method and equipment for realizing communication between virtual machines
US11050586B2 (en) Inter-cloud communication method and related device, and inter-cloud communication configuration method and related device
EP3482532B1 (en) Automatic service function validation in a virtual network environment
RU2595540C9 (en) Chassis controllers for converting universal flows
CN115699698A (en) Loop prevention in virtual L2 networks
US11652743B2 (en) Internet group management protocol (IGMP) of a layer-2 network in a virtualized cloud environment
US10419361B2 (en) Interworking between physical network and virtual network
CN107646185A (en) Operation, management and processing (OAM) in data center environment is covered
CN105052113A (en) Common agent framework for network devices
US20210176172A1 (en) Packet forwarding method, device and apparatus, and storage medium
CN110519079B (en) Data forwarding method and device, network board, network equipment and storage medium
WO2021050435A1 (en) Determining connectivity between compute nodes in multi-hop paths
US20150301571A1 (en) Methods and apparatus for dynamic mapping of power outlets
CN113489640A (en) Message forwarding method, device and gateway system
WO2021103657A1 (en) Network operation method, apparatus, and device and storage medium
WO2020029928A1 (en) Method for establishing bgp session and sending interface address and alias, and network device
WO2020181733A1 (en) Vpc-based multi-data center intercommunication method and related device
WO2023093513A1 (en) Path sensing method, apparatus and system
CN109450794B (en) Communication method and device based on SDN network
CN109710423B (en) Method and equipment for communication between virtual machines
CN113839876B (en) Transmission path optimization method and equipment for internal network
CN115904626A (en) Method and system for deploying cloud resource pool architecture
CN116264538A (en) Data processing method, device, equipment and computer storage medium
WO2018223991A1 (en) Method and system for switching between active bng and standby bng, and bng
JP7273130B2 (en) Communication method and device

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
GR01 Patent grant
GR01 Patent grant