A message processing system, method, electronic device and computer storage medium
By coordinating the network programmable unit and the computing unit, and customizing the metadata structure and message encapsulation logic, the problem of maintaining the mapping relationship by the computing unit is solved, thereby improving the device performance and flexibility.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2026-04-07
AI Technical Summary
In the prior art, the computing unit needs to maintain a mapping relationship with the network programmable chip device port and cannot carry additional information at the chip layer, which leads to increased processing complexity of the computing unit and destruction of message structure.
The network programmable unit obtains the initial message and metadata, generates the first message through custom encapsulation logic, and the computing unit parses and processes it to generate target metadata carrying the sending port information, thereby realizing message forwarding and reducing the computing unit's maintenance of mapping relationships.
It reduces business complexity, improves device performance and flexibility, and ensures that message and metadata encapsulation is not affected by upper-layer business processes.
Smart Images

Figure CN116800864B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud computing network technology, and in particular to a message processing system, method, electronic device and computer storage medium. Background Technology
[0002] With the rapid development of cloud computing technology, more and more users and businesses are migrating to the cloud, resulting in an explosive growth in cloud network traffic. Currently, in the cloud computing field, gateway facilities are gradually evolving from providing highly elastic distributed software-defined devices to integrated hardware and software (hardware-software convergence). Hardware-software convergence primarily involves the integration of heterogeneous computing power, leveraging the high forwarding capability of hardware and the high flexibility of software to meet the needs of cloud users and businesses. Heterogeneous computing power is reflected in the cooperation between the underlying network forwarding chip and diverse computing units. Regarding the collaboration between the underlying network forwarding chip and the computing unit, the industry standard practice is for the underlying network forwarding chip to handle fast forwarding based on hardware flow tables, and for flow misses to be sent to the computing unit for processing via internal channels (i.e., slow path mode).
[0003] However, the current slow path approach in related technologies has the following problems: the computing unit needs to establish a mapping relationship with the network chip device port, and at the same time, it also needs to synchronize the status and functional distribution of the network chip device port with the computing unit in real time; when the network chip sends a message to the computing unit, it cannot carry the chip-layer additional information (such as ingress port, timestamp, etc.), or even if the information is supplemented by expanding the original message, it will destroy the original message structure; in addition, the chip manufacturer provides a software development kit (SDK) to encapsulate the chip-layer additional information, and the computing unit application needs to be aware of the SDK's encapsulation of data, which increases the processing complexity of the computing unit. Summary of the Invention
[0004] This application provides a message processing system, method, electronic device, and computer storage medium. The computing unit does not need to maintain a mapping relationship with the network programmable chip device port. At the same time, the network programmable chip can customize the metadata structure and message encapsulation logic. Moreover, the message and metadata encapsulation is not affected by the upper layer business, thereby reducing business complexity and improving device performance.
[0005] The technical solution of this application is implemented as follows:
[0006] In a first aspect, embodiments of this application provide a message processing system, which includes a network programmable unit and a computing unit, wherein:
[0007] The network programmable unit is used to acquire an initial message and initial metadata, encapsulate the initial message and initial metadata to generate a first message, and send the first message to the computing unit;
[0008] The computing unit is configured to parse the first message, extract the initial metadata, generate target metadata carrying sending port information based on the initial metadata, encapsulate the initial message and the target metadata to generate a second message, and send the second message to the network programmable unit.
[0009] The network programmable unit is further configured to forward the initial message based on the sending port information carried in the second message.
[0010] Secondly, embodiments of this application provide a message processing method, the method comprising:
[0011] The network programmable unit obtains the initial message and initial metadata, encapsulates the initial message and initial metadata, generates a first message, and sends the first message to the computing unit.
[0012] The computing unit parses the first message to extract the initial metadata; generates target metadata carrying sending port information based on the initial metadata; encapsulates the initial message and the target metadata to generate a second message; and sends the second message to the network programmable unit.
[0013] Based on the sending port information carried in the second message, the initial message is forwarded through the network programmable unit.
[0014] Thirdly, embodiments of this application provide an electronic device, which includes a memory and a processor, wherein:
[0015] The memory is used to store computer programs that can run on the processor;
[0016] The processor is configured to execute the method as described in the second aspect when running the computer program.
[0017] Fourthly, embodiments of this application provide a computer storage medium storing a computer program that, when executed by at least one processor, implements the method described in the second aspect.
[0018] This application provides a message processing system, method, electronic device, and computer storage medium. The system includes a network programmable unit and a computing unit, wherein: the network programmable unit is used to acquire an initial message and initial metadata, encapsulate the initial message and initial metadata to generate a first message, and send the first message to the computing unit; the computing unit is used to parse the first message, extract the initial metadata, generate target metadata carrying sending port information based on the initial metadata, encapsulate the initial message and target metadata to generate a second message, and send the second message to the network programmable unit; the network programmable unit is also used to forward the initial message based on the sending port information carried in the second message. In this way, because the network programmable unit (NPTU) can customize the metadata structure and message encapsulation logic, it can encapsulate the initial metadata and initial message to generate a first message and send it to the computing unit. Then, the computing unit, which has metadata recognition capabilities, performs metadata parsing on the first message to obtain the initial metadata, and then generates target metadata carrying the sending port information. This target metadata is then encapsulated with the initial message, and the generated second message is sent to the NTU. The NTU can then forward the initial message based on the sending port information. This also eliminates the need for the computing unit to maintain a mapping relationship with the network programmable chip's device port, resulting in high flexibility. Furthermore, the message and metadata encapsulation process is unaffected by upper-layer services, reducing business complexity and improving device performance. Attached Figure Description
[0019] Figure 1 A schematic diagram of the composition structure of a message processing system provided in this application embodiment;
[0020] Figure 2 A schematic diagram of the composition structure of another message processing system provided in this application embodiment;
[0021] Figure 3 A flowchart illustrating a message processing method provided in an embodiment of this application;
[0022] Figure 4 A detailed structural diagram of a message processing system provided in this application embodiment;
[0023] Figure 5 A flowchart illustrating another message processing method provided in an embodiment of this application;
[0024] Figure 6 A schematic diagram of the composition structure of an electronic device provided in an embodiment of this application;
[0025] Figure 7 This is a schematic diagram of the composition structure of another electronic device provided in an embodiment of this application. Detailed Implementation
[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for explaining the relevant application and not for limiting the application. Furthermore, it should be noted that, for ease of description, only the parts related to the relevant application are shown in the accompanying drawings.
[0027] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0028] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0029] It should be noted that the terms "first, second, and third" used in the embodiments of this application are merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, and third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0030] With the rapid development of cloud computing technology, more and more users and businesses are migrating to the cloud, resulting in an explosive growth in cloud network traffic. Due to the diverse network needs of cloud users and the ever-increasing volume of data, cloud providers' basic network infrastructure (especially gateway infrastructure) faces enormous challenges. This infrastructure must not only provide stable and efficient data forwarding but also offer the ability to rapidly and elastically expand bandwidth for different users. Currently, in the cloud computing field, gateway infrastructure is gradually evolving from providing highly elastic distributed software-defined devices to integrated hardware and software (hardware-software convergence). Hardware-software convergence primarily involves the integration of heterogeneous computing power, leveraging the high forwarding capability of hardware and the high flexibility of software to meet the needs of cloud users and businesses. Heterogeneous computing power is reflected in the collaboration between underlying network forwarding chips and diverse computing units, such as combinations of Network Processor (NP) + Advanced RISC Machine (ARM), Application Specific Integrated Circuit (ASIC) + ARM, and ASIC + Field Programmable Gate Array (FPGA). Regarding the collaborative cooperation between the underlying network forwarding chip and the computing unit, the industry standard practice is for the underlying network forwarding chip to handle fast forwarding based on hardware flow tables. When a flow miss occurs, the data is sent to the computing unit for processing via an internal channel (i.e., slow path mode), as detailed below:
[0031] First, the computing unit establishes a mapping relationship between the network device ports that handle slow path processing packets, namely the virtualized network interface controller (vNIC) and the network chip device ports (ingress / egress ports). Then, when a flow miss occurs in the resource flow table of the ternary content-addressable memory (TCAM) / static random access memory (SRAM) in the network chip, it is sent to the computing unit (taking an ARM processor as an example) through the internal high-speed serial computer extension bus (Peripheral Component Interconnect express, PCIe) interface or direct connection channel. The ARM processor deploys software forwarding services for flow processing. Finally, after the computing unit completes its processing, it re-enters the data packet into the network chip for network processing, and simultaneously refreshes the resource flow table content in the network chip's TCAM / SRAM according to the policy.
[0032] However, current slow path methods have some technical problems. Based on this, this application provides a message processing system, which includes a network programmable unit and a computing unit. The network programmable unit is used to acquire an initial message and initial metadata, encapsulate the initial message and initial metadata to generate a first message, and send the first message to the computing unit. The computing unit is used to parse the first message, extract the initial metadata, generate target metadata carrying sending port information based on the initial metadata, encapsulate the initial message and target metadata to generate a second message, and send the second message to the network programmable unit. The network programmable unit is also used to forward the initial message based on the sending port information carried in the second message. In this way, because the network programmable unit (NPTU) can customize the metadata structure and message encapsulation logic, it can encapsulate the initial metadata and initial message to generate a first message and send it to the computing unit. Then, the computing unit, which has metadata recognition capabilities, performs metadata parsing on the first message to obtain the initial metadata, and then generates target metadata carrying the sending port information. This target metadata is then encapsulated with the initial message, and the generated second message is sent to the NTU. The NTU can then forward the initial message based on the sending port information. This also eliminates the need for the computing unit to maintain a mapping relationship with the network programmable chip's device port, resulting in high flexibility. Furthermore, the message and metadata encapsulation process is unaffected by upper-layer services, reducing business complexity and improving device performance.
[0033] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0034] In one embodiment of this application, see [link to embodiment]. Figure 1 This illustrates a schematic diagram of the composition structure of a message processing system provided in an embodiment of this application. Figure 1 As shown, the message processing system 10 may include a network programmable unit 101 and a computing unit 102.
[0035] It should be noted that this application provides a message processing system that can be installed in an electronic device. Here, the electronic device can be such as a computer, smartphone, tablet computer, laptop computer, PDA, navigation device, wearable device, server, etc.; the server can be a standalone server or a server cluster composed of multiple servers, and this application does not specifically limit this.
[0036] It should also be noted that, in this embodiment, the network programmable unit 101 can be integrated into a network programmable chip. The network programmable chip is a logic-programmable chip that uses a programmable memory to store instructions for performing logical operations, sequential operations, timing, counting, and arithmetic operations. In this way, the network programmable chip serves as the hardware component, and the computing unit serves as the software implementation component, thereby realizing a hardware-software integrated message processing method, specifically a method for slow-path message processing using heterogeneous computing power in a hardware-software integrated device.
[0037] Furthermore, for the message processing system 10, in some embodiments, wherein:
[0038] The network programmable unit 101 is used to acquire the initial message and initial metadata, encapsulate the initial message and initial metadata, generate the first message, and send the first message to the computing unit.
[0039] The calculation unit 102 is used to parse and process the first message, extract the initial metadata, generate target metadata carrying the sending port information based on the initial metadata, encapsulate the initial message and the target metadata, generate the second message, and send the second message to the network programmable unit.
[0040] The network programmable unit 101 is also used to forward the initial message based on the sending port information carried in the second message.
[0041] In this embodiment, the initial metadata of the initial message is first extracted by the network programmable unit 101. Then, the initial message and the initial metadata are combined, encapsulated, or assembled using logic processing before being sent to the computing unit 102. Because the network programmable unit 101 can be integrated into a network programmable chip, the cooperation between the network programmable chip and the computing unit 102, leveraging the high forwarding capability of hardware and the high flexibility of software, enables a hardware-software integration that meets the needs of cloud users and services.
[0042] Furthermore, in some embodiments, the initial message here can be a miss message.
[0043] It should be noted that, in this embodiment of the application, by parsing and extracting keywords from the message, such as extracting the message's five-tuple, which may include: the message's source IP address, source port, destination IP address, destination port, and transport layer protocol, it is then determined whether there is a forwarding table entry in the flow table information that corresponds to the five-tuple; if there is a forwarding table entry in the flow table information that corresponds to the message's five-tuple, it indicates that the message has been hit, and the five-tuple of the hit forwarding table entry is the same as the message's five-tuple; if there is no forwarding table entry in the flow table information that is the same as the message's five-tuple, it is determined that the message has not been hit.
[0044] Understandably, the embodiments of this application mainly involve processing messages that have experienced a flow miss in the network programmable chip.
[0045] Furthermore, in some embodiments, the network programmable unit 101 is specifically used to extract metadata from the initial message to obtain initial metadata.
[0046] It should be noted that, in the embodiments of this application, initial metadata refers to data that is not the initial message itself, that is, information that the network programmable chip needs to add, such as ingress port, egress port, timestamp, etc., which is not specifically limited here.
[0047] It should also be noted that, in the embodiments of this application, the logic processing of combining and encapsulating the initial message and the initial metadata is to concatenate the initial message and the initial metadata with a "+" sign, and integrate the data together to generate the first message; wherein, the format of the first message is metadata+Flow Miss Packet.
[0048] It should also be noted that, in this embodiment of the application, after generating the first message, the network programmable unit 101 needs to send the first message to the computing unit 102. The network programmable unit 101 can send the first message to the computing unit 102 through the internal PCIe interface or the direct connection channel, which is not specifically limited here.
[0049] It should also be noted that, in this embodiment of the application, the computing unit 102 first extracts the initial metadata from the first message sent by the network programmable unit 101, then adds the sending port information of the initial message to the initial metadata to generate target metadata, and then encapsulates the initial message and the target metadata to generate a second message and sends it to the network programmable unit 101.
[0050] Furthermore, in some embodiments, the computing unit 102 includes a Data Plane Development Kit (DPDK) driver module, and the data packet structure corresponding to the DPDK driver module includes metadata fields; wherein:
[0051] The DPDK driver module is used to parse and process the metadata of the first message, obtain the initial metadata, and store the initial metadata in the metadata field of the data message structure.
[0052] It should be noted that, in the embodiments of this application, the DPDK driver mainly runs on the Linux system and is a collection of function libraries and drivers for fast packet processing, which can greatly improve data processing performance and throughput, and improve the working efficiency of data plane applications.
[0053] It should be noted that the original DPDK driver cannot parse metadata. Therefore, in this embodiment, the DPDK driver's message receiving service logic is modified, and metadata parsing logic is added to the DPDK driver so that it can parse and process the metadata of the first message to obtain the initial metadata.
[0054] It should also be noted that, in this embodiment of the application, the data packet structure corresponding to the DPDK driver module is rte_mbuf, and the metadata field in the data packet structure is rte_mbuf->metadata.
[0055] Furthermore, in some embodiments, the data packet structure also includes an external interface field; wherein:
[0056] The DPDK driver module is also used to determine the sending port information of the initial message and to set the sending port information into the external interface field in the data packet structure.
[0057] It should be noted that, in the embodiments of this application, the sending port information of the initial message is the port value, which can be 1, 2, 3, 4, 5, etc. Different port values correspond to different network interfaces, and no specific limitation is made here.
[0058] It should be noted that, in this embodiment of the application, the external interface field in the data packet structure is rte_mbuf->metadata.egress_port.
[0059] It should also be noted that the original message sending logic sends the message to port ${port} and sends the message through the port sending queue; however, in this embodiment, by modifying the implementation of the OUTPUT keyword in the OpenFlow flow table of the Open vSwitch (OVS), the OUTPUT: ${port} logic is modified to set ${port} in the external interface field rte_mbuf->metadata.egress_port in the data packet structure, thereby fixing the network interface selected by OUTPUT to a single network interface, namely the interconnection interface between the computing unit 102 and the network programmable chip 104, and then sending the message out from the corresponding network interface according to the port value.
[0060] It should also be noted that, in this embodiment of the application, OVS is a virtual switch implemented using open source software, which supports multiple standard interfaces and protocols, supports a distributed environment of multiple physical servers, provides support for the OpenFlow protocol, and can be integrated with many open source virtualization platforms.
[0061] It should also be noted that, in this embodiment of the application, after receiving the second message sent by the computing unit 102, the network programmable unit 101 obtains the sending port information from the second message, and then forwards the initial message according to the sending port information.
[0062] Furthermore, in some embodiments, the network programmable unit 101 is specifically used to extract target metadata from the second message and obtain sending port information from the target metadata in order to forward the initial message through the sending port information.
[0063] It should be noted that, in this embodiment of the application, the logic code of the network programmable unit 101 can be modified to enable it to extract target metadata from the second message.
[0064] In some embodiments, Figure 1 Based on the message processing system 10 shown, see... Figure 2 The message processing system 10 may further include a management unit 103; wherein:
[0065] The calculation unit 102 is also configured to determine the flow table information corresponding to the initial message after sending the second message to the network programmable unit 101, and send the flow table information to the management unit 103;
[0066] The management unit 103 is used to perform update operations on the hardware flow table in the network programmable unit based on the received flow table information.
[0067] It should be noted that, in this embodiment of the application, after the first message is sent to the computing unit 102, it will be processed in two ways. On the one hand, after the computing unit 102 processes the first message to generate the second message, it sends the second message to the network programmable unit 101. On the other hand, it sends the flow table information corresponding to the initial message to the management unit 103, and then the management unit 103 sets the flow table information corresponding to the initial message into the hardware flow table in the network programmable unit.
[0068] It should be noted that, in this embodiment of the application, the flow table information corresponding to the initial message is the flow table information that matches the initial message.
[0069] It should also be noted that, in this embodiment of the application, the calculation unit 102 sends the flow table information to the flow table management unit in the management unit 103, and the flow table management unit sends the flow table information to the hardware flow table in the network programmable unit according to the hardware fast path flow table refresh strategy.
[0070] Furthermore, in some embodiments, the management unit 103 is specifically used to send flow table information and update instructions to the network programmable unit 101;
[0071] The network programmable unit 101 is specifically used to update the flow table information to the hardware flow table of the network programmable unit according to the update instruction.
[0072] It should be noted that, in the embodiments of this application, updating the flow table information to the hardware flow table of the network programmable unit means writing the matched flow table information into the hardware flow table.
[0073] This application provides a message processing system, which includes a network programmable unit and a computing unit. The network programmable unit is used to acquire an initial message and initial metadata, encapsulate the initial message and initial metadata to generate a first message, and send the first message to the computing unit. The computing unit is used to parse the first message, extract the initial metadata, generate target metadata carrying sending port information based on the initial metadata, encapsulate the initial message and target metadata to generate a second message, and send the second message to the network programmable unit. The network programmable unit is also used to forward the initial message based on the sending port information carried in the second message. The system also includes a management unit used to perform update operations on the hardware flow table in the network programmable unit. In this way, because the network programmable unit (NPTU) can customize the metadata structure and message encapsulation logic, it can encapsulate the initial metadata and initial message to generate a first message and send it to the computing unit. Then, the computing unit, which has metadata recognition capabilities, performs metadata parsing on the first message to obtain the initial metadata, and then generates target metadata carrying the sending port information. This target metadata is then encapsulated with the initial message, and the generated second message is sent to the NTU. The NTU can then forward the initial message based on the sending port information. This also eliminates the need for the computing unit to maintain a mapping relationship with the network programmable chip's device port, resulting in high flexibility. Furthermore, the message and metadata encapsulation process is unaffected by upper-layer services, reducing service complexity and improving device performance. Additionally, the network programmable chip receives hardware flow table update instructions from the management unit, improving the hit rate of subsequent messages.
[0074] In another embodiment of this application, see Figure 3This illustrates a flowchart of a message processing method provided in an embodiment of this application. Figure 3 As shown, the method may include:
[0075] S301. Obtain the initial message and initial metadata through the network programmable unit, encapsulate the initial message and initial metadata to generate the first message, and send the first message to the computing unit.
[0076] It should be noted that this application provides a message processing method, specifically a method for processing slow-path messages using heterogeneous computing power in a hardware-software integrated device. This method can be applied to the message processing system described in the foregoing embodiments, or to an electronic device integrating the message processing system. The electronic device can be, for example, a computer, smartphone, tablet computer, laptop computer, PDA, navigation device, wearable device, etc.; the server can be a standalone server or a server cluster composed of multiple servers, and this application does not specifically limit the scope of the application.
[0077] In some embodiments, the initial message here can be a miss message.
[0078] It should be noted that, in this embodiment of the application, by parsing and extracting keywords from the message, such as extracting the message's five-tuple, which may include: the message's source IP address, source port, destination IP address, destination port, and transport layer protocol, it is then determined whether there is a forwarding table entry in the flow table information that corresponds to the five-tuple; if there is a forwarding table entry in the flow table information that corresponds to the message's five-tuple, it indicates that the message has been hit, and the five-tuple of the hit forwarding table entry is the same as the message's five-tuple; if there is no forwarding table entry in the flow table information that is the same as the message's five-tuple, it is determined that the message has not been hit.
[0079] Understandably, the embodiments of this application mainly involve processing messages that have experienced a flow miss in the network programmable chip.
[0080] In some embodiments, obtaining the initial message and initial metadata through the network programmable unit may include:
[0081] The initial metadata is extracted from the initial message by the network programmable unit to determine the initial metadata.
[0082] It should be noted that, in the embodiments of this application, initial metadata refers to data that is not the initial message itself, that is, information that the network programmable chip needs to add, such as ingress port, egress port, timestamp, etc., which is not specifically limited here.
[0083] It should also be noted that, in the embodiments of this application, the logic processing of combining and encapsulating the initial message and the initial metadata is to concatenate the initial message and the initial metadata with a "+" sign, and integrate the data together to generate the first message; wherein, the format of the first message is metadata+Flow Miss Packet.
[0084] S302. The first message is parsed and processed by the computing unit to extract the initial metadata; the target metadata carrying the sending port information is generated based on the initial metadata; the initial message and the target metadata are encapsulated and processed to generate the second message; and the second message is sent to the network programmable unit.
[0085] In some embodiments, the computing unit includes a DPDK driver module, and the data packet structure corresponding to the DPDK driver module includes metadata fields.
[0086] It should be noted that the original DPDK driver cannot parse metadata. Therefore, in this embodiment, the DPDK driver's message receiving service logic is modified, and metadata parsing logic is added to the DPDK driver so that it can parse and process the metadata of the first message to obtain the initial metadata.
[0087] Accordingly, the first message is parsed and processed by the computing unit to extract initial metadata, which may include:
[0088] The DPDK driver module parses and processes the metadata of the first message to obtain the initial metadata, and stores the initial metadata in the metadata field of the data message structure.
[0089] It should be noted that, in this embodiment of the application, the data packet structure corresponding to the DPDK driver module is rte_mbuf, and the metadata field in the data packet structure is rte_mbuf->metadata.
[0090] In some embodiments, the data packet structure may further include an external interface field. Accordingly, generating target metadata carrying sending port information based on the initial metadata may include:
[0091] The DPDK driver module determines the initial packet's sending port information and sets the sending port information into the external interface field of the data packet structure.
[0092] It should be noted that, in the embodiments of this application, the sending port information of the initial message is the port value, which can be 1, 2, 3, 4, 5, etc. Different port values correspond to different network interfaces, and no specific limitation is made here.
[0093] It should also be noted that, in this embodiment of the application, the external interface field in the data packet structure is rte_mbuf->metadata.egress_port.
[0094] It should also be noted that the original message sending logic sends the message to port ${port} and sends the message through the port sending queue; however, in this embodiment, by modifying the implementation of the OUTPUT keyword in the OVS OpenFlow flow table, the OUTPUT: ${port} logic is modified to set ${port} in the external interface field rte_mbuf->metadata.egress_port in the data packet structure, thereby fixing the network interface selected by OUTPUT to a single network interface, namely the communication interface between the computing unit and the network programmable chip, and then sending the message out from the corresponding network interface according to the port value.
[0095] S303. Based on the sending port information carried in the second message, the initial message is forwarded through the network programmable unit.
[0096] In some embodiments, forwarding the initial message through a network programmable unit based on the sending port information carried in the second message may include:
[0097] The network programmable unit extracts target metadata from the second message and obtains sending port information from the target metadata in order to forward the initial message using the sending port information.
[0098] It should be noted that, in the embodiments of this application, the logic code of the network programmable unit can be modified to enable it to extract target metadata from the second message.
[0099] In some embodiments, after the computing unit sends the second message to the network programmable unit, the method may further include:
[0100] The calculation unit determines the flow table information corresponding to the initial message and sends the flow table information to the management unit.
[0101] Based on the received flow table information, the management unit performs an update operation on the hardware flow table in the network programmable unit.
[0102] It should be noted that, in this embodiment of the application, the flow table information corresponding to the initial message is the flow table information that matches the initial message.
[0103] It should also be noted that, in the embodiments of this application, the calculation unit sends the flow table information to the flow table management unit in the management unit, and the flow table management unit sends the flow table information to the hardware flow table in the network programmable unit according to the hardware fast path flow table refresh strategy.
[0104] In some embodiments, performing an update operation on the hardware flow table in the network programmable unit through the management unit based on the received flow table information may include:
[0105] The management unit sends flow table information and update instructions to the network programmable unit.
[0106] According to the update instruction, the network programmable unit updates the flow table information into the hardware flow table of the network programmable unit.
[0107] It should be noted that, in the embodiments of this application, updating the flow table information to the hardware flow table of the network programmable unit means writing the matched flow table information into the hardware flow table.
[0108] This application provides a message processing method, which involves obtaining an initial message and initial metadata through a network programmable unit, encapsulating the initial message and initial metadata to generate a first message, and sending the first message to a computing unit; parsing the first message through the computing unit to extract the initial metadata; generating target metadata carrying sending port information based on the initial metadata, encapsulating the initial message and target metadata to generate a second message, and sending the second message to the network programmable unit; and forwarding the initial message through the network programmable unit based on the sending port information carried in the second message. In this way, because the network programmable unit (NPTU) can customize the metadata structure and message encapsulation logic, it can encapsulate the initial metadata and initial message to generate a first message and send it to the computing unit. Then, the computing unit, which has metadata recognition capabilities, performs metadata parsing on the first message to obtain the initial metadata, and then generates target metadata carrying the sending port information. This target metadata is then encapsulated with the initial message, and the generated second message is sent to the NTU. The NTU can then forward the initial message based on the sending port information. This also eliminates the need for the computing unit to maintain a mapping relationship with the network programmable chip's device port, resulting in high flexibility. Furthermore, the message and metadata encapsulation process is unaffected by upper-layer services, reducing service complexity and improving device performance. Additionally, the network programmable chip receives hardware flow table update instructions from the management unit, improving the hit rate of subsequent messages.
[0109] In another embodiment of this application, based on the message processing system 10 described in the foregoing embodiments, this embodiment specifically provides a method for slow path message processing of heterogeneous computing power in a hardware-software integrated device. This application fully utilizes the programmability of DPDK, OVS, and network programmable chips, so that the computing unit no longer maintains the device port mapping relationship with the network programmable chip. First, with the programmability of the network programmable chip, the initial metadata and the initial message are encapsulated and sent to the computing unit through a direct connection channel; then, the DPDK network card driver's message receiving service logic is modified to extract the initial metadata from the message sent by the network programmable chip and store it in the DPDK message structure rte_mbuf; then, the sending logic of OUTPUT after the OVS flow table hit (OUTPUT: 1, representing sending from port 1) is modified to fill the sending port into the expanded Egress port in rte_mbuf, and the second message is sent down through the direct connection channel between the computing unit and the network programmable chip; finally, with the programmability of the network programmable chip, the sending port information is read from the target metadata and forwarded by the network programmable chip.
[0110] For example, see Figure 4 This illustrates a detailed structural diagram of a message processing system provided in an embodiment of this application. For example... Figure 4 As shown, the message processing system 10 may include a network programmable chip 401, a computing unit 402, and a management unit 403. The network programmable chip 401 may include a metadata processing module and a hardware flow table module; the computing unit 402 may include a flow table query module, a service processing module, and a message sending / receiving module; the management unit 403 may include a controller module, a flow table management module, a status detection module, a data synchronization module, a timer module, and an operation and maintenance monitoring module. The network programmable unit 101 described in the aforementioned embodiment is integrated into the network programmable chip 401.
[0111] When a message miss occurs, the network programmable chip 401 processes the initial metadata through the metadata processing module and generates a first message, which is then sent to the computing unit 402. After processing, the computing unit 402 generates a second message and sends it to the network programmable chip 401, thus executing... Figure 4 The process is shown in bold solid lines. After the computing unit 402 sends the second message to the network programmable chip 401, it also sends the flow table information matching the initial message to the management unit 403. The management unit 403 writes the matching flow table information into the hardware flow table module in the network programmable chip 401 based on the received flow table information, that is, it executes... Figure 4 The process is shown by the bold dashed line. When the matched flow table information is written into the hardware flow table module in the network programmable chip 401, if the same message needs to be processed again, the message matching processing step is executed directly, i.e., the process is executed. Figure 4 The process is shown by the dotted lines in the diagram.
[0112] In one specific embodiment, combined with Figure 4 The message processing system described in the foregoing embodiments may specifically include the following structural components:
[0113] (1) The network programmable chip 401 performs packet parsing (i.e., metadata extraction), hardware flow table resource operations (TCAM / SRAM resource table query, update, clear, etc.) by programming the chip, and sends the Flow Miss message (missed message, i.e. the initial message) and initial metadata to the computing unit 402 in the management unit (MGT Unit) of the network programmable chip 401.
[0114] (2) The computing unit 402 processes the first message sent by the network programmable chip 401. DPDK and OVS are introduced to improve network transmission and reception performance and the flexibility of service forwarding processing. The DPDK driver adds the function of recognizing metadata.
[0115] (3) The OVS in the computing unit 402 performs detailed processing of the first message and sends the processed message (i.e., the second message) to the network programmable chip 401 through a direct connection channel with the network programmable chip 401. It also sends the precise flow table entry of the Flow Hit (i.e., the flow table information corresponding to the initial message) to the flow table management module of the management unit 403 (the data in the flow table management module is completely consistent with the content of the hardware flow table module in the network programmable chip 401, mainly implementing functions such as hardware flow table timeout aging and table dimension data cleaning). The flow table management module sends the precise flow table entry to the hardware flow table module of the network programmable chip 401 according to the hardware fast path flow table refresh strategy. The flow table content in the computing unit 402 comes from the controller module in the management unit 403.
[0116] (4) The network programmable chip 401 forwards the initial message according to the target metadata content and receives the hardware flow table update instruction from the management unit 403 to improve the hit rate of subsequent messages.
[0117] For example, see Figure 5 This illustrates a flowchart of another message processing method provided in an embodiment of this application. Figure 5As shown, when the initial packet misses, the network programmable chip first performs an ingress parser on the initial packet to extract the initial metadata. Then, the management unit (MGT Unit) of the network programmable chip encapsulates the initial packet (i.e., initial data, raw data) and the initial metadata to generate the first packet, which is then sent to the computing unit via the PCIe interface (i.e., up call packet). The computing unit's DPDK module then parses the first packet to obtain the initial metadata and stores it in the metadata field rte_mbuf->metadata in the data packet structure. Finally, the OVS is modified... The implementation of the OUTPUT keyword in the OpenFlow flow table sets the sending port information of the initial packet into the external interface field rte_mbuf->metadata.egress_port in the data packet structure to obtain the target metadata carrying the sending port information. It also modifies the DPDK driver layer data sending logic to combine and encapsulate the target metadata with the initial packet to generate a second packet and send it to the network programmable chip. Finally, after receiving the second packet, the management unit of the network programmable chip forwards the initial packet according to the sending port information. In a specific embodiment, the packet processing method described in the foregoing embodiments may include the following steps:
[0118] Step 1: The network programmable chip combines the flow miss packet (i.e., the initial packet) and the initial metadata (defined by the interface and data in the network programmable chip logic, including ingress_port, egress_port, timestamp, mac, ip, port, etc.) into a new packet (i.e., the first packet) (format: metadata + flow miss packet), and sends it to the computing unit through the internal direct connection channel (or PCIe interface).
[0119] Step 2: The computing unit (slow path) uses DPDK-OVS to implement data transmission and reception and service processing. The DPDK driver layer adds Ethernet data parsing logic to store the first fixed bytes of the data sent by the network programmable chip, i.e., the initial metadata, in rte_mbuf->metadata (rte_mbuf is the data packet structure in DPDK, and the initial metadata is amplified in the data packet structure, wherein the definition of the initial metadata is consistent with that in the network programmable chip).
[0120] Step 3: The DPDK-OVS user-space polling mechanism driver (PMD), which is the OVS business processing logic, performs table queries and processing according to the established functions. It also modifies the implementation of the OUTPUT keyword in the OVS OpenFlow flow table, changing OUTPUT: ${port} (Note: the original OVS logic sent the packet to port ${port} and sent it through the port's sending queue) to setting ${port} to rte_mbuf->metadata.egress_port. Furthermore, it modifies the DPDK driver layer's data sending logic, combining and encapsulating the target metadata in rte_mbuf with the original packet (Flow Miss data packet, i.e., the initial packet) (format: metadata+FlowMiss Packet). Simultaneously, it specifies the netdev corresponding to ${port} as the Ethernet device that directly connects the computing unit and the network programmable chip, enabling data re-entry into the network programmable chip.
[0121] It should be noted that in the embodiments of this application, ${port} refers to the logical code in OVS, and netdev refers to the physical port in the network programmable chip.
[0122] Step 4: After receiving the second message, the MGT Unit (control message upload to the computing unit) in the network programmable chip retrieves the target metadata of fixed byte length and sends the initial message according to the port value in metadata.egress_port.
[0123] Step 5: After the computing unit sends the second message to the network programmable chip, it sends the flow table (slow path) entries hit in the computing unit to the management unit through the Ethernet port. The flow table management module in the management unit then performs the update operation on the hardware flow table.
[0124] This embodiment provides a message processing method. The specific implementation of the aforementioned embodiments is described in detail below. As can be seen, according to the technical solution of the aforementioned embodiments, firstly, the initial metadata of the message is extracted by the network programmable chip, and the initial metadata and the initial message are encapsulated and sent to the computing unit. Then, leveraging the high-performance packet sending and receiving characteristics of DPDK, the DPDK driver is enhanced to parse the initial metadata, and the initial metadata is stored in rte_mbuf for use throughout the message's lifecycle. (The entire lifecycle refers to the process from when the message is received by the network card driver to when it leaves the network card's sending queue). Next, by modifying the OUTPUT specific action in the OVS forwarding logic (in OVS, OUTPUT:${port} forwards the message to the device corresponding to ${port} for transmission), the sending action is replaced by setting the egress_port in the target metadata. Finally, the network programmable chip forwards data according to the egress_port in the custom target metadata. In this way, on the one hand, this application is highly flexible. The computing unit does not need to maintain the mapping relationship with the network programmable chip device port. The controller of the management unit senses the port status of the network programmable chip and synchronizes it to the computing unit in the form of flow table. On the other hand, this application reduces the complexity of services. The network programmable chip has a custom metadata structure and message encapsulation logic, which is adapted through the computing unit driver layer. At the same time, the setting of egress_port also occurs at the driver level (the port sending behavior corresponding to OVS OUTPUT), so that it is unaware of the upper layer services. At the same time, the complexity of service implementation is low and no vendor SDK adaptation is required.
[0125] In another embodiment of this application, for the message processing system 10 described in the foregoing embodiments, the term "unit" can refer to a portion of circuitry, a portion of processor, a portion of program or software, etc., or it can be a module, or it can be non-modular. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional module.
[0126] If the integrated unit is implemented as a software functional module and not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0127] Therefore, embodiments of this application provide a computer storage medium storing a computer program that, when executed by at least one processor, implements the steps of any of the message processing methods described in the foregoing embodiments.
[0128] In another embodiment of this application, based on the composition of the aforementioned message processing system 10 and the computer storage medium, see [link to relevant documentation]. Figure 6 This illustrates a schematic diagram of the structural composition of an electronic device 60 provided in an embodiment of this application. For example... Figure 6 As shown, electronic device 60 may include: a communication interface 601, a memory 602, and a processor 603; the various components are coupled together via a bus system 604. It is understood that the bus system 604 is used to implement communication between these components. In addition to a data bus, the bus system 604 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 6 The various buses are all labeled as bus system 604. Among them, communication interface 601 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
[0129] Memory 602 is used to store computer programs that can run on processor 603;
[0130] Processor 603, when running the computer program, performs the following:
[0131] The network programmable unit obtains the initial message and initial metadata, encapsulates and processes the initial message and initial metadata, generates the first message, and sends the first message to the computing unit.
[0132] The computing unit parses and processes the first message to extract initial metadata; it generates target metadata carrying sending port information based on the initial metadata, encapsulates the initial message and target metadata to generate a second message, and sends the second message to the network programmable unit.
[0133] Based on the sending port information carried in the second message, the initial message is forwarded through the network programmable unit.
[0134] It is understood that the memory 602 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate Synchronous DRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 602 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0135] The processor 603 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 603 or by instructions in software form. The processor 603 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 602, and the processor 603 reads the information in memory 602 and, in conjunction with its hardware, completes the steps of the above method.
[0136] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.
[0137] For software implementation, the techniques described herein can be achieved through modules (e.g., procedures, functions, etc.) that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented within the processor or externally.
[0138] Alternatively, as another embodiment, the processor 603 is also configured to perform the method described in any of the foregoing embodiments when running the computer program.
[0139] In another embodiment of this application, see [link to application]. Figure 7 This illustrates a schematic diagram of the composition structure of another electronic device 60 provided in an embodiment of this application. For example... Figure 7 As shown, the electronic device 60 includes at least the message processing system 10 described in any of the foregoing embodiments.
[0140] In this embodiment of the application, for the electronic device 60, the computing unit does not need to maintain the mapping relationship with the network programmable chip device port. At the same time, the network programmable chip can customize the metadata structure and message encapsulation logic. Moreover, the message and metadata encapsulation is not affected by the upper layer business, thereby reducing business complexity and improving device performance.
[0141] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application.
[0142] It should be noted that, in this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0143] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0144] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0145] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0146] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0147] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A message processing system, characterized in that, The message processing system includes a network programmable unit and a computing unit, wherein: The network programmable unit is used to acquire an initial message and initial metadata, encapsulate the initial message and initial metadata to generate a first message, and send the first message to the computing unit; The computing unit is configured to parse the first message, extract the initial metadata, generate target metadata carrying sending port information based on the initial metadata, encapsulate the initial message and the target metadata to generate a second message, and send the second message to the network programmable unit. The network programmable unit is further configured to forward the initial message based on the sending port information carried in the second message; The computing unit includes a DPDK driver module, and the data packet structure corresponding to the DPDK driver module includes an external interface field; wherein: The DPDK driver module is used to determine the sending port information of the initial message and set the sending port information into the external interface field of the data packet structure.
2. The message processing system according to claim 1, characterized in that, The network programmable unit is specifically used to extract metadata from the initial message to obtain the initial metadata.
3. The message processing system according to claim 1, characterized in that, The data message structure also includes metadata fields; wherein: The DPDK driver module is further configured to perform metadata parsing on the first message to obtain the initial metadata, and store the initial metadata in the metadata field of the data message structure.
4. The message processing system according to claim 1, characterized in that, The network programmable unit is specifically used to extract the target metadata from the second message and obtain the sending port information from the target metadata, so as to forward the initial message through the sending port information.
5. The message processing system according to claim 1, characterized in that, The message processing system further includes a management unit; wherein: The computing unit is further configured to, after sending the second message to the network programmable unit, determine the flow table information corresponding to the initial message, and send the flow table information to the management unit; The management unit is configured to perform an update operation on the hardware flow table in the network programmable unit based on the received flow table information.
6. The message processing system according to claim 5, characterized in that, The management unit is specifically used to send the flow table information and update instructions to the network programmable unit; The network programmable unit is specifically used to update the flow table information into the hardware flow table of the network programmable unit according to the update instruction.
7. A message processing method, characterized in that, The method includes: The network programmable unit obtains the initial message and initial metadata, encapsulates the initial message and initial metadata, generates a first message, and sends the first message to the computing unit. The computing unit parses the first message to extract the initial metadata; generates target metadata carrying sending port information based on the initial metadata; encapsulates the initial message and the target metadata to generate a second message; and sends the second message to the network programmable unit. Based on the sending port information carried in the second message, the initial message is forwarded through the network programmable unit; The computing unit includes a DPDK driver module, and the data packet structure corresponding to the DPDK driver module includes an external interface field; correspondingly, the step of generating target metadata carrying sending port information based on the initial metadata includes: The DPDK driver module determines the sending port information of the initial message and sets the sending port information into the external interface field of the data packet structure.
8. An electronic device, characterized in that, The electronic device includes a memory and a processor, wherein: The memory is used to store computer programs that can run on the processor; The processor is configured to perform the method as described in claim 7 when running the computer program.
9. A computer storage medium, characterized in that, The computer storage medium stores a computer program that, when executed by at least one processor, implements the method as described in claim 7.
Citation Information
Patent Citations
Method and system for expanding plurality of internet accesses of embedded system
CN112437028A
Message forwarding method, terminal equipment and computer storage medium
CN112787937A
Data packet processing method and device, data packet forwarding method and device, integrated chip, switch and system
CN113132240A