CN115665043A - Data message forwarding method, VTEP, device, medium and system - Google Patents

Data message forwarding method, VTEP, device, medium and system Download PDF

Info

Publication number
CN115665043A
CN115665043A CN202211103390.6A CN202211103390A CN115665043A CN 115665043 A CN115665043 A CN 115665043A CN 202211103390 A CN202211103390 A CN 202211103390A CN 115665043 A CN115665043 A CN 115665043A
Authority
CN
China
Prior art keywords
receiving
receiving end
sending
vtep
data message
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
CN202211103390.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.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group 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 China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202211103390.6A priority Critical patent/CN115665043A/en
Publication of CN115665043A publication Critical patent/CN115665043A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention provides a data message forwarding method, a VTEP, a device, a medium and a system, relates to the technical field of communication, and is used for solving the problem that data needs to pass through a centralized gateway when VM (virtual machine) cross-network section communication connected with the same VTEP is carried out, wherein the method comprises the following steps: receiving a data message sent by a sending end Virtual Machine (VM) to receiving end VMs in different subnets, wherein the data message comprises Internet Protocol (IP) addresses of the receiving end VMs; inquiring whether output port information of the receiving end VM corresponding to the IP address of the receiving end VM is recorded in advance, wherein the output port information of the receiving end VM is recorded when the receiving end VM is also connected by the sending end VTEP; and if the record exists, the data message is sent to the receiving end VM through an output port corresponding to the output port information of the receiving end VM. The invention optimizes the communication route between VMs which are connected with the same VTEP but are positioned in different subnets.

Description

Data message forwarding method, VTEP, device, medium and system
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a data packet forwarding method, a VTEP, an apparatus, a medium, and a system.
Background
In the current VXLAN centralized gateway architecture, cross-segment data must be forwarded three layers through a centralized gateway, which causes the problem that VMs in different subnets must pass through the centralized gateway device even if connected to the same VTEP, resulting in poor access routing.
Disclosure of Invention
The present invention provides a data packet forwarding method, a VTEP, an apparatus, a medium, and a system to solve the above-mentioned problems in the prior art, so as to solve the problem that in the VXLAN centralized gateway architecture in the prior art, even if a VM in a different subnet is connected to the same VTEP in a downstream manner, the communication data must pass through the centralized gateway device, which results in poor access routing.
In a first aspect, the present invention provides a data packet forwarding method, which is applied to a VTEP (virtual local area network tunnel endpoint) that is extensible at a sending end, and includes:
receiving a data message sent by a sending end Virtual Machine (VM) to receiving end VMs in different subnets, wherein the data message comprises Internet Protocol (IP) addresses of the receiving end VMs;
inquiring whether output port information of the receiving end VM corresponding to the IP address of the receiving end VM is recorded in advance, wherein the output port information of the receiving end VM is recorded when the receiving end VM is also connected by the sending end VTEP;
and if the record exists, the data message is sent to the receiving end VM through an output port corresponding to the output port information of the receiving end VM.
Preferably, the querying whether exit port information of the receiving-side VM corresponding to the IP address of the receiving-side VM is recorded in advance specifically includes:
inquiring whether a Media Access Control (MAC) address of the receiving terminal VM corresponding to the IP address of the receiving terminal VM exists in a pre-recorded Address Resolution Protocol (ARP) table entry;
and if so, further inquiring whether the pre-recorded MAC address table entry has the output port information of the receiving end VM corresponding to the MAC address of the receiving end VM.
Preferably, before the receiving the data packet sent by the sending-end virtual machine VM to the receiving-end VM in different subnets, the method further includes:
receiving a first ARP request aiming at the IP address of a receiving end VM sent by a sending end VM;
the first ARP request is transmitted in an IP network after being packaged until reaching a gateway;
receiving a first ARP response sent by a gateway after acquiring the MAC address of the receiving end VM according to the first ARP request;
and learning the corresponding relation between the IP address of the receiving end VM and the MAC address of the receiving end VM according to the first ARP response, and recording the corresponding relation in an ARP table item.
Preferably, before the receiving the data packet sent by the sending-end virtual machine VM to the receiving-end VM in different subnets, the method further includes:
when the receiving end VM is also connected in a downlink mode by the sending end VTEP, the corresponding relation between the MAC address of the receiving end VM and the output port information of the receiving end VM is learned according to the ARP request sent by the receiving end VM, and the corresponding relation is recorded in the MAC address table item.
Preferably, the data message further includes a MAC address of the gateway;
after inquiring whether the output port information of the receiving end VM corresponding to the IP address of the receiving end VM is recorded in advance, the method further includes:
and if the record is not recorded, the data message is packaged according to the MAC address of the gateway and then is sent to the gateway.
Preferably, before the receiving of the data packet sent by the sending-end virtual machine VM to the receiving-end VM in different subnets, the method further includes:
receiving a second ARP request which is sent by a sending end VM and aims at the gateway;
the second ARP request is transmitted in the IP network after being packaged until reaching the gateway;
receiving a second ARP response sent by the gateway after the gateway acquires the MAC address of the gateway according to the second ARP request;
and sending the second ARP response to the sending end VM so that the sending end VM responds to learn the MAC address of the gateway according to the second ARP.
In a second aspect, the present invention provides a sending-end extensible virtual local area network tunnel endpoint VTEP, including:
the receiving module is used for receiving a data message sent by a sending end virtual machine VM to receiving end VMs in different subnets, wherein the data message comprises IP addresses of the receiving end VMs;
the query module is connected with the receiving module and used for querying whether the output port information of the receiving end VM corresponding to the IP address of the receiving end VM is recorded in advance, wherein the output port information of the receiving end VM is recorded when the receiving end VM is also connected by the sending end VTEP;
and the sending module is connected with the query module and used for sending the data message to the receiving end VM through an output port corresponding to the output port information of the receiving end VM if the record exists.
In a third aspect, the present invention provides a data packet forwarding apparatus, including a memory and a processor, where the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes the data packet forwarding method as described above.
In a fourth aspect, the present invention provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a data message forwarding method as described above.
In a fifth aspect, the present invention provides a data packet forwarding system, including:
the sending end can expand the virtual local area network tunnel endpoint VTEP, is used for carrying out the above-mentioned data message and transmitting the method;
the sending end virtual machine VM is connected with the sending end VTEP and is used for sending data messages to the receiving end VMs in different subnets;
and the receiving end VM is connected with the sending end VTEP and is used for receiving the data message sent by the sending end VM.
The invention provides a data message forwarding method, a VTEP, a device, a medium and a system, aiming at a VXLAN centralized gateway architecture, when the VMs which are connected to the same VTEP but are positioned in different subnets communicate, the IP address of a receiving end VM is used for inquiring the output port information of the receiving end VM which is recorded in advance by the connected VTEP, and the data message is directly sent to the receiving end VM through the output port, thereby avoiding the problem that the data also needs to pass through the centralized gateway when the VMs which are connected to the same VTEP are communicated across network segments, and optimizing the communication route between the VMs which are connected to the same VTEP but are positioned in different subnets.
Drawings
Fig. 1 is a flow chart of a data message forwarding method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a VXLAN centralized gateway architecture according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data packet forwarding apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of another data packet forwarding device according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the following detailed description will be made with reference to the accompanying drawings.
It is to be understood that the specific embodiments and figures described herein are merely illustrative of the invention and are not limiting of the invention.
It is to be understood that the embodiments and features of the embodiments can be combined with each other without conflict.
It is to be understood that, for the convenience of description, only parts related to the present invention are shown in the drawings of the present invention, and parts not related to the present invention are not shown in the drawings.
It should be understood that each unit and module related in the embodiments of the present invention may correspond to only one physical structure, and may also be composed of multiple physical structures, or multiple units and modules may also be integrated into one physical structure.
It will be understood that, without conflict, the functions, steps, etc. noted in the flowchart and block diagrams of the present invention may occur in an order different from that noted in the figures.
It is to be understood that the flowchart and block diagrams of the present invention illustrate the architecture, functionality, and operation of possible implementations of systems, apparatus, devices and methods according to various embodiments of the present invention. Each block in the flowchart or block diagrams may represent a unit, module, segment, code, which comprises executable instructions for implementing the specified function(s). Furthermore, each block or combination of blocks in the block diagrams and flowchart illustrations can be implemented by hardware-based systems that perform the specified functions or by a combination of hardware and computer instructions.
It is to be understood that the units and modules involved in the embodiments of the present invention may be implemented by software, and may also be implemented by hardware, for example, the units and modules may be located in a processor.
For a better understanding of the invention, the virtual network will first be described.
VXLAN (Virtual eXtensible Virtual local area Network) is a two-layer VPN (Virtual Private Network) technology based on an IP (Internet Protocol) Network and adopting a "MAC (Media Access Control) in UDP (User Datagram Protocol)" encapsulation form.
A typical network model for VXLAN includes the following sections:
VM (Virtual Machine): multiple virtual machines can be created on one server, different virtual machines can belong to different VXLANs, and the virtual machines belonging to different VXLANs are isolated in two layers. The different VXLANs are identified by VXLAN IDs, also known as VNIs (VXLAN Network Identifier), which is 24 bits long.
VTEP (VXLAN Tunnel End Point ): the VXLAN edge device and VXLAN processing are all performed on the VTEP, for example, to identify the VXLAN to which the ethernet data frame belongs, to perform two-layer forwarding, and to encapsulate/decapsulate the packet based on the VXLAN. The VTEP may be an independent physical device or a server where the virtual machine is located.
VXLAN tunnel: a point-to-point logical tunnel between two VTEPs. After the VTEP encapsulates a VXLAN header, a UDP (User Datagram Protocol) header, and an IP header for the data frame, the encapsulated message is forwarded to the remote VTEP through the VXLAN tunnel, and the remote VTEP decapsulates the packet.
A core device: the device in the IP core network, the core device does not participate in VXLAN processing, and only needs to forward the message three layers according to the destination IP address of the encapsulated message.
VSI (Virtual Switch Instance): the VSI can be regarded as a virtual switch on the VTEP that performs layer two forwarding based on VXLAN, and has all functions of a conventional ethernet switch, including source MAC address learning, MAC address aging, flooding, and the like. VSIs correspond one-to-one to VXLANs.
AC (Attachment Circuit, access Circuit): the VTEP connects the physical or virtual circuits of the local site, and on the VTEP, the three-layer interface or ethernet service instance (service instance) associated with the VSI is called AC.
VXLAN gateways must be relied upon if communication between different VXLAN subnets is to be achieved, and VXLAN gateway architectures include centralized gateway architectures and distributed gateway architectures. In the VXLAN centralized gateway architecture, all the gateways of all the networks are all centrally deployed in one device, and all the cross-network access traffic needs to pass through the centralized gateway; the method has the advantages that the flow accessed by the cross-network segment can be managed in a centralized way, and the configuration and the maintenance are simpler; the defects include that when VMs located in different network segments of the same VTEP access each other, the traffic must pass through the centralized gateway device, so that the access route is not optimal.
Therefore, embodiments of the present invention provide a data message forwarding method, a VTEP, an apparatus, a medium, and a system, in a VXLAN centralized gateway architecture, a corresponding relationship between MAC addresses and egress port information of all connected VMs recorded in a Media Access Control (MAC) Address table of the VTEP is utilized, and when any one of the connected VMs needs to communicate with other VMs in different network segments, a corresponding Address Resolution Protocol (ARP) entry is established to record a corresponding relationship between IP addresses and MAC addresses of other VMs to communicate, in a cross-network-segment communication process, whether a cross-network-segment communication VM is connected by itself is determined through two pre-recorded tables, and if so, communication between the two VMs is directly realized through its own egress port; the following is a detailed description of specific embodiments of the invention.
Example 1:
as shown in fig. 1, an embodiment 1 of the present invention provides a data packet forwarding method, which is applied to an extensible virtual local area network tunnel endpoint VTEP at a sending end, and includes:
step S11, receiving a data message sent by a sending end virtual machine VM to a receiving end VM in different subnets, wherein the data message comprises an Internet Protocol (IP) address of the receiving end VM;
step S12, inquiring whether output port information of the receiving end VM corresponding to the IP address of the receiving end VM is recorded in advance, wherein the output port information of the receiving end VM is recorded when the receiving end VM is also connected downwards by the sending end VTEP;
and S13, if the record exists, sending the data message to the receiving end VM through an output port corresponding to the output port information of the receiving end VM.
Specifically, in this embodiment, when a sending end VTEP receives a data packet sent by a sending end VM subordinate to the sending end VTEP to a receiving end VM, a pre-record of the sending end VM is queried according to an IP address of the receiving end VM included in the data packet, where the pre-record is for achieving the purpose of the present invention, and when the receiving end VM is also subordinate to the sending end VTEP, the VTEP records an IP address of the receiving end VM and information of an egress port of the receiving end VM and a corresponding relationship between the IP address and the egress port of the receiving end VM, and if there is such a record, it indicates that the receiving end VM is also subordinate to the sending end VTEP, at this time, the data packet is sent directly to the receiving end VM through an egress port corresponding to the egress port information of the receiving end VM, and it is not necessary to forward the data packet through a gateway, so that a communication route between VMs located in different subnets under the same VTEP is optimized.
Optionally, the querying whether exit port information of the receiving-end VM corresponding to the IP address of the receiving-end VM is recorded in advance specifically includes:
inquiring whether a Media Access Control (MAC) address of the receiving terminal VM corresponding to the IP address of the receiving terminal VM exists in a pre-recorded Address Resolution Protocol (ARP) table entry;
and if so, further inquiring whether the pre-recorded MAC address table entry has the output port information of the receiving end VM corresponding to the MAC address of the receiving end VM.
Specifically, in this embodiment, the corresponding relationship between the IP address of the receiving end VM and the MAC address of the receiving end VM is recorded in advance by using the ARP table of the VTEP, the corresponding relationship between the MAC address of the receiving end VM and the egress port information of the receiving end VM is recorded in advance by using the MAC address table of the VTEP, when a data packet sent to the receiving end VM by the sending end VM is received, the IP address of the receiving end VM is obtained from the data packet, the MAC address of the receiving end VM is obtained from the corresponding entry in the ARP table, and the egress port information of the receiving end VM is obtained from the corresponding entry in the MAC address table.
Optionally, before the receiving of the data packet sent by the sending-end virtual machine VM to the receiving-end VM in different subnets, the method further includes:
receiving a first ARP request aiming at the IP address of a receiving end VM sent by a sending end VM;
the first ARP request is transmitted in an IP network after being packaged until reaching a gateway;
receiving a first ARP response sent by a gateway after acquiring the MAC address of a receiving end VM according to a first ARP request;
and learning the corresponding relation between the IP address of the receiving end VM and the MAC address of the receiving end VM according to the first ARP response, and recording the corresponding relation in an ARP table item.
Specifically, in this embodiment, when a sending end VM sends a data packet to a receiving end VM, it is determined that the receiving end VM and the receiving end VM are in different subnets through an IP address of the receiving end VM, at this time, the sending end VM may send a first ARP request to a gateway through a sending end VTEP, where the first ARP request is used to request to analyze an IP address of the receiving end VM, the gateway receives the first ARP request, obtains an MAC address of the receiving end VM through analysis, generates a first ARP response, and sends the first ARP response to the sending end VTEP, where the sending end VTEP learns, from the first ARP response, to obtain the IP address of the receiving end VM and the MAC address of the receiving end VM and a corresponding relationship between the two addresses, and records the receiving end VM and the receiving end VM through an ARP entry form.
Optionally, before the receiving the data packet sent by the sending-end virtual machine VM to the receiving-end VM in different subnets, the method further includes:
when the receiving end VM is also connected in a downlink mode by the sending end VTEP, the corresponding relation between the MAC address of the receiving end VM and the output port information of the receiving end VM is learned according to the ARP request sent by the receiving end VM, and the corresponding relation is recorded in the MAC address table item.
Specifically, in this embodiment, when the receiving end VM is also downlinked by the sending end VTEP, the receiving end VM also serves as a sending end for communication at a certain time, at this time, the receiving end VM also sends an ARP request through the sending end VTEP which is uplinked by itself, and the sending end VTEP can learn and obtain the MAC address of the receiving end VM, the output port information of the receiving end VM, and the corresponding relationship between the MAC address and the output port information of the receiving end VM from this ARP request, and record the MAC address and the output port information in the form of the MAC address table entry by itself; it should be noted that, the sending-end VTEP may also record the MAC address of the sending-end VM and the egress port information of the sending-end VM in its MAC address table, for example, after receiving the first ARP request, learn the MAC address of the sending-end VM and the egress port information of the sending-end VM and the corresponding relationship between the two from the first ARP request, and record the MAC address and the egress port information in the form of an MAC address table entry.
Optionally, the data packet further includes a MAC address of the gateway;
after inquiring whether the output port information of the receiving end VM corresponding to the IP address of the receiving end VM is recorded in advance, the method further includes:
and if the record does not exist, the data message is packaged according to the MAC address of the gateway and then is sent to the gateway.
Specifically, in this embodiment, if the receiving end VM is not downlinked by the sending end VTEP, the sending end VTEP does not have a corresponding relationship between the IP address of the receiving end VM and the egress port information of the receiving end VM, at this time, the data packet is encapsulated by the sending end VTEP according to the MAC address of the gateway in the data packet, and then sent to the gateway, and then sent to the next hop device by the gateway until the receiving end VM is reached.
Optionally, before the receiving of the data packet sent by the sending-end virtual machine VM to the receiving-end VM in different subnets, the method further includes:
receiving a second ARP request aiming at the gateway and sent by a sending end VM;
transmitting the second ARP request in an IP network after encapsulating the second ARP request until the second ARP request reaches a gateway;
receiving a second ARP response sent by the gateway after the gateway acquires the MAC address of the gateway according to the second ARP request;
and sending the second ARP response to the sending end VM so that the sending end VM learns the MAC address of the gateway according to the second ARP response.
Specifically, in this embodiment, the sending end VM forwards the second ARP request to the gateway through the sending end VTEP by sending the second ARP request for the gateway, and the gateway returns the second ARP response after obtaining the MAC address of the gateway according to the second ARP request, and the sending end VTEP sends the second ARP response to the sending end VM, and the sending end VM learns the MAC address of the gateway according to the second ARP response; it should be noted that the second ARP request and the first ARP request may be the same ARP request, the second ARP response and the first ARP response may be the same ARP response, the sending end VTEP may learn from the ARP response to obtain the IP address of the receiving end VM, the MAC address of the receiving end VM, and the MAC address of the gateway, then record the IP address of the receiving end VM and the MAC address of the receiving end VM in the ARP entry correspondingly, and send the MAC address of the gateway to the sending end VM.
In a more specific example, the data packet forwarding method applies VTEP1 as shown in fig. 2, VTEP1 at least connects down two VMs in different VXLAN subnets, e.g. VM1 in VXLAN1 and VM2 in VXLAN2 in fig. 2, VTEP1 is connected up to a centralized gateway VTEP2, VTEP1 and VTEP2 may not be in a direct connection relationship as shown in the figure, there may be other VTEPs in the middle, VTEP2 may also connect down other VTEPs or VMs, e.g. VTEP2 connects down VM3 in fig. 2, VM3 is in a certain vxlax, vxlax may be VXLAN1, VXLAN2 or other VXLAN subnets, and the data packet forwarding method is used to implement communication of data between VM1 and VM2 in fig. 2 without passing through VTEP2, for example, VM1 serves as a sending end, VM2 serves as a receiving end, and the steps involved in completing the data packet forwarding method include:
(1) When VM1 needs to send data messages to VM2 of different subnets, VM1 judges that the data messages are cross-network segment addresses according to IP addresses of VM2, VM1 firstly sends ARP requests to a connected VTEP1, and the ARP requests comprise the IP addresses of VM2;
(2) After receiving the ARP request of the VM1, the VTEP1 learns the corresponding relation between the MAC of the VM1 and the output port information of the VM1, records the MAC address table item of the VM1 formed in the MAC address table, and generates the ARP table item of the VM1 at the same time;
(4) The VTEP copies the ARP request message according to the head end copy list and respectively encapsulates the ARP request message, wherein the encapsulated outer layer source IP address is the IP address of the VTEP1, and the outer layer destination IP address is the IP addresses of all opposite end VTEPs; the outer layer source MAC address is the MAC address of VTEP1, and the outer layer destination MAC address is the MAC address of the next hop equipment in the network to the destination IP;
(5) The packaged message is transmitted in an IP network according to outer MAC and IP information until an opposite end VTEP is reached, for example, after a gateway VTEP2, the VTEP2 unpacks the message to obtain an original ARP request message sent by a VM 1;
(6) The gateway VTEP2 judges that the target IP address in the ARP request message is the ARP request message sent to the gateway VTEP2, and obtains the MAC address of the VM2 through self analysis or continuously requests the VM2 to obtain the MAC address of the VM2 according to the IP address of the VM2;
(7) According to the obtained MAC address of the VM2, the MAC address of the VTEP2 is provided, an ARP response is generated, and the ARP response is fed back to the VTEP 1;
(8) After receiving the ARP response, VTEP1 learns the corresponding relation of the IP address of VM2 and the MAC address of VM2, and records the ARP list item in VM2; the ARP table entry of VM2 may be generated and filled at this time, or may be generated and filled at step (2) when VM2 is to send data as a sending end, and the MAC address table entry of VM2 is formed at step (2) when VM2 is to send data as a sending end;
(9) VTEP1 sends ARP response to VM1, after VM1 receives ARP response, learn the MAC address of VTEP 2;
(10) The VM1 sends a data message to the VM2, wherein a target IP address is an IP address of the VM2, and a target MAC address is an MAC address of the VTEP 2;
(11) After receiving the data message, the VTEP1 judges that the data message is a cross-network-segment data message according to the destination IP address and the destination MAC address;
(12) The VTEP1 firstly searches ARP table items according to the target IP address, if the table items of the target IP address are searched in the ARP table items, the MAC address table items are continuously searched according to the MAC address corresponding to the target IP address in the ARP table items, and if the corresponding table items of the MAC address are searched in the MAC address table items, the corresponding outlet port information in the MAC address table items is obtained;
(13) If the output port information is found, the data message is directly sent to the VM2 through the output port corresponding to the output port information;
(14) If the entry of the destination IP address is not found in the ARP entry, or the entry of the corresponding MAC address is not found in the MAC address entry, the VTEP1 encapsulates the data message by VXLAN according to the destination MAC address and then sends the encapsulated data message to the gateway VTEP2, so that the VTEP2 continuously forwards the data message to the VM2.
Obviously, the above steps (1) - (13) are also applicable to VM2 as the transmitting end and VM1 as the receiving end; the occurrence of step (14) may include that the MAC address entry of VM2 is not formed yet, the ARP entry of VM2 is not filled successfully, or may occur during communication between VMs connected by different VTEPs, for example, when VM1 sends a data packet to VM 3.
Embodiment 1 provides a method for directly forwarding a received cross-network-segment data message to a receiving end VM connected with the receiving end VM through a sending end VTEP, which avoids sending the data message to a gateway when the receiving end VM is connected with the sending end VTEP, sends the data message to the sending end VTEP through the gateway, and finally sends the data message to the receiving end VM through the sending end VTEP via a complex route, thereby optimizing a sending mode of the cross-network-segment data message under a centralized gateway architecture.
Example 2:
as shown in fig. 3, embodiment 2 of the present invention provides a sending-end extensible virtual local area network tunnel endpoint VTEP, including:
a receiving module 11, configured to receive a data packet sent by a sending-end virtual machine VM to receiving-end VMs located in different subnets, where the data packet includes an IP address of the receiving-end VM;
the query module 12 is connected to the receiving module 11, and is configured to query whether output port information of the receiving end VM corresponding to the IP address of the receiving end VM is pre-recorded, where the output port information of the receiving end VM is recorded when the receiving end VM is also connected by the sending end VTEP;
a sending module 13, connected to the querying module 12, configured to send the data packet to the receiving end VM through an egress port corresponding to egress port information of the receiving end VM if there is a record.
Optionally, the query module 12 specifically includes:
the first query unit is used for querying whether a Media Access Control (MAC) address of the receiving terminal VM corresponding to the IP address of the receiving terminal VM exists in a pre-recorded Address Resolution Protocol (ARP) table entry;
and the second query unit is connected with the first query unit and used for further querying whether the pre-recorded MAC address table entry has the output port information of the receiving end VM corresponding to the MAC address of the receiving end VM or not if the MAC address of the receiving end VM exists.
Optionally:
the receiving module 11 is further configured to receive a first address resolution protocol ARP request, which is sent by the sending end VM and is addressed to the IP address of the receiving end VM;
the sending module 13 is further configured to transmit the first ARP request in the IP network after encapsulating the first ARP request until the first ARP request reaches the gateway;
the receiving module 11 is further configured to receive a first ARP response sent by the gateway after acquiring the MAC address of the receiving end VM according to the first ARP request;
the sending end VTEP also comprises a recording module which is used for learning the corresponding relation between the IP address of the receiving end VM and the MAC address of the receiving end VM according to the first ARP response and recording the corresponding relation in the ARP list item.
Optionally:
the recording module is further configured to learn, according to the ARP request sent by the receiving end VM when the receiving end VM is also downlinked by the sending end VTEP, a correspondence between the MAC address of the receiving end VM and the egress port information of the receiving end VM, and record the correspondence in the MAC address table entry.
Optionally, the data packet further includes a MAC address of the gateway;
the sending module 13 is further configured to, if there is no record, encapsulate the data packet according to the MAC address of the gateway and send the encapsulated data packet to the gateway.
Optionally:
the receiving module 11 is further configured to receive a second ARP request for the gateway, sent by the sending end VM;
the sending module 13 is further configured to transmit the encapsulated second ARP request in the IP network until the second ARP request reaches the gateway;
the receiving module 11 is further configured to receive a second ARP response sent by the gateway after the gateway acquires the MAC address of the gateway according to the second ARP request;
the sending module 13 is further configured to send the second ARP response to the sending end VM, so that the sending end VM learns the MAC address of the gateway according to the second ARP response.
Embodiment 2 provides a VTEP capable of directly sending data packets sent between VMs in different subnets connected downstream of the VTEP, and optimizes a cross-network communication route of VXLAN under a centralized gateway architecture.
Example 3:
as shown in fig. 4, embodiment 3 of the present invention provides a data packet forwarding apparatus, including a memory 10 and a processor 20, where the memory 10 stores a computer program, and when the processor 20 runs the computer program stored in the memory 10, the processor 20 executes the data packet forwarding method according to embodiment 1.
The memory 10 is connected to the processor 20, the memory 10 may be a flash memory, a read-only memory or other memories, and the processor 20 may be a central processing unit or a single chip microcomputer.
Embodiment 3 provides a data packet forwarding apparatus, which can be applied to a computer device having any form of memory 10 and processor 20, and which can implement the data packet forwarding method described in embodiment 1.
Example 4:
embodiment 4 of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the data packet forwarding method according to embodiment 1 is implemented.
The computer-readable storage media include volatile or nonvolatile, removable or non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, computer program modules or other data. Computer-readable storage media include, but are not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash Memory or other Memory technology, CD-ROM (Compact disk Read-Only Memory), digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer.
Embodiment 4 provides a computer-readable storage medium capable of implementing the data packet forwarding method according to embodiment 1, where after being installed and run on any VTEP of the VXLAN centralized gateway architecture, the computer-readable storage medium can implement route optimization of cross-segment data packet transmission between VMs connected under the corresponding VTEP.
Example 5:
an embodiment 5 of the present invention provides a data packet forwarding system, including:
a sending end extensible virtual local area network tunnel endpoint VTEP, configured to execute the data message forwarding method according to embodiment 1;
the sending end virtual machine VM is connected with the sending end VTEP and is used for sending data messages to the receiving end VMs in different subnets;
and the receiving end VM is connected with the sending end VTEP and is used for receiving the data message sent by the sending end VM.
Specifically, in this embodiment, the data packet forwarding system is shown by a dotted line in fig. 2, and includes VM1, VM2, and VTEP1, where VM1 and VM2 are respectively located in different VXLAN subnets VALAN1 and VXLAN2, and VM1 and VM2 are both connected to VTEP1, and the data packet forwarding method includes: and sending data to VM2 through VTEP1 by using VM1 as a sender, or sending data to VM1 through VTEP1 by using VM2 as a sender.
Embodiment 5 provides a data packet forwarding system, which uses the VTEP capable of implementing the data packet forwarding method described in embodiment 1 as a sending end VTEP, and optimizes a route for sending data packets across network segments between VMs connected to the VTEP in the downstream.
Embodiments 1 to 5 of the present invention provide a data packet forwarding method, a VTEP, an apparatus, a medium, and a system, which are directed to a VXLAN centralized gateway architecture, and when a VM connected to the same VTEP but located in different subnets communicates with each other, query, through an IP address of a receiving end VM, egress port information of the receiving end VM recorded in advance by the connected VTEP, and send a data packet to the receiving end VM directly through an egress port, so as to avoid a problem that data needs to pass through the centralized gateway when VMs connected to the same VTEP communicate across network segments, and optimize a communication route between VMs connected to the same VTEP but located in different subnets.
It will be understood that the above embodiments are merely exemplary embodiments taken to illustrate the principles of the present invention, which is not limited thereto. It will be apparent to those skilled in the art that various modifications and improvements can be made without departing from the spirit and substance of the invention, and these modifications and improvements are also considered to be within the scope of the invention.

Claims (10)

1. A data message forwarding method is applied to a sending end and an extensible virtual local area network (VTEP) and comprises the following steps:
receiving a data message sent by a sending end Virtual Machine (VM) to receiving end VMs in different subnets, wherein the data message comprises Internet Protocol (IP) addresses of the receiving end VMs;
inquiring whether output port information of the receiving end VM corresponding to the IP address of the receiving end VM is recorded in advance, wherein the output port information of the receiving end VM is recorded when the receiving end VM is also connected downwards by the sending end VTEP;
and if the record exists, the data message is sent to the receiving end VM through an output port corresponding to the output port information of the receiving end VM.
2. The method according to claim 1, wherein the querying whether exit port information of the receiving-side VM corresponding to the IP address of the receiving-side VM is pre-recorded specifically includes:
inquiring whether a Media Access Control (MAC) address of the receiving terminal VM corresponding to the IP address of the receiving terminal VM exists in a pre-recorded Address Resolution Protocol (ARP) table entry;
and if so, further inquiring whether the pre-recorded MAC address table entry has the output port information of the receiving end VM corresponding to the MAC address of the receiving end VM.
3. The method according to claim 2, wherein before receiving the data packet sent by the sending-side VM to the receiving-side VM in a different subnet, the method further comprises:
receiving a first ARP request aiming at the IP address of a receiving end VM sent by a sending end VM;
the first ARP request is transmitted in an IP network after being packaged until reaching a gateway;
receiving a first ARP response sent by a gateway after acquiring the MAC address of the receiving end VM according to the first ARP request;
and learning the corresponding relation between the IP address of the receiving end VM and the MAC address of the receiving end VM according to the first ARP response, and recording the corresponding relation in an ARP table item.
4. The method according to claim 2, wherein before receiving the data packet sent by the sending-side VM to the receiving-side VM in a different subnet, the method further comprises:
when the receiving end VM is also connected in a downlink mode by the sending end VTEP, the corresponding relation between the MAC address of the receiving end VM and the output port information of the receiving end VM is learned according to the ARP request sent by the receiving end VM, and the corresponding relation is recorded in the MAC address table item.
5. The method according to any of claims 1-4, wherein the data message further comprises a MAC address of the gateway;
after inquiring whether the output port information of the receiving end VM corresponding to the IP address of the receiving end VM is recorded in advance, the method further includes:
and if the record is not recorded, the data message is packaged according to the MAC address of the gateway and then is sent to the gateway.
6. The method according to claim 5, wherein before receiving the data packet sent by the sending-side virtual machine VM to the receiving-side VM in a different subnet, the method further comprises:
receiving a second ARP request which is sent by a sending end VM and aims at the gateway;
the second ARP request is transmitted in the IP network after being packaged until reaching the gateway;
receiving a second ARP response sent by the gateway after the gateway acquires the MAC address of the gateway according to the second ARP request;
and sending the second ARP response to the sending end VM so that the sending end VM learns the MAC address of the gateway according to the second ARP response.
7. A sending-end extensible virtual local area network tunnel endpoint (VTEP), comprising:
the receiving module is used for receiving a data message sent by a sending end Virtual Machine (VM) to receiving end VMs in different subnets, wherein the data message comprises IP addresses of the receiving end VMs;
the query module is connected with the receiving module and is used for querying whether output port information of the receiving end VM corresponding to the IP address of the receiving end VM is recorded in advance, wherein the output port information of the receiving end VM is recorded when the receiving end VM is also connected in a descending mode by the sending end VTEP;
and the sending module is connected with the query module and used for sending the data message to the receiving end VM through an output port corresponding to the output port information of the receiving end VM if the record exists.
8. A data message forwarding device comprising a memory and a processor, the memory having stored therein a computer program, the processor performing the data message forwarding method according to any one of claims 1-6 when the processor runs the computer program stored in the memory.
9. A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, implements a data message forwarding method according to any one of claims 1 to 6.
10. A data message forwarding system, comprising:
a sending-end extensible virtual local area network tunnel endpoint, VTEP, configured to perform the data message forwarding method according to any one of claims 1 to 6;
the sending end virtual machine VM is connected with the sending end VTEP and is used for sending data messages to the receiving end VMs in different subnets;
and the receiving end VM is connected with the sending end VTEP and is used for receiving the data message sent by the sending end VM.
CN202211103390.6A 2022-09-09 2022-09-09 Data message forwarding method, VTEP, device, medium and system Pending CN115665043A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211103390.6A CN115665043A (en) 2022-09-09 2022-09-09 Data message forwarding method, VTEP, device, medium and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211103390.6A CN115665043A (en) 2022-09-09 2022-09-09 Data message forwarding method, VTEP, device, medium and system

Publications (1)

Publication Number Publication Date
CN115665043A true CN115665043A (en) 2023-01-31

Family

ID=85024465

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211103390.6A Pending CN115665043A (en) 2022-09-09 2022-09-09 Data message forwarding method, VTEP, device, medium and system

Country Status (1)

Country Link
CN (1) CN115665043A (en)

Similar Documents

Publication Publication Date Title
CN109257265B (en) Flooding suppression method, VXLAN bridge, gateway and system
EP3544240B1 (en) Data processing
US8819267B2 (en) Network virtualization without gateway function
WO2017114196A1 (en) Packet processing method, related apparatus and nvo3 network system
US10263808B2 (en) Deployment of virtual extensible local area network
EP3197107B1 (en) Message transmission method and apparatus
CN108718269B (en) Message processing method and device
CN108964940B (en) Message sending method and device and storage medium
CN107317752B (en) Method and device for forwarding data message
US11477114B2 (en) Packet forwarding method and apparatus
CN107995083B (en) Method, system and equipment for realizing intercommunication between L2VPN and VxLAN
CN108199963B (en) Message forwarding method and device
CN107547340B (en) Message forwarding method and device
CN107040441B (en) Cross-data-center data transmission method, device and system
CN107659484B (en) Method, device and system for accessing VXLAN network from VLAN network
CN111526223B (en) Management method of edge service server, service data processing method and device
CN108092890B (en) Route establishing method and device
US20190215191A1 (en) Deployment Of Virtual Extensible Local Area Network
US10171259B2 (en) Network system and relay device
CN107547691B (en) Address resolution protocol message proxy method and device
CN110620715B (en) Virtual extended local area network communication method, tunnel endpoint and controller
CN113794615B (en) Message forwarding method and device
EP3605958A1 (en) Ip routed virtual private lan
CN106487677A (en) Provider edge equipment and data forwarding method
CN113037883B (en) Method and device for updating MAC address table entries

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