Message forwarding method, device, equipment and computer-readable storage medium

By using the OpenFlow protocol stream table on a virtualized open stream switch (OVS), VxLAN packets are encapsulated and decapsulated, and sent directly to the destination virtual machine, the problem of low forwarding efficiency in VxLAN packets in the existing technology is solved, and the improvement is achieved Efficient message forwarding.

CN115001900BActive Publication Date: 2024-11-15CHINA MOBILEHANGZHOUINFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210645267.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-06
Publication Date
2024-11-15
Estimated Expiration
2042-06-06

AI Technical Summary

Technical Problem

The current VxLAN packet forwarding efficiency is low, resulting in messages sent by the source virtual machine that need to be checked multiple times and processed by the protocol stack, reducing the forwarding efficiency.

Method used

By using the OpenFlow protocol flow table on a virtualized open stream switch (OVS), the VxLAN packets to be forwarded are encapsulated and decapsulated, and sent directly to the destination virtual machine, reducing intermediate processing steps.

Benefits of technology

Improves the forwarding efficiency of VxLAN packets, and reduces the configuration complexity and processing delay between virtual machines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115001900B_ABST
    Figure CN115001900B_ABST
Patent Text Reader

Abstract

The present invention discloses a message forwarding method, device, equipment and readable storage medium, wherein the method is applied to a first virtualized open flow switch OVS of a first virtual machine, including: based on a first identifier of a virtual extensible local area network VxLAN message to be forwarded and an openflow protocol flow table, performing a message encapsulation operation on the VxLAN message to be forwarded to obtain a target VxLAN message; based on a first Uplink port on the first OVS, sending the target VxLAN message to a second OVS corresponding to a destination virtual machine, wherein the second OVS obtains an openflow protocol flow table from the SDN controller, performs a decapsulation operation on the target VxLAN message based on the openflow protocol flow table, obtains the VxLAN message to be forwarded, and forwards the VxLAN message to be forwarded to the second virtual machine. The present invention can realize the encapsulation of the VxLAN message to be forwarded and the decapsulation of the encapsulated VxLAN message through the openflow protocol flow table, thereby improving the VxLAN message forwarding efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a message forwarding method, device, equipment and computer-readable storage medium. Background Art

[0002] Software Defined Network (SDN) technology achieves flexible control of network traffic by separating the control plane from the data plane of network devices. Accordingly, the SDN architecture includes an SDN controller and an SDN switch, wherein: the SDN controller and the SDN switch communicate through an SDN management channel preferably using the OpenFlow protocol, the SDN controller generates a flow table based on the user's configuration or the dynamically running protocol and sends it to the SDN switch, and the SDN switch processes the message based on the flow table sent by the SDN controller.

[0003] VxLAN is a technology that uses a layer 3 protocol to encapsulate layer 2 packets, which can extend the layer 2 network within the layer 3 network. It is used within the data center to enable virtual machines (VMs) to migrate within the interconnected layer 3 network, thereby ensuring business continuity. VxLAN is one of the popular technologies for implementing overlay networks. By setting up a VxLAN Tunnel End Point (VTEP) at the edge of the physical network, the isolation of the virtual network from the physical network can be achieved.

[0004] Open vSwitch (OVS) is an open source virtual switch. OVS can support VxLAN protocol to increase support for Overlay network. Currently, OVS can already perform VxLAN header encapsulation on messages, thereby using VxLAN technology to support Overlay network deployment. However, in the VxLAN forwarding of related technologies, the message sent by the source virtual machine needs to go through multiple table lookups and IP ingress protocol stack and IP egress protocol stack processing before it can be received by the destination virtual machine, which makes the implementation process complicated and reduces the message forwarding efficiency. Summary of the invention

[0005] The main purpose of the present invention is to provide a message forwarding method, device, equipment and computer-readable storage medium, aiming to solve the technical problem of low efficiency of existing VxLAN message forwarding.

[0006] To achieve the above object, the present invention provides a message forwarding method, which is applied to a first virtualized open flow switch OVS of a first virtual machine. The message forwarding method comprises the following steps:

[0007] Based on the first identifier of the virtual extensible local area network VxLAN message to be forwarded and the openflow protocol flow table, perform a message encapsulation operation on the VxLAN message to be forwarded to obtain a target VxLAN message;

[0008] Based on the first Uplink port on the first OVS, the target VxLAN message is sent to the second OVS corresponding to the destination virtual machine, wherein the second OVS obtains the openflow protocol flow table from the SDN controller, decapsulates the target VxLAN message based on the openflow protocol flow table, obtains the VxLAN message to be forwarded, and forwards the VxLAN message to be forwarded to the second virtual machine.

[0009] Furthermore, the openflow protocol flow table includes a message identifier of the VxLAN message, and the step of performing a message encapsulation operation on the VxLAN message to be forwarded based on the first identifier of the VxLAN message to be forwarded and the openflow protocol flow table to obtain the target VxLAN message includes:

[0010] Determining a first target message identifier that matches the first identifier in the message identifier;

[0011] Based on the first target message identifier and the openflow protocol flow table, a message encapsulation operation is performed on the VxLAN message to be forwarded to obtain a target VxLAN message.

[0012] Furthermore, the step of performing a message encapsulation operation on the VxLAN message to be forwarded based on the first target message identifier and the openflow protocol flow table to obtain the target VxLAN message includes:

[0013] Acquire the first encapsulation information corresponding to the first target message identifier in the openflow protocol flow table;

[0014] Based on the first encapsulation information, a message encapsulation operation is performed on the VxLAN message to be forwarded to obtain a target VxLAN message.

[0015] Furthermore, the first encapsulation information includes: VxLAN header information and VxLAN tunnel information of the VxLAN message to be forwarded.

[0016] In addition, to achieve the above-mentioned purpose, the present invention also provides a message forwarding method, which is applied to a second virtualized open flow switch OVS of a second virtual machine, and the message forwarding method comprises:

[0017] Receive the target VxLAN message through the second Uplink port, wherein the first OVS performs a message encapsulation operation on the VxLAN message to be forwarded based on the first identifier of the VxLAN message to be forwarded and the openflow protocol flow table, obtains the target VxLAN message, and forwards the target VxLAN message through the first Uplink port;

[0018] Based on the openflow protocol flow table and the second identifier of the target VxLAN message, the target VxLAN message is decapsulated to obtain the VxLAN message to be forwarded, and the VxLAN message to be forwarded is forwarded to the second virtual machine.

[0019] Further, the openflow protocol flow table includes a message identifier of the VxLAN message, and the step of performing a decapsulation operation on the target VxLAN message based on the openflow protocol flow table and the second identifier of the target VxLAN message to obtain the VxLAN message to be forwarded includes:

[0020] Determining a second target message identifier that matches the second identifier in the message identifier;

[0021] Based on the second target message identifier and the openflow protocol flow table, the target VxLAN message is decapsulated to obtain the VxLAN message to be forwarded.

[0022] Furthermore, the step of performing a decapsulation operation on the target VxLAN message based on the second target message identifier and the openflow protocol flow table to obtain the VxLAN message to be forwarded includes:

[0023] Acquire the second encapsulation information corresponding to the second target message identifier in the openflow protocol flow table;

[0024] Based on the second encapsulation information, the target VxLAN message is decapsulated to obtain the VxLAN message to be forwarded.

[0025] In addition, to achieve the above object, the present invention further provides a message forwarding device, the message forwarding device comprising:

[0026] An encapsulation module is used to perform a message encapsulation operation on the VxLAN message to be forwarded based on the first identifier of the virtual extensible local area network VxLAN message to be forwarded and the openflow protocol flow table to obtain a target VxLAN message;

[0027] A sending module is used to send the target VxLAN message to the second OVS corresponding to the destination virtual machine based on the first Uplink port on the first OVS, wherein the second OVS obtains an openflow protocol flow table from the SDN controller, decapsulates the target VxLAN message based on the openflow protocol flow table, obtains the VxLAN message to be forwarded, and forwards the VxLAN message to be forwarded to the second virtual machine.

[0028] In addition, to achieve the above-mentioned purpose, the present invention also provides a message forwarding device, which includes: a memory, a processor, and a message forwarding program stored in the memory and executable on the processor, and the message forwarding program implements the steps of the aforementioned message forwarding method when executed by the processor.

[0029] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a message forwarding program is stored, and when the message forwarding program is executed by a processor, the steps of the aforementioned message forwarding method are implemented.

[0030] The present invention performs a message encapsulation operation on the VxLAN message to be forwarded based on the first identifier of the virtual extensible local area network VxLAN message to be forwarded and an openflow protocol flow table to obtain a target VxLAN message; then sends the target VxLAN message to the second OVS corresponding to the destination virtual machine based on the first Uplink port on the first OVS, wherein the second OVS obtains the openflow protocol flow table from the SDN controller, decapsulates the target VxLAN message based on the openflow protocol flow table to obtain the VxLAN message to be forwarded, and forwards the VxLAN message to be forwarded to the second virtual machine, and can realize the encapsulation of the VxLAN message to be forwarded and the decapsulation of the encapsulated VxLAN message through the openflow protocol flow table, thereby improving the forwarding efficiency of the VxLAN message. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 It is a structural diagram of an implementation method of a message forwarding device in a hardware operating environment involved in an embodiment of the present invention;

[0032] Figure 2 A schematic diagram of a flow chart of a first embodiment of a message forwarding method of the present invention;

[0033] Figure 3 A schematic diagram of the message structure of a VxLAN message in the message forwarding method of the present invention;

[0034] Figure 4A schematic diagram of a flow chart of a second embodiment of a message forwarding method of the present invention;

[0035] Figure 5 This is a schematic diagram of the functional modules of an embodiment of a message forwarding device of the present invention.

[0036] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0037] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0038] Figure 1 It is a structural diagram of a message forwarding device in a hardware operating environment involved in an embodiment of the present invention.

[0039] The message forwarding device in the embodiment of the present invention can virtualize the OpenFlow switch.

[0040] like Figure 1 As shown, the message forwarding device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or it may be a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0041] Optionally, the message forwarding device may also include a camera, a RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, etc. Of course, the message forwarding device may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be described in detail here.

[0042] Those skilled in the art will understand that Figure 1 The terminal structure shown in the figure does not constitute a limitation on the message forwarding device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0043] like Figure 1As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a message forwarding program.

[0044] exist Figure 1 In the message forwarding device shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the client (user end) and communicate data with the client; and the processor 1001 can be used to call the message forwarding program stored in the memory 1005.

[0045] In this embodiment, the message forwarding device includes: a memory 1005, a processor 1001, and a message forwarding program stored on the memory 1005 and executable on the processor 1001, wherein the processor 1001 calls the message forwarding program stored in the memory 1005 and executes the steps of the message forwarding method in each of the following embodiments.

[0046] The present invention also provides a message forwarding method, referring to Figure 2 , Figure 2 The figure is a flow chart of the first embodiment of the message forwarding method of the present invention.

[0047] In this embodiment, the message forwarding method is applied to a first virtualized open flow switch OVS applied to a first virtual machine VM1, and the message forwarding method includes:

[0048] Step S101, based on the first identifier of the virtual extensible local area network VxLAN message to be forwarded and the openflow protocol flow table, performing a message encapsulation operation on the VxLAN message to be forwarded to obtain a target VxLAN message;

[0049] In this embodiment, the first OVS obtains the openflow protocol flow table from the SDN controller. The openflow protocol flow table can be triggered by the first flow packet sent by the first OVS to the SDN controller to be generated and sent to the first OVS. Alternatively, the SDN controller can generate the openflow protocol flow table in advance according to the configuration and send it to the first OVS.

[0050] Among them, the openflow protocol flow table includes the message identifier vni of each VxLAN message and the Vxlan header information and vxlan tunnel information of the Vxlan message, that is, the vni of each VxLAN message and the Vxlan header information (Vxlan tunnel header) and vxlan tunnel information are associated and stored in the openflow protocol flow table, and each vni corresponds to a Vxlan header information and a vxlan tunnel information. Among them, the Vxlan header information includes Outer_Ethernet_header, Outer_IP_header, Outer_UDP_Header and VXLAN_header, and the vxlan tunnel information includes the source MAC address of the Vxlan tunnel, the destination MAC address of the Vxlan tunnel, the source IP address of the Vxlan tunnel, the destination IP address of the Vxlan tunnel, the UDP source port of the Vxlan tunnel, OFPXMT_OFB_VXLAN_VNI (Vxlan's vni), and the vxlan tunnel information can also include the vlan tag of the Vxlan tunnel.

[0051] Specifically, when generating the openflow protocol flow table, the match function of the openflow protocol flow table is extended. The match function includes the matching data structure "uint8_t oxm_fields[0]". "uint8_toxm_fields[0]" represents the matching data structure stored in the OXM TLV structure. The data structure of the OXM TLV includes oxm_class, oxm_field, and oxm_length, where oxm_class has a fixed value of 0x8000; oxm_field represents a specific matching item, and oxm_length is the length of the specific TLV. The content after the OXM TLV header is the specific value. In the match function, a new "uint8_t oxm_fields[0]" matching item OFPXMT_OFB_VXLAN_VNI is set, indicating the OXM TLV type for the VNI field. The vlaue of the OXM TLV is the vni value of the VxLAN message. The OXM TLV is added to the matching data structure of the OFPT_FLOW_MOD message of openflow, so as to add a matching table entry for the vxlan VNI field in the openflow protocol flow table to set the vni value of each VxLAN message in the openflow protocol flow table.

[0052] At the same time, the action function of the openflow protocol flow table is extended, and new POP / PUSH types are added to the action function, including OFPAT_PUSH_VXLAN and OFPAT_POP_VXLAN, that is, VxLAN header information is added to the message. OFPAT_PUSH_VXLAN means adding VxLAN header information to the message, and OFPAT_POP_VXLAN means decapsulating the VxLAN header information of the message.

[0053] In the set-field action of the action function of the openflow protocol flow table, set each field of the VxLAN tunnel header, including OFPXMT_OFB_VXLAN_SRCMAC corresponding to the source MAC address of the Vxlan tunnel, OFPXMT_OFB_VXLAN_DSTMAC corresponding to the destination MAC address of the Vxlan tunnel, OFPXMT_OFB_VXLAN_TAG corresponding to the vlan tag of the Vxlan tunnel, OFPXMT_OFB_VXLAN_SRCNET corresponding to the source IP address of the Vxlan tunnel, OFPXMT_OFB_VXLAN_DSTNET corresponding to the destination IP address of the Vxlan tunnel, and OFPXMT_OFB_VXLAN_SRCPORT corresponding to the UDP source port of the Vxlan tunnel.

[0054] In this embodiment, when the first OVS receives a VxLAN message to be forwarded from the first virtual machine, it obtains a first identifier (VNI) of the VxLAN message to be forwarded, and based on the first identifier and the openflow protocol flow table, performs a message encapsulation operation on the VxLAN message to be forwarded to obtain a target VxLAN message; specifically, the corresponding encapsulation information is queried in the openflow protocol flow table through the first identifier, and a message encapsulation operation is performed on the VxLAN message to be forwarded.

[0055] Furthermore, in one embodiment, step S101 includes:

[0056] Step a, determining a first target message identifier matching the first identifier in the message identifier;

[0057] Step b: Based on the first target message identifier and the openflow protocol flow table, perform message encapsulation operation on the VxLAN message to be forwarded to obtain the target VxLAN message.

[0058] In this embodiment, when the first identifier is obtained, all message identifiers in the openflow protocol flow table are obtained, and the first target message identifier that matches the first identifier is determined among the message identifiers, and based on the first target message identifier and the openflow protocol flow table, a message encapsulation operation is performed on the VxLAN message to be forwarded to obtain the target VxLAN message. Specifically, the encapsulation information corresponding to the first target message identifier is obtained in the openflow protocol flow table, and a message encapsulation operation is performed on the VxLAN message to be forwarded according to the encapsulation information to obtain the target VxLAN message, and then the configuration data of the message encapsulation is obtained through the openflow protocol flow table to realize the encapsulation of the VxLAN message, thereby reducing the configuration complexity of the Vxlan sending end VTEP (edge ​​device of the vxlan network) and improving the encapsulation efficiency of the VxLAN message.

[0059] Furthermore, in another embodiment, step b includes:

[0060] Step c, obtaining first encapsulation information corresponding to the first target message identifier in the openflow protocol flow table;

[0061] Step d: perform message encapsulation operation on the VxLAN message to be forwarded based on the first encapsulation information to obtain the target VxLAN message.

[0062] In this embodiment, the first encapsulation information corresponding to the first target message identifier is first obtained in the openflow protocol flow table. The first encapsulation information includes the VxLAN header information and VxLAN tunnel information of the VxLAN message to be forwarded. The Vxlan header information includes Outer_Ethernet_header, Outer_IP_header, Outer_UDP_Header and VXLAN_header. The Vxlan tunnel information includes the source MAC address of the Vxlan tunnel, the destination MAC address of the Vxlan tunnel, the source IP address of the Vxlan tunnel, the destination IP address of the Vxlan tunnel, the UDP source port of the Vxlan tunnel, and OFPXMT_OFB_VXLAN_VNI (Vxlan's vni). The vxlan tunnel information may also include the vlan tag of the Vxlan tunnel.

[0063] Next, based on the OFPAT_PUSH_VXLAN action function of the openflow protocol flow table, the Vxlan header information is added to the VxLAN message to be forwarded, and then the Vxlan tunnel information is set in the VxLAN message with the Vxlan header information added based on the Vxlan tunnel information to obtain the target VxLAN message, and then the encapsulation of the VxLAN message can be accurately realized, so as to realize the encapsulation of the VxLAN message through the openflow protocol flow table, thereby reducing the configuration complexity of the Vxlan sending end VTEP (edge ​​device of the vxlan network) and improving the encapsulation efficiency of the VxLAN message.

[0064] Reference Figure 3 The data structure of the target VxLAN message shown in the figure, wherein the destination PORT involved in the UDP header is 4789, the SRC Port can be automatically calculated by the first OVS, and the UDP length, checksum, etc. are calculated by the first OVS during the encapsulation process.

[0065] Step S102: Send the target VxLAN message to the second OVS corresponding to the destination virtual machine based on the first Uplink port on the first OVS, wherein the second OVS obtains the openflow protocol flow table from the SDN controller, decapsulates the target VxLAN message based on the openflow protocol flow table, obtains the VxLAN message to be forwarded, and forwards the VxLAN message to be forwarded to the second virtual machine.

[0066] In this embodiment, when the target VxLAN message is obtained, the target VxLAN message is sent to the second OVS corresponding to the destination virtual machine based on the first Uplink port on the first OVS.

[0067] The second OVS obtains the openflow protocol flow table from the SDN controller, decapsulates the target VxLAN message based on the openflow protocol flow table, obtains the VxLAN message to be forwarded, and forwards the VxLAN message to be forwarded to the second virtual machine. Specifically, the second OVS determines a second target message identifier that matches the second identifier in the message identifier, the second OVS obtains all message identifiers in the openflow protocol flow table, and determines a second target message identifier that matches the second identifier in the message identifier; the second OVS obtains second encapsulation information corresponding to the second target message identifier in the openflow protocol flow table, and the second encapsulation information includes the target VxLAN message. The VxLAN header information and VxLAN tunnel information, the Vxlan header information includes Outer_Ethernet_header, Outer_IP_header, Outer_UDP_Header and VXLAN_header, the Vxlan tunnel information includes the source MAC address of the Vxlan tunnel, the destination MAC address of the Vxlan tunnel, the source IP address of the Vxlan tunnel, the destination IP address of the Vxlan tunnel, the UDP source port of the Vxlan tunnel, OFPXMT_OFB_VXLAN_VNI (Vxlan's vni), and the vxlan tunnel information can also include the vlan tag of the Vxlan tunnel.

[0068] Next, based on the Vxlan tunnel information, the Vxlan tunnel information is deleted from the target Vxlan message, and then based on the OFPAT_POP_VXLAN of the action function of the openflow protocol flow table, the Vxlan header information is deleted from the target Vxlan message from which the Vxlan tunnel information is deleted to obtain the VxLAN message to be forwarded, and the VxLAN message to be forwarded is forwarded to the second virtual machine, so that the decapsulation of the VxLAN message can be accurately realized, and the decapsulation of the VxLAN message can be realized through the openflow protocol flow table, thereby reducing the configuration complexity of the Vxlan receiving end VTEP (edge ​​device of the vxlan network) and improving the decapsulation efficiency of the VxLAN message.

[0069] The message forwarding method proposed in this embodiment performs a message encapsulation operation on the VxLAN message to be forwarded based on the first identifier of the virtual extensible local area network VxLAN message to be forwarded and the openflow protocol flow table to obtain the target VxLAN message; then sends the target VxLAN message to the second OVS corresponding to the destination virtual machine based on the first Uplink port on the first OVS, wherein the second OVS obtains the openflow protocol flow table from the SDN controller, decapsulates the target VxLAN message based on the openflow protocol flow table to obtain the VxLAN message to be forwarded, and forwards the VxLAN message to be forwarded to the second virtual machine, which can realize the encapsulation of the VxLAN message to be forwarded and the decapsulation of the encapsulated VxLAN message through the openflow protocol flow table, thereby improving the VxLAN message forwarding efficiency.

[0070] The present invention also provides a message forwarding method, referring to Figure 4 , Figure 4 This is a flow chart of the second embodiment of the message forwarding method of the present invention.

[0071] Step S201, receiving a target VxLAN message through the second Uplink port, wherein the first OVS performs a message encapsulation operation on the VxLAN message to be forwarded based on the first identifier of the VxLAN message to be forwarded and the openflow protocol flow table, obtains the target VxLAN message, and forwards the target VxLAN message through the first Uplink port;

[0072] Step S202: Based on the openflow protocol flow table and the second identifier of the target VxLAN message, decapsulate the target VxLAN message, obtain the VxLAN message to be forwarded, and forward the VxLAN message to be forwarded to the second virtual machine.

[0073] In this embodiment, the second OVS obtains the openflow protocol flow table from the SDN controller. The openflow protocol flow table can be triggered by the first flow packet sent by the first OVS to the SDN controller and sent to the second OVS. Alternatively, the SDN controller can generate the openflow protocol flow table in advance according to the configuration and send it to the second OVS.

[0074] Among them, the openflow protocol flow table includes the message identifier vni of each VxLAN message and the Vxlan header information and vxlan tunnel information of the Vxlan message, that is, the vni of each VxLAN message and the Vxlan header information (Vxlan tunnel header) and vxlan tunnel information are associated and stored in the openflow protocol flow table, and each vni corresponds to a Vxlan header information and a vxlan tunnel information. Among them, the Vxlan header information includes Outer_Ethernet_header, Outer_IP_header, Outer_UDP_Header and VXLAN_header, and the vxlan tunnel information includes the source MAC address of the Vxlan tunnel, the destination MAC address of the Vxlan tunnel, the source IP address of the Vxlan tunnel, the destination IP address of the Vxlan tunnel, the UDP source port of the Vxlan tunnel, OFPXMT_OFB_VXLAN_VNI (Vxlan's vni), and the vxlan tunnel information can also include the vlan tag of the Vxlan tunnel.

[0075] Specifically, when generating the openflow protocol flow table, the match function of the openflow protocol flow table is extended. The match function includes the matching data structure "uint8_t oxm_fields[0]". "uint8_toxm_fields[0]" represents the matching data structure stored in the OXM TLV structure. The data structure of the OXM TLV includes oxm_class, oxm_field, and oxm_length, where oxm_class has a fixed value of 0x8000; oxm_field represents a specific matching item, and oxm_length is the length of the specific TLV. The content after the OXM TLV header is the specific value. In the match function, a new "uint8_t oxm_fields[0]" matching item OFPXMT_OFB_VXLAN_VNI is set, indicating the OXM TLV type for the VNI field. The vlaue of the OXM TLV is the vni value of the VxLAN message. The OXM TLV is added to the matching data structure of the OFPT_FLOW_MOD message of openflow, so as to add a matching table entry for the vxlan VNI field in the openflow protocol flow table to set the vni value of each VxLAN message in the openflow protocol flow table.

[0076] At the same time, the action function of the openflow protocol flow table is extended, and new POP / PUSH types are added to the action function, including OFPAT_PUSH_VXLAN and OFPAT_POP_VXLAN, that is, VxLAN header information is added to the message. OFPAT_PUSH_VXLAN means adding VxLAN header information to the message, and OFPAT_POP_VXLAN means decapsulating the VxLAN header information of the message.

[0077] In the set-field action of the action function of the openflow protocol flow table, set each field of the VxLAN tunnel header, including OFPXMT_OFB_VXLAN_SRCMAC corresponding to the source MAC address of the Vxlan tunnel, OFPXMT_OFB_VXLAN_DSTMAC corresponding to the destination MAC address of the Vxlan tunnel, OFPXMT_OFB_VXLAN_TAG corresponding to the vlan tag of the Vxlan tunnel, OFPXMT_OFB_VXLAN_SRCNET corresponding to the source IP address of the Vxlan tunnel, OFPXMT_OFB_VXLAN_DSTNET corresponding to the destination IP address of the Vxlan tunnel, and OFPXMT_OFB_VXLAN_SRCPORT corresponding to the UDP source port of the Vxlan tunnel.

[0078] In this embodiment, in this embodiment, when the first OVS receives a VxLAN message to be forwarded from the first virtual machine, a first identifier (VNI) of the VxLAN message to be forwarded is obtained, and a first target message identifier matching the first identifier is determined in the message identifier; when the first identifier is obtained, all message identifiers in the openflow protocol flow table are obtained, and a first target message identifier matching the first identifier is determined in the message identifier, and first encapsulation information corresponding to the first target message identifier is obtained in the openflow protocol flow table, and a message encapsulation operation is performed on the VxLAN message to be forwarded based on the first encapsulation information to obtain a target VxLAN message, and a first encapsulation information corresponding to the first target message identifier is obtained in the openflow protocol flow table. The first encapsulation information includes the VxLAN header information and VxLAN tunnel information of the VxLAN message to be forwarded, the Vxlan header information includes Outer_Ethernet_header, Outer_IP_header, Outer_UDP_Header and VXLAN_header, the Vxlan tunnel information includes the source MAC address of the Vxlan tunnel, the destination MAC address of the Vxlan tunnel, the source IP address of the Vxlan tunnel, the destination IP address of the Vxlan tunnel, the UDP source port of the Vxlan tunnel, OFPXMT_OFB_VXLAN_VNI (Vxlan's vni), and the vxlan tunnel information may also include the vlan tag of the Vxlan tunnel. Next, based on the OFPAT_PUSH_VXLAN action function of the openflow protocol flow table, the Vxlan header information is added to the VxLAN message to be forwarded, and then the Vxlan tunnel information is set in the VxLAN message with the Vxlan header information added based on the Vxlan tunnel information to obtain the target VxLAN message, and then the encapsulation of the VxLAN message can be accurately realized, so as to realize the encapsulation of the VxLAN message through the openflow protocol flow table, thereby reducing the configuration complexity of the Vxlan sending end VTEP (edge ​​device of the vxlan network) and improving the encapsulation efficiency of the VxLAN message.

[0079] In this embodiment, when the target VxLAN message is obtained, the target VxLAN message is sent to the second OVS corresponding to the destination virtual machine based on the first Uplink port on the first OVS, and the second OVS receives the target VxLAN message through the second Uplink port.

[0080] Then, the second OVS decapsulates the target VxLAN message based on the openflow protocol flow table and the second identifier of the target VxLAN message, obtains the VxLAN message to be forwarded, and forwards the VxLAN message to be forwarded to the second virtual machine.

[0081] The openflow protocol flow table includes the message identifier of the VxLAN message.

[0082] Furthermore, in one embodiment, step S202 includes:

[0083] Step e, determining a second target message identifier matching the second identifier in the message identifier;

[0084] Step f, based on the second target message identifier and the openflow protocol flow table, decapsulate the target VxLAN message to obtain the VxLAN message to be forwarded.

[0085] Specifically, the second OVS determines a second target message identifier that matches the second identifier in the message identifier, the second OVS obtains all message identifiers in the openflow protocol flow table, determines a second target message identifier that matches the second identifier in the message identifier, and then based on the second target message identifier and the openflow protocol flow table, performs a decapsulation operation on the target VxLAN message to obtain the VxLAN message to be forwarded, so as to realize the decapsulation of the VxLAN message through the openflow protocol flow table, thereby reducing the configuration complexity of the Vxlan receiving end VTEP (edge ​​device of the vxlan network) and improving the decapsulation efficiency of the VxLAN message.

[0086] Furthermore, in another embodiment, step f comprises:

[0087] Step g, obtaining the second encapsulation information corresponding to the second target message identifier in the openflow protocol flow table;

[0088] Step h: perform message decapsulation operation on the target VxLAN message based on the second encapsulation information to obtain the VxLAN message to be forwarded.

[0089] In this embodiment, when the second target message identifier matching the second identifier is obtained, the second OVS obtains the second encapsulation information corresponding to the second target message identifier in the openflow protocol flow table.

[0090] The second encapsulation information includes the VxLAN header information and VxLAN tunnel information of the target VxLAN message. The Vxlan header information includes Outer_Ethernet_header, Outer_IP_header, Outer_UDP_Header and VXLAN_header. The Vxlan tunnel information includes the source MAC address of the Vxlan tunnel, the destination MAC address of the Vxlan tunnel, the source IP address of the Vxlan tunnel, the destination IP address of the Vxlan tunnel, the UDP source port of the Vxlan tunnel, OFPXMT_OFB_VXLAN_VNI (Vxlan's vni). The vxlan tunnel information may also include the vlan tag of the Vxlan tunnel.

[0091] Next, based on the Vxlan tunnel information, the Vxlan tunnel information is deleted from the target Vxlan message, and then based on the OFPAT_POP_VXLAN of the action function of the openflow protocol flow table, the Vxlan header information is deleted from the target Vxlan message from which the Vxlan tunnel information is deleted to obtain the VxLAN message to be forwarded, and the VxLAN message to be forwarded is forwarded to the second virtual machine, so that the decapsulation of the VxLAN message can be accurately realized, and the decapsulation of the VxLAN message can be realized through the openflow protocol flow table, thereby reducing the configuration complexity of the Vxlan receiving end VTEP (edge ​​device of the vxlan network) and improving the decapsulation efficiency of the VxLAN message.

[0092] The message forwarding method proposed in this embodiment receives the target VxLAN message through the second Uplink port, wherein the first OVS performs a message encapsulation operation on the VxLAN message to be forwarded based on the first identifier of the VxLAN message to be forwarded and the openflow protocol flow table, obtains the target VxLAN message, and forwards the target VxLAN message through the first Uplink port; then, based on the openflow protocol flow table and the second identifier of the target VxLAN message, decapsulates the target VxLAN message to obtain the VxLAN message to be forwarded, and forwards the VxLAN message to be forwarded to the second virtual machine, which can realize the encapsulation of the VxLAN message to be forwarded and the decapsulation of the encapsulated VxLAN message through the openflow protocol flow table, thereby improving the VxLAN message forwarding efficiency.

[0093] The present invention also provides a message forwarding device, referring to Figure 5 , the message forwarding device comprises:

[0094] The encapsulation module 10 is used to perform a message encapsulation operation on the VxLAN message to be forwarded based on the first identifier of the virtual extensible local area network VxLAN message to be forwarded and the openflow protocol flow table to obtain a target VxLAN message;

[0095] The sending module 20 is used to send the target VxLAN message to the second OVS corresponding to the destination virtual machine based on the first Uplink port on the first OVS, wherein the second OVS obtains the openflow protocol flow table from the SDN controller, decapsulates the target VxLAN message based on the openflow protocol flow table, obtains the VxLAN message to be forwarded, and forwards the VxLAN message to be forwarded to the second virtual machine.

[0096] Furthermore, the encapsulation module 10 is also used for:

[0097] Determining a first target message identifier that matches the first identifier in the message identifier;

[0098] Based on the first target message identifier and the openflow protocol flow table, a message encapsulation operation is performed on the VxLAN message to be forwarded to obtain a target VxLAN message.

[0099] Furthermore, the encapsulation module 10 is also used for:

[0100] Acquire the first encapsulation information corresponding to the first target message identifier in the openflow protocol flow table;

[0101] Based on the first encapsulation information, a message encapsulation operation is performed on the VxLAN message to be forwarded to obtain a target VxLAN message.

[0102] The present invention also provides a message forwarding device, the message forwarding device comprising:

[0103] A receiving module, configured to receive a target VxLAN message through a second Uplink port, wherein the first OVS performs a message encapsulation operation on the VxLAN message to be forwarded based on a first identifier of the VxLAN message to be forwarded and an openflow protocol flow table, obtains a target VxLAN message, and forwards the target VxLAN message through the first Uplink port;

[0104] A decapsulation module is used to decapsulate the target VxLAN message based on the openflow protocol flow table and the second identifier of the target VxLAN message, obtain the VxLAN message to be forwarded, and forward the VxLAN message to be forwarded to the second virtual machine.

[0105] Furthermore, the decapsulation module is also used to:

[0106] Determining a second target message identifier that matches the second identifier in the message identifier;

[0107] Based on the second target message identifier and the openflow protocol flow table, the target VxLAN message is decapsulated to obtain the VxLAN message to be forwarded.

[0108] Furthermore, the decapsulation module is also used to:

[0109] Acquire the second encapsulation information corresponding to the second target message identifier in the openflow protocol flow table;

[0110] Based on the second encapsulation information, the target VxLAN message is decapsulated to obtain the VxLAN message to be forwarded.

[0111] The methods executed by the above-mentioned program units can refer to the various embodiments of the message forwarding method of the present invention, which will not be repeated here.

[0112] The present invention also provides a computer-readable storage medium.

[0113] The computer-readable storage medium of the present invention stores a message forwarding program, and when the message forwarding program is executed by a processor, the steps of the message forwarding method described above are implemented.

[0114] Among them, the method implemented when the message forwarding program running on the processor is executed can refer to the various embodiments of the message forwarding method of the present invention, and will not be repeated here.

[0115] In addition, an embodiment of the present invention further provides a computer program product, which includes a message forwarding program. When the message forwarding program is executed by a processor, the steps of the message forwarding method described above are implemented.

[0116] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0117] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0118] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0119] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A message forwarding method, It is characterized in that A first virtualized open flow switch OVS applied to a first virtual machine, the message forwarding method comprises the following steps: Based on the first identifier of the virtual extensible local area network VxLAN message to be forwarded and the openflow protocol flow table, the message encapsulation operation is performed on the VxLAN message to be forwarded to obtain the target VxLAN message, wherein the openflow protocol flow table is used to add Vxlan header information to the VxLAN message to be forwarded, and based on the Vxlan tunnel information in the openflow protocol flow table, the Vxlan tunnel information is set in the Vxlan message to which the Vxlan header information is added to obtain the target VxLAN message, and the action function of the openflow protocol flow table The number includes OFPAT_PUSH_VXLAN and OFPAT_POP_VXLAN, the OFPAT_PUSH_VXLAN indicates adding the VxLAN header information to the message, the OFPAT_POP_VXLAN indicates decapsulating the VxLAN header information of the message, the openflow protocol flow table includes the message identifier of the VxLAN message, the step of performing a message encapsulation operation on the VxLAN message to be forwarded based on the first identifier of the VxLAN message to be forwarded and the openflow protocol flow table, and obtaining the target VxLAN message includes: determining a first target message identifier matching the first identifier in the message identifier; performing a message encapsulation operation on the VxLAN message to be forwarded based on the first target message identifier and the openflow protocol flow table, and obtaining the target VxLAN message, wherein the step of performing a message encapsulation operation on the VxLAN message to be forwarded based on the first target message identifier and the openflow protocol flow table, and obtaining the target VxLAN message includes: Obtaining first encapsulation information corresponding to the first target message identifier in the openflow protocol flow table; performing a message encapsulation operation on the VxLAN message to be forwarded based on the first encapsulation information to obtain a target VxLAN message; Based on the first Uplink port on the first OVS, the target VxLAN message is sent to the second OVS corresponding to the destination virtual machine, wherein the second OVS obtains an openflow protocol flow table from the SDN controller, decapsulates the target VxLAN message based on the openflow protocol flow table, obtains the VxLAN message to be forwarded, and forwards the VxLAN message to be forwarded to the destination virtual machine.

2. The message forwarding method according to claim 1, It is characterized in that The first encapsulation information includes: VxLAN header information and VxLAN tunnel information of the VxLAN message to be forwarded.

3. A message forwarding method, It is characterized in that A second virtualized open flow switch OVS applied to a second virtual machine, the message forwarding method comprising: The target VxLAN message is received through the second Uplink port, wherein the first OVS performs a message encapsulation operation on the VxLAN message to be forwarded based on the first identifier of the VxLAN message to be forwarded and the openflow protocol flow table, obtains the target VxLAN message, and forwards the target VxLAN message to the second Uplink port through the first Uplink port, wherein the openflow protocol flow table is used to add Vxlan header information to the VxLAN message to be forwarded, and set Vxlan tunnel information in the VxLAN message to which the Vxlan header information is added based on the Vxlan tunnel information in the openflow protocol flow table, and obtains The target VxLAN message, the action function of the openflow protocol flow table includes OFPAT_PUSH_VXLAN and OFPAT_POP_VXLAN, the OFPAT_PUSH_VXLAN indicates adding the VxLAN header information to the message, the OFPAT_POP_VXLAN indicates decapsulating the VxLAN header information of the message, the openflow protocol flow table includes the message identifier of the VxLAN message, the first identifier of the VxLAN message to be forwarded and the openflow protocol flow table are used to perform a message encapsulation operation on the VxLAN message to be forwarded, and the step of obtaining the target VxLAN message includes: Determine a first target message identifier that matches the first identifier in the message identifier; based on the first target message identifier and the openflow protocol flow table, perform a message encapsulation operation on the VxLAN message to be forwarded to obtain a target VxLAN message, wherein the step of performing a message encapsulation operation on the VxLAN message to be forwarded based on the first target message identifier and the openflow protocol flow table to obtain a target VxLAN message includes: Obtaining first encapsulation information corresponding to the first target message identifier in the openflow protocol flow table; performing a message encapsulation operation on the VxLAN message to be forwarded based on the first encapsulation information to obtain a target VxLAN message; Based on the openflow protocol flow table and the second identifier of the target VxLAN message, the target VxLAN message is decapsulated to obtain the VxLAN message to be forwarded, and the VxLAN message to be forwarded is forwarded to the target virtual machine.

4. The message forwarding method according to claim 3, It is characterized in that The openflow protocol flow table includes a message identifier of the VxLAN message, and the step of performing a decapsulation operation on the target VxLAN message based on the openflow protocol flow table and the second identifier of the target VxLAN message to obtain the VxLAN message to be forwarded includes: Determining a second target message identifier that matches the second identifier in the message identifier; Based on the second target message identifier and the openflow protocol flow table, the target VxLAN message is decapsulated to obtain the VxLAN message to be forwarded.

5. The message forwarding method according to claim 4, It is characterized in that The step of performing a decapsulation operation on the target VxLAN message based on the second target message identifier and the openflow protocol flow table to obtain the VxLAN message to be forwarded includes: Acquire the second encapsulation information corresponding to the second target message identifier in the openflow protocol flow table; Based on the second encapsulation information, the target VxLAN message is decapsulated to obtain the VxLAN message to be forwarded.

6. A message forwarding device, It is characterized in that The message forwarding device is applied to a first virtualized open flow switch OVS of a first virtual machine, and the message forwarding device includes: The encapsulation module is used to perform a message encapsulation operation on the VxLAN message to be forwarded based on the first identifier of the virtual extensible local area network VxLAN message to be forwarded and the openflow protocol flow table to obtain a target VxLAN message, wherein the openflow protocol flow table is used to add Vxlan header information to the VxLAN message to be forwarded, and to set Vxlan tunnel information in the Vxlan message to which the Vxlan header information is added based on the Vxlan tunnel information in the openflow protocol flow table to obtain the target VxLAN message, and the act of the openflow protocol flow table ion functions include OFPAT_PUSH_VXLAN and OFPAT_POP_VXLAN, wherein OFPAT_PUSH_VXLAN represents adding the VxLAN header information to the message, and OFPAT_POP_VXLAN represents decapsulating the VxLAN header information of the message, and the openflow protocol flow table includes the message identifier of the VxLAN message, and the step of performing a message encapsulation operation on the VxLAN message to be forwarded based on the first identifier of the VxLAN message to be forwarded and the openflow protocol flow table, and obtaining the target VxLAN message includes: determining a first target message identifier matching the first identifier in the message identifier; performing a message encapsulation operation on the VxLAN message to be forwarded based on the first target message identifier and the openflow protocol flow table, and obtaining the target VxLAN message, wherein the step of performing a message encapsulation operation on the VxLAN message to be forwarded based on the first target message identifier and the openflow protocol flow table, and obtaining the target VxLAN message includes: Obtaining first encapsulation information corresponding to the first target message identifier in the openflow protocol flow table; performing a message encapsulation operation on the VxLAN message to be forwarded based on the first encapsulation information to obtain a target VxLAN message; A sending module is used to send the target VxLAN message to the second OVS corresponding to the destination virtual machine based on the first Uplink port on the first OVS, wherein the second OVS obtains an openflow protocol flow table from the SDN controller, decapsulates the target VxLAN message based on the openflow protocol flow table, obtains the VxLAN message to be forwarded, and forwards the VxLAN message to be forwarded to the destination virtual machine.

7. A message forwarding device, It is characterized in that The message forwarding device includes: a memory, a processor, and a message forwarding program stored in the memory and executable on the processor. When the message forwarding program is executed by the processor, the steps of the message forwarding method as described in any one of claims 1 to 2 or 3-5 are implemented.

8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a message forwarding program, and when the message forwarding program is executed by the processor, the steps of the message forwarding method according to any one of claims 1 to 2 or 3 to 5 are implemented.