Message processing method and device and storage medium
By introducing inbound and outbound statistics tables into virtual switches for traffic statistics, the problem of flow table matching in the DPU hardware acceleration engine being difficult to meet the needs of telecom cloud networks is solved, and highly accurate and timely traffic analysis and fault recovery are achieved. , improving the reliability and operation and maintenance capabilities of the network.
Patent Information
- Application Number
- CN202311779714.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-22
- Publication Date
- 2024-10-18
AI Technical Summary
In the existing technology, the flow table matching and packet forwarding implemented by the virtual switch (vSwitch) in the DPU hardware acceleration engine are difficult to meet the traffic classification statistics and analysis requirements of the telecom cloud network, resulting in insufficient network fault monitoring and operation and maintenance capabilities.
In the packet processing equipment, inbound and outbound statistics tables are introduced, and through flow table matching and statistical operations, classification statistics and analysis of inbound and outbound traffic of data packets are realized, and statistical information is provided to support network fault monitoring and rapid recover.
It improves the reliability and operation and maintenance capabilities of the network, ensures rapid fault recovery and delimitation of operation and maintenance responsibilities, and meets carrier-level reliability and operation and maintenance requirements.
Smart Images

Figure CN118802807A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of cloud computing virtualization, and in particular to a message processing method, device and storage medium. Background Art
[0002] To solve the problem of virtual switches (vSwitch) occupying too many CPU resources, the industry usually offloads some or all of the vSwitch components to the data processor (DPU), and uses the dedicated hardware acceleration engine in the DPU to implement flow table matching and packet forwarding. These hardware acceleration engines are usually field programmable gate arrays (FPGA), network processors (NP) or application-specific integrated circuits (ASIC) architectures, which are good at data parallel processing and can greatly improve network forwarding performance. At the same time, they can release valuable CPU resources for upper-layer business use, reduce platform overhead, and improve computing resource utilization.
[0003] Since the vSwitch forwarding plane is offloaded to the hardware acceleration engine, the data packet transmission path will be implemented by hardware, that is, after matching the flow table in the hardware acceleration engine, it will be directly sent to the cloud host through direct memory access (DMA), which has a stronger performance advantage than using software processing in the CPU. In the DPU hardware acceleration engine, the industry usually uses a hardware-based match-action mechanism to implement the pipeline of flow table matching and packet forwarding. Compared with the traditional software-implemented vSwitch, it has the following problems in terms of reliability and maintainability:
[0004] 1) In telecom cloud networks, traffic classification, statistics, and analysis are usually required. The DPU hardware acceleration engine cannot meet this requirement well based on the single flow table matching statistics method. The statistical accuracy and timeliness are low, which easily leads to untimely network fault monitoring and prediction, reducing network reliability.
[0005] 2) In the DPU offload acceleration scenario, the data forwarding plane and control plane in the vSwitch are usually jointly developed and implemented by two manufacturers. When a network failure occurs, specific data flow statistics and analysis methods are required to achieve rapid recovery from the failure and define operation and maintenance responsibilities. The current DPU hardware acceleration engine is only responsible for matching flow tables and forwarding messages. It is difficult to determine whether the DPU actually receives and sends correct data messages. The maintainability in this mode is low, which reduces the operation and maintenance capabilities of the existing network.
[0006] In summary, the current vSwitch offload acceleration technology based on DPU is weak in reliability and maintainability, and it is difficult to meet the carrier-level reliability of network element services. Summary of the invention
[0007] At least one embodiment of the present application provides a message processing method, device and storage medium for solving the problem that the virtual switch in the prior art is weak in reliability and maintainability and is difficult to meet the telecommunications-level reliability of network element services.
[0008] In order to solve the above technical problems, this application is implemented as follows:
[0009] In a first aspect, an embodiment of the present application provides a message processing method, which is applied to a message processing device, the method comprising: receiving a data message, and performing flow table matching and forwarding processing on the data message using a forwarding table; the method further comprises:
[0010] The data message is subjected to a first process and / or a second process, wherein:
[0011] The first processing includes: before using the forwarding table to perform flow table matching and forwarding processing on the data message, using the first statistical table to perform flow table matching and statistical operations on the data message for incoming messages;
[0012] The second processing includes: after performing flow table matching and forwarding processing on the data message by using the forwarding table, performing flow table matching and statistical operations of outgoing messages on the data message by using the second statistical table.
[0013] Optionally, the statistical operation includes at least one of the following: counting the number of hits of a preset flow table, performing coloring processing on data packets, and performing mirroring processing on data packets.
[0014] Optionally, the first statistical table is used to perform flow table matching and statistical operations on the data packet as an incoming message, including: matching the data packet with the flow table in the first statistical table, and performing corresponding statistical operations based on the successfully matched flow table; after completing the matching of the first statistical table, executing the step of performing flow table matching and forwarding processing on the data packet using the forwarding table.
[0015] The second statistical table is used to perform flow table matching and statistical operations on the data message as an outgoing message, including: matching the data message with the flow table in the second statistical table, and performing corresponding statistical operations according to the flow table that successfully matches; after completing the matching of the second statistical table, sending the data message out through the destination port, and the destination port is the outgoing port determined when the forwarding table is used to perform flow table matching and forwarding processing on the data message.
[0016] Optionally, the first statistical table includes at least one first flow table group, each of which includes at least one flow table; matching the data packet with the flow table in the first statistical table and performing corresponding statistical operations according to the successfully matched flow table specifically includes: matching the data packet with the flow tables in each first flow table group in sequence, and in the case of successful matching, performing corresponding statistical operations according to the currently successfully matched flow table, and continuing to match the flow table in the next first flow table group;
[0017] The second statistical table includes at least one second flow table group, and each second flow table group includes at least one flow table; matching the data packet with the flow tables in the second statistical table and performing corresponding statistical operations according to the successfully matched flow tables specifically includes: matching the data packet with the flow tables in each second flow table group in turn, and in the case of successful matching, performing corresponding statistical operations according to the current successfully matched flow table, and continuing to match the flow table in the next second flow table group.
[0018] Optionally, the using a forwarding table to perform flow table matching and forwarding processing on the data message includes:
[0019] Matching the data message with the forwarding table, and after the matching process is completed, forwarding the data message through the target port, or performing a step of performing a second process on the data message;
[0020] The matching process specifically includes:
[0021] Matching the data message with the flow tables in the forwarding table in sequence, and forwarding the data message according to the first successfully matched flow table, wherein the forwarding process includes determining the destination port of the data message;
[0022] In the case that the data message fails to match all flow tables in the forwarding table, the data message is sent to a preset destination address, a new flow table matching the data message is received and saved in the forwarding table, and the data message is forwarded according to the new flow table.
[0023] In a second aspect, an embodiment of the present application provides a message processing device, including:
[0024] A receiving module, used for receiving data messages;
[0025] A forwarding table matching module, used for performing flow table matching and forwarding processing on the data message using the forwarding table;
[0026] The message processing device further includes: a first statistical table matching module and / or a second statistical table matching module; wherein,
[0027] The first statistical table matching module is used to use the first statistical table to perform flow table matching and statistical operations on the data message before the forwarding table matching module performs flow table matching and forwarding processing on the data message;
[0028] The second statistical table matching module is used to use the second statistical table to perform flow table matching and statistical operations of outgoing messages on the data message after the forwarding table matching module performs flow table matching and forwarding processing on the data message.
[0029] Optionally, the statistical operation includes at least one of the following: counting the number of hits of a preset flow table, performing coloring processing on data packets, and performing mirroring processing on data packets.
[0030] Optionally, the first statistical table matching module is also used to match the data packet with the flow table in the first statistical table, and perform corresponding statistical operations according to the successfully matched flow table; after completing the matching of the first statistical table, trigger the forwarding table matching module to execute the flow table matching and forwarding processing of the data packet using the forwarding table.
[0031] The second statistical table matching module is also used to match the data message with the flow table in the second statistical table, and perform corresponding statistical operations according to the successfully matched flow table; after completing the matching of the second statistical table, the data message is sent out through the destination port, and the destination port is the egress port determined when the flow table matching and forwarding processing of the data message are performed using the forwarding table.
[0032] Optionally, the first statistical table includes at least one first flow table group, and each of the first flow table groups includes at least one flow table; the first statistical table matching module is further used to: match the data message with the flow tables in each first flow table group in sequence, and in the case of successful matching, perform corresponding statistical operations according to the current successfully matched flow table, and continue to match the flow table in the next first flow table group;
[0033] The second statistical table includes at least one second flow table group, and each second flow table group includes at least one flow table; the second statistical table matching module is also used to: match the data packet with the flow tables in each second flow table group in turn, and in the case of successful matching, perform corresponding statistical operations based on the current successful matching flow table, and continue to match the flow table in the next second flow table group.
[0034] Optionally, the forwarding table matching module is further used to match the data message with the forwarding table, and after the matching process is completed, forward the data message through the target port, or trigger the second statistical table matching module to perform a second process on the data message;
[0035] The matching process specifically includes:
[0036] Matching the data message with the flow tables in the forwarding table in sequence, and forwarding the data message according to the first successfully matched flow table, wherein the forwarding process includes determining the destination port of the data message;
[0037] In the case that the data message fails to match all flow tables in the forwarding table, the data message is sent to a preset destination address, a new flow table matching the data message is received and saved in the forwarding table, and the data message is forwarded according to the new flow table.
[0038] In a third aspect, an embodiment of the present application provides a message processing device, including a transceiver and a processor, wherein:
[0039] The transceiver is used to receive data messages;
[0040] The processor is used to perform flow table matching and forwarding processing on the data message using a forwarding table;
[0041] The processor is further configured to perform a first process and / or a second process on the data message, wherein:
[0042] The first processing includes: before using the forwarding table to perform flow table matching and forwarding processing on the data message, using the first statistical table to perform flow table matching and statistical operations on the data message for incoming messages;
[0043] The second processing includes: after performing flow table matching and forwarding processing on the data message by using the forwarding table, performing flow table matching and statistical operations of outgoing messages on the data message by using the second statistical table.
[0044] Optionally, the processor is further configured to:
[0045] The data message is matched with the flow table in the first statistical table, and the corresponding statistical operation is performed according to the successfully matched flow table; after completing the matching of the first statistical table, the step of using the forwarding table to perform flow table matching and forwarding processing on the data message is performed.
[0046] The data message is matched with the flow table in the second statistical table, and the corresponding statistical operation is performed according to the flow table that matches successfully; after completing the matching of the second statistical table, the data message is sent out through the destination port, and the destination port is the egress port determined when the flow table matching and forwarding processing of the data message are performed using the forwarding table.
[0047] Optionally, the first statistical table includes at least one first flow table group, and each of the first flow table groups includes at least one flow table; the processor is further used to: match the data packet with the flow tables in each first flow table group in sequence, and if the match is successful, perform a corresponding statistical operation according to the current successfully matched flow table, and continue to match the flow table in the next first flow table group;
[0048] The second statistical table includes at least one second flow table group, and each second flow table group includes at least one flow table; the processor is also used to: match the data packet with the flow tables in each second flow table group in turn, and if the match is successful, perform corresponding statistical operations based on the current successful matching flow table, and continue to match the flow table in the next second flow table group.
[0049] In a fourth aspect, an embodiment of the present application provides a message processing device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the method described in the first aspect.
[0050] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a program is stored. When the program is executed by a processor, the steps of the method described above are implemented.
[0051] Compared with the prior art, the message processing method, device and storage medium provided in the embodiment of the present application can obtain the statistical information of the incoming messages and outgoing messages of the message processing device, realize the operations such as classification statistics and analysis of the traffic, and based on the above statistical information, the embodiment of the present application can realize network fault monitoring and prediction, and improve network reliability. In addition, by separately counting the incoming messages and outgoing messages, the embodiment of the present application can realize the rapid recovery of faults and the demarcation of operation and maintenance responsibilities based on the above statistical information, and improve the network operation and maintenance capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0053] Figure 1 A flow chart of a message processing method according to an embodiment of the present application;
[0054] Figure 2 Another flow chart of the message processing method of the embodiment of the present application;
[0055] Figure 3Another flow chart of the message processing method of the embodiment of the present application;
[0056] Figure 4 A schematic diagram of the structure of a DPU as a message processing device provided in an embodiment of the present application;
[0057] Figure 5 An example flow chart of a message processing method provided in an embodiment of the present application;
[0058] Figure 6 This is a structural diagram of a message processing device according to an embodiment of the present application;
[0059] Figure 7 This is a structural diagram of a message processing device according to another embodiment of the present application;
[0060] Figure 8 This is a structural diagram of a message processing device according to another embodiment of the present application. DETAILED DESCRIPTION
[0061] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.
[0062] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable in appropriate circumstances, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units need not be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment. "And / or" in the specification and claims represents at least one of the connected objects.
[0063] The following description provides examples and does not limit the scope, applicability, or configuration set forth in the claims. Changes may be made to the functions and arrangements of the elements discussed without departing from the spirit and scope of the present disclosure. Various examples may appropriately omit, replace, or add various procedures or components. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
[0064] With the rapid development of cloud computing, the increase in computing power and network bandwidth has put a huge test on the network performance in the data center. Traditional network forwarding relies on the CPU to complete, and the processing of network data traffic is realized through general software programming, such as the Linux kernel TCP / IP protocol stack, virtual switch (vSwitch), virtual router (vRouter, etc.). Therefore, the processing capacity of network data packets depends on the CPU performance. In the past 40 years, the overall performance of the CPU has increased by nearly 50,000 times, but now the progress of semiconductor technology and processor architecture has reached a bottleneck, and Moore's Law has gradually slowed down, causing the marginal cost of CPU performance growth to rise rapidly. At the same time, the network bandwidth has developed from the mainstream 10G to 25G, 100G and even 400G. In the era of computing network, the computing power resources at the cloud, edge and end are exposed to the surging network data volume, resulting in a significant gap between the CPU performance growth rate and the network bandwidth growth rate.
[0065] In the cloud network resource pool based on the network function virtualization / software defined network (NFV / SDN) technology architecture, functions such as interconnection communication and tenant isolation between network element virtual machines rely on the vSwitch component implemented by CPU software. The industry usually uses open source software Open vSwitch (OvS) to implement it. The current pure software-implemented OvS mainly includes three parts: vswitchd, ovsdb and datapath.
[0066] Among them, the vswitchd component is the main module of the switch, running in user mode, and is mainly responsible for basic forwarding logic, address learning, external physical port binding, etc. The ovsdb component is a lightweight database that stores the configuration, logs, and status of OVS bridges. Datapath is the core forwarding module. In traditional native OvS, datapath runs in kernel mode and is mainly responsible for flow table matching, message modification, tunnel encapsulation, forwarding or sending, and maintaining the underlying forwarding table.
[0067] The datapath module responsible for packet processing in traditional OvS runs in kernel state. Data transmission with the virtual network card in the virtual machine requires multiple data switching between kernel state and user state, which brings performance bottlenecks. To address this problem, the industry mostly uses DPDK to improve the processing and forwarding performance of datapath. DPDK is a set of development platforms and interfaces for fast packet processing. It runs in the user state of the operating system and is a collection of function libraries and drivers for fast packet processing. After using DPDK to accelerate OvS, the packets received by the network port do not need to be processed in the openvswitch.ko kernel state. The packets are directly sent to the user state through the DPDK PMD driver and sent to the running program.
[0068] In the OvS-DPDK architecture, the processing of flow tables and the forwarding of data are dependent on the user-state DPDK component, and the core of the DPDK component is to obtain the message data on the network card through polling, and the polling operation depends on the CPU capability. In the cloud network of the telecommunications scenario, in order to ensure the stable forwarding performance of the network element service, it is necessary to reserve a dedicated CPU core for the OvS-DPDK component to process operations such as flow table matching and message forwarding. In the case of the current network cloud service plane network 25G bandwidth, it is necessary to bind about 20% of the CPU cores to ensure the forwarding performance of the vSwitch component, resulting in excessive platform overhead and reduced resources for network element services. In addition, due to the characteristics of large bandwidth and massive connections of 5G services, the bandwidth between computing nodes in the data center is gradually evolving towards 100G. As the component in the computing node that is mainly responsible for control and logical operations, the CPU itself is not good at parallel processing of a large number of I / Os. In order to ensure the forwarding performance of the vSwitch, more CPU cores need to be bound, resulting in a sharp drop in the availability of platform computing resources.
[0069] To address the above issues, the industry usually offloads part or all of the vSwitch components to the DPU, using the dedicated hardware acceleration engine in the DPU to implement flow table matching and packet forwarding. The DPU can significantly improve network forwarding performance, while freeing up more valuable CPU resources for upper-layer services, reducing platform overhead and improving computing resource utilization.
[0070] Through DPU offloading and acceleration, the vSwitch forwarding performance can be improved and CPU computing resources can be released. In the specific vSwitch offloading technology, the industry usually uses two interface technologies, rte_flow and tc_flower. rte_flow is the offloading interface in the DPDK component, and tc_flower is the offloading interface in the Linux operating system kernel. The core of both technologies is to disassemble the flow table in the vSwitch datapath module into a standard match-action mode, and offload the relevant fields to the hardware acceleration module of the DPU. The industry's DPU manufacturers also usually develop corresponding drivers based on the rte_flow or tc_flower technologies, and develop a match-action-based flow table processing pipeline in the DPU's hardware acceleration engine to achieve the core flow table matching and packet forwarding operations in vSwitch acceleration.
[0071] As described in the background technology, offloading the vSwitch forwarding plane to the hardware acceleration engine will lead to the following problems: 1) The DPU hardware acceleration engine's single flow table matching statistics method is difficult to meet the needs of traffic classification statistics and analysis in the telecommunications cloud network; 2) It is difficult to achieve rapid fault recovery and operation and maintenance responsibility demarcation when a network failure occurs.
[0072] To solve at least one of the above problems, an embodiment of the present application provides a message processing method that can perform operations such as classification, statistics and analysis on traffic, with high statistical accuracy and timeliness. In addition, it can also provide statistical information on message reception and transmission, so that when a network failure occurs, the above information can be used to achieve rapid recovery of the failure and demarcation of operation and maintenance responsibilities to meet requirements in terms of reliability and maintainability.
[0073] The message processing method provided in the embodiment of the present application is applied to a message processing device, and the message processing device may be a device such as a virtual switch. In the message processing method, the message processing device receives a data message and uses a forwarding table to perform flow table matching and forwarding processing on the data message. In addition, in the message processing method, the message processing device also performs a first processing and / or a second processing on the data message.
[0074] The first processing includes: before using the forwarding table to perform flow table matching and forwarding processing on the data message, using the first statistical table to perform flow table matching and statistical operations on the data message for incoming messages;
[0075] The second processing includes: after performing flow table matching and forwarding processing on the data message by using the forwarding table, performing flow table matching and statistical operations of outgoing messages on the data message by using the second statistical table.
[0076] That is to say, before using the forwarding table to match and forward the data message, the embodiment of the present application can use the statistical operation defined in the flow table in the first statistical table to count the messages received by the data processing device, and / or use the statistical operation defined in the flow table in the second statistical table to count the messages sent by the data processing device, thereby supporting operations such as traffic classification statistics and analysis. Since it is a statistical operation based on the flow table of the data message, its statistical accuracy and timeliness are high. In addition, the embodiment of the present application can count the received messages and / or sent messages of the message processing device, so as to provide statistical information on message reception and transmission. In this way, when a network failure occurs, the above statistical information can be used to achieve rapid recovery of the failure and demarcation of operation and maintenance responsibilities to meet the requirements of reliability and maintainability.
[0077] like Figure 1As shown, as an implementation method, the message processing method of the embodiment of the present application specifically includes the following steps:
[0078] Step 10: Receive data message.
[0079] Step 11: Use the first statistical table to perform flow table matching and statistical operations on the data packets.
[0080] Here, the embodiment of the present application matches the data message with the flow table in the first statistical table, and performs corresponding statistical operations according to the flow table that successfully matches. Specifically, the matching can be to match any combination of fields in the data message with the flow table in the first statistical table as needed, and the present application does not make specific restrictions on this. The statistical operation includes but is not limited to at least one of the following: counting the number of hits of the preset flow table, coloring the data message, mirroring the data message, etc. For example, when it is desired to count or analyze the first type of data message received by the data processing device, a corresponding flow table can be set in the first statistical table, and the match item of the flow table includes the characteristics of the header field of the first type of data message, and the statistical operation of the flow table can be set as needed, for example, counting the total number of the first type of data messages received, counting the reception frequency of the first type of data messages received within a unit time, and counting the total message length or average length of the first type of data messages received, etc., and the present application does not make specific restrictions on this.
[0081] Considering the statistical requirements, it is possible to perform one or more statistics on the received data packets. In this case, the first statistical table may include at least one first flow table group, and each of the first flow table groups includes at least one flow table. In this way, in step 11, the data packets can be matched with the flow tables in each first flow table group in turn, and in the case of successful matching, the corresponding statistical operation is performed according to the current successfully matched flow table, and the flow table in the next first flow table group is continued to be matched until all the first flow table groups are matched. Then, go to step 12. Specifically, the matching order of each first flow table group can be set arbitrarily, and this application does not make specific restrictions on this.
[0082] Step 12: Use the forwarding table to perform flow table matching and forwarding processing on the data message.
[0083] Here, the embodiment of the present application matches the data message with the forwarding table, and after the matching process is completed, proceeds to step 13. The matching process specifically includes:
[0084] The data message is matched with the flow tables in the forwarding table in sequence, and the data message is forwarded according to the first successfully matched flow table, wherein the forwarding process includes determining the destination port of the data message.
[0085] In addition, when the data message fails to match all flow tables in the forwarding table, the data message is sent to a preset destination address (such as), a new flow table matching the data message is received and saved in the forwarding table, and the data message is forwarded based on the new flow table.
[0086] Step 13: Use the second statistical table to perform flow table matching and statistical operations on the data packets.
[0087] Here, the embodiment of the present application matches the data message with the flow table in the second statistical table, and performs corresponding statistical operations according to the flow table that successfully matches; after completing the matching of the second statistical table, enter step 14. Similarly, the matching can be to match the combination of any fields in the data message with the flow table in the second statistical table as needed, and the present application does not make specific restrictions on this. The statistical operation includes but is not limited to at least one of the following: counting the number of hits of the preset flow table, coloring the data message, mirroring the data message, etc. For example, when it is desired to count or analyze the second type of data message sent by the data processing device, a corresponding flow table can be set in the second statistical table, and the match item of the flow table includes the characteristics of the header field of the second type of data message, and the statistical operation of the flow table can be set as needed, for example, counting the total number of the second type of data messages sent, counting the reception frequency of the second type of data messages sent within a unit time, and counting the total length or average length of the second type of data messages sent, etc., and the present application does not make specific restrictions on this.
[0088] Considering the statistical requirements, it is possible to perform one or more statistics on the sent data packets. In this case, the second statistical table may include at least one second flow table group, and each second flow table group includes at least one flow table. In this way, in step 12, the data packets can be matched with the flow tables in each second flow table group in turn, and in the case of successful matching, the corresponding statistical operation is performed according to the current successful matching flow table, and the flow table in the next second flow table group is continued to be matched until all the second flow table groups are matched. Then, proceed to step 14. Specifically, the matching order of each second flow table group can be set arbitrarily, and this application does not make specific restrictions on this.
[0089] Step 14: forward the data message through the destination port, where the destination port is the egress port of the data message on the data processing device determined when the forwarding table is used to perform flow table matching and forwarding processing on the data message.
[0090] Here, the data message processing flow is completed by forwarding the data message from the destination port.
[0091] Through the above steps, the embodiment of the present application can obtain the statistical information of the incoming and outgoing messages of the message processing device, and can realize operations such as classification statistics and analysis of traffic. Based on the above statistical information, network fault monitoring and prediction can be realized to improve network reliability. In addition, by separately counting the incoming and outgoing messages, the embodiment of the present application can realize rapid recovery of faults and demarcation of operation and maintenance responsibilities based on the above statistical information, thereby improving network operation and maintenance capabilities.
[0092] like Figure 2 As shown, as another implementation, the message processing method in the embodiment of the present application specifically includes the following steps:
[0093] Step 10: Receive data message.
[0094] Step 11: Use the first statistical table to perform flow table matching and statistical operations on the data packets.
[0095] Step 12: Use the forwarding table to perform flow table matching and forwarding processing on the data message.
[0096] Step 14: forward the data message through the destination port, where the destination port is the egress port of the data message on the data processing device determined when the forwarding table is used to perform flow table matching and forwarding processing on the data message.
[0097] Figure 2 In the embodiment, only the inbound statistics are provided. Figure 2 and Figure 1 The steps with the same number are the same or similar steps and will not be repeated here to save space.
[0098] like Figure 3 As shown, as another implementation, the message processing method in the embodiment of the present application specifically includes the following steps:
[0099] Step 10: Receive data message.
[0100] Step 12: Use the forwarding table to perform flow table matching and forwarding processing on the data message.
[0101] Step 13: Use the second statistical table to perform flow table matching and statistical operations on the data packets.
[0102] Step 14: forward the data message through the destination port, where the destination port is the egress port of the data message on the data processing device determined when the forwarding table is used to perform flow table matching and forwarding processing on the data message.
[0103] Figure 3 In the embodiment, only outbound statistics are provided. Figure 3 and Figure 1 The steps with the same number are the same or similar steps and will not be repeated here to save space.
[0104] Below Figure 4 The DPU shown is used as a message processing device as an example, and combined with Figure 5 The process provided is to further illustrate the above embodiments.
[0105] This example proposes a highly reliable DPU network flow table implementation solution. Based on the existing flow table offloading solution and mechanism, the pipeline module in the DPU hardware acceleration engine is enhanced and optimized. The basic principles are as follows:
[0106] 1. In the original Datapath Pipeline, two levels of flow tables are added before and after the table responsible for packet forwarding, namely the inbound statistics table (i.e. the first statistics table mentioned above) and the outbound statistics table (i.e. the second statistics table mentioned above). In the inbound and outbound statistics tables, match operations can be performed on any combination of fields in the packet header field. Action operations include statistics, coloring, mirroring and other operations. After entering the DPU, the packet first enters the inbound statistics table and finally passes through the outbound statistics table before being sent out from the DPU.
[0107] 2. The inbound and outbound statistics tables are based on the same principles as the message forwarding table, and are implemented based on match and aciton operations. The vSwitch control plane uses the same interface as the forwarding table unloading to implement the match-actin field information on the inbound and outbound statistics tables. The inbound and outbound statistics tables do not change the actual forwarding path of the message (only determined by the message forwarding table), and only perform corresponding operations for statistics, coloring and other scenarios to achieve reliability and maintainability goals.
[0108] 3. The match operation in the inbound and outbound statistics table supports the combination of any fields in the packet header. The action operation does not allow the specified forwarding to the port. It only supports operations such as sending (sending to the vSwitch control plane), counting (counting the number of hits), and coloring (modifying certain packet header fields).
[0109] 4. The match operation in the inbound and outbound statistics tables supports multiple matches based on flow table groups, that is, each message, regardless of whether it matches in a certain group, needs to complete the scanning of all flow table groups to meet the flow statistics scenario, when some messages meet the flow tables under different message header field combination types at the same time, to achieve accurate match and action on the corresponding flow tables. For example, flow table 1 match is source mac=1, action=counter a, flow table 2 match is source ip=2, action=counter b; when there is a message with source mac=1 and source ip=2, after matching flow table 1 in the traditional way, it enters the message forwarding table, resulting in inaccurate statistics for flow table 2. In this example, flow table 1 and flow table 2 are placed in two flow table groups respectively, so that the message can be matched in these two flow tables respectively.
[0110] Combining the vSwitch datapath operation process and principle, and the inbound and outbound statistics tables of the embodiment of the present application, the complete pipeline process of the data packet entering the DPU is as follows: Figure 5 As shown, including:
[0111] 1. Data packets enter the DPU through the ingress port (physical port or virtual port).
[0112] 2. Scan the inbound statistics table and match the data packet with all flow table groups in the inbound statistics table. If no match is found, go to step 4.
[0113] 3. If the data packet matches the inbound statistics table, execute the corresponding action operation (coloring, statistics, etc.). After all flow table group matches are completed, execute step 4.
[0114] 4. Scan the forwarding table and match the data packet with the flow table in the forwarding table. If a match is found, proceed to step 6.
[0115] 5. If the data packet does not match the forwarding table, the data packet is sent to the vSwitch control plane. The control plane generates a new flow table and sends it to the forwarding table. The data packet matches the new flow table and executes the corresponding action (forwarding to the destination port). The packet is then injected into the hardware forwarding plane and then goes to step 6.
[0116] 6. Scan the outbound statistics table and match the data packet with all flow table groups in the outbound statistics table. If no match is found, go to step 8.
[0117] 7. If the data packet matches the outgoing statistics table, perform the action operation (coloring, statistics, etc.). After all flow table group matches are completed, execute step 8.
[0118] 8. The data message is sent to the cloud host or switch through the destination port (virtual port or physical port).
[0119] From the above embodiments, it can be seen that this example enhances the statistical operation and maintenance capabilities of network data packets on the DPU, and can realize multiple statistical and operation and maintenance functions such as multi-type combination, dye flow statistics, and probe statistics, breaking through the limitation that only a single flow table can be counted in the original forwarding table. In addition, this example also improves the fault demarcation capability of virtual network components on the DPU, using dedicated hardware to accelerate the forwarding performance of flow tables, resulting in virtual network components such as vSwitch being jointly developed and implemented by software and hardware manufacturers. The solution of this example can accurately count and locate all messages received and sent by the DPU hardware pipeline, improving the operation and maintenance efficiency. In addition, the implementation scheme of this example is concise and reliable. The implementation principle of its inbound and outbound statistics tables is consistent with that of the forwarding table, which is based on the match-action operation of the flow table. The DPU manufacturer does not need to redevelop the pipeline logic in the hardware acceleration engine. The unloading of the field information in the statistics table reuses the flow table unloading interface of the forwarding table, and the upper-layer software can be implemented through simple modification according to operation and maintenance requirements. At the same time, the statistics table is usually only used in fault operation and maintenance scenarios, and the number of flow tables is limited, which is several orders of magnitude lower than that of the forwarding table, and has almost no effect on the DPU's processing performance of the message forwarding table.
[0120] The above describes various methods of the embodiments of the present application. The following further provides devices for implementing the above methods.
[0121] Please refer to Figure 6 The present application also provides a message processing device, including:
[0122] A receiving module 61, used for receiving data messages;
[0123] The forwarding table matching module 63 is used to perform flow table matching and forwarding processing on the data message using the forwarding table.
[0124] like Figure 6 As shown, the message processing device further includes: a first statistical table matching module 62 and / or a second statistical table matching module 64; wherein,
[0125] The first statistical table matching module 62 is used to use the first statistical table to perform flow table matching and statistical operations on the data message before the forwarding table matching module performs flow table matching and forwarding processing on the data message;
[0126] The second statistical table matching module 64 is used to use the second statistical table to perform flow table matching and statistical operations of outgoing messages on the data message after the forwarding table matching module performs flow table matching and forwarding processing on the data message.
[0127] Based on the above modules, the embodiment of the present application can obtain the statistical information of the incoming and outgoing messages of the message processing device, and realize operations such as classification statistics and analysis of traffic, thereby realizing network fault monitoring and prediction, and improving network reliability. In addition, by separately counting the incoming and outgoing messages, the embodiment of the present application can realize rapid recovery of faults and demarcation of operation and maintenance responsibilities based on the above statistical information, thereby improving network operation and maintenance capabilities.
[0128] Optionally, the statistical operation includes at least one of the following: counting the number of hits of a preset flow table, performing coloring processing on data packets, and performing mirroring processing on data packets.
[0129] Optionally, the first statistical table matching module is also used to match the data packet with the flow table in the first statistical table, and perform corresponding statistical operations according to the successfully matched flow table; after completing the matching of the first statistical table, trigger the forwarding table matching module to execute the flow table matching and forwarding processing of the data packet using the forwarding table.
[0130] The second statistical table matching module is also used to match the data message with the flow table in the second statistical table, and perform corresponding statistical operations according to the successfully matched flow table; after completing the matching of the second statistical table, the data message is sent out through the destination port, and the destination port is the egress port determined when the flow table matching and forwarding processing of the data message are performed using the forwarding table.
[0131] Optionally, the first statistical table includes at least one first flow table group, and each of the first flow table groups includes at least one flow table; the first statistical table matching module is further used to: match the data message with the flow tables in each first flow table group in sequence, and in the case of successful matching, perform corresponding statistical operations according to the current successfully matched flow table, and continue to match the flow table in the next first flow table group;
[0132] The second statistical table includes at least one second flow table group, and each second flow table group includes at least one flow table; the second statistical table matching module is also used to: match the data packet with the flow tables in each second flow table group in turn, and in the case of successful matching, perform corresponding statistical operations based on the current successful matching flow table, and continue to match the flow table in the next second flow table group.
[0133] Optionally, the forwarding table matching module is further used to match the data message with the forwarding table, and after the matching process is completed, forward the data message through the target port, or trigger the second statistical table matching module to perform a second process on the data message;
[0134] The matching process specifically includes:
[0135] Matching the data message with the flow tables in the forwarding table in sequence, and forwarding the data message according to the first successfully matched flow table, wherein the forwarding process includes determining the destination port of the data message;
[0136] In the case that the data message fails to match all flow tables in the forwarding table, the data message is sent to a preset destination address, a new flow table matching the data message is received and saved in the forwarding table, and the data message is forwarded according to the new flow table.
[0137] It should be noted that the device in this embodiment is a device corresponding to the above method, and the implementation methods in the above embodiments are all applicable to the embodiments of the device, and can also achieve the same technical effects. The above device provided in the embodiment of the present application can implement all the method steps implemented in the above method embodiment, and can achieve the same technical effects, and the parts and beneficial effects that are the same as those in the method embodiment in this embodiment will not be specifically described here.
[0138] Please refer to Figure 7 , the embodiment of the present application further provides a message processing device 700, including: a transceiver 701 and a processor 702, the processor can be a module such as FPGA, ASIC, NP, etc.;
[0139] The transceiver 701 is used to receive data messages;
[0140] The processor 702 is used to perform flow table matching and forwarding processing on the data message using a forwarding table;
[0141] The processor 702 is further configured to perform a first process and / or a second process on the data message, wherein:
[0142] The first processing includes: before using the forwarding table to perform flow table matching and forwarding processing on the data message, using the first statistical table to perform flow table matching and statistical operations on the data message for incoming messages;
[0143] The second processing includes: after performing flow table matching and forwarding processing on the data message by using the forwarding table, performing flow table matching and statistical operations of outgoing messages on the data message by using the second statistical table.
[0144] Optionally, the statistical operation includes at least one of the following: counting the number of hits of a preset flow table, performing coloring processing on data packets, and performing mirroring processing on data packets.
[0145] Optionally, the processor is further configured to:
[0146] The data message is matched with the flow table in the first statistical table, and the corresponding statistical operation is performed according to the successfully matched flow table; after completing the matching of the first statistical table, the step of using the forwarding table to perform flow table matching and forwarding processing on the data message is performed.
[0147] The data message is matched with the flow table in the second statistical table, and the corresponding statistical operation is performed according to the flow table that matches successfully; after completing the matching of the second statistical table, the data message is sent out through the destination port, and the destination port is the egress port determined when the flow table matching and forwarding processing of the data message are performed using the forwarding table.
[0148] Optionally, the first statistical table includes at least one first flow table group, and each of the first flow table groups includes at least one flow table; the processor is further used to: match the data packet with the flow tables in each first flow table group in sequence, and if the match is successful, perform a corresponding statistical operation according to the current successfully matched flow table, and continue to match the flow table in the next first flow table group;
[0149] The second statistical table includes at least one second flow table group, and each second flow table group includes at least one flow table; the processor is also used to: match the data packet with the flow tables in each second flow table group in turn, and if the match is successful, perform corresponding statistical operations based on the current successful matching flow table, and continue to match the flow table in the next second flow table group.
[0150] Optionally, the processor is further configured to perform matching processing on the data message and the forwarding table, and after the matching processing is completed, forward the data message through a target port, or perform a step of performing a second processing on the data message;
[0151] The matching process specifically includes:
[0152] Matching the data message with the flow tables in the forwarding table in sequence, and forwarding the data message according to the first successfully matched flow table, wherein the forwarding process includes determining the destination port of the data message;
[0153] In the case that the data message fails to match all flow tables in the forwarding table, the data message is sent to a preset destination address, a new flow table matching the data message is received and saved in the forwarding table, and the data message is forwarded according to the new flow table.
[0154] It should be noted that the device in this embodiment is a device corresponding to the above method, and the implementation methods in the above embodiments are all applicable to the embodiments of the device, and can also achieve the same technical effects. The above device provided in the embodiment of the present application can implement all the method steps implemented in the above method embodiment, and can achieve the same technical effects, and the parts and beneficial effects that are the same as those in the method embodiment in this embodiment will not be specifically described here.
[0155] Please refer to Figure 8 The embodiment of the present application also provides a message processing device 800, including a processor 801, a memory 802, and a computer program stored in the memory 802 and executable on the processor 801. When the computer program is executed by the processor 801, the various processes of the above-mentioned message processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0156] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned message processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0157] It should be noted that, in this article, the terms "include", "include" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device 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 device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0158] 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 application, 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, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0159] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A message processing method, applied to a message processing device, the method comprising: receiving a data message, and performing flow table matching and forwarding processing on the data message using a forwarding table; wherein the method further comprises: The data message is subjected to a first process and / or a second process, wherein: The first processing includes: before using the forwarding table to perform flow table matching and forwarding processing on the data message, using the first statistical table to perform flow table matching and statistical operations on the data message for incoming messages; The second processing includes: after performing flow table matching and forwarding processing on the data message by using the forwarding table, performing flow table matching and statistical operations of outgoing messages on the data message by using the second statistical table.
2. The method according to claim 1, characterized in that The statistical operation includes at least one of the following: counting the number of hits of a preset flow table, performing coloring processing on data packets, and performing mirroring processing on data packets.
3. The method according to claim 1, characterized in that Using the first statistical table to perform flow table matching and statistical operations on the data message, including: matching the data message with the flow table in the first statistical table, and performing corresponding statistical operations according to the flow table that successfully matches; after completing the matching of the first statistical table, performing the steps of using the forwarding table to perform flow table matching and forwarding processing on the data message; The second statistical table is used to perform flow table matching and statistical operations on the data message as an outgoing message, including: matching the data message with the flow table in the second statistical table, and performing corresponding statistical operations according to the flow table that successfully matches; after completing the matching of the second statistical table, sending the data message out through the destination port, and the destination port is the outgoing port determined when the forwarding table is used to perform flow table matching and forwarding processing on the data message.
4. The method according to claim 3, characterized in that The first statistical table includes at least one first flow table group, each of which includes at least one flow table; matching the data packet with the flow tables in the first statistical table and performing corresponding statistical operations according to the flow tables that successfully match, specifically includes: matching the data packet with the flow tables in each of the first flow table groups in sequence, and in the case of successful matching, performing corresponding statistical operations according to the current successful matching flow table, and continuing to match the flow table in the next first flow table group; The second statistical table includes at least one second flow table group, and each second flow table group includes at least one flow table; matching the data packet with the flow tables in the second statistical table and performing corresponding statistical operations according to the successfully matched flow tables specifically includes: matching the data packet with the flow tables in each second flow table group in turn, and in the case of successful matching, performing corresponding statistical operations according to the current successfully matched flow table, and continuing to match the flow table in the next second flow table group.
5. The method according to claim 1, characterized in that The using the forwarding table to perform flow table matching and forwarding processing on the data message includes: Matching the data message with the forwarding table, and after the matching process is completed, forwarding the data message through the target port, or performing a step of performing a second process on the data message; The matching process specifically includes: Matching the data message with the flow tables in the forwarding table in sequence, and forwarding the data message according to the first successfully matched flow table, wherein the forwarding process includes determining the destination port of the data message; In the case that the data message fails to match all flow tables in the forwarding table, the data message is sent to a preset destination address, a new flow table matching the data message is received and saved in the forwarding table, and the data message is forwarded according to the new flow table.
6. A message processing device, comprising: A receiving module, used for receiving data messages; A forwarding table matching module, used for performing flow table matching and forwarding processing on the data message using the forwarding table; Characterized in that the message processing device further comprises: a first statistical table matching module and / or a second statistical table matching module; wherein, The first statistical table matching module is used to use the first statistical table to perform flow table matching and statistical operations on the data message before the forwarding table matching module performs flow table matching and forwarding processing on the data message; The second statistical table matching module is used to use the second statistical table to perform flow table matching and statistical operations of outgoing messages on the data message after the forwarding table matching module performs flow table matching and forwarding processing on the data message.
7. The device according to claim 6, characterized in that The statistical operation includes at least one of the following: counting the number of hits of a preset flow table, performing coloring processing on data packets, and performing mirroring processing on data packets.
8. The device according to claim 6, characterized in that The first statistical table matching module is further used to match the data message with the flow table in the first statistical table, and perform corresponding statistical operations according to the flow table that successfully matches; after completing the matching of the first statistical table, trigger the forwarding table matching module to perform the flow table matching and forwarding processing on the data message using the forwarding table; The second statistical table matching module is also used to match the data message with the flow table in the second statistical table, and perform corresponding statistical operations according to the successfully matched flow table; after completing the matching of the second statistical table, the data message is sent out through the destination port, and the destination port is the egress port determined when the flow table matching and forwarding processing of the data message are performed using the forwarding table.
9. The device according to claim 8, characterized in that The first statistical table includes at least one first flow table group, each of which includes at least one flow table; the first statistical table matching module is further used to: match the data message with the flow tables in each first flow table group in sequence, and if the match is successful, perform corresponding statistical operations according to the current successfully matched flow table, and continue to match the flow table in the next first flow table group; The second statistical table includes at least one second flow table group, and each second flow table group includes at least one flow table; the second statistical table matching module is also used to: match the data packet with the flow tables in each second flow table group in turn, and in the case of successful matching, perform corresponding statistical operations based on the current successful matching flow table, and continue to match the flow table in the next second flow table group.
10. The device according to claim 6, characterized in that The forwarding table matching module is further used to match the data message with the forwarding table, and after the matching process is completed, forward the data message through the target port, or trigger the second statistical table matching module to perform a second process on the data message; The matching process specifically includes: Matching the data message with the flow tables in the forwarding table in sequence, and forwarding the data message according to the first successfully matched flow table, wherein the forwarding process includes determining the destination port of the data message; In the case that the data message fails to match all flow tables in the forwarding table, the data message is sent to a preset destination address, a new flow table matching the data message is received and saved in the forwarding table, and the data message is forwarded according to the new flow table.
11. A message processing device, characterized in that: comprising a transceiver and a processor, wherein: The transceiver is used to receive data messages; The processor is used to perform flow table matching and forwarding processing on the data message using a forwarding table; The processor is further configured to perform a first process and / or a second process on the data message, wherein: The first processing includes: before using the forwarding table to perform flow table matching and forwarding processing on the data message, using the first statistical table to perform flow table matching and statistical operations on the data message for incoming messages; The second processing includes: after performing flow table matching and forwarding processing on the data message by using the forwarding table, performing flow table matching and statistical operations of outgoing messages on the data message by using the second statistical table.
12. The device according to claim 11, characterized in that The processor is further configured to: Matching the data message with the flow table in the first statistical table, and performing corresponding statistical operations according to the flow table that successfully matches; after completing the matching of the first statistical table, performing the steps of using the forwarding table to perform flow table matching and forwarding processing on the data message; Matching the data packet with the flow table in the second statistical table, and performing corresponding statistical operations according to the successfully matched flow table; After completing the matching of the second statistical table, the data message is sent out through a destination port, where the destination port is an egress port determined when performing flow table matching and forwarding processing on the data message using a forwarding table.
13. The device according to claim 12, characterized in that The first statistical table includes at least one first flow table group, and each of the first flow table groups includes at least one flow table; the processor is further used to: match the data message with the flow tables in each first flow table group in sequence, and if the match is successful, perform a corresponding statistical operation according to the current successfully matched flow table, and continue to match the flow table in the next first flow table group; The second statistical table includes at least one second flow table group, and each second flow table group includes at least one flow table; the processor is also used to: match the data packet with the flow tables in each second flow table group in turn, and if the match is successful, perform corresponding statistical operations based on the current successful matching flow table, and continue to match the flow table in the next second flow table group.
14. A message processing device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the method according to any one of claims 1 to 5.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Cited By
Packet forwarding method and apparatus, NP chip, and network device
WO2026145185A1
