CN115913819A - Communication method and related device - Google Patents

Communication method and related device Download PDF

Info

Publication number
CN115913819A
CN115913819A CN202110907953.6A CN202110907953A CN115913819A CN 115913819 A CN115913819 A CN 115913819A CN 202110907953 A CN202110907953 A CN 202110907953A CN 115913819 A CN115913819 A CN 115913819A
Authority
CN
China
Prior art keywords
vlan
host
vni
virtual machine
data packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110907953.6A
Other languages
Chinese (zh)
Inventor
朱小平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Cloud Computing Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Cloud Computing Technologies Co Ltd filed Critical Huawei Cloud Computing Technologies Co Ltd
Priority to CN202110907953.6A priority Critical patent/CN115913819A/en
Publication of CN115913819A publication Critical patent/CN115913819A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application discloses a communication method and a related device, which are used for improving communication efficiency. The method in the embodiment of the application comprises the following steps: the first host sends a first data packet to the second host, the first data packet carries a first Virtual Local Area Network (VLAN) identifier and a second VLAN identifier, the first VLAN identifier and the second VLAN identifier can form a first Virtual Network Identity (VNI), and the first VNI is a VNI corresponding to the second host.

Description

Communication method and related device
Technical Field
The present invention relates to the field of communications, and in particular, to a communication method and a related apparatus.
Background
The public cloud is a public-oriented distributed computing service, and can provide resources such as computing, storage, and network for users, network Function Virtualization (NFV) is an important way for the public cloud to provide network resources, NFV virtualizes network functions, and a virtualized network function after virtualization is called a Virtualized Network Function (VNF), and a virtual machine is an important expression form of the VNF. When the virtual machine assumes the role of a gateway on the public cloud, the Virtual Private Cloud (VPC) of different tenants on the public cloud can be connected, and the capabilities of routing forwarding, address conversion, load balancing, security protection and the like are realized.
When the virtual machine assumes the gateway, a virtual local area network identifier (VLAN) on the packet may be converted into a virtual extensible local area network identifier (VNI), so that the packet is forwarded to another virtual machine corresponding to a different VPC through a VXLAN tunneling technique.
However, the virtual machine needs to search the mapping relationship table between the VLAN identifier and the VXLAN identifier to convert the VLAN identifier into the VXLAN identifier, which brings extra overhead and is inefficient in communication.
Disclosure of Invention
The embodiment of the application provides a communication method and a related device, which are used for improving the communication efficiency.
A first aspect of an embodiment of the present application provides a communication method:
the first host sends a first data packet to the second host, wherein the first data packet carries a first virtual local area network VLAN identification and a second VLAN identification. The first VLAN id and the second VLAN id may form a first virtual extensible local area network id VNI, where the first VNI is a VNI corresponding to the second host.
In the embodiment of the application, the first data packet carries the double-layer VLAN identifier which can form the VNI corresponding to the second host, so that a mapping table between the VLAN identifier and the VNI does not need to be queried, and corresponding overhead is reduced. And because the form of double-layer VLAN is adopted, VLAN of 24 types of 2 can be isolated in a host where the host is located, and therefore the host serving as a gateway can establish connection with VPC of 24 types of 2.
In a possible implementation manner, before the first host sends the first data packet to the second host, the first host further receives a second data packet from the third host, where the second data packet carries an Internet Protocol (IP) address of the second host, and the first host determines, according to the IP address of the second host, that the second data packet needs to be forwarded to the second host, and determines a first VNI corresponding to the second host.
In a possible implementation manner, the second data packet further carries a third VLAN identifier and a fourth VLAN identifier, where the third VLAN identifier and the fourth VLAN identifier may form a second VNI corresponding to the third host, and the second VNI is different from the first VNI. After receiving the second packet, the first host updates the third VNI and the fourth VNI in the second packet to the first VNI and the second VNI, thereby updating the second packet to the first packet.
In this embodiment of the application, the first host may further forward the packet from the third host to the second host in a manner of updating the VLAN identifier, so as to improve an application range of the scheme.
In a possible implementation manner, the first host may further receive a third data packet from the second host, where the third data packet carries the IP address of the third host, the first VLAN id, and the second VLAN id. And the first host determines a second VNI corresponding to the third host according to the IP address of the third host, and updates the first VLAN identifier and the second VLAN identifier into a third VLAN identifier and a fourth VLAN identifier, so that the third data packet is updated into a fourth data packet. And then, the first host sends the fourth data packet to the third host.
In this embodiment of the present application, the first host may further forward the data packet from the second host to the third host in a manner of updating the VLAN identifier, thereby increasing the application range of the scheme.
In one possible implementation, the first VNI includes 24 bits of information, the first VLAN identification includes first 12 bits of information in the first VNI, and the second VLAN identification includes second 12 bits of information in the first VNI.
In one possible implementation, the first host, the second host, and the third host include a virtual machine and a physical host.
A second aspect of embodiments of the present application provides a communication apparatus, which includes means for implementing corresponding functions of the method in the first aspect.
A third aspect of embodiments of the present application provides a communication device, where the memory processing device includes a processor, and the processor is coupled to a storage, and the storage is configured to store instructions, which, when executed by the processor, cause the device to perform the method in the first aspect.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium for storing instructions for performing the method in the first aspect.
Drawings
Fig. 1 is a schematic view of an application scenario of a communication method in an embodiment of the present application;
fig. 2 is a schematic view of another application scenario of the communication method in the embodiment of the present application;
fig. 3 is a flowchart illustrating a communication method according to an embodiment of the present application;
fig. 4 is a schematic view of another application scenario of the communication method in the embodiment of the present application;
FIG. 5 is a flow chart illustrating a communication method according to an embodiment of the present application;
fig. 6 is a schematic view of another application scenario of the communication method in the embodiment of the present application;
fig. 7 is a flowchart illustrating a communication method according to an embodiment of the present application;
fig. 8 is a schematic view of another application scenario of the communication method in the embodiment of the present application;
fig. 9 is a flowchart illustrating a communication method according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a communication device in the embodiment of the present application;
fig. 11 is another schematic structural diagram of a communication device in the embodiment of the present application;
fig. 12 is another schematic structural diagram of a communication device in the embodiment of the present application;
fig. 13 is another schematic structural diagram of a communication device in the embodiment of the present application.
Detailed Description
Embodiments of the present application will now be described with reference to the accompanying drawings, and it is to be understood that the described embodiments are merely illustrative of some, but not all, embodiments of the present application. As can be known to those skilled in the art, with the development of technology and the emergence of new scenarios, the technical solution provided in the embodiments of the present application is also applicable to similar technical problems.
The terms "first," "second," and the like in the description and claims of this application and in the foregoing drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The embodiment of the application provides a communication method and a related device, which are used for improving the communication efficiency.
The embodiment of the present application may be applied to the communication scenario shown in fig. 1, please refer to fig. 1, where a host 1 may establish a connection relationship with multiple hosts, for example, with a host 2, a host 3, and a host 4. The host 2 corresponds to a Virtual Private Cloud (VPC) 1, the host 3 corresponds to a VPC2, and the host 4 corresponds to a VPC3. Host 1 may act as a gateway providing a communication connection between hosts corresponding to different VPCs, e.g. for establishing a communication connection between host 2 and host 3, or for establishing a communication connection between host 3 and host 4.
The embodiments of the present application may also be applicable to public cloud, private cloud, hybrid cloud, software defined network (SND), and Network Function Virtualization (NFV). The virtual machine in the embodiment of the present application may be a Network Address Translation (NAT) gateway, a load balancer, a virtual router, a virtual switch, and the like.
The host in this embodiment of the present application may be a virtual machine, or may also be a physical host operating on an over layer, and the following describes the communication method in this embodiment of the present application by taking the host as the virtual machine as an example:
referring to fig. 2, fig. 2 is a diagram illustrating an application scenario of the communication method according to the embodiment of the present application. As shown in fig. 2, virtual machines 1 and 2 run on host 1, virtual machines 3 and 4 run on host 2, and virtual machines 5 and 6 run on host 3. The virtual machines 1 and 2 correspond to the VPC1, the virtual machines 4 and 5 correspond to the VPC2, the virtual machine 6 corresponds to the VPC3, the virtual machine 3 may be a gateway, and a connection relationship is established between the virtual machine 3 and the VPC1, the VPC2, and the VPC3, it should be noted that the interface type used by the virtual machine 3 is a VPC VXLAN Trunk port. The virtual machines corresponding to the same VPC can be directly communicated with each other, and the communication between the virtual machines corresponding to different VPCs needs to be realized through a gateway. Communication between virtual machines in different host machines needs to be based on a VXLAN tunnel technology, when the virtual machines send out data packets, a computing node agent converts VLAN identifications carried in the data packets into virtual extensible local area network identifications (VNIs), and when the virtual machines receive the data packets, the computing node agent converts the VNIs carried in the data packets into the VLAN identifications and sends the VLAN identifications to the virtual machines.
The communication method in the embodiment of the present application includes a forwarding scenario and a direct communication scenario, which are introduced below:
1. and forwarding the scene.
Referring to fig. 3, a flow of the communication method in the embodiment of the present application is described below on the basis of fig. 2:
301. the virtual machine 1 sends a second data packet to the virtual machine 3;
when the virtual machine 1 needs to communicate with the virtual machine 5, the virtual machine 1 cannot directly communicate with the virtual machine 5 because the virtual machine 1 corresponds to the VPC1 and the virtual machine 5 corresponds to the VPC 2. Therefore, the virtual machine 1 transmits a second packet to the virtual machine 3 functioning as a gateway, where a destination Internet Protocol (IP) address in the second packet is an IP address of the virtual machine 5, and a destination media access control address (MAC) is a MAC address of the virtual machine 3. The virtual machine 1 is a third virtual machine, the virtual machine 3 is a first virtual machine, and the virtual machine 5 is a second virtual machine.
VPC1 corresponds to a VNI that is a second VNI that includes 24 bits of information, which is 0x112233, for example. The virtual machine 1 splits the 24-bit information in the second VNI into 2 VLAN ids comprising 12-bit information, for example, one layer of VLAN id is composed of the first 12-bit information of the VNI, and the other layer of VLAN id is composed of the last 12-bit information of the VNI, and then fills the two layers of VLAN ids together into the second packet. Taking the second VNI as 0x112233 as an example, that is, 0x112 is used as a layer VLAN id, and 0x233 is used as a layer VLAN id and filled in the second packet, where 0x112 is a third VLAN id and 0x233 is a fourth VLAN id.
After the virtual machine 1 sends out the second data packet, the compute node agent 1 combines the third VLAN id and the fourth VLAN id of the second data packet into a second VNI, and sends the second data packet to the virtual machine 3.
302. The virtual machine 3 determines a first VNI corresponding to the virtual machine 5;
after the second data packet arrives at the compute node proxy 2, the compute node proxy 2 converts the second VNI in the second data packet into two-layer VLAN tags, that is, a third VLAN tag and a fourth VLAN tag, and then sends the second data packet to the virtual machine 3.
The virtual machine 3 receives the second data packet, combines the third VLAN identifier and the fourth VLAN identifier into a second VNI, determines, according to a destination IP in the second data packet, that the second data packet needs to be forwarded to the virtual machine 5, and determines a first VNI corresponding to the virtual machine 5, where the first VNI includes 24 bits of information, and learns, according to a local routing policy, that a routing route exists between the virtual machine 1 and the virtual machine 5. Illustratively, the first VNI is 0x445566.
303. The virtual machine 3 sends a first data packet to the virtual machine 5;
after determining the first VNI corresponding to the virtual machine 5, the virtual machine 3 updates the third VLAN id and the fourth VLAN id in the second packet to the first VLAN id and the second VLAN id, so as to update the second packet to the first packet. The first VLAN id is composed of first 12 bits of information of the first VNI, and the second VLAN id is composed of last 12 bits of information of the first VNI, that is, the first VLAN id is 0x445, and the second VLAN id is 0x566. After the update of the VLAN identifier is completed, the virtual machine 3 sends out a first data packet, and the computing node agent 2 combines the first VLAN identifier and the second VLAN identifier in the first data packet into a first VNI, and sends the first VNI to the virtual machine 5. Since the VNI carried in the first packet is consistent with the VNI corresponding to the virtual machine 5, the first packet can be smoothly sent to the virtual machine 5.
304. The virtual machine 5 sends a third data packet to the virtual machine 3;
when the virtual machine 5 needs to communicate with the virtual machine 1, the virtual machine 5 sends a third data packet to the virtual machine 3 serving as a gateway, where a destination IP address in the third data packet is an IP address of the virtual machine 1, a destination MAC is a MAC address of the virtual machine 3, and the third data packet further carries the first VLAN identifier and the second VLAN identifier.
After the virtual machine 5 sends out the second data packet, the compute node agent 3 combines the first VLAN id and the second VLAN id of the third data packet into the first VNI and sends the third data packet to the virtual machine 3.
305. Virtual machine 3 sends a fourth packet to virtual machine 1.
After the third data packet arrives at the compute node proxy 2, the compute node proxy 2 converts the first VNI in the third data packet into two-layer VLAN identifiers, that is, the first VLAN identifier and the second VLAN identifier, and then sends the third data packet to the virtual machine 3.
The virtual machine 3 updates the first VLAN id and the second VLAN id in the third packet to the third VLAN id and the fourth VLAN id, thereby updating the third packet to a fourth packet, and sends the fourth packet to the virtual machine 1.
The computing node proxy 2 combines the third VLAN id and the fourth VLAN id in the fourth packet into the second VNI, and sends the fourth packet to the virtual machine 1.
After the fourth data packet arrives at the compute node proxy 1, the compute node proxy 1 converts the second VNI in the fourth data packet into the third VLAN id and the fourth VLAN id, and then sends the fourth data packet to the virtual machine 1.
In the embodiment of the application, when the data packet is transmitted across the VPCs, because the identifiers of the double-layer VLANs carried in the data packet can be combined into the corresponding VNI, a mapping table between the VLAN identifier and the VNI does not need to be queried, thereby reducing corresponding overhead. And because the form of double-layer VLAN is adopted, VLAN of 24 types of 2 can be isolated in a host, and therefore the virtual machine serving as the gateway can establish connection with VPC of 24 types of 2.
While the above describes the case where the gateway is the virtual machine 3, on the basis of the above fig. 3, the gateway may be another virtual machine. Referring to fig. 4, when the virtual machine 2 is a gateway, the virtual machine 2 establishes a connection relationship with VPC1, VPC2, and VPC3 at the same time, and the interface type used is VPC VXLAN Trunk port. The virtual machine 3 is not associated with the gateway, and thus corresponds to only one kind of VPC, for example, corresponds to the VPC1.
Referring to fig. 5, the following describes the case where the gateway is the virtual machine 2 in detail with reference to fig. 4:
501. the virtual machine 1 sends a second data packet to the virtual machine 2;
when the virtual machine 1 needs to communicate with the virtual machine 5, the virtual machine 1 cannot directly communicate with the virtual machine 5 because the virtual machine 1 corresponds to the VPC1 and the virtual machine 5 corresponds to the VPC 2. Virtual machine 1 therefore sends a second packet to virtual machine 2, which acts as a gateway, in which the destination IP address is the IP address of virtual machine 5 and the destination MAC is the MAC address of virtual machine 2. The virtual machine 1 is a third virtual machine, the virtual machine 2 is a first virtual machine, and the virtual machine 5 is a second virtual machine.
The second packet carries a third VLAN id and a fourth VLAN id that may form a second VNI corresponding to the virtual machine 1. Since the virtual machine 1 and the virtual machine 2 are in the same host, the computing node agent 1 does not need to combine the third VLAN id and the fourth VLAN id of the second packet into the VNI, but directly sends the second packet to the virtual machine 2.
502. The virtual machine 2 determines a first VNI corresponding to the virtual machine 5;
the virtual machine 2 receives the second data packet, combines the third VLAN identifier and the fourth VLAN identifier into a second VNI, determines, according to the destination IP in the second data packet, that the second data packet needs to be forwarded to the virtual machine 5, and determines the first VNI corresponding to the virtual machine 5. This step is similar to step 302 in the embodiment shown in FIG. 3, and will not be described in detail herein.
503. Virtual machine 2 sends a first packet to virtual machine 5.
After determining the first VNI corresponding to the virtual machine 5, the virtual machine 2 updates the third VLAN id and the fourth VLAN id in the second data packet to the first VLAN id and the second VLAN id, so as to update the second data packet to the first data packet. The computing node agent 1 combines the first VLAN id and the second VLAN id in the first packet into a first VNI, and sends the first VNI to the virtual machine 5. Since the VNI carried in the first packet is consistent with the VNI corresponding to the virtual machine 5, the first packet can be smoothly sent to the virtual machine 5.
In this embodiment, a manner in which the virtual machine 5 sends the data packet to the virtual machine 1 through the virtual machine 2 is similar to the manner in which the virtual machine 5 sends the data packet to the virtual machine 1 through the virtual machine 3 in the embodiment shown in fig. 3, and details are not described here.
It is understood that the compute node agent 3 may convert the first VNI carried in the first data packet into the first VLAN id and the second VLAN id, and then send the first data packet to the virtual machine 5.
In the embodiment of the present application, the first virtual machine may also be another virtual machine in the network, so that the flexibility of the scheme is improved.
Still alternatively, referring to fig. 6, in another case, virtual machine 1, virtual machine 2 and virtual machine 3 are in the same host, where virtual machine 1 corresponds to VPC1, virtual machine 3 corresponds to VPC2, virtual machine 2 is a gateway, and the interface type used is VPC VXLAN Trunk port, and the connection is established with VPC1 and VPC2 at the same time.
Referring to fig. 7, another flow of the communication method in the embodiment of the present application is described below with reference to fig. 6:
701. the virtual machine 1 sends a second data packet to the virtual machine 2;
when the virtual machine 1 needs to communicate with the virtual machine 3, since the virtual machine 1 corresponds to the VPC1 and the virtual machine 3 corresponds to the VPC2, the virtual machine 1 cannot directly communicate with the virtual machine 3. Virtual machine 1 therefore sends a second packet to virtual machine 2, which acts as a gateway, in which the destination IP address is the IP address of virtual machine 3 and the destination MAC is the MAC address of virtual machine 2. The virtual machine 1 is a third virtual machine, the virtual machine 2 is a first virtual machine, and the virtual machine 3 is a second virtual machine.
The second packet carries a third VLAN id and a fourth VLAN id that may form a second VNI corresponding to the virtual machine 1. Since the virtual machine 1 and the virtual machine 2 are in the same host, the compute node agent does not need to combine the third VLAN id and the fourth VLAN id of the second packet into a VNI, but directly sends the second packet to the virtual machine 2.
702. The virtual machine 2 determines a first VNI corresponding to the virtual machine 3;
the virtual machine 2 receives the second data packet, combines the third VLAN identifier and the fourth VLAN identifier into a second VNI, determines, according to the destination IP in the second data packet, that the second data packet needs to be forwarded to the virtual machine 3, and determines the first VNI corresponding to the virtual machine 3. This step is similar to step 302 in the embodiment shown in FIG. 3, and will not be described in detail herein.
703. Virtual machine 2 sends a first packet to virtual machine 3.
After the virtual machine 2 determines the first VNI corresponding to the virtual machine 3, the third VLAN id and the fourth VLAN id in the second data packet are updated to the first VLAN id and the second VLAN id, so that the second data packet is updated to the first data packet. The computing node agent 1 combines the first VLAN id and the second VLAN id in the first packet into a first VNI, and sends the first VNI to the virtual machine 3. Since the VNI carried in the first packet is consistent with the VNI corresponding to the virtual machine 5, the first packet can be smoothly sent to the virtual machine 5.
Since the virtual machine 2 and the virtual machine 3 are in the same host, the compute node agent does not need to combine the first VLAN id and the second VLAN id of the second packet into a VNI, but directly sends the second packet to the virtual machine 2.
It can be understood that, in this embodiment, a manner in which the virtual machine 3 sends the data packet to the virtual machine 1 through the virtual machine 2 is similar to the manner in which the virtual machine 5 sends the data packet to the virtual machine 1 through the virtual machine 3 in the embodiment shown in fig. 3, and details are not described here again, except that in this embodiment, the VNI and VLAN identifier conversion does not need to be performed through the computing node agent.
2. A direct communication scenario.
The forwarding scenario of the communication method in the embodiment of the present application is described above, and the direct communication scenario of the communication method in the embodiment of the present application is described below:
in a public cloud, a resource tenant is a special tenant, and can open own resources to other tenants. For example, tenant a creates one virtual machine and allows other tenants, e.g., tenant B, to access the virtual machine created by tenant a, which may correspond to the same or different VPCs.
Referring to fig. 8, tenant a creates virtual machine 3 and tenant B creates virtual machine 5, as an example. The virtual machine 3 directly communicates with the virtual machine 5, the virtual machine 3 corresponds to the VPC3, and the interface type used is VPC VXLAN Trunk port. Virtual machine 5 corresponds to VPC3, virtual machines 1 and 2 correspond to VPC1, virtual machine 4 corresponds to VPC2, and virtual machine 6 corresponds to VPC3.
Referring to fig. 9, another flow of the communication method in the embodiment of the present application is described in detail below with reference to fig. 8:
901. the virtual machine 3 determines a first VNI corresponding to the virtual machine 5;
before virtual machine 3 communicates with virtual machine 5, virtual machine 3 determines that virtual machine 5 corresponds to VPC3, and thus determines that virtual machine 5 corresponds to a VNI of 0x778899. It should be noted that, in this embodiment, the virtual machine 3 is a first virtual machine, the virtual machine 5 is a second virtual machine, and a VNI corresponding to the virtual machine 5 is a first VNI.
902. The virtual machine 3 sends a first data packet to the virtual machine 5;
the virtual machine 3 sends a first data packet to the virtual machine 5, where the first data packet carries a first VLAN id and a second VLAN id, and the first VLAN id and the second VLAN id may form a first VNI, and in this embodiment, the first VLAN id is 0x778, and the second VLAN id is 0x899.
It can be understood that, after the virtual machine 3 sends the first data packet, since the virtual machine 3 and the virtual machine 5 are in different hosts, the computing node proxy 2 combines the first VLAN id and the second VLAN id in the first data packet into the first VNI, and after receiving the first data packet, the computing node proxy 3 converts the first VNI in the first data packet into the first VLAN id and the second VLAN id, and sends the first VLAN id and the second VLAN id to the virtual machine 5.
903. The virtual machine 5 transmits the packet to the virtual machine 3.
The virtual machine 5 needs to send a data packet to the virtual machine 3, where the data packet carries the first VLAN id and the second VLAN id.
It can be understood that, after the virtual machine 5 sends the data packet, since the virtual machine 3 and the virtual machine 5 are located in different hosts, the computing node agent 3 combines the first VLAN id and the second VLAN id in the data packet into the first VNI, and after receiving the data packet, the computing node agent 2 converts the first VNI in the data packet into the first VLAN id and the second VLAN id, and sends the first VLAN id and the second VLAN id to the virtual machine 3.
It can be understood that the virtual machine 3 may also communicate with one or more of the virtual machines 1, 2, 4, 5 and 6 in the above manner, and details of this embodiment are not described herein for brevity of description. The virtual machine 3 needs to establish a connection relationship with one or more VPCs so as to be able to provide services for different virtual machines, for example, when the virtual machine 3 needs to communicate with the virtual machine 1 and the virtual machine 4, the virtual machine 1 needs to establish a connection relationship with the VPC1 corresponding to the virtual machine 1 and the VPC2 corresponding to the virtual machine 4.
In the embodiment of the application, when the data packet is transmitted across the VPC, because the identifiers of the double-layer VLANs carried in the data packet can be combined into the corresponding VNI, it is no longer necessary to query the mapping table between the VLAN identifier and the VNI, and corresponding overhead is reduced. And because the double-layer VLAN form is adopted, the 24 th power type VLAN of 2 can be isolated in one host, and therefore the virtual machine serving as the gateway can also establish connection with the 24 th power type VPC of 2.
For example, the conversion between the two-layer VLAN id and the VNI in the embodiments shown in fig. 3, fig. 5, fig. 7 and fig. 9 may be implemented by the following commands:
#ip link add link eth0 eth0.24 type vlan proto 802.1ad id 24
#ip link add link eth0.24 eth0.24.371 type vlan proto 802.1Q id 371
#ip link set eth0 up
#ip link set eth0.24 up
it should be noted that, when the host in the embodiment of the present application is a physical host, the operations performed by the host are the same as the operations performed by the virtual machine in the embodiments shown in fig. 3, fig. 5, fig. 7, and fig. 9, except that the function of the compute node proxy in the embodiments described above needs to be implemented by another physical host.
The communication method in the embodiment of the present application is described above, and the following describes the communication device in the embodiment of the present application:
referring to fig. 10, fig. 10 is a schematic structural diagram of a communication device according to an embodiment of the present application.
As shown in fig. 10, the communication apparatus 1000 in the embodiment of the present application includes a transmission unit 1001.
A sending unit 1001, configured to send a first data packet to a second host, where the first data packet carries a first VLAN id and a second VLAN id, and the first VLAN id and the second VLAN id may form a first VNI, where the first VNI is a VNI corresponding to the second host.
In addition to the embodiment shown in fig. 10, please refer to fig. 11, the communication apparatus 1100 in the embodiment of the present application further includes a receiving unit 1102 and a determining unit 1103.
The receiving unit 1102 is configured to receive a second data packet from a third host, where the second data packet carries an IP address of the second host.
A determining unit 1103 configured to determine the first VNI according to an IP address of the second host.
The sending unit 1101 is similar to the sending unit 1001 in the embodiment shown in fig. 10, and is not described again here.
In addition to the embodiment shown in fig. 11, please refer to fig. 12, the communication apparatus 1200 in the embodiment of the present application further includes an updating unit 1204.
An updating unit 1204, configured to update the third VLAN id and the fourth VLAN id in the second packet to the first VLAN id and the second VLAN id, so that the second packet is updated to the first packet.
The sending unit 1201 is similar to the sending unit 1101 in the embodiment shown in fig. 11, the receiving unit 1202 is similar to the receiving unit 1102 in the embodiment shown in fig. 11, and the determining unit 1203 is similar to the determining unit 1103 in the embodiment shown in fig. 11, and thus, the description thereof is omitted.
On the basis of the embodiment described above with reference to figure 11,
the receiving unit 1202 is further configured to receive a third data packet from the second host, where the third data packet carries an IP address of the third host, the first VLAN id, and the second VLAN id.
The determining unit 1203 is further configured to determine a second VNI corresponding to the third host according to the IP address of the third host.
The updating unit 1204 is further configured to update the first VLAN id and the second VLAN id to a third VLAN id and a fourth VLAN id, so that the third packet is updated to a fourth packet.
The sending unit 1201 is further configured to send a fourth data packet to the third host.
Wherein the first VNI comprises 24 bits of information, the first VLAN identification comprises the first 12 bits of information in the first VNI, and the second VLAN identification comprises the last 12 bits of information in the first VNI.
Fig. 13 is a schematic structural diagram of a communication device according to an embodiment of the present disclosure, where the communication device 1300 may include one or more Central Processing Units (CPUs) 1301 and a memory 1305, where the memory 1305 stores one or more applications or data.
Memory 1305 may be volatile storage or persistent storage, among others. The program stored in the memory 1305 may include one or more modules, each of which may include a sequence of instructions operating on a server. Further, the central processor 1301 may be arranged in communication with the memory 1305, executing a series of instruction operations in the memory 1305 on the communication apparatus 1300.
The communications device 1300 may also include one or more power supplies 1302, one or more wired or wireless network interfaces 1303, one or more input-output interfaces 1304, and/or one or more operating systems, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, etc.
The central processing unit 1301 may perform the operations performed by the communication apparatus in the embodiments shown in fig. 3, fig. 5, fig. 7 and fig. 9, which are not described herein again.
It can be clearly understood by those skilled in the art that, for convenience and simplicity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.

Claims (13)

1. A method of communication, comprising:
the method comprises the steps that a first data packet is sent to a second host by a first host, the first data packet carries a first Virtual Local Area Network (VLAN) identification and a second VLAN identification, the first VLAN identification and the second VLAN identification can form a first Virtual Network Identifier (VNI), and the first VNI is a VNI corresponding to the second host.
2. The method of claim 1, wherein before the first host sends the first packet to the second host, the method further comprises:
the first host receives a second data packet from a third host, wherein the second data packet carries an Internet Protocol (IP) address of the second host;
the first host determines the first VNI according to the IP address of the second host.
3. The method of claim 2, wherein the second packet further carries a third VLAN id and a fourth VLAN id, and wherein the third VLAN id and the fourth VLAN id may constitute a second VNI corresponding to the third host, and wherein the second VNI is different from the first VNI;
the method further comprises the following steps:
the first host updates the third VLAN id and the fourth VLAN id in the second packet to the first VLAN id and the second VLAN id, so that the second packet is updated to the first packet.
4. The method of claim 3, further comprising:
the first host receives a third data packet from the second host, wherein the third data packet carries the IP address of the third host, the first VLAN identifier and the second VLAN identifier;
the first host determines the second VNI corresponding to the third host according to the IP address of the third host;
the first host updates the first VLAN identification and the second VLAN identification to the third VLAN identification and the fourth VLAN identification so that the third data packet is updated to a fourth data packet;
and the first host sends the fourth data packet to the third host.
5. The method of any of claims 1-4, wherein the first VNI comprises 24 bits of information, wherein the first VLAN identification comprises first 12 bits of information in the first VNI, and wherein the second VLAN identification comprises last 12 bits of information in the first VNI.
6. The method of any of claims 1 to 5, wherein the first, second, and third hosts comprise virtual machines and physical hosts.
7. A communications apparatus, comprising:
the sending unit is configured to send a first data packet to a second host, where the first data packet carries a first VLAN id and a second VLAN id, and the first VLAN id and the second VLAN id may form a first VNI, where the first VNI is a VNI corresponding to the second host.
8. The communication apparatus according to claim 7, further comprising a receiving unit and a determining unit;
the receiving unit is configured to receive a second data packet from a third host, where the second data packet carries an internet protocol IP address of the second host;
the determining unit is configured to determine the first VNI according to an IP address of the second host.
9. The communication apparatus according to claim 8, wherein the second packet further carries a third VLAN id and a fourth VLAN id, and the third VLAN id and the fourth VLAN id may constitute a second VNI corresponding to the third host, and the second VNI is different from the first VNI;
the communication device further comprises an updating unit;
the updating unit is configured to update the third VLAN id and the fourth VLAN id in the second packet to the first VLAN id and the second VLAN id, so that the second packet is updated to the first packet.
10. The communication device of claim 9,
the receiving unit is further configured to receive a third data packet from the second host, where the third data packet carries an IP address of the third host, the first VLAN identifier, and the second VLAN identifier;
the determining unit is configured to determine the second VNI corresponding to the third host according to an IP address of the third host;
the updating unit is further configured to update the first VLAN id and the second VLAN id to the third VLAN id and the fourth VLAN id, so that the third packet is updated to a fourth packet;
the sending unit is further configured to send the fourth data packet to the third host.
11. The communications apparatus of any of claims 7-10, wherein the first VNI comprises 24 bits of information, wherein the first VLAN identification comprises the first 12 bits of information in the first VNI, and wherein the second VLAN identification comprises the last 12 bits of information in the first VNI.
12. A communications apparatus comprising a processor coupled with a memory, the memory to store instructions that when executed by the processor cause the apparatus to perform the method of any of claims 1 to 6.
13. A computer-readable storage medium having stored thereon a computer program or instructions, which, when executed, cause a computer to perform the method of any one of claims 1 to 6.
CN202110907953.6A 2021-08-09 2021-08-09 Communication method and related device Pending CN115913819A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110907953.6A CN115913819A (en) 2021-08-09 2021-08-09 Communication method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110907953.6A CN115913819A (en) 2021-08-09 2021-08-09 Communication method and related device

Publications (1)

Publication Number Publication Date
CN115913819A true CN115913819A (en) 2023-04-04

Family

ID=86474852

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110907953.6A Pending CN115913819A (en) 2021-08-09 2021-08-09 Communication method and related device

Country Status (1)

Country Link
CN (1) CN115913819A (en)

Similar Documents

Publication Publication Date Title
US11546288B2 (en) Techniques for managing software defined networking controller in-band communications in a data center network
US10171357B2 (en) Techniques for managing software defined networking controller in-band communications in a data center network
EP2853066B1 (en) Layer-3 overlay gateways
US10992590B2 (en) Path maximum transmission unit (PMTU) discovery in software-defined networking (SDN) environments
EP4024787A1 (en) Sharing routes using an in-memory data store in a distributed network system
KR101840904B1 (en) Virtualization gateway between virtualized and non-virtualized networks
US20180027080A1 (en) Scaling service discovery in a micro-service environment
US20150124823A1 (en) Tenant dhcp in an overlay network
US10536362B2 (en) Configuring traffic flow monitoring in virtualized computing environments
CN109716717A (en) From software-defined network controller management virtual port channel switching equipment peer-to-peer
US20150358232A1 (en) Packet Forwarding Method and VXLAN Gateway
CN114338606B (en) Public cloud network configuration method and related equipment
CN112671628A (en) Business service providing method and system
US11558478B2 (en) Scaling service discovery in a micro-service environment
US20220239629A1 (en) Business service providing method and system, and remote acceleration gateway
US20190356632A1 (en) Method and system for network traffic steering towards a service device
CN114039912B (en) Method for improving route advertisement and software defined network controller
US20230254183A1 (en) Generating route target values for virtual private network routes
CN114765567B (en) Communication method and communication system
CN113709016B (en) Communication system, communication method, communication apparatus, communication device, and storage medium
CN115913819A (en) Communication method and related device
US11533386B2 (en) Virtual tunnel endpoint (VTEP) learning based on transport protocol information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination