Virtual machine communication method, system, computer device and storage medium

By deploying OpenvSwitch virtual routers and protocol conversion modules in a cloud platform, and utilizing Linux network namespaces and OpenvSwitch internal ports to achieve protocol conversion between virtual machines, the problem of virtual machine cross-protocol communication in the cloud platform being dependent on physical devices is solved, and an efficient and flexible communication solution is achieved.

CN120935105BActive Publication Date: 2026-07-31JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JINAN INSPUR DATA TECH CO LTD
Filing Date
2025-07-31
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Cross-protocol communication between virtual machines in cloud platforms relies excessively on physical devices, resulting in low efficiency in adjusting physical devices and difficulty in meeting elastic scaling requirements.

Method used

Deploy an OpenvSwitch virtual router and protocol conversion module in a cloud platform. Utilize Linux network namespaces and OpenvSwitch internal ports to achieve protocol conversion between virtual machines, reducing dependence on physical devices. Send request packets to the protocol conversion module for protocol conversion through the virtual router and preset ports, and then send them to the target virtual machine through the virtual router.

Benefits of technology

It automates and streamlines cross-protocol communication between virtual machines, improves communication flexibility and reliability, reduces dependence on physical devices, and lowers maintenance complexity and cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120935105B_ABST
    Figure CN120935105B_ABST
Patent Text Reader

Abstract

This application discloses a virtual machine communication method, system, computer device, and storage medium, relating to the field of cloud platform technology. The method includes: a virtual router sending a first request message to a preset port; the first request message being sent to a protocol conversion module through the preset port; the protocol conversion module performing protocol conversion on the first request message to obtain a second request message; and the second request message being sent to a second virtual machine through the virtual router. This method solves the problem of excessive reliance on physical devices for cross-protocol communication between virtual machines, resulting in low efficiency in adjusting physical devices and difficulty in meeting the elastic scaling requirements of cloud platforms. The method deploys a protocol conversion module within the network namespace, using this module to convert the first request message to the second request message, removing the dependence on physical devices and replacing physical Layer 3 network devices with preset ports and virtual routers, thus reducing the public IP address requirements of physical Layer 3 network devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud platform technology, specifically to a virtual machine communication method, system, computer device, and storage medium. Background Technology

[0002] With the exponential growth of the internet, the IPv4 (Internet Protocol version 4) address pool has been exhausted. To avoid limiting network development, the current solution uses Internet Protocol version 6 (IPv6) addresses to address the address shortage. However, many critical services on current cloud platforms still rely on IPv4 addresses for communication, including numerous database services and third-party interfaces. Given the coexistence of old and new protocols, cloud platforms must support the hybrid deployment of IPv4 / IPv6 dual-stack virtual machines (VMs), and ensure cross-protocol communication between VMs.

[0003] Currently, cross-protocol communication in cloud platforms primarily relies on a combination of physical Layer 3 network devices and independent hardware NAT64 (Network Address Translation - IPv6 to IPv4) gateways. This solution is highly dependent on physical devices, requiring the configuration of static routes on physical routers to enable packet transmission between the cloud platform, the physical Layer 3 network devices, and the gateway. When the cloud platform dynamically expands, virtual machines migrate, or the network topology changes, the static routes on the physical routers need to be adjusted. However, the current manual adjustment of static routes is inefficient and cannot meet the elastic scaling requirements of cloud platforms. Summary of the Invention

[0004] In view of this, this application provides a virtual machine communication method, system, computer device, and storage medium to solve the problem that cross-protocol communication between virtual machines relies excessively on physical devices, has low efficiency in adjusting physical devices, and is difficult to meet the elastic expansion requirements of cloud platforms.

[0005] In a first aspect, this application provides a virtual machine communication method, which is applied to a virtual router, and the method includes:

[0006] Upon receiving a first request message from the first virtual machine, the first request message is sent to a preset port, which then forwards the first request message to a protocol conversion module. The protocol conversion module performs protocol conversion on the first request message to obtain a second request message. The virtual router and the first virtual machine reside on the same cloud platform, and the preset port and the protocol conversion module reside in the same network namespace. The virtual router and the preset port are connected via a virtual network. Upon receiving a second request message from the preset port, the second request message is sent to the second virtual machine. The communication protocols of the first and second virtual machines are different, and the virtual router and the second virtual machine reside on the same cloud platform.

[0007] Secondly, this application provides a virtual machine communication method, which is applied to a protocol conversion module, and the method includes:

[0008] Upon receiving a first request message from the first virtual machine, the first request message is converted into a second request message through protocol conversion. The first request message received by the protocol conversion module is sent from a preset port. The first request message received by the preset port is sent by a virtual router. The virtual router and the first virtual machine reside on the same cloud platform. The preset port and the protocol conversion module reside in the same network namespace. The virtual router and the preset port are connected via a virtual network. The second request message is then sent to the preset port, which in turn forwards the second request message to the virtual router. The virtual router is used to forward the second request message to the second virtual machine. The communication protocols of the first and second virtual machines are different. The virtual router and the second virtual machine reside on the same cloud platform.

[0009] Thirdly, this application provides a virtual machine communication system, which includes: a virtual router, a preset port, and a protocol conversion module;

[0010] The virtual router resides on the same cloud platform as the first virtual machine and the second virtual machine, but the communication protocols of the first and second virtual machines are different. The virtual router is connected to a preset port via a virtual network and is used to send the first request message to the preset port upon receiving the first request message from the first virtual machine. The preset port resides in the same network namespace as the protocol conversion module and is used to send the first request message to the protocol conversion module. The protocol conversion module is used to perform protocol conversion on the first request message to obtain a second request message and send the second request message to the preset port. The preset port is used to send the second request message to the virtual router. Upon receiving the second request message sent by the preset port, the virtual router is used to send the second request message to the second virtual machine.

[0011] Fourthly, this application provides a computer device, including: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the virtual machine communication method of the first aspect or any corresponding embodiment described above, or to perform the virtual machine communication method of the second aspect or any corresponding embodiment described above.

[0012] Fifthly, this application provides a computer-readable storage medium storing computer instructions, which are used to cause a computer to execute the virtual machine communication method of the first aspect or any corresponding embodiment described above, or to execute the virtual machine communication method of the second aspect or any corresponding embodiment described above.

[0013] In a sixth aspect, this application provides a computer program product, including computer instructions, which are used to cause a computer to execute the virtual machine communication method of the first aspect or any corresponding embodiment described above, or to execute the virtual machine communication method of the second aspect or any corresponding embodiment described above.

[0014] This application addresses the problem of excessive reliance on physical devices for cross-protocol communication between virtual machines, leading to inefficient adjustments to physical devices and difficulty in meeting the elastic scaling requirements of cloud platforms. By deploying a protocol conversion module within the network namespace and using this module to convert the first request message into a second request message, the application eliminates dependence on physical devices, reduces the need for connecting cloud and external networks, and shortens the communication process. Furthermore, using a preset port and a virtual router instead of physical Layer 3 network devices reduces the need for public IP addresses of physical Layer 3 network devices and increases the flexibility of protocol conversion. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the specific embodiments or related technologies of this application, the drawings used in the description of the specific embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0016] Figure 1 This is a schematic diagram of the virtual machine communication process applied to a virtual router according to an embodiment of this application;

[0017] Figure 2This is a schematic diagram of the structure of a virtual machine communication system according to an embodiment of this application;

[0018] Figure 3 This is a flowchart illustrating another virtual machine communication method applied to a virtual router according to an embodiment of this application;

[0019] Figure 4 This is a schematic diagram of the virtual machine communication process applied to the protocol conversion module according to an embodiment of this application;

[0020] Figure 5 This is a flowchart illustrating another virtual machine communication method applied to a protocol conversion module according to an embodiment of this application;

[0021] Figure 6 This is a schematic diagram illustrating the process of deploying components using a deployment module according to an embodiment of this application;

[0022] Figure 7 This is a structural block diagram of a virtual machine communication device deployed on a virtual router according to an embodiment of this application;

[0023] Figure 8 This is a structural block diagram of a virtual machine communication device deployed in a protocol conversion module according to an embodiment of this application;

[0024] Figure 9 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of this application. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0026] IPv6 is a next-generation Internet protocol that uses 128-bit addresses, providing fundamental support for the Internet of Things (IoT) and large-scale networks. IPv4, the currently widely used Internet protocol, uses 32-bit addresses. With the exponential growth of the Internet, IPv4 address exhaustion has become a core bottleneck restricting network development. Currently, many business systems on the Internet still rely on the IPv4 protocol, especially in cloud environments, where numerous legacy applications, database services, and third-party interfaces still run on IPv4 networks. The coexistence of IPv4 and IPv6 protocols necessitates that cloud platforms support the hybrid deployment of IPv4 / IPv6 dual-stack virtual machines, making cross-protocol communication a core requirement for cloud platforms.

[0027] Cross-protocol communication requires protocol translation between IPv4 and IPv6. Currently, NAT64 translation technology is commonly used to achieve this. NAT64 is a network translation technology that establishes a bidirectional mapping between protocols and addresses between IPv6 and IPv4 networks, enabling IPv6 devices to access IPv4 resources while hiding the internal network structure. However, traditional cloud platforms primarily employ a combination of physical Layer 3 network devices and dedicated hardware NAT64 gateways to achieve cross-protocol communication. This approach suffers from strong reliance on physical devices, complex address management, and insufficient security isolation. First, it requires configuring static routes on physical routers to forward cross-protocol communication packets to dedicated NAT64 gateway nodes. When the cloud environment dynamically expands, virtual machines migrate, or network topology changes, manual adjustments to static routes are necessary, resulting in inefficient adjustments and failing to meet the elastic scaling requirements of the cloud platform. Second, the NAT64 gateway needs to be configured with both its public IPv4 and IPv6 addresses, and communication between virtual machines within the cloud platform and the public network where the NAT64 gateway resides must be established, leading to complex address planning. Finally, the NAT64 gateway, acting as a single point of access to the physical network, lacks an effective network isolation mechanism, and an attack could cause a complete communication outage across the entire cloud platform.

[0028] OpenvSwitch is an open-source virtual switch that enables flexible network traffic control and network interconnection between virtualized environments through software. It supports SDN (Software-Defined Networking) protocols and is widely used in cloud platforms to build programmable, high-performance virtual networks. OVN (Open Virtual Network) is a network virtualization technology based on software-defined networking, providing flexible network topology and security policy management for cloud environments, enhancing network isolation and scalability. Linux network namespaces are a resource isolation mechanism provided by the Linux kernel. By creating an independent network protocol stack for each process or container, it ensures that network configurations between different virtual environments do not interfere with each other, guaranteeing communication security and flexible scheduling. The network protocol stack includes IP (Internet Protocol) addresses, routing tables, firewall rules, and other information.

[0029] Based on the above, this application provides a virtual machine communication method that combines a virtual switch and an open virtual network to create an OpenvSwitch virtual router in a cloud platform; a protocol conversion module is created within the Linux network namespace; an OpenvSwitch internal port is created within the Linux network namespace based on OpenvSwitch technology; the OpenvSwitch virtual router and the NAT64 conversion module are connected using the Linux network namespace and the OpenvSwitch internal port; and packets are forwarded to the NAT64 conversion module using the OpenvSwitch virtual router, removing the dependency on physical Layer 3 forwarding devices and NAT64 gateways, while also reducing the need to connect cloud-internal and cloud-external networks and shortening the communication process. This achieves automated, lightweight, and highly reliable cross-protocol communication based on a pure software architecture for dual-stack communication.

[0030] According to an embodiment of this application, a virtual machine communication method for use with a virtual router is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, for example, a computer, a server, etc. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0031] This embodiment provides a virtual machine communication method applied to a virtual router. Figure 1 This is a flowchart of a virtual machine communication method according to an embodiment of this application, such as... Figure 1 As shown, the process includes the following steps:

[0032] Step S101: Upon receiving the first request message from the first virtual machine, the first request message is sent to a preset port, so that the preset port sends the first request message to the protocol conversion module. The protocol conversion module is used to perform protocol conversion on the first request message to obtain a second request message. The virtual router and the first virtual machine are in the same cloud platform, the preset port and the protocol conversion module are in the same network namespace, and the virtual router and the preset port are connected through a virtual network.

[0033] Specifically, a virtual router, for example, is an OpenvSwitch virtual router created in a cloud platform, combining virtual switch technology and open virtual networks. The OpenvSwitch virtual router supports a hybrid configuration of dynamic routing protocols and static routes. The router has a built-in traffic classification engine that matches packets requiring protocol conversion using a five-tuple (source IP address, destination IP address, port, protocol, and VLAN identifier), avoiding the performance loss caused by full traffic scanning. Preset ports, for example, are OpenvSwitch internal ports created within the Linux network namespace using virtual switch technology. These OpenvSwitch internal ports act as a bridge between the virtual router and the protocol conversion module, employing VETH (Virtual Ethernet) pairing technology to achieve bidirectional communication between the virtual router and the protocol conversion module. A VETH is a pair of virtual Ethernet devices connected together via a virtual link. Additionally, each preset port is configured with a unique media access control address. Network namespaces, such as the Linux network namespace, are dedicated namespaces. By creating independent network protocol stacks for each process or container, the Linux network namespace ensures that network configurations across different virtual environments do not interfere with each other, guaranteeing communication security and flexible scheduling. The network protocol stack includes information such as IP addresses, routing tables, and firewall rules. Protocol conversion modules, such as the NAT64 conversion module, are generated based on NAT64 conversion rules created within the Linux network namespace to achieve bidirectional conversion between IPv6 and IPv4 protocols. Figure 2 As shown, the virtual machine communication system includes a protocol conversion module, a preset port, a virtual router, and a network namespace, used to achieve dual-stack communication between IPv4 virtual machines and IPv6 virtual machines within the cloud. The virtual router and the first virtual machine reside on the same cloud platform, the preset port and the protocol conversion module reside in the same network namespace, and the virtual router and the preset port are connected through a virtual network.

[0034] The first virtual machine is, for example, an IPv4 virtual machine or an IPv6 virtual machine within the cloud. The first virtual machine generates a first request message using the corresponding protocol and forwards the first request message to the virtual router. For example, if the first virtual machine is an IPv6 virtual machine within the cloud and the second virtual machine is an IPv4 virtual machine within the cloud, the first virtual machine accesses an IPv6 address containing the second virtual machine according to the NAT64 rule, and the message is first forwarded to the OpenvSwitch virtual router.

[0035] When the virtual router receives the first request message from the first virtual machine, it matches the first request message with the built-in static routes. If the first request message matches a static route within the virtual router, it sends the first request message to a preset port based on the matching result. For example, if the protocol type of the first request message is IPv6, then... Figure 2 As shown, the virtual router matches the first request packet with the IPv6 static route, and forwards the first request packet to the OpenvSwitch internal port based on the matching result.

[0036] The default port sends the first request message to the protocol conversion module based on its built-in address information. For example, if the protocol type of the first request message is IPv6, the OpenvSwitch internal port forwards the first request message to the NAT64 conversion module in the Linux network namespace based on its IPv6 address.

[0037] After receiving the first request message, the protocol conversion module performs protocol conversion on the first request message according to its protocol conversion rules to obtain the second request message. For example, the protocol conversion module performs NAT64 conversion on the first request message according to the NAT64 conversion rules, converting the IPv6 network segments of the source address and destination address into IPv4 messages, i.e., the second request message.

[0038] By adding static routes to the OpenvSwitch virtual router, packets requiring NAT64 translation are forwarded to the NAT64 translation module. This ensures fast packet forwarding and low latency, and avoids forwarding all packets to the NAT64 translation module, reducing its performance overhead. Furthermore, using the OpenvSwitch virtual router instead of a physical Layer 3 gateway device reduces maintenance complexity and cost. The Linux network namespace provides an independent network environment, isolating it from the operating system's network structure, improving the security of the NAT64 translation module, and removing its dependency on the host machine's physical network interface card.

[0039] Step S102: Upon receiving a second request message from a preset port, the second request message is sent to the second virtual machine. The communication protocols of the first virtual machine and the second virtual machine are different, and the virtual router and the second virtual machine are located in the same cloud platform.

[0040] Specifically, the protocol conversion module converts the first request message into a second request message, and then forwards the second request message to a preset port. The preset port then forwards the second request message to the virtual router. For example, the NAT64 conversion module converts the first request message of the IPv6 protocol into a second request message of the IPv4 protocol, and then forwards the second request message to the OpenvSwitch internal port. The OpenvSwitch internal port then forwards the second request message to the virtual router.

[0041] The second virtual machine, for example, is either an IPv6 virtual machine or an IPv4 virtual machine within the cloud. The communication protocols of the first and second virtual machines are different; that is, if the first virtual machine is an IPv6 virtual machine, then the second virtual machine is an IPv4 virtual machine, and vice versa. When the virtual router receives a second request message from a preset port, it matches the second request message with the built-in static routes. If the second request message matches a static route within the virtual router, it sends the second request message to the second virtual machine based on the matching result. For example, if the protocol type of the second request message is IPv4... Figure 2 As shown, the virtual router and the second virtual machine are in the same cloud platform. The virtual router matches the second request message with the IPv4 static route and forwards the second request message to the corresponding IPv4 virtual machine in the cloud, i.e., the second virtual machine, based on the matching result.

[0042] This embodiment provides a virtual machine communication method in which a virtual router sends a first request message to a preset port, and then sends the first request message to a protocol conversion module through the preset port. The protocol conversion module performs protocol conversion on the first request message to obtain a second request message, which is then sent to a second virtual machine through the virtual router. This method deploys the protocol conversion module within the network namespace and uses it to convert the first request message into a second request message, removing the dependence on physical devices and reducing the need to connect cloud-internal and cloud-external networks, thus shortening the communication process. Furthermore, using a preset port and a virtual router instead of physical Layer 3 network devices reduces the need for public IP addresses of physical Layer 3 network devices and increases the flexibility of protocol conversion. This solves the problem of excessive reliance on physical devices for cross-protocol communication between virtual machines, low efficiency in adjusting physical devices, and difficulty in meeting the elastic scaling requirements of cloud platforms.

[0043] This embodiment provides another virtual machine communication method applied to a virtual router. Figure 3 This is a flowchart of another virtual machine communication method applied to a virtual router according to an embodiment of this application, such as... Figure 3 As shown, the process includes the following steps:

[0044] Step S301: Upon receiving the first request message from the first virtual machine, the first request message is sent to a preset port, so that the preset port sends the first request message to the protocol conversion module. The protocol conversion module is used to perform protocol conversion on the first request message to obtain a second request message. The virtual router and the first virtual machine are in the same cloud platform, the preset port and the protocol conversion module are in the same network namespace, and the virtual router and the preset port are connected through a virtual network.

[0045] For details on how to implement this step, please refer to [link / reference]. Figure 1 Step S101 of the illustrated embodiment will not be described again here.

[0046] Step S302: Upon receiving a second request message from a preset port, the second request message is sent to the second virtual machine. The communication protocols of the first virtual machine and the second virtual machine are different, and the virtual router and the second virtual machine are located in the same cloud platform.

[0047] For details on how to implement this step, please refer to [link / reference]. Figure 1 Step S102 of the illustrated embodiment will not be described again here.

[0048] Step S303: Upon receiving the first reply message from the second virtual machine, match the first reply message with the routing table to obtain the first matching result.

[0049] Specifically, the second virtual machine is, for example, an IPv6 virtual machine or an IPv4 virtual machine in the cloud. The communication protocols of the first virtual machine and the second virtual machine are different. That is, if the first virtual machine is an IPv6 virtual machine in the cloud, then the second virtual machine is an IPv4 virtual machine in the cloud, and if the first virtual machine is an IPv4 virtual machine in the cloud, then the second virtual machine is an IPv6 virtual machine in the cloud.

[0050] Upon receiving the second request message, the second virtual machine parses it to determine the request information from the first virtual machine. The second virtual machine needs to reply to the first virtual machine, confirming whether it allows the first virtual machine to access it. The second virtual machine generates a first reply message. For example, if the second virtual machine is an IPv4 virtual machine within the cloud, it generates the first reply message based on the IPv4 protocol and the reply information; if the second virtual machine is an IPv6 virtual machine within the cloud, it generates the first reply message based on the IPv6 protocol and the reply information. The second virtual machine sends the first reply message to the virtual router. Upon receiving the first reply message from the second virtual machine, the virtual router matches it with its built-in static routes. If the first reply message matches a static route within the virtual router, the first matching result is determined. For example, if the protocol type of the first reply message is IPv4, such as... Figure 2As shown, the virtual router matches the first reply packet with the IPv4 static route to determine the first matching result. Subsequently, the first reply packet can be forwarded to the OpenvSwitch internal port based on the first matching result.

[0051] Step S304: Based on the first matching result, the first reply message is sent to the preset port, so that the preset port sends the first reply message to the protocol conversion module. The protocol conversion module is used to perform protocol conversion on the first reply message to obtain the second reply message.

[0052] Specifically, the virtual router sends the first reply packet to a preset port based on the first matching result. The preset port then sends the first request packet to the protocol conversion module based on its built-in address information. For example, if the protocol type of the first reply packet is IPv4, the OpenvSwitch internal port forwards the first reply packet to the NAT64 conversion module in the Linux network namespace based on its IPv4 address.

[0053] After receiving the first reply message, the protocol conversion module performs protocol conversion on the first reply message according to its protocol conversion rules to obtain the second reply message. For example, the protocol conversion module performs NAT64 conversion on the first reply message according to the NAT64 conversion rules, converting the IPv4 network segments of the source address and destination address into IPv6 packets, i.e., the second reply message.

[0054] Step S305: Upon receiving a second reply message from a preset port, the second reply message is matched against the routing table to obtain a second matching result.

[0055] Step S306: Based on the second matching result, send the second reply message to the first virtual machine.

[0056] Specifically, the protocol conversion module converts the first reply message into a second reply message, and then forwards the second reply message to a preset port. The preset port then forwards the second reply message to the virtual router. For example, the NAT64 conversion module converts the first reply message of the IPv4 protocol into a second reply message of the IPv6 protocol, and then forwards the second reply message to the OpenvSwitch internal port. The OpenvSwitch internal port then forwards the second reply message to the virtual router.

[0057] When the virtual router receives a second reply message from a preset port, it matches the second request message with its built-in static routes. If the second request message matches a static route within the virtual router, the matching result is determined, and the virtual router sends the second request message to the first virtual machine based on the matching result. For example, if the protocol type of the second request message is IPv6, such as... Figure 2 As shown, the virtual router and the second virtual machine are in the same cloud platform. The virtual router matches the second request message with the IPv6 static route to determine the second matching result. Based on the second matching result, the virtual router forwards the second request message to the corresponding cloud IPv6 virtual machine, namely the first virtual machine.

[0058] As an optional embodiment, the above step S301 "sends the first request message to the preset port" includes steps S3011 to S3013.

[0059] Step S3011: Determine whether the first request message is a message to be converted to a protocol. Step S3012: If the first request message is determined to be a message to be converted to a protocol, match the first request message with the routing table to obtain a third matching result. Step S3013: Send the first request message to the preset port according to the third matching result.

[0060] Specifically, when the virtual router receives the first request message from the first virtual machine, it determines whether the first request message is a message to be converted to a protocol. For example, the determination method is to record the five-tuple information of the message to be converted to a protocol in the virtual router, match the first request message with the five-tuple information, and if the match is successful, determine that the first request message is a message to be converted to a protocol. Alternatively, the static route of the message to be converted to a protocol can be recorded in the static routing table. If the first request message matches these static routes, determine that the first request message is a message to be converted to a protocol.

[0061] If the first request message is determined to be a message requiring protocol conversion, it is matched against the built-in static routes. If the first request message matches a static route within the virtual router, a third matching result is determined. For example, if the protocol type of the first request message is IPv6, the virtual router matches the first request message against an IPv6 static route to determine the third matching result; if the protocol type of the first request message is IPv4, the virtual router matches the first request message against an IPv4 static route to determine the third matching result. Based on the third matching result, the first request message is sent to a preset port, for example, it is forwarded to an internal OpenvSwitch port.

[0062] In this embodiment, the first request message is filtered by a virtual router, and only the message to be converted is sent to a preset port. The preset port then forwards the message to the protocol conversion module. This ensures fast message forwarding and low latency, and avoids all messages being forwarded to the protocol conversion module, thus reducing the performance consumption of the protocol conversion module. Furthermore, using a virtual router instead of a physical Layer 3 gateway device reduces the complexity and cost of maintenance.

[0063] As an optional embodiment, step S3011 includes steps A1 to A4.

[0064] Step A1: Obtain the 5-tuple information of the first request message. Step A2: Match the 5-tuple information with preset information. Step A3: If the match is successful, determine that the first request message is a message to be converted to the protocol. Step A4: If the match fails, determine that the first request message is not a message to be converted to the protocol.

[0065] Specifically, the five-tuple information of the first request message is obtained. This five-tuple information includes: source IP address, destination IP address, port address, protocol type, and virtual LAN identifier. In this embodiment, a traffic classification engine is built into the virtual router. The traffic classification engine records preset information, which is the five-tuple information of the user-specified message to be protocol-converted. The five-tuple information is matched with the preset information. If a match is successful, the first request message is determined to be a message to be protocol-converted; if a match fails, the first request message is determined not to be a message to be protocol-converted. Alternatively, the preset information can also be the prefix information of the user-specified message to be protocol-converted. For example, if the user specifies 64:ff9b: / 96 as the NAT64 conversion prefix, any message with the prefix 64:ff9b: / 96 needs to undergo protocol conversion.

[0066] This embodiment provides a virtual machine communication method in which a virtual router sends a first request message to a preset port, and then sends the first request message to a protocol conversion module through the preset port. The protocol conversion module performs protocol conversion on the first request message to obtain a second request message, which is then sent to a second virtual machine through the virtual router. This method deploys the protocol conversion module within the network namespace and uses it to convert the first request message into a second request message, removing the dependence on physical devices and reducing the need to connect cloud-internal and cloud-external networks, thus shortening the communication process. Furthermore, using a preset port and a virtual router instead of physical Layer 3 network devices reduces the need for public IP addresses of physical Layer 3 network devices and increases the flexibility of protocol conversion. This solves the problem of excessive reliance on physical devices for cross-protocol communication between virtual machines, low efficiency in adjusting physical devices, and difficulty in meeting the elastic scaling requirements of cloud platforms.

[0067] According to an embodiment of this application, a virtual machine communication method embodiment applied to a protocol conversion module is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, for example, a computer, a server, etc., and although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0068] This embodiment provides a virtual machine communication method applied to a protocol conversion module. Figure 4 This is a flowchart of a virtual machine communication method applied to a protocol conversion module according to an embodiment of this application, such as... Figure 4 As shown, the process includes the following steps:

[0069] Step S401: Upon receiving the first request message from the first virtual machine, the first request message is converted into a second request message by protocol conversion. The first request message received by the protocol conversion module is sent by a preset port. The first request message received by the preset port is sent by a virtual router. The virtual router and the first virtual machine are in the same cloud platform. The preset port and the protocol conversion module are in the same network namespace. The virtual router and the preset port are connected through a virtual network.

[0070] Specifically, upon receiving a first request message from the first virtual machine, the virtual router matches the first request message with its built-in static routes. If the first request message matches a static route within the virtual router, it sends the first request message to a preset port based on the matching result. For example, if the protocol type of the first request message is IPv6, then... Figure 2 As shown, the virtual router matches the first request packet with the IPv6 static route and forwards it to the OpenvSwitch internal port based on the matching result. The default port, based on its built-in address information, sends the first request packet to the protocol conversion module. For example, if the protocol type of the first request packet is IPv6, the OpenvSwitch internal port will forward it to the NAT64 translation module within the Linux network namespace based on its IPv6 address.

[0071] After receiving the first request message, the protocol conversion module performs protocol conversion on the first request message according to its protocol conversion rules to obtain the second request message. For example, the protocol conversion module performs NAT64 conversion on the first request message according to the NAT64 conversion rules, converting the IPv6 network segments of the source address and destination address into IPv4 messages, i.e., the second request message.

[0072] Step S402: Send the second request message to a preset port so that the preset port sends the second request message to the virtual router. The virtual router is used to send the second request message to the second virtual machine. The communication protocols of the first virtual machine and the second virtual machine are different. The virtual router and the second virtual machine are in the same cloud platform.

[0073] Specifically, the protocol conversion module converts the first request message into a second request message, and then forwards the second request message to a preset port. The preset port then forwards the second request message to the virtual router. For example, the NAT64 conversion module converts the first request message of the IPv6 protocol into a second request message of the IPv4 protocol, and then forwards the second request message to the OpenvSwitch internal port. The OpenvSwitch internal port then forwards the second request message to the virtual router.

[0074] The second virtual machine can be, for example, an IPv6 virtual machine or an IPv4 virtual machine within the cloud. The communication protocols of the first and second virtual machines are different; that is, if the first virtual machine is an IPv6 virtual machine, then the second virtual machine is an IPv4 virtual machine, and vice versa. When the virtual router receives a second request message from a preset port, it matches the second request message with the built-in static routes. If the second request message matches a static route within the virtual router, it sends the second request message to the second virtual machine based on the matching result.

[0075] This embodiment provides a virtual machine communication method. A protocol conversion module converts a received first request message into a second request message, which is then sent to a second virtual machine via a preset port and a virtual router. This method deploys the protocol conversion module within the network namespace, using it to convert the first request message into the second request message. It replaces physical Layer 3 network devices with preset ports and virtual routers, removing the dependency on physical devices. This solves the problems of excessive reliance on physical devices for cross-protocol communication between virtual machines, low efficiency in adjusting physical devices, and difficulty in meeting the elastic scaling requirements of cloud platforms.

[0076] This embodiment provides another virtual machine communication method applied to the protocol conversion module. Figure 5 This is a flowchart of another virtual machine communication method applied to a protocol conversion module according to an embodiment of this application, such as... Figure 5 As shown, the process includes the following steps:

[0077] Step S501: Upon receiving the first request message from the first virtual machine, the first request message is converted into a second request message by protocol conversion. The first request message received by the protocol conversion module is sent by a preset port. The first request message received by the preset port is sent by a virtual router. The virtual router and the first virtual machine are in the same cloud platform. The preset port and the protocol conversion module are in the same network namespace. The virtual router and the preset port are connected through a virtual network.

[0078] For details on how to implement this step, please refer to [link / reference]. Figure 4 Step S401 of the illustrated embodiment will not be described again here.

[0079] Step S502: Send the second request message to a preset port so that the preset port sends the second request message to the virtual router. The virtual router is used to send the second request message to the second virtual machine. The communication protocols of the first virtual machine and the second virtual machine are different. The virtual router and the second virtual machine are in the same cloud platform.

[0080] For details on how to implement this step, please refer to [link / reference]. Figure 4 Step S401 of the illustrated embodiment will not be described again here.

[0081] Step S503: Upon receiving the first reply message from the second virtual machine, the first reply message is protocol-converted to obtain the second reply message. The first reply message received by the protocol conversion module is sent by a preset port. The first reply message received by the preset port is sent by the virtual router based on the first matching result. The first matching result is obtained by the virtual router matching the first reply message with the routing table.

[0082] Specifically, upon receiving the first reply message from the second virtual machine, the virtual router matches the first reply message with its built-in static routes. If the first reply message matches a static route within the virtual router, the first match result is determined. For example, if the protocol type of the first reply message is IPv4, then... Figure 2 As shown, the virtual router matches the first reply packet with the IPv4 static route to determine the first match result. Subsequently, based on this match result, the virtual router forwards the first reply packet to the OpenvSwitch internal port. The virtual router then sends the first reply packet to a preset port based on the first match result. The preset port, based on its built-in address information, sends the first request packet to the protocol conversion module. For example, if the protocol type of the first reply packet is IPv4, the OpenvSwitch internal port forwards the first reply packet to the NAT64 translation module within the Linux network namespace based on its IPv4 address.

[0083] After receiving the first reply message, the protocol conversion module performs protocol conversion on the first reply message according to its protocol conversion rules to obtain the second reply message. For example, the protocol conversion module performs NAT64 conversion on the first reply message according to the NAT64 conversion rules, converting the IPv4 network segments of the source address and destination address into IPv6 packets, i.e., the second reply message.

[0084] Step S504: Send the second reply message to a preset port so that the preset port sends the second reply message to the virtual router. The virtual router is used to send the second reply message to the first virtual machine according to the second matching result. The second matching result is obtained by the virtual router by matching the second reply message with the routing table.

[0085] Specifically, the protocol conversion module converts the first reply message into a second reply message, and then forwards the second reply message to a preset port. The preset port then forwards the second reply message to the virtual router. For example, the NAT64 conversion module converts the first reply message of the IPv4 protocol into a second reply message of the IPv6 protocol, and then forwards the second reply message to the OpenvSwitch internal port. The OpenvSwitch internal port then forwards the second reply message to the virtual router.

[0086] When the virtual router receives a second reply message from a preset port, it matches the second request message with the built-in static route. If the second request message matches a static route in the virtual router, the second matching result is determined, and the virtual router sends the second request message to the first virtual machine based on the second matching result.

[0087] This embodiment provides a virtual machine communication method. A protocol conversion module converts a received first request message into a second request message, which is then sent to a second virtual machine via a preset port and a virtual router. This method deploys the protocol conversion module within the network namespace, using it to convert the first request message into the second request message. It replaces physical Layer 3 network devices with preset ports and virtual routers, removing the dependency on physical devices. This solves the problems of excessive reliance on physical devices for cross-protocol communication between virtual machines, low efficiency in adjusting physical devices, and difficulty in meeting the elastic scaling requirements of cloud platforms.

[0088] As an optional embodiment, the above step S401 "converting the first request message into a protocol to obtain a second request message" includes steps B1 and B2.

[0089] Step B1: The protocol conversion module receives the first request message and detects the IP address format of the first request message.

[0090] Specifically, the protocol conversion module determines whether the source address of the first request message is the IP address of the first virtual machine, and whether the destination address of the first request message is the IP address of another virtual machine in the cloud platform. Furthermore, the protocol type of the other virtual machine must be different from that of the first virtual machine. If the above conditions are met, it is determined that protocol conversion of the first request message is required.

[0091] In step B2, if the protocol conversion module determines that the first request message needs to be converted into an IPv6 protocol message and that the first request message is an IPv6 protocol message, then the first request message is converted from an IPv6 protocol message into an IPv4 protocol message, i.e., the second request message, and sent to the preset port.

[0092] Specifically, in this embodiment, there are two ways to convert IPv6 protocol packets into IPv4 protocol packets: stateful IPv4 to IPv6 conversion and stateless IPv4 to IPv6 conversion.

[0093] Stateful IPv4 and IPv6 translation includes: setting up an IPv4 address pool in the protocol conversion module; when converting an IPv6 address to an IPv4 address, randomly selecting an IPv4 address from the IPv4 address pool as the corresponding address for the IPv6 address; storing this mapping relationship in the protocol conversion module; and replacing the IPv6 address in the first request message with the corresponding IPv4 address, thereby converting the IPv6 address to an IPv4 address. When converting an IPv4 address back to its corresponding IPv6 address, searching for the corresponding IPv6 address from the mapping relationship, and replacing the IPv4 address in the first request message with the corresponding IPv6 address, thereby converting the IPv4 address back to an IPv6 address.

[0094] Stateless IPv4 and IPv6 translation eliminates the need to store mapping relationships in the protocol conversion module. To enable interoperability between IPv4 and IPv6 protocols, IPv4 addresses are embedded within IPv6 addresses. Simply adding a specific IPv6 prefix to the IPv4 address converts it to an IPv6 address. For example, if the IPv4 address is "ddd" and the IPv6 prefix is ​​"XXX:", the converted IPv6 address is "XXX:ddd". To convert the IPv6 address back to IPv4, simply remove the specific prefix "XXX:". Therefore, the default format is "XXX:ddd" with the specific prefix "XXX:". If the source and destination addresses of the first request packet conform to the default format, the specific prefix is ​​removed from the source and destination addresses to generate the source and destination addresses of the IPv4 data access request packet.

[0095] In this embodiment, network protocol conversion is achieved through software methods, eliminating the use of physical devices and reducing the cost of network protocol conversion. Integrating the entire system into a cloud platform management system fully leverages the advantages of the cloud platform, resulting in convenient system management and high reliability.

[0096] This embodiment provides a virtual machine communication system, such as Figure 2As shown, the virtual machine communication system includes: a virtual router, a preset port, and a protocol conversion module; the virtual router is located in the same cloud platform as the first virtual machine and the second virtual machine, and the communication protocols of the first virtual machine and the second virtual machine are different; the virtual router is connected to the preset port through a virtual network, and is used to send the first request message to the preset port when it receives the first request message from the first virtual machine; the preset port is located in the same network namespace as the protocol conversion module, and is used to send the first request message to the protocol conversion module; the protocol conversion module is used to perform protocol conversion on the first request message to obtain a second request message, and send the second request message to the preset port; the preset port is used to send the second request message to the virtual router; the virtual router is used to send the second request message to the second virtual machine when it receives the second request message sent by the preset port.

[0097] Specifically, such as Figure 2 As shown, the virtual machine communication system includes a protocol conversion module, a preset port, a virtual router, and a network namespace, used to achieve dual-stack communication between IPv4 virtual machines and IPv6 virtual machines within the cloud. The virtual router and the first virtual machine reside on the same cloud platform, and the preset port and the protocol conversion module reside in the same network namespace. The virtual router and the preset port are connected via a virtual network, for example: Figure 2 As shown, a virtual network connection between a preset port and a virtual router is achieved through a bridge, a first tunnel network card, and a second tunnel network card.

[0098] Virtual routers, for example, are OpenvSwitch virtual routers created in a cloud platform, combining virtual switch technology and open virtual networks. OpenvSwitch virtual routers support a mix of dynamic and static routing protocols. The router has a built-in traffic classification engine that matches packets requiring protocol conversion using a 5-tuple (source IP address, destination IP address, port, protocol, and VLAN identifier), avoiding the performance overhead of full traffic scanning. Preset ports, for example, are OpenvSwitch internal ports created within the Linux network namespace using virtual switch technology. These internal ports act as a bridge between the virtual router and the protocol conversion module, employing virtual Ethernet pairs (VETHs) to enable bidirectional communication. Each VETH is a pair of virtual Ethernet devices connected by a virtual link. Additionally, each preset port is configured with a unique media access control address. Network namespaces, for example, are Linux network namespaces. Linux network namespaces are dedicated namespaces that create independent network protocol stacks for each process or container, ensuring that network configurations between different virtual environments do not interfere with each other, guaranteeing communication security and flexible scheduling. The network protocol stack includes information such as IP addresses, routing tables, and firewall rules. For example, a protocol conversion module might include:

[0099] The NAT64 translation module is generated by creating NAT64 translation rules within the Linux network namespace and based on those rules. It is used to implement bidirectional translation between IPv6 and IPv4 protocols.

[0100] The first virtual machine is, for example, an IPv4 virtual machine or an IPv6 virtual machine in the cloud. The communication protocols of the first virtual machine and the second virtual machine are different. That is, if the first virtual machine is an IPv6 virtual machine in the cloud, then the second virtual machine is an IPv4 virtual machine in the cloud, and vice versa.

[0101] The first virtual machine generates a first request message using the corresponding protocol and forwards it to the virtual router. Upon receiving the first request message, the virtual router matches it against its built-in static routes. If a match is found, the virtual router sends the request message to a preset port based on the matching result. For example, if the protocol type of the first request message is IPv6... Figure 2As shown, the virtual router matches the first request packet with the IPv6 static route and forwards it to the OpenvSwitch internal port based on the matching result. The default port, based on its built-in address information, sends the first request packet to the protocol conversion module. For example, if the protocol type of the first request packet is IPv6, the OpenvSwitch internal port forwards it to the NAT64 translation module within the Linux network namespace based on its IPv6 address. Upon receiving the first request packet, the protocol conversion module performs protocol conversion according to its protocol conversion rules to obtain the second request packet. For example, the protocol conversion module performs NAT64 translation on the first request packet according to the NAT64 translation rules, converting the IPv6 network segments of the source and destination addresses into IPv4 packets, i.e., the second request packet.

[0102] The protocol conversion module converts the first request message into a second request message, and then forwards the second request message to a preset port. The preset port then forwards the second request message to the virtual router. For example, the NAT64 conversion module converts the first request message of IPv6 protocol into a second request message of IPv4 protocol, and then forwards the second request message to the OpenvSwitch internal port. The OpenvSwitch internal port then forwards the second request message to the virtual router. When the virtual router receives the second request message from the preset port, it matches the second request message with the built-in static routes. If the second request message matches a static route within the virtual router, it sends the second request message to the second virtual machine based on the matching result. For example, if the protocol type of the second request message is IPv4... Figure 2 As shown, the virtual router and the second virtual machine are in the same cloud platform. The virtual router matches the second request message with the IPv4 static route and forwards the second request message to the corresponding IPv4 virtual machine in the cloud, i.e., the second virtual machine, based on the matching result.

[0103] This embodiment provides a virtual machine communication system where a virtual router sends a first request message to a preset port. The preset port then forwards the first request message to a protocol conversion module. The protocol conversion module performs protocol conversion on the first request message to obtain a second request message, which is then sent to a second virtual machine via the virtual router. This method deploys a protocol conversion module within the network namespace, using it to convert the first request message into a second request message. This removes the dependency on physical devices, reduces the need to establish connections between cloud and external networks, and shortens the communication process. Furthermore, using a preset port and a virtual router instead of physical Layer 3 network devices reduces the need for public IP addresses of physical Layer 3 network devices and increases the flexibility of protocol conversion. This solves the problem of excessive reliance on physical devices for cross-protocol communication between virtual machines, low efficiency in adjusting physical devices, and difficulty in meeting the elastic scaling requirements of cloud platforms.

[0104] As an optional embodiment, the system further includes: a configuration interface module and a deployment module;

[0105] The configuration interface module provides a configuration interface for obtaining user configuration information. The deployment module retrieves the first network protocol, the second network protocol, and the prefix information of the first network protocol from the user configuration information, creates a virtual router, adds the first and second network protocols to the virtual router, and creates static routes for the virtual router based on the prefix information. The deployment module also retrieves the target cloud platform node from the user configuration information and creates a network namespace on the target cloud platform node. Furthermore, the deployment module creates a preset port on the target cloud platform node, adds the preset port to the network namespace, and configures the preset port according to the first and second network protocols. Finally, the deployment module retrieves preset protocol conversion rules from the user configuration information and creates a protocol conversion module in the network namespace based on these rules.

[0106] Specifically, the virtual machine communication system also includes: a configuration interface module and a deployment module. Combined with... Figure 6 This embodiment will be described.

[0107] The configuration interface module provides users with a configuration interface, such as a cloud platform page. The cloud platform page is a visual interface, like... Figure 6As shown, users can select any cloud platform node as the target cloud platform node on the cloud platform page, and use the target cloud platform node as the gateway node. The gateway node is used for NAT64 translation. Users can create protocol translation resources on the cloud platform page, such as NAT64 translation resources, which include an IPv6 prefix, an IPv4 address pool, and the IPv6 / IPv4 network to be established. The configuration interface module obtains the user's configuration information, including the target cloud platform node and NAT64 translation resource selected by the user. The configuration interface module generates a user request containing the user's configuration information and sends the user request to the deployment module.

[0108] After receiving a user request, the deployment module retrieves the user configuration information from the request. Within this information, it obtains the first network protocol, the second network protocol, and the prefix information for the first network protocol. For example, the first network protocol might be IPv6, and the second network protocol might be IPv4. The prefix information for the first network protocol, for example, is the prefix information for the IPv6 protocol. This prefix information is the prefix information for the packets to be NAT64 translated, specified by the user. For example, if the user specifies 64:ff9b: / 96 as the prefix information for packets requiring NAT64 translation, any first network protocol packet with the prefix 64:ff9b: / 96 needs to undergo protocol translation.

[0109] The deployment module creates a virtual router in the cloud platform, such as an OpenvSwitch virtual router. It adds a first network protocol and a second network protocol to the virtual router, thus adding the required IPv6 / IPv4 network to the virtual router. It creates static routes for the virtual router based on the prefix information of the first network protocol, for example: Figure 6 As shown, static routes are created based on the IPv6 prefix.

[0110] The deployment module retrieves the target cloud platform node from the user configuration information. This target cloud platform node is the gateway node selected by the user to act as a NAT64 translation tool. A network namespace is created on the specified gateway node, for example, a Linux network namespace. The deployment module also creates preset ports on the target cloud platform node, for example, internal ports for OpenvSwitch. A lightweight protocol stack is deployed within the namespace, loading only the IPv4 / IPv6 core modules (net.IPv4.conf.all.rp_filter=0, net.IPv6.conf.all.disable_IPv6=0), reducing system resource consumption. The IPv4 core module, for example, `net.IPv4.conf.all.rp_filter=0`, is used to configure reverse path filtering. Reverse path filtering prevents IP spoofing attacks (such as packets with forged source addresses). `net` indicates a network-related parameter; `IPv4` indicates IPv4 protocol configuration; `conf` is short for "configuration," indicating the following configuration items for network interfaces; `all` indicates this setting applies to all network interfaces in the system; `rp_filter` is short for Reverse Path Filter, and 0 disables reverse path filtering. The principle of reverse path filtering is: when a packet is received, the kernel checks the source IP address of the packet and then sees which route would be taken when returning from the local machine to that source address. If the egress interface of the return path matches the interface that received the packet, it is considered legitimate; otherwise, it may be considered a packet with a forged source address and will be dropped. For example, `net.IPv6.conf.all.disable_IPv6=0` is a parameter used to control whether the IPv6 protocol stack is enabled. Setting it to 1 disables IPv6 protocol support on the specified interface; setting it to 0 allows the use of the IPv6 protocol, where `IPv6` indicates that this is the IPv6 protocol configuration; `disable_IPv6` indicates whether the IPv6 protocol is disabled; `disable_IPv6=0` means the IPv6 protocol is not disabled.

[0111] Add the preset port to the network namespace. Configure the preset port according to the first network protocol and the second network protocol, for example: Figure 6 As shown, the first network protocol is IPv6, and the second network protocol is IPv4. The IPv6 address of the preset port is determined according to the IPv6 protocol, and the IPv4 address of the preset port is determined according to the IPv4 protocol. The preset port is then configured with both the IPv6 address and the IPv4 address.

[0112] The deployment module retrieves preset protocol conversion rules from the user configuration information, such as NAT64 conversion rules. Based on these rules, it creates a protocol conversion module in the network namespace; for example, it creates a NAT64 conversion module in the Linux network namespace. Then, it configures the corresponding rules for IPv6 and IPv4 conversion for the protocol conversion module according to the NAT64 conversion rules.

[0113] In this embodiment, the NAT64 translation rules are placed in the Linux network namespace to generate a protocol conversion module. The connection between the protocol conversion module and the virtual machine is directly established through a preset port and a virtual router, so that the NAT64 translation service no longer depends on the static forwarding of the Layer 3 physical network device and the physical host network card, thus removing the dependence on physical devices.

[0114] This embodiment also provides a virtual machine communication device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0115] This embodiment provides a virtual machine communication device deployed on a virtual router, such as... Figure 7 As shown, it includes: a first message sending unit 701, used to send the first request message to a preset port upon receiving a first request message from a first virtual machine, so that the preset port sends the first request message to a protocol conversion module, wherein the protocol conversion module is used to perform protocol conversion on the first request message to obtain a second request message, the virtual router and the first virtual machine are in the same cloud platform, the preset port and the protocol conversion module are in the same network namespace, and the virtual router and the preset port are connected through a virtual network; and a second message sending unit 702, used to send the second request message to a second virtual machine upon receiving a second request message sent by the preset port, wherein the communication protocols of the first virtual machine and the second virtual machine are different, and the virtual router and the second virtual machine are in the same cloud platform.

[0116] This embodiment provides a virtual machine communication device deployed in a protocol conversion module, such as... Figure 8As shown, it includes: a protocol conversion unit 801, used to convert the first request message received from the first virtual machine into a second request message, wherein the first request message received by the protocol conversion module is sent by a preset port, the first request message received by the preset port is sent by a virtual router, the virtual router and the first virtual machine are in the same cloud platform, the preset port and the protocol conversion module are in the same network namespace, and the virtual router and the preset port are connected through a virtual network; and a third message sending unit 802, used to send the second request message to the preset port, so that the preset port sends the second request message to the virtual router, wherein the virtual router is used to send the second request message to the second virtual machine, the communication protocols of the first virtual machine and the second virtual machine are different, and the virtual router and the second virtual machine are in the same cloud platform.

[0117] Further functional descriptions of the above modules are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0118] In this embodiment, the virtual machine communication device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0119] This application also provides a computer device having the above-described features. Figure 7 and Figure 8 The virtual machine communication device shown.

[0120] Please see Figure 9 , Figure 9 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of this application, such as... Figure 9 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 9 Take a processor 10 as an example.

[0121] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include an integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field-programmable gate array (FPGA), a general-purpose array logic (GPA), or any combination thereof.

[0122] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.

[0123] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device 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.

[0124] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0125] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.

[0126] This application also provides a computer-readable storage medium. The methods described in this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded over a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium may also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the methods shown in the above embodiments are implemented.

[0127] A portion of this application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to this application through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0128] Although embodiments of this application have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of this application, and such modifications and variations all fall within the scope defined by this application.

Claims

1. A method of communicating with virtual machines, the method comprising: The method is applied to a virtual router, and the method includes: Upon receiving a first request message from a first virtual machine, the first request message is sent to a preset port, so that the preset port sends the first request message to a protocol conversion module. The protocol conversion module is used to perform protocol conversion on the first request message to obtain a second request message. The virtual router and the first virtual machine are in the same cloud platform, the preset port and the protocol conversion module are in the same network namespace, and the virtual router and the preset port are connected through a virtual network. Upon receiving the second request message sent from the preset port, the second request message is sent to the second virtual machine, wherein the communication protocols of the first virtual machine and the second virtual machine are different, and the virtual router and the second virtual machine are in the same cloud platform.

2. The method of claim 1, wherein, After sending the second request message to the second virtual machine, the method further includes: Upon receiving the first reply message from the second virtual machine, the first reply message is matched against the routing table to obtain the first matching result; The first reply message is sent to the preset port according to the first matching result, so that the preset port sends the first reply message to the protocol conversion module, wherein the protocol conversion module is used to perform protocol conversion on the first reply message to obtain a second reply message; Upon receiving the second reply message sent by the preset port, the second reply message is matched with the routing table to obtain a second matching result; Based on the second matching result, the second reply message is sent to the first virtual machine.

3. The method of claim 1, wherein, Sending the first request message to a preset port includes: Determine whether the first request message is a message to be converted to a different protocol; If it is determined that the first request message is a message to be converted by the protocol, the first request message is matched with the routing table to obtain a third matching result; The first request message is sent to the preset port based on the third matching result.

4. The method of claim 3, wherein, The determination of whether the first request message is a message to be converted to a protocol includes: Obtain the 5-tuple information of the first request message; Match the quintuple information with preset information; If the match is successful, it is determined that the first request message is a message to be converted by the protocol; If the match fails, it is determined that the first request message is not the message to be converted by the protocol.

5. A virtual machine communication method characterized by, The method is applied to a protocol conversion module, and the method includes: Upon receiving a first request message from a first virtual machine, the first request message is converted into a second request message through protocol conversion. The first request message received by the protocol conversion module is sent by a preset port. The first request message received by the preset port is sent by a virtual router. The virtual router and the first virtual machine are in the same cloud platform. The preset port and the protocol conversion module are in the same network namespace. The virtual router and the preset port are connected through a virtual network. The second request message is sent to the preset port, so that the preset port sends the second request message to the virtual router. The virtual router is used to send the second request message to the second virtual machine. The communication protocols of the first virtual machine and the second virtual machine are different. The virtual router and the second virtual machine are in the same cloud platform.

6. The method of claim 5, wherein, The method further includes: Upon receiving the first reply message from the second virtual machine, the first reply message is converted into a protocol to obtain a second reply message. The first reply message received by the protocol conversion module is sent by the preset port. The first reply message received by the preset port is sent by the virtual router based on a first matching result. The first matching result is obtained by the virtual router by matching the first reply message with the routing table. The second reply message is sent to the preset port, so that the preset port sends the second reply message to the virtual router. The virtual router is used to send the second reply message to the first virtual machine according to the second matching result, whereby the second matching result is obtained by the virtual router by matching the second reply message with the routing table.

7. A virtual machine communication system, characterized by The system includes: a virtual router, a preset port, and a protocol conversion module; The virtual router is located on the same cloud platform as the first virtual machine and the second virtual machine, but the communication protocols of the first virtual machine and the second virtual machine are different. The virtual router is connected to the preset port via a virtual network and is used to send the first request message to the preset port when the first request message of the first virtual machine is received. The preset port is in the same network namespace as the protocol conversion module and is used to send the first request message to the protocol conversion module; The protocol conversion module is used to convert the first request message into a second request message and send the second request message to the preset port. The preset port is used to send the second request message to the virtual router; The virtual router is configured to send the second request message to the second virtual machine upon receiving the second request message sent from the preset port.

8. The system of claim 7, wherein, The system also includes: a configuration interface module and a deployment module; The configuration interface module is used to provide a configuration interface, which is used to obtain user configuration information; The deployment module is used to obtain a first network protocol, a second network protocol, and prefix information of the first network protocol from the user configuration information, create the virtual router, add the first network protocol and the second network protocol to the virtual router, and create a static route for the virtual router according to the prefix information. The deployment module is also used to obtain the target cloud platform node from the user configuration information and create the network namespace on the target cloud platform node; The deployment module is further configured to create the preset port on the target cloud platform node, add the preset port to the network namespace, and configure the preset port according to the first network protocol and the second network protocol. The deployment module is also used to obtain preset protocol conversion rules from the user configuration information and create the protocol conversion module in the network namespace according to the preset protocol conversion rules.

9. A computer device, comprising: include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the virtual machine communication method of any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the virtual machine communication method according to any one of claims 1 to 6.