Flow table aging method, system and device based on DPU (Data Processing Unit) and CPU (Central Processing Unit)
By introducing a flow table aging module and a flow ID mapping table between the CPU controller and the DPU controller, the flow table aging decision is decentralized, which solves the problems of wasted CPU computing power and slow aging speed, and improves the efficiency of flow table aging.
Patent Information
- Application Number
- CN202310536793.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-10
- Publication Date
- 2024-11-12
AI Technical Summary
In existing technologies, the DPU flow table aging scheme results in wasted CPU computing power and slow aging speed, which cannot meet the application scenarios requiring rapid aging.
By introducing a flow table aging message receiving module, a flow table aging control module, and a flow table aging decision module into the CPU controller, and combining the periodic scanning of the DPU controller and the flow ID mapping table, the flow table aging decision is decentralized, reducing the mechanical scanning work of the CPU.
It effectively saves CPU computing resources, improves the aging performance of flow tables, and ensures efficient and orderly system operation, meeting the needs of rapid aging.
Smart Images

Figure CN118939409A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of DPU processing technology, and in particular to a DPU-based flow table aging method, system, device and CPU processor. Background Art
[0002] As the third chip that has appeared in recent years (CPU and GPU are the first two chips), DPU is becoming the hottest and fastest-growing field in the industry. In terms of virtualization, network, storage and security, DPU has its unique advantages. As a chip unit dedicated to processing data, it can offload key network, storage, security and other services from the CPU, greatly releasing CPU computing power, and will play an important role in the future development of networks.
[0003] "Flow" is an important concept for DPU to process data packets. Data packets with certain common characteristics or attributes are abstracted into a flow. In network management, flows can be defined by network administrators, and different policies and actions can be further determined, and sent to DPU in the form of flow tables. With the rapid development of network and security applications, tens of millions of flow tables have become very common. These flow tables are sent to DPU through the CPU controller and written to the external storage of DPU. In order to improve storage utilization, when a flow has no message arriving within a preset time, the flow table corresponding to this flow needs to be aged and deleted. In many application scenarios, whether the flow table is aged needs to be decided by the CPU controller.
[0004] For a flow table with tens of millions of flows, it consumes a lot of resources to scan the hardware flow table (the flow table stored outside the DPU) one by one. Therefore, the current common solution in the industry is that the DPU periodically sends the statistics of packet reception for each flow to the CPU controller, which stores the statistical value of each flow and periodically scans the entire flow table. If the flow table count does not change within a preset time, it is determined that the flow needs to be aged and deleted, such as Figure 1 shown.
[0005] However, the drawback of the above solution is that the CPU needs to periodically scan the entire flow table, but it is idling most of the time, which is a huge waste of CPU computing power. In addition, the flow table ages slowly and cannot meet some application scenarios that require rapid aging. Summary of the invention
[0006] In view of the shortcomings of the prior art described above, the purpose of the present application is to provide a DPU-based flow table aging method, system, device and CPU processor to solve the technical problems that the existing flow table aging causes waste of CPU computing power and slow flow table aging.
[0007] To achieve the above-mentioned purpose and other related purposes, the first aspect of the present application provides a DPU-based flow table aging method, which is applied to a CPU controller; the CPU controller includes a flow table aging message receiving module, a flow table aging control module and a flow table aging decision module; the method includes: the flow table aging message receiving module assigns a corresponding flow ID to each flow table and establishes a flow ID mapping table; the flow table and the flow ID mapping table are sent to the corresponding DPU controller so that the DPU controller can identify the flow table that needs to be aged; the flow table aging message receiving module receives the flow table aging message constructed by the DPU controller, and parses it to obtain the flow ID to be aged; the flow table aging control module of the CPU controller takes out the flow ID and complete flow table information from the chain to be aged and transmits it to the flow table aging decision module; the flow table aging decision module of the CPU controller determines whether to delete the aged flow according to a preset strategy; if it is to be deleted, a deletion operation instruction is sent to the DPU controller.
[0008] In some embodiments of the first aspect of the present application, the way in which the DPU controller determines the flow table that needs to be aged includes: the DPU controller periodically scans the flow table; determines whether each flow in the flow table has a message arrived within a preset aging period; if no message arrives within the preset aging period, determines that the flow is a flow that needs to be aged; otherwise, determines that the flow is a flow that does not need to be aged.
[0009] In some embodiments of the first aspect of the present application, the flow mark aging message constructed by the DPU controller includes a flow ID to be aged, and it packages multiple flow IDs to be aged into one message and sends it to the CPU controller.
[0010] In some embodiments of the first aspect of the present application, after receiving the flow table aging message and parsing to obtain the flow ID to be aged, the CPU controller performs the following steps: determining whether the parsed flow ID to be aged is already in the chain to be aged; if it is already in the chain to be aged, not processing it to avoid repeated addition; if it is not in the chain to be aged, adding it to the tail of the chain to be aged.
[0011] In some embodiments of the first aspect of the present application, before adding the flow ID to be aged to the aging chain, if the aging chain is empty, the flow table aging control module is notified; if the aging chain is not empty, the flow table aging control module is not notified to reduce the number of notifications.
[0012] In some embodiments of the first aspect of the present application, after receiving a notification, the flow table aging control module repeatedly takes out flow IDs from the to-be-aged chain for processing until the to-be-aged chain is empty.
[0013] To achieve the above-mentioned purpose and other related purposes, the second aspect of the present application provides a DPU-based flow table aging system, including a CPU controller and a DPU controller; the CPU controller includes a flow table aging message receiving module, a flow table aging control module and a flow table aging decision module; wherein: the flow table aging message receiving module of the CPU controller assigns a corresponding flow ID to each flow table and establishes a flow ID mapping table; the flow table and the flow ID mapping table are sent to the corresponding DPU controller; the DPU controller identifies the flow table that needs to be aged and constructs a flow table aging message and then sends it to the flow table aging message receiving module of the CPU controller; the flow table aging message receiving module of the CPU controller receives the flow table aging message and parses it to obtain the flow ID to be aged; the flow table aging control module of the CPU controller takes out the flow ID and complete flow table information from the chain to be aged and transmits it to the flow table aging decision module; the flow table aging decision module of the CPU controller determines whether to delete the aged flow according to a preset strategy; if it is to be deleted, a deletion operation instruction is sent to the DPU controller.
[0014] To achieve the above-mentioned purpose and other related purposes, the third aspect of the present application provides a DPU-based flow table aging device, including: a flow table aging message receiving module, which is used to assign a corresponding flow ID to each flow table and establish a flow ID mapping table; the flow table and the flow ID mapping table are sent to the corresponding DPU controller so that the DPU controller can identify the flow table that needs to be aged; and, the flow table aging message constructed by the DPU controller is received, and the flow ID to be aged is obtained by parsing; a flow table aging control module is used to take out the flow ID and complete flow table information from the chain to be aged and transmit them to the flow table aging decision module; the flow table aging decision module determines whether to delete the aged flow according to a preset strategy; if it is to be deleted, a deletion operation instruction is sent to the DPU controller.
[0015] To achieve the above-mentioned purpose and other related purposes, the third aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the DPU-based flow table aging method is implemented.
[0016] To achieve the above-mentioned purpose and other related purposes, the fourth aspect of the present application provides a CPU processor on which a memory is integrated; the memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory so that the terminal executes the DPU-based flow table aging method.
[0017] As described above, the DPU-based flow table aging method, system, device and CPU processor of the present application have the following beneficial effects: In the present invention, the CPU controller sends the flow table and the corresponding flow ID to the DPU controller, the DPU controller periodically scans the flow table, identifies the flow that needs to be aged, packages the flow ID into an aging message and sends it to the CPU, the CPU controller receives the aging message, first caches the flow ID to be aged in the aging chain, and then retrieves the flow ID to be aged from the aging chain by query according to the current processing capacity, and makes a final judgment. Therefore, the present application unloads the mechanical flow table scanning work to the DPU controller, the CPU controller can accurately process the flow table to be aged, and adopts the notification and query method, the CPU controller will not be frequently interrupted, and the entire system operates very efficiently and orderly, thereby greatly saving the CPU computing power resources and improving the flow table aging performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a schematic diagram showing flow table aging in the prior art.
[0019] Figure 2 Shown is a flow chart of a DPU-based flow table aging method in one embodiment of the present application.
[0020] Figure 3 Shown is a schematic diagram of the flow table aging process in one embodiment of the present application.
[0021] Figure 4 Shown is a schematic diagram of a flow table creation process in an embodiment of the present application.
[0022] Figure 5 Shown is a schematic diagram of the flow table aging process in one embodiment of the present application.
[0023] Figure 6 Shown is a structural schematic diagram of a DPU-based flow table aging device in one embodiment of the present application. DETAILED DESCRIPTION
[0024] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0025] It should be noted that in the following description, with reference to the accompanying drawings, several embodiments of the present application are described in the accompanying drawings. It should be understood that other embodiments may also be used, and mechanical composition, structure, electrical and operational changes may be made without departing from the spirit and scope of the present application. The following detailed description should not be considered restrictive, and the scope of the embodiments of the present application is limited only by the claims of the published patents. The terms used here are only for describing specific embodiments and are not intended to limit the present application. Spatially related terms, such as "upper", "lower", "left", "right", "below", "below", "lower", "above", "upper", etc., may be used in the text to facilitate the description of the relationship between an element or feature shown in the figure and another element or feature.
[0026] In this application, unless otherwise clearly specified and limited, the terms "install", "connect", "connect", "fix", "hold" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0027] Furthermore, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless there is an indication to the contrary in the context. It should be further understood that the terms "comprise", "include" indicate the presence of the described features, operations, elements, components, items, kinds, and / or groups, but do not exclude the presence, occurrence or addition of one or more other features, operations, elements, components, items, kinds, and / or groups. The terms "or" and "and / or" used herein are interpreted as inclusive, or mean any one or any combination. Therefore, "A, B or C" or "A, B and / or C" means "any of the following: A; B; C; A and B; A and C; B and C; A, B and C". Exceptions to this definition will only occur when the combination of elements, functions or operations is inherently mutually exclusive in some way.
[0028] In order to solve the problems in the above-mentioned background technology, the present invention provides a DPU-based flow table aging method, device, terminal and medium, which are used to solve the technical problems that the existing flow table aging solution consumes too much CPU computing power and has poor aging performance.
[0029] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the technical solution in the embodiments of the present invention is further described in detail through the following embodiments and in combination with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the invention.
[0030] Before further describing the present invention in detail, the nouns and terms involved in the embodiments of the present invention are explained. The nouns and terms involved in the embodiments of the present invention are applicable to the following interpretations:
[0031] (1) DPU (Data Processing Unit): A distributed processing unit (DPU) is a newly developed category of special-purpose processors. It is another important computing chip in data center scenarios after CPU and GPU, providing a computing engine for high-bandwidth, low-latency, and data-intensive computing scenarios.
[0032] (2) Flow table aging: The timestamp mechanism is used to delete useless flow tables to improve the utilization efficiency of flow table space.
[0033] The embodiments of the present invention provide a flow table aging method based on a DPU, a system for a flow table aging method based on a DPU, and a storage medium storing an executable program for implementing the flow table aging method based on a DPU. As far as the implementation of the flow table aging method based on a DPU is concerned, the embodiments of the present invention will describe an exemplary implementation scenario of the flow table aging based on a DPU.
[0034] like Figure 2 As shown, a flow chart of a DPU-based flow table aging method in an embodiment of the present invention is shown. It should be understood that the DPU-based flow table aging method provided in an embodiment of the present invention is applied to a CPU controller, and the CPU controller is electrically connected to the corresponding DPU controller. In this embodiment, the CPU controller includes a flow table aging message receiving module, a flow table aging control module and a flow table aging decision module. It should be noted that the above modules refer to sub-functional modules of the software running on the CPU, which are similar to components.
[0035] It should be understood that flow table aging uses the timestamp mechanism to delete useless flow tables to improve the utilization efficiency of flow table space; the process of flow table aging is as follows Figure 3 As shown:
[0036] Read the flow table from the address of flow id=1 and extract the timestamp of the flow table, and read the flow table in a loop in sequence.
[0037] Determine whether the current time minus the flow table timestamp exceeds the threshold?
[0038] If the threshold is exceeded, the statistical information is reported to the business software, and the flow table is deleted after the business software issues a command.
[0039] In this embodiment, the DPU-based flow table aging method mainly includes the following steps:
[0040] Step S21: The flow table aging message receiving module allocates a corresponding flow ID to each flow table and establishes a flow ID mapping table; the flow table and the flow ID mapping table are sent to the corresponding DPU controller so that the DPU controller can identify the flow table that needs to be aged.
[0041] Specifically, the CPU controller assigns a flow ID to each flow table and creates a flow ID mapping table, and then sends the flow table and the flow ID mapping table to the DPU controller. The flow ID can be any identifier that can uniquely identify a flow table, usually an integer index.
[0042] In this embodiment, the DPU controller determines the flow table that needs to be aged in the following manner: the DPU controller periodically scans the flow table; determines whether a message arrives for each flow in the flow table within a preset aging period; if no message arrives within the preset aging period, determines that the flow is a flow that needs to be aged; otherwise, determines that the flow is a flow that does not need to be aged.
[0043] Step S22: The flow table aging message receiving module receives the flow table aging message constructed by the DPU controller, and parses it to obtain the ID of the flow to be aged.
[0044] In this embodiment, the flow mark aging message constructed by the DPU controller includes the flow ID to be aged and is sent to the CPU controller. Preferably, multiple flow IDs to be aged are packaged in one message to reduce the number of messages.
[0045] In this embodiment, after receiving the flow table aging message and parsing to obtain the flow ID to be aged, the CPU controller performs the following steps: determining whether the parsed flow ID to be aged is already in the chain to be aged; if it is already in the chain to be aged, not processing it to avoid repeated addition; if it is not in the chain to be aged, adding it to the end of the chain to be aged.
[0046] Furthermore, before adding the flow ID to be aged to the aging chain, if the aging chain is empty, the flow table aging control module is notified; if the aging chain is not empty (that is, other flow IDs to be aged already exist in the aging chain), there is no need to notify the flow table aging control module to reduce the number of notifications.
[0047] In this embodiment, the way in which the flow table aging message receiving module notifies the flow aging control module includes but is not limited to: function call notification, message mechanism notification, shared memory notification, etc.
[0048] Step S23: the flow table aging control module of the CPU controller takes out the flow ID and the complete flow table information from the chain to be aged and transmits them to the flow table aging decision module.
[0049] Preferably, after receiving a notification, the flow table aging control module repeatedly takes out flow IDs from the to-be-aged chain for processing until the to-be-aged chain is empty.
[0050] Step S24: The flow table aging decision module of the CPU controller determines whether to delete the aged flow according to a preset strategy; if it is to be deleted, a deletion operation instruction is sent to the DPU controller.
[0051] As described above, in the DPU-based flow table aging method provided in the embodiment of the present invention, the CPU controller sends the flow table and the corresponding flow ID to the DPU controller. The DPU controller periodically scans the flow table, identifies the flow that needs to be aged, and packages the flow ID into an aging message and sends it to the CPU. The CPU controller receives the aging message, first caches the flow ID to be aged in the aging chain, and then retrieves the flow ID to be aged from the aging chain by querying and acquiring according to the current processing capacity, and makes a final judgment. Therefore, the present application unloads the mechanical flow table scanning work to the DPU controller, and the CPU controller can accurately process the flow table to be aged, and adopts the notification and query method. The CPU controller will not be frequently interrupted, and the operation of the entire system is very efficient and orderly, thereby greatly saving the CPU computing power resources and improving the flow table aging performance. It should be noted that the so-called notification and query method mainly refers to that the DPU driver module notifies the upper-layer APP of the flow table aging event, and the upper-layer APP then queries (or can also be called to obtain) the specific flow table entries to be aged from the DPU driver.
[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0053] like Figure 4 FIG. 1 is a schematic diagram showing a flow table creation process according to an embodiment of the present invention. The flow table creation process is as follows:
[0054] Step 1: The CPU controller assigns a flow ID to each flow table, creates a flow ID mapping table, and sends the flow table and the flow ID mapping table together to the DPU controller.
[0055] Step 2: The DPU controller receives the flow table sent by the CPU controller and creates its own flow table.
[0056] like Figure 5 As shown, a schematic diagram of the flow table aging process in an embodiment of the present invention is shown. The flow table aging process is as follows:
[0057] Step 1: The DPU controller periodically scans the flow table to identify flows to be aged.
[0058] Step 2: The DPU controller packages the ID of the flow to be aged into an aging message and sends it to the CPU controller.
[0059] Step 3: The flow table aging message receiving module of the CPU controller receives the message and adds the flow ID to be aged to the aging chain.
[0060] Step 4: The flow table aging message receiving module notifies the flow aging control module; the notification method can be but not limited to: function call, message mechanism, shared memory and other arbitrary methods.
[0061] Step 5: The flow aging control module takes out the ID of the flow to be aged from the aging chain.
[0062] Step 6: The flow aging control module obtains complete flow table information from the flow ID mapping table according to the flow ID.
[0063] Step 7: The flow aging control module notifies the flow aging decision module of the information of the flow table to be aged; the notification method can be but not limited to: function call, message mechanism, shared memory and other methods.
[0064] Step 8: The flow aging decision module determines whether the flow table needs to be aged according to the preset rules. If aging is required, the DPU deletion operation is issued and the process ends.
[0065] In one embodiment, the present invention further provides a DPU-based flow table aging system, which includes a CPU controller and a DPU controller; the CPU controller includes a flow table aging message receiving module, a flow table aging control module and a flow table aging decision module; wherein:
[0066] The flow table aging message receiving module of the CPU controller assigns a corresponding flow ID to each flow table and establishes a flow ID mapping table; sends the flow table and the flow ID mapping table to the corresponding DPU controller;
[0067] The DPU controller determines the flow table that needs to be aged and constructs a flow table aging message and sends it to the flow table aging message receiving module of the CPU controller;
[0068] The flow table aging message receiving module of the CPU controller receives the flow table aging message and parses it to obtain the flow ID to be aged;
[0069] The flow table aging control module of the CPU controller takes out the flow ID and the complete flow table information from the to-be-aged chain and transmits them to the flow table aging decision module;
[0070] The flow table aging decision module of the CPU controller determines whether to delete the aged flow according to the preset strategy; if it is to be deleted, a deletion operation instruction is sent to the DPU controller.
[0071] It should be noted that the implementation method of the DPU-based flow table aging system provided in the embodiment of the present invention is similar to that of the DPU-based flow table aging method described above, so it will not be repeated here.
[0072] like Figure 6 , which shows a schematic diagram of the structure of a DPU-based flow table aging device in an embodiment of the present invention. In this embodiment, the DPU-based flow table aging device 600 includes a flow table aging message receiving module 601, a flow table aging control module 602 and a flow table aging decision module 603.
[0073] The flow table aging message receiving module 601 is used to assign a corresponding flow ID to each flow table and establish a flow ID mapping table; send the flow table and flow ID mapping table to the corresponding DPU controller so that the DPU controller can identify the flow table that needs to be aged; and receive the flow table aging message constructed by the DPU controller, and parse it to obtain the flow ID to be aged.
[0074] The flow table aging control module 602 is used to take out the flow ID and complete flow table information from the chain to be aged and transmit them to the flow table aging decision module.
[0075] The flow table aging decision module 603 is used to determine whether to delete the aged flow according to a preset strategy; if it is to be deleted, a deletion operation instruction is sent to the DPU controller.
[0076] It should be noted that: the DPU-based flow table aging device provided in the above embodiment only uses the division of the above program modules as an example when performing DPU-based flow table aging. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the DPU-based flow table aging device provided in the above embodiment and the DPU-based flow table aging method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0077] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the DPU-based flow table aging method is implemented.
[0078] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to the computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.
[0079] In the embodiments provided in the present application, the computer readable and writable storage medium may include a read-only memory, a random access memory, an EEPROM, a CD-ROM or other optical disk storage device, a disk storage device or other magnetic storage device, a flash memory, a USB flash drive, a mobile hard disk, or any other medium that can be used to store a desired program code in the form of an instruction or data structure and can be accessed by a computer. In addition, any connection can be appropriately referred to as a computer-readable medium. For example, if the instruction is sent from a website, a server or other remote source using a coaxial cable, an optical fiber cable, a twisted pair, a digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwaves, the coaxial cable, optical fiber cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwaves are included in the definition of the medium. However, it should be understood that computer readable and writable storage media and data storage media do not include connections, carriers, signals, or other temporary media, but are intended to be non-temporary, tangible storage media. Disk and disc, as used in this application, includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers.
[0080] An embodiment of the present invention also provides a CPU processor on which a memory is integrated; the memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory, so that the terminal executes the DPU-based flow table aging method.
[0081] It can be understood that the processor and the memory can be connected via a system bus, and the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.
[0082] It is understood that the memory can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), 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), synchronous static random access memory (SSRAM). The memory described in the embodiments of the present invention is intended to include but is not limited to these and any other suitable categories of memory.
[0083] The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or instructions in the form of software. The above processor may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present invention. A general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the accessory optimization method provided in the embodiment of the present invention, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0084] In summary, the present application provides a flow table aging method, device, terminal and medium based on DPU. The present invention provides a method for improving the efficiency of flow table aging based on DPU. In the present invention, the CPU controller sends the flow table and the corresponding flow ID to the DPU controller. The DPU controller periodically scans the flow table, identifies the flow that needs to be aged, packages the flow ID into an aging message and sends it to the CPU. The CPU controller receives the aging message, first caches the flow ID to be aged in the aging chain, and then retrieves the flow ID to be aged from the aging chain by query according to the current processing capacity, and makes a final judgment. Therefore, the present application unloads the mechanical flow table scanning work to the DPU controller, and the CPU controller can accurately process the flow table to be aged, and adopts the notification and query method. The CPU controller will not be frequently interrupted, and the entire system runs very efficiently and orderly, thereby greatly saving the CPU computing power resources and improving the flow table aging performance. Therefore, the present application effectively overcomes the various shortcomings in the prior art and has a high industrial utilization value.
[0085] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A flow table aging method based on DPU, characterized in that: Applied to a CPU controller; the CPU controller includes a flow table aging message receiving module, a flow table aging control module and a flow table aging decision module; the method includes: The flow table aging message receiving module assigns a corresponding flow ID to each flow table and establishes a flow ID mapping table; sends the flow table and the flow ID mapping table to the corresponding DPU controller so that the DPU controller can identify the flow table that needs to be aged; The flow table aging message receiving module receives the flow table aging message constructed by the DPU controller, and parses it to obtain the ID of the flow to be aged; The flow table aging control module of the CPU controller takes out the flow ID and the complete flow table information from the to-be-aged chain and transmits them to the flow table aging decision module; The flow table aging decision module of the CPU controller determines whether to delete the aged flow according to the preset strategy; if it is to be deleted, a deletion operation instruction is sent to the DPU controller.
2. The DPU-based flow table aging method according to claim 1, characterized in that: The method in which the DPU controller determines the flow table that needs to be aged includes: the DPU controller periodically scans the flow table; determines whether each flow in the flow table has a message arriving within a preset aging period; if no message arrives within the preset aging period, determines that the flow is a flow that needs to be aged; otherwise, determines that the flow is a flow that does not need to be aged.
3. The DPU-based flow table aging method according to claim 1, characterized in that: The flow mark aging message constructed by the DPU controller includes the flow ID to be aged, and it packages multiple flow IDs to be aged into one message and sends it to the CPU controller.
4. The DPU-based flow table aging method according to claim 1, characterized in that: After receiving the flow table aging message and parsing to obtain the flow ID to be aged, the CPU controller executes the following steps: determining whether the parsed flow ID to be aged is already in the chain to be aged; if it is already in the chain to be aged, not processing it to avoid repeated addition; if it is not in the chain to be aged, adding it to the end of the chain to be aged.
5. The DPU-based flow table aging method according to claim 4 is characterized in that: Before adding the to-be-aged flow ID to the to-be-aged chain, if the to-be-aged chain is empty, the flow table aging control module is notified; if the to-be-aged chain is not empty, the flow table aging control module is not notified to reduce the number of notifications.
6. The DPU-based flow table aging method according to claim 1, characterized in that: After receiving a notification, the flow table aging control module repeatedly takes out flow IDs from the to-be-aged chain for processing until the to-be-aged chain is empty.
7. A flow table aging system based on DPU, characterized in that: It includes a CPU controller and a DPU controller; the CPU controller includes a flow table aging message receiving module, a flow table aging control module and a flow table aging decision module; wherein: The flow table aging message receiving module of the CPU controller assigns a corresponding flow ID to each flow table and establishes a flow ID mapping table; sends the flow table and the flow ID mapping table to the corresponding DPU controller; The DPU controller determines the flow table that needs to be aged and constructs a flow table aging message and sends it to the flow table aging message receiving module of the CPU controller; The flow table aging message receiving module of the CPU controller receives the flow table aging message and parses it to obtain the flow ID to be aged; the flow table aging control module of the CPU controller takes out the flow ID and the complete flow table information from the chain to be aged and transmits them to the flow table aging decision module; The flow table aging decision module of the CPU controller determines whether to delete the aged flow according to the preset strategy; if it is to be deleted, a deletion operation instruction is sent to the DPU controller.
8. A flow table aging device based on DPU, characterized in that: include: A flow table aging message receiving module is used to assign a corresponding flow ID to each flow table and establish a flow ID mapping table; send the flow table and the flow ID mapping table to the corresponding DPU controller so that the DPU controller can identify the flow table that needs to be aged; and receive the flow table aging message constructed by the DPU controller, and parse it to obtain the flow ID to be aged; A flow table aging control module, used for taking out the flow ID and complete flow table information from the chain to be aged and transmitting them to the flow table aging decision module; The flow table aging decision module is used to determine whether to delete the aged flow according to the preset strategy; if it is to be deleted, a deletion operation instruction is sent to the DPU controller.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the DPU-based flow table aging method described in any one of claims 1 to 6 is implemented.
10. A CPU processor, characterized in that: A memory is integrated thereon; The memory is used to store computer programs; The CPU processor is used to execute the computer program stored in the memory to perform the DPU-based flow table aging method as described in any one of claims 1 to 6.
