Packet injection method based on Open vSwitch forwarding plane

By creating dedicated packet-blocking ports and flow table rules in the Open vSwitch bridge, combining custom packet construction and efficient forwarding technology, the existing packet-blocking methods have solved the problem of low performance in high-frequency packet-blocking scenarios, and high-performance, reliability and flexibility packet-blocking operations are achieved.

CN119966922APending Publication Date: 2025-05-09UNICLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510102428.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-22
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

The existing Open vSwitch packet call method will occupy the control channel of the bridge in high-frequency packet call scenarios, affecting normal controller communication, and the process of analyzing OpenFlow messages and generating packet call packets is complicated, with low performance, and cannot meet the high-performance and high-reliability network monitoring needs.

Method used

Using a packet call method based on the Open vSwitch forwarding plane, the performance, reliability and flexibility of packet call are improved by creating dedicated packet call ports and flow table rules in the Open vSwitch bridge, combining custom packet construction and efficient forwarding technology.

Benefits of technology

It realizes feature-rich message injection operations, supports any type of message customization, and relies on Open vSwitch's efficient forwarding plane to improve packet injection performance, and avoids the use of OpenFlow protocol parsing to ensure the stability of the control channel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119966922A_ABST
    Figure CN119966922A_ABST
Patent Text Reader

Abstract

The invention provides a packet injection method based on an OpenvSwitch forwarding plane, and the method comprises the steps: creating a special packet injection port in an OpenvSwitch network bridge, and the type of the packet injection port is an internal interface; configuring a packet injection application program, wherein the packet injection application program receives message information input by a user and a target packet injection port name; the packet injection application program generates a target network message according to the input message information and a preset logic; after a target network message is processed through a protocol stack of an operating system, the target network message is sent to the OpenvSwitch network bridge from the packet injection port; and in the OpenvSwitch network bridge, forwarding the injected message according to a default flow table rule or a predefined flow table rule. The packet injection method based on the OpenvSwitch forwarding plane has the beneficial effects that the packet injection operation with rich functions is realized through the special packet injection port and the user-defined flow table.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of computer networks, and in particular relates to a packet injection method based on an Open vSwitch forwarding plane. Background Art

[0002] Open vSwitch is an open source virtual switch that is widely used in large-scale virtualized network environments to provide efficient network traffic forwarding and monitoring functions. In actual applications, the packet injection function of Open vSwitch is mainly used for network monitoring and testing. For example, when it is necessary to test whether the communication between two cloud hosts is normal, communication verification can be achieved by injecting specific network packets (such as Ping packets) into the Open vSwitch at the source end. In addition, in some cases, the service provider may not be able to directly log in to the user's cloud host for operation. At this time, remote testing and monitoring can be achieved through the packet injection function of Open vSwitch.

[0003] The traditional way to inject packets in Open vSwitch is to use the command line tool ovs-ofctl packet-out, which communicates with the Open vSwitch bridge through the control channel and issues injection commands using the OpenFlow protocol. However, this method has the following defects: In high-frequency packet injection scenarios, the control channel of the Open vSwitch bridge will be occupied, affecting normal controller communication; Open vSwitch needs to parse OpenFlow messages and generate injection packets, which is a complex process with low performance.

[0004] Therefore, the existing packet injection methods cannot well meet the needs of high-performance and high-reliability network monitoring. Summary of the invention

[0005] In view of this, the present invention aims to propose a packet injection method based on the Open vSwitch forwarding plane, which adopts a new packet injection mechanism, improves the performance, reliability and flexibility of packet injection through dedicated packet injection ports and flow table rules, combined with custom message construction and efficient forwarding technology.

[0006] To achieve the above object, the technical solution of the present invention is achieved as follows: A packet injection method based on an Open vSwitch forwarding plane, comprising: ● Creating a dedicated packet injection port in the Open vSwitch bridge, where the type of the packet injection port is an internal interface; ● Configure the packet injection application, which accepts the message information and target packet injection port name input by the user; ● The packet injection application generates target network messages according to preset logic based on the input message information; ● After the target network message is processed by the protocol stack of the operating system, it is sent from the packet injection port to the OpenvSwitch bridge; ● In the Open vSwitch bridge, the injected packets are forwarded according to the default flow table rules or predefined flow table rules.

[0007] Furthermore, the network messages include but are not limited to Address Resolution Protocol messages, Internet Control Message Protocol messages, and other user-defined network messages.

[0008] Furthermore, the packet injection application completes message sending by directly calling the underlying communication interface of the system, and the message enters the dedicated packet injection port after being processed by the protocol stack, thereby reducing dependence on the network control plane.

[0009] Furthermore, the configuration of the injection port includes the following steps: Allocate a dedicated port for the Open vSwitch bridge and set the port type to internal interface; Establish a logical binding between the packet injection port and the target virtual machine, network node or other network entity to support the directional transmission of the message flow.

[0010] Furthermore, the configuration of the flow table rule includes the following logic: Determine whether the port for injecting the message is a dedicated packet injection port; According to the type and target path of the message, match the existing flow table rules; If there is no matching rule, the target transmission path is defined for the specific message by dynamically issuing flow table rules; Ensure that all messages are efficiently forwarded to the target network node according to the preset path or default path.

[0011] Furthermore, the multi-task concurrent packet injection processing includes the following steps: Run multiple instances of the injection packet application at the same time, each instance independently generates and sends a specific type of message; Allocate sufficient forwarding resources in the Open vSwitch bridge to support high-concurrency packet injection operations.

[0012] Further, in the Open vSwitch bridge, the injected message is forwarded according to the default flow table rule or the predefined flow table rule, including: When the default path is used for forwarding, the injected message is processed and forwarded according to the default flow table rules of the bridge; When the forwarding path needs to be customized, the target path forwarding of the message is achieved by configuring the flow table rules in the bridge.

[0013] Furthermore, the present solution discloses an electronic device, comprising a processor and a memory connected to the processor for storing instructions executable by the processor, wherein the processor is used to execute a packet injection method based on an Open vSwitch forwarding plane.

[0014] Furthermore, the present solution discloses a server, comprising at least one processor and a memory communicatively connected to the processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor so that the at least one processor executes a packet injection method based on an Open vSwitch forwarding plane.

[0015] Furthermore, the present solution discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, a packet injection method based on an Open vSwitch forwarding plane is implemented.

[0016] Compared with the prior art, the packet injection method based on the Open vSwitch forwarding plane described in the present invention has the following beneficial effects: (1) The packet injection method based on the Open vSwitch forwarding plane described in the present invention realizes a feature-rich message injection operation through a dedicated packet injection port and a custom flow table; (2) The packet injection method based on the Open vSwitch forwarding plane described in the present invention has flexible message construction and supports customization of any type of messages; (3) The packet injection method based on the Open vSwitch forwarding plane described in the present invention relies on the efficient forwarding plane of Open vSwitch to improve the packet injection performance; (4) The packet injection method based on the Open vSwitch forwarding plane described in the present invention avoids the use of OpenFlow protocol parsing and ensures the stability of the control channel. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings: Figure 1 A schematic diagram of a packet injection method based on an Open vSwitch forwarding plane according to an embodiment of the present invention. DETAILED DESCRIPTION

[0018] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0019] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0020] This solution discloses a packet injection method based on the Open vSwitch forwarding plane, including: ● Creating a dedicated packet injection port in the Open vSwitch bridge, where the type of the packet injection port is an internal interface; ● Configure the packet injection application, which accepts the message information and target packet injection port name input by the user; ● The packet injection application generates target network messages according to preset logic based on the input message information; ● After the target network message is processed by the protocol stack of the operating system, it is sent from the packet injection port to the OpenvSwitch bridge; ● In the Open vSwitch bridge, the injected packets are forwarded according to the default flow table rules or predefined flow table rules.

[0021] Furthermore, the network messages include but are not limited to Address Resolution Protocol messages, Internet Control Message Protocol messages, and other user-defined network messages.

[0022] Furthermore, the packet injection application completes message sending by directly calling the underlying communication interface of the system, and the message enters the dedicated packet injection port after being processed by the protocol stack, thereby reducing dependence on the network control plane.

[0023] Furthermore, the configuration of the injection port includes the following steps: Allocate a dedicated port for the Open vSwitch bridge and set the port type to internal interface; Establish a logical binding between the packet injection port and the target virtual machine, network node or other network entity to support the directional transmission of the message flow.

[0024] Furthermore, the configuration of the flow table rule includes the following logic: Determine whether the port for injecting the message is a dedicated packet injection port; According to the type and target path of the message, match the existing flow table rules; If there is no matching rule, the target transmission path is defined for the specific message by dynamically issuing flow table rules; Ensure that all messages are efficiently forwarded to the target network node according to the preset path or default path.

[0025] Furthermore, the multi-task concurrent packet injection processing includes the following steps: Run multiple instances of the injection packet application at the same time, each instance independently generates and sends a specific type of message; Allocate sufficient forwarding resources in the Open vSwitch bridge to support high-concurrency packet injection operations.

[0026] Further, in the Open vSwitch bridge, the injected message is forwarded according to the default flow table rule or the predefined flow table rule, including: When the default path is used for forwarding, the injected message is processed and forwarded according to the default flow table rules of the bridge; When the forwarding path needs to be customized, the target path forwarding of the message is achieved by configuring the flow table rules in the bridge.

[0027] In the specific implementation process, the business configuration is described as follows: 1. Create a new packet injection port (internal type) on the Open vSwitch bridge. 2. Install the injection package application 3. Run the package injection application, enter the message information and the package injection port name, and the package injection application will construct the required message based on the input message information. 4. The packet injection application sends the message to the protocol stack through the raw socket, and finally enters the OpenvSwitch bridge through the packet injection port. If the injection packet needs to be forwarded according to the default forwarding path, there is no need to send the flow table. If you need to send the packet directly to the specified path, you need to add and send the OpenFlow flow table. Take sending the ARP packet directly to the virtual machine vm1 as an example: ovs-ofctl add-flow business “cookie=0, table=0, in_port=inject_port,arp action=output:vm1” If multiple messages need to be injected concurrently, open multiple instances of the application at the same time to send packets. 5. The message is successfully injected into the Open vSwitch bridge, completing the network detection and monitoring functions.

[0028] This solution has the following advantages: 1. Functionality: This solution can fully implement the current ovs-ofctl packet-out packet sending function, such as specifying the outbound interface after injecting the packet. 2. Flexibility: In this solution, the packet-sending application can be customized and flexibly construct any type of message information, no longer restricted by the construction conditions currently provided by Open vSwitch. 3. High performance: After the message is injected into Open vSwitch, the high-performance forwarding plane of Open vSwitch is used to forward the message. There is no need to use the OpenFlow protocol to parse control information and other operations, thus achieving high-performance processing of injected messages. 4. High reliability: This solution supports high-concurrency Open vSwitch packet injection, does not occupy the OpenFlow control channel of Open vSwitch, and does not affect the connection stability between the controller and Open vSwitch.

[0029] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0030] In the several embodiments provided in the present application, it should be understood that the disclosed methods and systems can be implemented in other ways. For example, the division of the units described above is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The above-mentioned units may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.

[0031] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.

[0032] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A packet injection method based on Open vSwitch forwarding plane, characterized in that: include: ● creating a dedicated packet injection port in the Open vSwitch bridge, where the type of the packet injection port is an internal interface; ●Configure the packet injection application, which accepts the message information and target packet injection port name input by the user; ●The packet injection application generates the target network message according to the preset logic based on the input message information; ● After the target network message is processed by the protocol stack of the operating system, it is sent from the packet injection port to the OpenvSwitch bridge; ●In the Open vSwitch bridge, the injected packets are forwarded according to the default flow table rules or predefined flow table rules.

2. According to claim 1, a packet injection method based on the Open vSwitch forwarding plane is characterized in that: The network messages include but are not limited to Address Resolution Protocol messages, Internet Control Message Protocol messages, and other user-defined network messages.

3. The packet injection method based on the Open vSwitch forwarding plane according to claim 1, characterized in that: The packet injection application completes message sending by directly calling the system bottom layer communication interface. The message enters the dedicated packet injection port after being processed by the protocol stack, thereby reducing dependence on the network control plane.

4. The packet injection method based on the Open vSwitch forwarding plane according to claim 1, characterized in that: The configuration of the injection port includes the following steps: Allocate a dedicated port for the Open vSwitch bridge and set the port type to internal interface; Establish a logical binding between the packet injection port and the target virtual machine, network node or other network entity to support the directional transmission of the message flow.

5. A packet injection method based on Open vSwitch forwarding plane according to claim 1, characterized in that: The configuration of the flow table rules includes the following logic: Determine whether the port for injecting the message is a dedicated packet injection port; According to the type and target path of the message, match the existing flow table rules; If there is no matching rule, the target transmission path is defined for the specific message by dynamically issuing flow table rules; Ensure that all messages are efficiently forwarded to the target network node according to the preset path or default path.

6. The packet injection method based on the Open vSwitch forwarding plane according to claim 1, characterized in that: The multi-task concurrent packet injection processing comprises the following steps: Run multiple instances of the injection packet application at the same time, each instance independently generates and sends a specific type of message; Allocate sufficient forwarding resources in the Open vSwitch bridge to support high-concurrency packet injection operations.

7. A packet injection method based on Open vSwitch forwarding plane according to claim 1, characterized in that: In the Open vSwitch bridge, forwarding the injected message according to the default flow table rule or the predefined flow table rule includes: When the default path is used for forwarding, the injected message is processed and forwarded according to the default flow table rules of the bridge; When the forwarding path needs to be customized, the target path forwarding of the message is achieved by configuring the flow table rules in the bridge.

8. An electronic device, comprising a processor and a memory connected to the processor for storing instructions executable by the processor, characterized in that: The processor is used to execute a packet injection method based on an Open vSwitch forwarding plane as described in any one of claims 1 to 7.

9. A server, characterized in that: The device comprises at least one processor and a memory in communication with the processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor so that the at least one processor executes a packet injection method based on an Open vSwitch forwarding plane as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the packet injection method based on the Open vSwitch forwarding plane according to any one of claims 1 to 7 is implemented.