Message forwarding method and device, computer readable storage medium and program product
By receiving and forwarding messages carrying virtual private cloud identifiers in the VPC network environment, the virtualization problem of requiring special equipment in traditional technology is solved, and efficient and low-cost message forwarding and network function processing is achieved.
Patent Information
- Application Number
- CN202411790616.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-07
AI Technical Summary
In the VPC network environment, traditional technology requires special virtual bridges or gateway devices to support, which is less practical and difficult to effectively solve the virtualization needs of NFV network elements under the VPC network.
By receiving messages forwarded by the virtual machine of the first cloud host, the destination physical address is determined based on the message, and when the determined address is the virtual network card address of the second cloud host, the source physical address carrying the virtual private cloud identifier is generated, the message forwarding is performed and the target network function processing is performed.
There is no need to deploy special equipment, and packet forwarding can be achieved by creating a virtual network card on a cloud host, reducing costs, improving practicality, and ensuring the stability and reliability of network function processing.
Smart Images

Figure CN119583441A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network communication technology, and in particular to a message conversion method, device, computer-readable storage medium and program product. Background Art
[0002] At present, mainstream cloud service providers, especially public cloud service providers, all provide virtual private cloud (VPC) products, and provide various virtualization services in the VPC environment, including cloud hosts, cloud physical machines, etc. In addition to providing basic layer 2 and layer 3 network interconnection functions, mainstream cloud service providers also provide various network function services in the VPC environment, such as firewalls (FireWall), network address translation (Network Address Translation, NAT) gateways, etc. At present, network function virtualization (NFV) technology is basically used to implement these network functions. NFV network elements are usually deployed on cloud hosts (virtual machines) in VPC to provide multi-tenant network function services. In other words, to access NFV network elements under the VPC network, further virtualization is required on the VPC virtualized network.
[0003] Traditional technologies usually use multi-level tunnels, overlay networks, virtual local area networks (VLANs), etc. However, the various technologies used in traditional technologies require the support of special virtual bridges or gateway devices, which are less practical. Summary of the invention
[0004] Based on this, it is necessary to provide a message forwarding method, device, computer-readable storage medium and program product with high practicality in order to solve the above technical problems.
[0005] In a first aspect, the present application provides a message forwarding method, the method comprising:
[0006] Receive a first message forwarded by a virtual machine of a first cloud host, and determine a first destination physical address based on the first message;
[0007] In a case where the determined first destination physical address is a virtual network card address of a virtual machine of the second cloud host, generating a first source physical address according to the virtual private cloud identifier of the first cloud host and the initial source physical address in the first message;
[0008] The message is forwarded according to the first source physical address and the first destination physical address, and target network function processing is performed.
[0009] In one embodiment, determining the first destination physical address based on the first message includes:
[0010] When the initial destination physical address in the first message is the virtual gateway address of the virtual machine of the first cloud host, query the first routing table and modify the initial destination physical address in the first message;
[0011] Forwarding the first message based on the modified initial destination physical address in the second message, and querying the first address table to determine the first destination physical address;
[0012] When the initial destination physical address in the first message is the virtual network card address of the virtual machine of the second cloud host, the first address table is queried to determine the first destination physical address.
[0013] In one embodiment, generating a first source physical address according to a virtual private cloud identifier of a first cloud host and an initial source physical address in a first message includes:
[0014] The high-order bytes of the initial source physical address in the first message are replaced with the virtual private cloud identifier to generate a first source physical address.
[0015] In one embodiment, when the host corresponding to the first cloud host is a first server and the host corresponding to the second cloud host is a second server, the method for determining whether the first destination physical address is a virtual network card address of a virtual machine of the second cloud host includes:
[0016] Based on the first destination physical address, the first message is forwarded to the second server, so that the second server queries the first address table based on the first destination physical address in the received first message, and determines whether the first destination physical address is the virtual network card address of the virtual machine of the second cloud host.
[0017] In one embodiment, the method further comprises:
[0018] receiving a second message after target network function processing, and determining whether a second source physical address of the second message includes a virtual private cloud identifier;
[0019] When it is determined that the second source physical address of the second message includes the virtual private cloud identifier, determining the second destination physical address according to the virtual private cloud identifier;
[0020] The second message is forwarded to the virtual machine of the first cloud host according to the second destination physical address.
[0021] In one embodiment, determining the second destination physical address according to the virtual private cloud identifier includes:
[0022] When the initial destination physical address in the second message is the virtual gateway address of the virtual machine of the third cloud host, query the second routing table according to the virtual private cloud identifier and modify the initial destination physical address in the second message;
[0023] Based on the modified initial destination physical address in the second message, query the second address table to determine the second destination physical address;
[0024] When the destination physical address in the second message is the virtual network card address of the virtual machine of the first cloud host, the second address table is queried to determine the second destination physical address.
[0025] In one embodiment, when the host corresponding to the first cloud host is a first server and the host corresponding to the second cloud host is a second server, forwarding the second message to the virtual machine of the first cloud host according to the second destination physical address includes:
[0026] Based on the second destination physical address, the second message is forwarded to the first server, so that the first server queries the second address table based on the second destination physical address in the received second message and forwards the second message to the virtual machine of the first cloud host.
[0027] In a second aspect, an embodiment of the present application provides a message forwarding device, the device comprising:
[0028] A receiving module, configured to receive a first message forwarded by a virtual machine of a first cloud host, and determine a first destination physical address based on the first message;
[0029] A generating module, configured to generate a first source physical address according to a virtual private cloud identifier of the first cloud host and an initial source physical address in the first message when the determined first destination physical address is a virtual network card address of a virtual machine of the second cloud host;
[0030] The forwarding module is used to forward the message according to the first source physical address and the first destination physical address, and perform target network function processing.
[0031] In a third aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method provided in the first aspect are implemented.
[0032] In a fourth aspect, an embodiment of the present application provides a computer program product, including a computer program, which implements the steps of the method provided in the first aspect when the computer program is executed by a processor.
[0033] The above-mentioned message forwarding method, device, computer-readable storage medium and program product, by receiving the first message forwarded by the virtual machine of the first cloud host, determine the first destination physical address based on the first message; when the determined first destination physical address is the virtual network card address of the virtual machine of the second cloud host, generate the first source physical address according to the virtual private cloud identifier of the first cloud host and the initial source physical address in the first message; forward the message according to the first source physical address and the first destination physical address, and perform target network function processing. In this embodiment, by making the first source physical address in the first message carry the virtual private cloud identifier of the first cloud host, the virtual private cloud information of the first cloud host is transmitted to the virtual network card of the virtual machine of the second cloud host, without the need to deploy special equipment for support, only the virtual network card needs to be created in the first cloud host and the second cloud host, the cost is low, and it is applicable to all users, and it has high practicality. In addition, the virtual machine of the second cloud host can shield the impact on the second and third layer processing flow of the overall traffic by processing the received first message, ensuring the normal operation of other traffic processing flows, so that the second cloud host has high stability and reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 An application environment diagram of a message forwarding method in an embodiment;
[0035] Figure 2 A schematic diagram of a flow chart of steps of a message forwarding method in an embodiment;
[0036] Figure 3 A schematic diagram of a flow chart of steps of a message forwarding method in another embodiment;
[0037] Figure 4 A schematic diagram of a flow chart of steps of a message forwarding method in another embodiment;
[0038] Figure 5 A schematic diagram of a flow chart of steps of a message forwarding method in another embodiment;
[0039] Figure 6 A schematic diagram of a flow chart of steps of a message forwarding method in another embodiment;
[0040] Figure 7 A schematic diagram of a flow chart of steps of a message forwarding method in another embodiment;
[0041] Figure 8 A schematic diagram of the structure of a message forwarding device in an embodiment;
[0042] Fig. 9 FIG. 4 is a schematic diagram of the structure of a server in an embodiment. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0044] The serial numbers assigned to the components in this article, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning.
[0045] First, before specifically introducing the technical solutions of the embodiments disclosed in the present application, the background technology or technical evolution context based on the embodiments of the present application is introduced. At present, mainstream cloud service providers, especially shared cloud service providers, all provide VPC (Virtual Private Cloud) products, and provide various virtualization services in the VPC environment, including cloud hosts, cloud physical machines, etc. Usually, cloud resources use isolated Internet Protocol Address (IP) addresses to conduct network communications based on the Transmission Control Protocol (TCP) / IP protocol stack within the VPC, and the data packets of cloud resources are converted into overlay networks on specific network devices to access the VPC network. In addition to the basic second and third layer network intercommunication functions, mainstream cloud service providers also provide various network function services in the VPC environment, such as firewalls (FireWall), network address translation (NAT) gateways, etc. At present, network function virtualization (NFV) technology is basically used to implement these network functions. NFV network elements are usually deployed on cloud hosts (virtual machines) in VPC to provide multi-tenant network function services.
[0046] NFV network elements need to support virtual routing and forwarding (VRF) isolation to support multi-tenant services. The IP address space between VPCs is independent, that is, the IP addresses of different VPCs may be the same, and the VPC itself is implemented in the Overlay network. Therefore, when accessing NFV network elements in the VPC network, it is necessary to support two-level Overlay network virtualization functions, that is, to support further virtualization on the VPC network.
[0047] In traditional technologies, for accessing NFV network elements under VPC networks, multi-level tunnels, Overlay virtual local area networks (VLANs) and other technologies are usually used. However, the various technologies used in traditional technologies require special virtual bridges or special gateway devices to support them, which have high requirements, are not conducive to promotion, and have low practicality. In this regard, the present application provides a message forwarding method.
[0048] The message forwarding method provided in the present application can be applied to a cloud platform system, in which multiple cloud hosts are deployed. Each cloud host implements the function of a virtual switch by the open source OpenVSwitch (OVS) to provide network connection services for virtual machines in the cloud host. The host of each cloud host can be the same server, or one cloud host corresponds to one server. The multiple cloud hosts include at least a first cloud host, a second cloud host, and a third cloud host. The first cloud host and the third cloud host can be a first client cloud host and a second client cloud host, respectively. The second cloud host is a cloud host that can provide NFV, that is, an NFV cloud host. The virtual network card of the second cloud host is marked, that is, the virtual network card turns on the NFV function, allowing other cloud hosts to mount the virtual network card of the gateway instance to the virtual network card of the NFV network element based on the VPC network to use the network function provided by the NFV network element. The first cloud host and the third cloud host create a virtual network card as an access point for the gateway instance under the VPC network, and bind the virtual network card to the virtual network card of the second cloud host, so that the virtual network card serves as a sub-interface of the virtual network card of the second cloud host, and is used to receive and send business traffic of the virtual gateway instance. The virtual network card of the second cloud host can be bound to the virtual network cards of multiple first cloud hosts and second cloud hosts, that is, the second cloud host includes multiple sub-interfaces for receiving and sending business traffic of virtual gateway instances of multiple different VPCs. Business traffic transmission between the first cloud host, the second cloud host, and the third cloud host is as follows: Figure 1 As shown, business process transmission is performed between the virtual machine of the first cloud host and the virtual machine of the second cloud host under the VPC network, and business process transmission is performed between the virtual machine of the third cloud host and the virtual machine of the second cloud host under the VPC network.
[0049] The technical solution of the present application and how the technical solution of the present application solves the technical problem are described in detail below with specific embodiments.
[0050] In one embodiment, Figure 2As shown, a message conversion method is provided. This embodiment uses the method to be applied to the virtual machine of the second cloud host as shown above as an example. In this embodiment, the method describes a process in which the virtual machine of the first cloud host forwards a first message to the virtual machine of the second cloud host, the virtual machine of the second cloud host receives the first message, and performs network function processing on the first message. The method includes the following steps:
[0051] Step 200: Receive a first message forwarded by a virtual machine of a first cloud host, and determine a first destination physical address based on the first message.
[0052] The virtual machine of the first cloud host sends access service traffic, and can encapsulate the access service traffic into a first message based on tunnel technology, and forward the first message to the virtual machine of the second cloud host. The first message may include a source physical (Media Access Control, MAC) address, a destination MAC address, a source (Internet Protocol (Internet Protocol, IP) address, a destination IP address, and specific access data of the first cloud host. After the virtual machine of the second cloud host receives the first message forwarded by the virtual machine of the first cloud host, it parses the first message and can obtain the initial destination physical address and the initial source physical address. The initial source physical address is the address of the virtual network card of the virtual machine of the first cloud host, and the initial destination physical address may be the virtual network card address of the virtual machine of the first cloud host, or it may be the virtual network card address of the virtual machine of the second cloud host. The virtual machine of the second cloud host determines the first destination physical address based on the obtained initial destination physical address. This embodiment does not limit the specific method for determining the first destination physical address based on the first message, as long as its function can be achieved.
[0053] Step 210: When the determined first destination physical address is the virtual network card address of the virtual machine of the second cloud host, generate a first source physical address according to the virtual private cloud identifier of the first cloud host and the initial source physical address in the first message.
[0054] The virtual machine of the second cloud host determines whether the determined first destination physical address is the virtual network card address of the virtual machine of the second cloud host. If the determined first destination physical address is the virtual network card address of the virtual machine of the second cloud host, the first source physical address is generated by parsing the received first message to determine the virtual private cloud (VPC) identifier of the first cloud host and the initial source physical address in the first message. In other words, the first source physical address can be generated by modifying the initial source physical address according to the VPC identifier of the first cloud host so that the first source physical address contains the VPC identifier of the first cloud host. This embodiment does not limit the specific method for generating the first source physical address according to the VPC identifier of the first cloud host and the initial source physical address in the first message, as long as its function can be achieved.
[0055] In an optional embodiment, the virtual machine of the second cloud host can add the VPC identifier of the first cloud host to the target location of the initial source physical address to generate the first source physical address. The target location can be the beginning of the initial source physical address or the end of the initial source physical address. This embodiment does not limit this as long as its function can be achieved.
[0056] Step 220: forward the message according to the first source physical address and the first destination physical address, and perform target network function processing.
[0057] After determining the first source physical address in the first message, the virtual machine of the second cloud host forwards the message according to the first source physical address and the first destination physical address, and enters the target network function processing. In other words, the virtual machine of the first cloud host can forward the first message to the virtual network card of the virtual machine of the second cloud host according to the first destination physical address in the first message, so that the virtual network card of the virtual machine of the second cloud host recognizes the VPC identifier in the first source physical address in the first message, and determines the target network function required by the first cloud host based on the VPC identifier, performs VRF distinction, and performs target network function processing.
[0058] The message forwarding method provided in the embodiment of the present application receives the first message forwarded by the virtual machine of the first cloud host, determines the first destination physical address based on the first message; when the determined first destination physical address is the virtual network card address of the virtual machine of the second cloud host, generates the first source physical address according to the virtual private cloud identifier of the first cloud host and the initial source physical address in the first message; forwards the message according to the first source physical address and the first destination physical address, and performs target network function processing. In this embodiment, by making the first source physical address in the first message carry the VPC identifier of the first cloud host, the VPC information of the first cloud host is transmitted to the virtual network card of the virtual machine of the second cloud host, without the need to deploy special equipment for support, only the virtual network card needs to be created in the first cloud host and the second cloud host, which is low in cost and applicable to all users, and has high practicality. In addition, the virtual machine of the second cloud host can shield the impact on the second and third layer processing flow of the overall traffic by processing the received first message, ensuring the normal operation of other traffic processing flows, so that the second cloud host has high stability and reliability.
[0059] In addition, the first cloud host and the second cloud host in this embodiment both use open source OVS to implement the function of a virtual interactive machine, so the above-mentioned message forwarding process can implement multi-NFV network element Equal-Cost Multipath Routing (ECMP) based on the OVS group table capability.
[0060] In one embodiment, Figure 3 As shown, an implementation method for determining a first destination physical address based on a first message is involved, and the steps of the implementation method include:
[0061] Step 300: When the initial destination physical address in the first message is the virtual gateway address of the virtual machine of the first cloud host, query the first routing table and modify the initial destination physical address in the first message.
[0062] The first routing table records various destinations in the network and information on how to reach these destinations. Each entry in the first routing table contains key information such as the destination network address and the next address or outbound interface, which is used to guide the forwarding path of the message in the network.
[0063] After receiving the first message, the virtual machine of the second cloud host parses the first message, obtains the initial destination physical address in the first message, and determines whether the initial destination physical address is the virtual network card address of the virtual machine of the second cloud host. If the virtual machine of the second cloud host determines that the initial destination physical address in the first message is not the virtual network card address of the virtual machine of the second cloud host, but the virtual gateway address of the virtual machine of the first cloud host, the first routing table is queried and the initial destination physical address in the first message is modified, that is, the destination physical address that the first message needs to be transmitted can be determined according to the first routing table, and the initial destination physical address in the first message is modified using the destination physical address, and the modified initial destination physical address is the virtual network card address of the virtual machine of the second cloud host.
[0064] In an optional embodiment, the virtual machine of the second cloud host can also modify the initial source physical address in the first message by querying the first routing table, and the modified initial source physical address in the first message is the virtual gateway address of the virtual machine of the second cloud host.
[0065] Step 310: forward the first message based on the modified initial destination physical address, and query the first address table to determine the first destination physical address.
[0066] The first address table is mainly used to record the mapping relationship between the network device (switch) port and the related address (MAC address). Its main purpose is to help the switch determine how to forward data frames from the source port to the destination port in a Layer 2 network environment such as a LAN.
[0067] After obtaining the initial destination physical address in the modified first message, the virtual machine of the second cloud host forwards the first message based on the initial destination physical address in the modified first message. Specifically, when the virtual machine of the second cloud host can determine that the first message needs to be forwarded to the initial destination physical address in the modified first message by querying the first routing table, it will first forward the first message to the physical address of the next node, and then forward the first message based on the physical address of the next node. After forwarding the first message to the physical address of the next node, it will query the first address table to determine the first destination physical address in the first message.
[0068] Step 320: When the initial destination physical address in the first message is the virtual network card address of the virtual machine of the second cloud host, query the first address table to determine the first destination physical address.
[0069] If the virtual machine of the second cloud host determines that the initial destination physical address in the first message is the virtual network card address of the virtual machine of the second cloud host, the first address table is directly queried to determine the first destination physical address.
[0070] In this embodiment, when determining the first destination physical address of the first message, first determine whether the initial destination physical address in the first message is the virtual network card address of the virtual machine of the second cloud host; when it is determined that the initial destination physical address is the virtual network card address of the virtual machine of the second cloud host, directly query the first address table to determine the first destination physical address; when it is determined that the initial destination physical address is the virtual gateway address of the virtual machine of the first cloud host, first query the first routing table, modify the initial destination physical address in the first message, and then forward the first message based on the modified destination physical address, and query the first address table to determine the first destination physical address. This provides two methods for determining the first destination physical address in two cases, and users can choose according to actual application needs, which can improve the practicality of the message forwarding method.
[0071] In one embodiment, an implementation method of generating a first source physical address according to a virtual private cloud identifier of a first cloud host and an initial source physical address in a first message includes:
[0072] The high-order bytes of the initial source physical address in the first message are replaced with the virtual private cloud identifier to obtain the first source physical address.
[0073] Typically, the upper three bytes of the initial source physical address in the first message are fixed vendor codes. The virtual machine of the second cloud host can replace the upper three bytes of the initial source physical address in the first message with the VPC identifier. The replaced initial cloud physical address is the first source physical address.
[0074] In this embodiment, the virtual private cloud identifier is directly used to replace the upper three bytes of the initial source physical address to modify the initial source physical address and obtain the first source physical address. This will not change the length of the first source physical address, and the fixed manufacturer code in the initial source physical address is replaced, so that the first message carries the VPC identifier of the first cloud host, which will not affect the transmission of the first message and is easy to restore when needed, thereby improving the reliability of the message forwarding method.
[0075] In one embodiment, the host corresponding to the first cloud host is the first server, and the host corresponding to the second cloud host is the second server, that is, the host of the first cloud host is different from the host of the second cloud host. In this case, the method for determining whether the first destination physical address is the virtual network card address of the virtual machine of the second cloud host, that is, after determining the first destination physical address based on the first message, and before determining that the first destination physical address is the virtual network card address of the virtual machine of the second cloud host, the method further includes:
[0076] Based on the first destination physical address, the first message is forwarded to the second service, so that the second server queries the first address table based on the first destination physical address in the received first message, and determines whether the first destination physical address is the virtual network card address of the virtual machine of the second cloud host.
[0077] After the virtual machine of the second cloud host determines the first destination physical address based on the first message, it forwards the first message to the second server based on the first destination physical address. That is to say, the next node of the first message transmission determined based on the first destination physical address is the second server corresponding to the second cloud host. After receiving the first message, the second server parses the first message to obtain the first destination physical address in the first message. The second server queries the first address table based on the first destination physical address and determines whether the queried first destination physical address is the virtual network card address of the virtual machine of the second cloud host.
[0078] In an optional embodiment, when forwarding the first message to the second server, the virtual machine of the second cloud host will encapsulate the first message using tunnel technology and then forward it. After receiving the first message, the second server will parse the received first message using tunnel technology.
[0079] In this embodiment, when the hosts of the first cloud host and the second cloud host are different, the first message is forwarded to the second server based on the first destination physical address, so that the second server queries the first address table based on the first destination physical address in the received first message, and determines whether the first destination physical address is the virtual network card address of the virtual machine of the second cloud host. In other words, when the hosts of the first cloud host and the second cloud host are different, when the first message is to be forwarded to the virtual network card of the virtual machine of the second cloud host, the first message needs to be forwarded to the second server corresponding to the second cloud host first, and the second server forwards the first message to the virtual network card of the virtual machine of the second cloud host, so that the normal forwarding of the first message can be guaranteed.
[0080] In one embodiment, Figure 4 As shown, the process involves the virtual machine of the third cloud host forwarding the second message to the virtual machine of the second cloud host, and the virtual machine of the second cloud host performs network function processing on the second message and then forwards the second message to the virtual machine of the first cloud host. The steps of the method also include:
[0081] Step 400: Receive a second message after target network function processing, and determine whether a second source physical address of the second message includes a virtual private cloud identifier.
[0082] When the virtual machine of the third cloud host needs to send business traffic to the virtual machine of the first cloud host, it is necessary to perform target network function processing on the sent business traffic through the virtual network card in the virtual machine of the second cloud host, and then forward it to the virtual machine of the first cloud host. In other words, when the virtual machine of the third cloud host sends reply business traffic, it can encapsulate the access reply business traffic into a second message based on tunnel technology, and forward the second message to the virtual machine of the second cloud host, and the virtual machine of the second cloud host performs target network function processing on the received second message. The description of the second message can refer to the specific description of the first message in the above embodiment, which will not be repeated here. The description of the target network function processing of the received second message by the virtual machine of the second cloud host can refer to the specific description of the target network function processing of the received first message by the virtual machine of the second cloud host in the above embodiment, which will not be repeated here.
[0083] As described in the above implementation, the second cloud host will modify the source physical address of the message during the process of performing target network function processing on the received message, so that the source physical address carries the VPC identifier of the corresponding cloud host. After the virtual machine of the second cloud host receives the second message, if the second message is processed by the second cloud host for the target network function, the second source physical address of the second message will carry the VPC identifier; if the second message is not processed by the second cloud host for the network function, but the service flow of the second cloud host itself, the second source physical address in the second message does not carry the VPC identifier. After receiving the second message, the virtual machine of the second cloud host will parse the second message, obtain the second source physical address, and determine whether the second source physical address contains the virtual private cloud identifier.
[0084] Step 410: When it is determined that the second source physical address of the second message includes the virtual private cloud identifier, determine the second destination physical address according to the virtual private cloud identifier.
[0085] If the virtual machine of the second cloud host determines whether the second source physical address of the second message contains a VPC identifier by judging whether the second source physical address contains a VPC identifier, the target cloud host to which the second message needs to be forwarded can be determined based on the VPC identifier, thereby determining the second destination physical address. The second message needs to be forwarded to the virtual machine of the first cloud host, and the VPC identifier is the VPC identifier corresponding to the first cloud host.
[0086] In an optional embodiment, if the virtual machine of the second cloud host determines whether the second source physical address of the second message contains a VPC identifier and determines that the second source physical address does not contain a VPC identifier, indicating that the second message is the business traffic of the virtual machine of the second cloud host, then it is processed according to the preset processing flow.
[0087] In an optional embodiment, when it is determined that the second source physical address of the second message contains a virtual private cloud identifier, the virtual private cloud identifier is obtained and the second source physical address is restored, that is, the virtual private cloud identifier is replaced with the corresponding manufacturer code.
[0088] Step 420: forward the second message to the virtual machine of the first cloud host according to the second destination physical address.
[0089] After determining the second destination physical address, the virtual machine of the second cloud host forwards the second message according to the second destination physical address to forward the second message to the virtual machine of the first cloud host. In other words, the message forwarded by the virtual machine of another cloud host (the virtual machine of the third cloud host) to the virtual machine of the first cloud host will first be processed by the virtual machine of the second cloud host for the target network function, and then forwarded to the virtual machine of the first cloud host.
[0090] In this embodiment, the second message processed by the network function is received, and it is determined whether the second source physical address of the second message contains a VPC identifier; when it is determined that the second source physical address of the second message contains a VPC identifier, the second destination physical address is determined according to the VPC identifier; according to the second destination physical address, the second message is forwarded to the virtual machine of the first cloud host. In this embodiment, the second source physical address of the second message carries the VPC identifier of the first cloud host, so that the virtual machine of the second cloud host determines the second destination physical address to which the second message needs to be forwarded. In this way, there is no need to deploy special equipment for support, and only needs to create virtual network cards in the first cloud host and the second cloud host. The cost is low, and it is applicable to all users and has high practicality. In addition, the virtual machine of the second cloud host can shield the impact on the second and third layer processing flow of the overall traffic by processing the received second message, ensuring the normal operation of other traffic processing flows, so that the second cloud host has high stability and reliability.
[0091] In one embodiment, Figure 5 As shown, an implementation method for determining a second destination physical address according to a virtual private cloud identifier includes the following steps:
[0092] Step 500: When the initial destination physical address in the second message is the virtual gateway address of the virtual machine of the third cloud host, query the second routing table according to the virtual private cloud identifier and modify the initial destination physical address in the second message.
[0093] After receiving the second message, the virtual machine of the second cloud host parses the second message, obtains the initial destination physical address in the second message, and then determines whether the initial destination physical address in the second message is the virtual network card address of the virtual machine of the first cloud host. If the virtual machine of the second cloud host determines that the initial destination physical address in the second message is not the virtual network card address of the virtual machine of the first cloud host, but the virtual network card address of the virtual machine of the third cloud host, then according to the VPC identifier obtained from the second source physical address of the second message, the second routing table under the VPC network is searched. The initial destination physical address in the second message is modified according to the second routing table. The description of the second routing table can refer to the specific description of the first routing table in the above embodiment, which will not be repeated here.
[0094] In an optional embodiment, the virtual machine of the second cloud host may also modify the second source physical address in the second message by querying the second routing table, and the second source physical address in the modified second message is the virtual gateway address of the virtual machine of the second cloud host.
[0095] Step 510: Based on the modified initial destination physical address in the second message, query the second address table to determine the second destination physical address.
[0096] After obtaining the initial destination physical address in the modified second message, the virtual machine of the second cloud host forwards the second message based on the initial destination physical address in the modified second message. Specifically, when the virtual machine of the second cloud host can determine that the second message needs to be forwarded to the initial destination physical address in the modified second message by querying the second routing table, it will first forward the second message to the physical address of the first node; and then forward the second message based on the physical address of the first node. After forwarding the second message to the physical address of the next node, the second address table will be queried to determine the second destination physical address in the second message. The second address table is an address table under the VPC network. The description of the second address table can refer to the specific description of the first address table in the above embodiment, which will not be repeated here.
[0097] Step 520: When the destination physical address in the second message is the virtual network card address of the virtual machine of the first cloud host, query the second address table to determine the second destination physical address.
[0098] If the virtual machine of the second cloud host determines that the destination physical address in the second message is the virtual network card address of the virtual machine of the first cloud host, the second address table is directly queried to determine the second destination physical address in the second message.
[0099] In this embodiment, when determining the second destination physical address according to the virtual private cloud identifier, first determine whether the initial destination physical address in the second message is the virtual network card address of the virtual machine of the first cloud host; if it is determined that the initial destination physical address in the second message is the virtual gateway address of the virtual machine of the third cloud host, then query the second routing table according to the virtual private cloud identifier and modify the initial destination physical address in the second message; query the second address table based on the modified initial destination physical address in the second message to determine the second destination physical address in the second message; if it is determined that the destination physical address in the second message is the virtual network card address of the virtual machine of the first cloud host, directly query the second address table to determine the second destination physical address. This provides two methods for determining the second destination physical address in two cases, and users can choose according to actual application needs, which can improve the practicality of the message forwarding method.
[0100] In one embodiment, the host corresponding to the first cloud host is the first server, and the host corresponding to the second cloud host is the second server, that is, the host of the first cloud host is different from the host of the second cloud host. In this case, an implementation method of forwarding the second message to the virtual machine of the first cloud host according to the second destination physical address includes:
[0101] Based on the second destination physical address, the second message is forwarded to the first server, so that the first server queries the second address table based on the second destination physical address in the received second message and forwards the second message to the virtual machine of the first cloud host.
[0102] The virtual machine of the second cloud host can determine that the next node of the second message is the address of the first server according to the second destination physical address in the second message, and then forward the second message to the first server. After receiving the second message, the first server queries the second address table again according to the second destination physical address in the second message, determines the next node of the second message based on the query result, and forwards the second message to the virtual machine of the first cloud host.
[0103] In an optional embodiment, when the virtual machine of the second cloud host forwards the second message to the first server, it will use tunnel technology to encapsulate the second message and then forward it. After receiving the second message, the first server will use tunnel technology to parse the received second message.
[0104] In this embodiment, when the hosts of the first cloud host and the second cloud host are different, the second message is forwarded to the first server based on the second destination physical address, so that the first server queries the second address table based on the second destination physical address in the received second message and forwards the second message to the virtual machine of the first cloud host. In other words, when the hosts of the first cloud host and the second cloud host are different, when the second message is to be forwarded to the virtual network card of the virtual machine of the first cloud host, the second message needs to be forwarded to the first server corresponding to the first cloud host first, and the second server forwards the second message to the virtual machine of the first cloud host, so that the normal forwarding of the second message can be guaranteed.
[0105] See also Figure 6 An embodiment of the present application provides a method for forwarding a first message from a first cloud host to a second cloud host so that the second cloud host performs a target network function processing on the first message, and the hosts of the first cloud host and the second cloud host are different. The steps of the method are as follows:
[0106] Step 600: Receive a first message forwarded by a virtual machine of a first cloud host, and determine an initial destination physical address of the first message;
[0107] Step 610: determine whether the initial destination physical address of the first message is the virtual network card address of the virtual machine of the second cloud host;
[0108] Step 620: If not, query the first routing table, modify the initial destination physical address in the first message, forward the first message based on the modified initial destination physical address in the first message, and query the first address table to determine the first destination physical address;
[0109] Step 630: If yes, query the first address table to determine the first destination physical address;
[0110] Step 640: forwarding the first message to the second server based on the first destination physical address, so that the second server queries the first address table based on the second destination physical address in the received second message; the second server is the host of the second cloud host;
[0111] Step 650: Determine whether the first destination physical address is a virtual network card address of a virtual machine of the second cloud host;
[0112] Step 660: If yes, replace the upper three bytes of the initial source physical address in the first message with the virtual private cloud identifier to obtain the first source physical address;
[0113] Step 670: forward the message according to the first source physical address and the first destination physical address, and perform target network function processing.
[0114] See also Figure 7 An embodiment of the present application provides a method for forwarding a message when a third cloud host forwards a second message to a second cloud host, and after the second cloud host processes the second message with a target network function, the second message is forwarded to a first cloud host, and the hosts of the first cloud host and the second cloud host are different. The steps of the method include:
[0115] Step 700: receiving a second message after target network function processing, and determining whether a second source physical address of the second message includes a virtual private cloud identifier;
[0116] Step 710: If not, process the second cloud host's own message;
[0117] Step 720: If yes, extract the virtual private cloud identifier in the second source physical address;
[0118] Step 730: determine whether the initial destination physical address in the second message is the virtual network card address of the virtual machine of the first cloud host;
[0119] Step 740: If not, query the second routing table according to the virtual private cloud identifier, modify the initial destination physical address in the second message, and query the second address table based on the modified initial destination physical address in the second message to determine the second destination physical address;
[0120] Step 750: If yes, query the second address table to determine the second destination physical address;
[0121] Step 760: forward the second message to the first server based on the second destination physical address, so that the first server queries the second address table based on the second destination physical address in the second message and forwards the second message to the virtual machine of the first cloud host; the first server is the host of the first cloud host.
[0122] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0123] Based on the same inventive concept, the embodiment of the present application also provides a message forwarding device for implementing the message forwarding method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more message forwarding device embodiments provided below can refer to the limitations on the message forwarding method above, and will not be repeated here.
[0124] In one embodiment, Figure 8 As shown, a message forwarding device 10 is provided, comprising: a receiving module 11, a generating module 12 and a forwarding module 13, wherein:
[0125] The receiving module 11 is used to receive a first message forwarded by a virtual machine of a first cloud host, and determine a first destination physical address based on the first message.
[0126] The generating module 12 is used to generate a first source physical address according to the virtual private cloud identifier of the first cloud host and the initial source physical address in the first message when the determined first destination physical address is the virtual network card address of the virtual machine of the second cloud host.
[0127] The forwarding module 13 is used to forward the message according to the first source physical address and the first destination physical address, and perform target network function processing.
[0128] In one embodiment, the receiving module 11 is specifically used to query the first routing table and modify the initial destination physical address in the first message when the initial destination physical address in the first message is the virtual gateway address of the virtual machine of the first cloud host; forward the first message based on the modified initial destination physical address in the second message, and query the first address table to determine the first destination physical address; when the initial destination physical address in the first message is the virtual network card address of the virtual machine of the second cloud host, query the first address table to determine the first destination physical address.
[0129] In one embodiment, the generating module is specifically configured to replace high-order bytes of an initial source physical address in the first message with a virtual private cloud identifier to generate a first source physical address.
[0130] In one embodiment, when the host corresponding to the first cloud host is the first server and the host corresponding to the second cloud host is the second server, the forwarding module 13 is also used to forward the first message to the second server based on the first destination physical address, so that the second server queries the first address table based on the first destination physical address in the received first message, and determines whether the first destination physical address is the virtual network card address of the virtual machine of the second cloud host.
[0131] In one embodiment, the message forwarding device 10 further includes a determination module. The receiving module 11 is further used to receive the second message after the target network function processing is performed, and to determine whether the second source physical address of the second message contains the virtual private cloud identifier. The determination module is used to determine the second destination physical address according to the virtual private cloud identifier when it is determined that the second source physical address of the second message contains the virtual private cloud identifier. The forwarding module 13 is further used to forward the second message to the virtual machine of the first cloud host according to the second destination physical address.
[0132] In one embodiment, the receiving module 11 is also specifically used to query the second routing table and modify the initial destination physical address in the second message according to the virtual private cloud identifier when the initial destination physical address in the second message is the virtual gateway address of the virtual machine of the third cloud host; query the second address table based on the modified initial destination physical address in the second message to determine the second destination physical address; and query the second address table and determine the second destination physical address when the destination physical address in the second message is the virtual network card address of the virtual machine of the first cloud host.
[0133] In one embodiment, when the host corresponding to the first cloud host is the first server and the host corresponding to the second cloud host is the second server, the forwarding module 13 is specifically used to forward the second message to the first server based on the second destination physical address, so that the first server queries the second address table based on the second destination physical address in the received second message, and forwards the second message to the virtual machine of the first cloud host.
[0134] Each module in the above-mentioned message forwarding device can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.
[0135] In one embodiment, a communication device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9As shown. The server includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the server is used to provide computing and control capabilities. The memory of the server includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a message forwarding method is implemented. The display screen of the server can be a liquid crystal display screen or an electronic ink display screen, and the input device of the server can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0136] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0137] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0138] Receive a first message forwarded by a virtual machine of a first cloud host, and determine a first destination physical address based on the first message;
[0139] In a case where the determined first destination physical address is a virtual network card address of a virtual machine of the second cloud host, generating a first source physical address according to the virtual private cloud identifier of the first cloud host and the initial source physical address in the first message;
[0140] The message is forwarded according to the first source physical address and the first destination physical address, and target network function processing is performed.
[0141] In one embodiment, the processor further implements the following steps when executing the computer program: when the initial destination physical address in the first message is the virtual gateway address of the virtual machine of the first cloud host, query the first routing table and modify the initial destination physical address in the first message; forward the first message based on the modified initial destination physical address in the second message, and query the first address table to determine the first destination physical address; when the initial destination physical address in the first message is the virtual network card address of the virtual machine of the second cloud host, query the first address table to determine the first destination physical address.
[0142] In one embodiment, when the processor executes the computer program, the following steps are further implemented: replacing the high-order bytes of the initial source physical address in the first message with the virtual private cloud identifier to generate a first source physical address.
[0143] In one embodiment, when the processor executes the computer program, it also implements the following steps: based on the first destination physical address, forwarding the first message to the second server, so that the second server queries the first address table based on the first destination physical address in the received first message, and determines whether the first destination physical address is the virtual network card address of the virtual machine of the second cloud host.
[0144] In one embodiment, when the processor executes the computer program, it also implements the following steps: receiving a second message after the target network function is processed, and determining whether the second source physical address of the second message contains a virtual private cloud identifier; when it is determined that the second source physical address of the second message contains the virtual private cloud identifier, determining a second destination physical address based on the virtual private cloud identifier; and forwarding the second message to the virtual machine of the first cloud host based on the second destination physical address.
[0145] In one embodiment, the processor further implements the following steps when executing the computer program: when the initial destination physical address in the second message is the virtual gateway address of the virtual machine of the third cloud host, query the second routing table according to the virtual private cloud identifier, and modify the initial destination physical address in the second message; based on the modified initial destination physical address in the second message, query the second address table to determine the second destination physical address; when the destination physical address in the second message is the virtual network card address of the virtual machine of the first cloud host, query the second address table to determine the second destination physical address.
[0146] In one embodiment, when the processor executes the computer program, it also implements the following steps: based on the second destination physical address, forwarding the second message to the first server, so that the first server queries the second address table based on the second destination physical address in the received second message, and forwards the second message to the virtual machine of the first cloud host.
[0147] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0148] Receive a first message forwarded by a virtual machine of a first cloud host, and determine a first destination physical address based on the first message;
[0149] In a case where the determined first destination physical address is a virtual network card address of a virtual machine of the second cloud host, generating a first source physical address according to the virtual private cloud identifier of the first cloud host and the initial source physical address in the first message;
[0150] The message is forwarded according to the first source physical address and the first destination physical address, and target network function processing is performed.
[0151] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the initial destination physical address in the first message is the virtual gateway address of the virtual machine of the first cloud host, query the first routing table and modify the initial destination physical address in the first message; forward the first message based on the modified initial destination physical address in the second message, and query the first address table to determine the first destination physical address; when the initial destination physical address in the first message is the virtual network card address of the virtual machine of the second cloud host, query the first address table to determine the first destination physical address.
[0152] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: replacing the high-order bytes of the initial source physical address in the first message with the virtual private cloud identifier to generate a first source physical address.
[0153] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the first destination physical address, the first message is transferred to the second server, so that the second server queries the first address table based on the first destination physical address in the received first message, and determines whether the first destination physical address is the virtual network card address of the virtual machine of the second cloud host.
[0154] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: receiving a second message after target network function processing, and determining whether the second source physical address of the second message contains a virtual private cloud identifier; when it is determined that the second source physical address of the second message contains the virtual private cloud identifier, determining a second destination physical address based on the virtual private cloud identifier; and forwarding the second message to the virtual machine of the first cloud host based on the second destination physical address.
[0155] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the initial destination physical address in the second message is the virtual gateway address of the virtual machine of the third cloud host, query the second routing table according to the virtual private cloud identifier, and modify the initial destination physical address in the second message; based on the modified initial destination physical address in the second message, query the second address table to determine the second destination physical address; when the destination physical address in the second message is the virtual network card address of the virtual machine of the first cloud host, query the second address table to determine the second destination physical address.
[0156] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the second destination physical address, the second message is forwarded to the first server, so that the first server queries the second address table based on the second destination physical address in the received second message, and forwards the second message to the virtual machine of the first cloud host.
[0157] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0158] Receive a first message forwarded by a virtual machine of a first cloud host, and determine a first destination physical address based on the first message;
[0159] In a case where the determined first destination physical address is a virtual network card address of a virtual machine of the second cloud host, generating a first source physical address according to the virtual private cloud identifier of the first cloud host and the initial source physical address in the first message;
[0160] The message is forwarded according to the first source physical address and the first destination physical address, and target network function processing is performed.
[0161] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the initial destination physical address in the first message is the virtual gateway address of the virtual machine of the first cloud host, query the first routing table and modify the initial destination physical address in the first message; forward the first message based on the modified initial destination physical address in the second message, and query the first address table to determine the first destination physical address; when the initial destination physical address in the first message is the virtual network card address of the virtual machine of the second cloud host, query the first address table to determine the first destination physical address.
[0162] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: replacing the high-order bytes of the initial source physical address in the first message with the virtual private cloud identifier to generate a first source physical address.
[0163] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the first destination physical address, the first message is transferred to the second server, so that the second server queries the first address table based on the first destination physical address in the received first message, and determines whether the first destination physical address is the virtual network card address of the virtual machine of the second cloud host.
[0164] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: receiving a second message after target network function processing, and determining whether the second source physical address of the second message contains a virtual private cloud identifier; when it is determined that the second source physical address of the second message contains the virtual private cloud identifier, determining a second destination physical address based on the virtual private cloud identifier; and forwarding the second message to the virtual machine of the first cloud host based on the second destination physical address.
[0165] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the initial destination physical address in the second message is the virtual gateway address of the virtual machine of the third cloud host, query the second routing table according to the virtual private cloud identifier, and modify the initial destination physical address in the second message; based on the modified initial destination physical address in the second message, query the second address table to determine the second destination physical address; when the destination physical address in the second message is the virtual network card address of the virtual machine of the first cloud host, query the second address table to determine the second destination physical address.
[0166] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the second destination physical address, the second message is forwarded to the first server, so that the first server queries the second address table based on the second destination physical address in the received second message, and forwards the second message to the virtual machine of the first cloud host.
[0167] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0168] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0169] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A message forwarding method, characterized in that: The method comprises: Receive a first message forwarded by a virtual machine of a first cloud host, and determine a first destination physical address based on the first message; In a case where the determined first destination physical address is a virtual network card address of a virtual machine of a second cloud host, generating a first source physical address according to the virtual private cloud identifier of the first cloud host and the initial source physical address in the first message; The message is forwarded according to the first source physical address and the first destination physical address, and target network function processing is performed.
2. The method according to claim 1, characterized in that The determining the first destination physical address based on the first message includes: In a case where the initial destination physical address in the first message is the virtual gateway address of the virtual machine of the first cloud host, querying the first routing table and modifying the initial destination physical address in the first message; forwarding the first message based on the modified initial destination physical address in the second message, and querying the first address table to determine the first destination physical address; When the initial destination physical address in the first message is the virtual network card address of the virtual machine of the second cloud host, the first address table is queried to determine the first destination physical address.
3. The method according to claim 1, characterized in that: The generating the first source physical address according to the virtual private cloud identifier of the first cloud host and the initial source physical address in the first message includes: The high-order bytes of the initial source physical address in the first message are replaced with the virtual private cloud identifier to generate the first source physical address.
4. The method according to any one of claims 1 to 3, characterized in that When the host corresponding to the first cloud host is a first server and the host corresponding to the second cloud host is a second server, a method for determining whether the first destination physical address is a virtual network card address of a virtual machine of the second cloud host includes: Based on the first destination physical address, the first message is forwarded to the second server, so that the second server queries the first address table based on the first destination physical address received in the first message, and determines whether the first destination physical address is the virtual network card address of the virtual machine of the second cloud host.
5. The method according to claim 1, characterized in that The method further comprises: receiving a second message after target network function processing, and determining whether a second source physical address of the second message includes a virtual private cloud identifier; When it is determined that the second source physical address of the second message includes a virtual private cloud identifier, determining a second destination physical address according to the virtual private cloud identifier; According to the second destination physical address, the second message is forwarded to the virtual machine of the first cloud host.
6. The method according to claim 5, characterized in that The determining the second destination physical address according to the virtual private cloud identifier includes: In a case where the initial destination physical address in the second message is the virtual gateway address of the virtual machine of the third cloud host, querying the second routing table according to the virtual private cloud identifier, and modifying the initial destination physical address in the second message; Based on the modified initial destination physical address in the second message, query the second address table to determine the second destination physical address; When the destination physical address in the second message is the virtual network card address of the virtual machine of the first cloud host, the second address table is queried to determine the second destination physical address.
7. The method according to claim 6, characterized in that When the host corresponding to the first cloud host is a first server and the host corresponding to the second cloud host is a second server, forwarding the second message to the virtual machine of the first cloud host according to the second destination physical address includes: Based on the second destination physical address, the second message is forwarded to the first server, so that the first server queries the second address table based on the second destination physical address in the received second message and forwards the second message to the virtual machine of the first cloud host.
8. A message forwarding device, characterized in that: The device comprises: A receiving module, configured to receive a first message forwarded by a virtual machine of a first cloud host, and determine a first destination physical address based on the first message; A generating module, configured to generate a first source physical address according to a virtual private cloud identifier of the first cloud host and an initial source physical address in the first message when the first destination physical address is determined to be a virtual network card address of a virtual machine of the second cloud host; A forwarding module is used to forward messages according to the first source physical address and the first destination physical address, and perform target network function processing.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Communication method and device between VPCs
CN113132201A
Hybrid network connection method and system, electronic equipment and storage medium
CN116668512A
Virtual private cloud and under-cloud data center communication and configuration method and related device
CN116800712A
Data Packet Processing Method, Host, and System
US20180302243A1