A method, system, apparatus, and readable storage medium for unloading flow tables.

CN115344326BActive Publication Date: 2026-07-03SHENZHEN XINGYUN ZHILIAN TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN XINGYUN ZHILIAN TECH CO LTD
Filing Date
2022-08-18
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

In existing technologies, the cost and power consumption are relatively high when OVS flow tables are offloaded to tcam memory and host memory, making it difficult to meet the needs of high-performance service forwarding.

Method used

By identifying the template type of the target flow table, the target fields are determined using the preset template type-field correspondence, and the target flow table is converted into an exact flow table through field completion, and then unloaded to DDR that does not support masks.

Benefits of technology

It reduces flow table offloading costs and power consumption, improves data forwarding efficiency, and meets the needs of high-performance service forwarding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115344326B_ABST
    Figure CN115344326B_ABST
Patent Text Reader

Abstract

This application discloses a flow table unloading method, system, apparatus, and readable storage medium, relating to the field of computer networks. In this scheme, the template type of the target flow table is identified; the target field is determined based on the identified template type and a preset template type-field correspondence; the target flow table is completed using the target field to obtain a precise target flow table; upon receiving unloading information, the precise target flow table is unloaded into the DDR memory of the target hardware. This application can convert a masked target flow table into a precise target flow table through field completion, thereby enabling the unloading of the target flow table into DDR memory, which does not support masks. Compared to tcam memory and / or host memory, DDR memory has lower cost and power consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer networks, and in particular to a flow table unloading method, system, apparatus, and readable storage medium. Background Technology

[0002] With the development of cloud computing networks, the widespread business demands have led to the rapid growth of data centers and a surge in data traffic. The limitations of using VSwitch (virtual switch) for data forwarding are becoming increasingly apparent, proving inadequate for the ever-increasing business demands. To meet the high-performance business forwarding requirements, dedicated forwarding chips are needed to handle data forwarding services. Offloading data forwarding to hardware using OVS (Open VSwitch) / OVS+DPDK (data plane development kit) is imperative. Since OVS flow tables contain masks, flow tables are typically offloaded to tcam (ternary content addressable memory) memory and / or host memory that support masks. However, tcam memory and / or host memory have significant costs and power consumption. Summary of the Invention

[0003] The purpose of this application is to provide a flow table unloading method, system, device, and readable storage medium, which can convert a target flow table with a mask into a target accurate flow table by field completion, thereby enabling the target flow table to be unloaded to DDR that does not support masks. Compared with tcam memory and / or host memory, DDR has lower cost and power consumption.

[0004] To address the aforementioned technical problems, this application provides a flow table offloading method applied to a processor, comprising:

[0005] Identify the template type of the target flow table;

[0006] The target field is determined based on the identified template type and the preset template type-field correspondence;

[0007] The target flow table is completed using the target field to obtain the target precise flow table;

[0008] Upon receiving the unloading information, the target precise flow table is unloaded into the DDR of the target hardware.

[0009] Preferably, identifying the template type of the target flow table includes:

[0010] Receive a target flow table sent by the target hardware, the target flow table including a source flow table and an extension header, the extension header including the template ID of the target flow table;

[0011] The extended header is parsed to obtain the template ID of the target flow table;

[0012] The template type of the target flow table is determined based on the template ID.

[0013] Preferably, after parsing the extended header to obtain the template ID of the target flow table, the method further includes:

[0014] The template ID is written into the cache module so that the template type of the target flow table can be determined subsequently based on the template ID in the cache module.

[0015] Preferably, the target hardware sends the target flow table, including:

[0016] Receive the source flow table and identify the characteristic information of the source flow table;

[0017] The template ID of the source flow table is determined based on the aforementioned feature information;

[0018] The template ID is encapsulated into the extension header;

[0019] The extended header and the source flow table are sent to the processor as the target flow table.

[0020] Preferably, after determining the template ID of the source flow table based on the feature information, the method further includes:

[0021] Determine whether it is the first time it has received the source flow table corresponding to the template ID;

[0022] If so, proceed to the step of encapsulating the template ID into the extension header;

[0023] If not, the template ID is used as an index to call the exact flow table stored within itself corresponding to the template ID and perform the distribution processing.

[0024] Preferably, determining whether it is the first time it has received the source flow table corresponding to the template ID includes:

[0025] Determine whether there exists an exact flow table corresponding to the template ID based on the template ID and the corresponding relationship between the preset template ID and the exact flow table stored in the template ID;

[0026] If it does not exist, then it is determined that the source flow table corresponding to the template ID has been received for the first time;

[0027] If it exists, it is determined that this is not the first time the source flow table corresponding to the template ID has been received.

[0028] To address the aforementioned technical problems, this application also provides a flow table offloading system applied to a processor, comprising:

[0029] The identification unit is used to identify the template type of the target flow table;

[0030] The field determination unit is used to determine the target field based on the identified template type and the preset template type-field correspondence.

[0031] The completion unit is used to complete the target flow table using the target field to obtain the target accurate flow table;

[0032] The unloading unit is used to unload the target precise flow table into the DDR of the target hardware when receiving unloading information.

[0033] To address the aforementioned technical problems, this application also provides a flow table unloading device, comprising:

[0034] Memory, used to store computer programs;

[0035] A processor is configured to implement the steps of the flow table unloading method described above when storing a computer program.

[0036] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the flow table offloading method described above.

[0037] This application provides a flow table offloading method, relating to the field of computer networks. In this scheme, the template type of the target flow table is identified; the target field is determined based on the identified template type and a preset template type-field correspondence; the target flow table is completed using the target field to obtain a precise target flow table; upon receiving offloading information, the precise target flow table is offloaded to the DDR memory of the target hardware. This application can convert a masked target flow table into a precise target flow table through field completion, thereby enabling the offloading of the target flow table to DDR memory, which does not support masks. Compared to tcam memory and / or host memory, DDR memory has lower cost and power consumption.

[0038] This application also provides a flow table unloading system, apparatus, and readable storage medium, which have the same beneficial effects as the flow table unloading method described above. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the prior art and embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0040] Figure 1 A flowchart illustrating a flow table unloading method provided in this application;

[0041] Figure 2 A structural block diagram of a flow table unloading system provided in this application;

[0042] Figure 3 This application provides a structural block diagram of a flow table unloading device. Detailed Implementation

[0043] The core of this application is to provide a flow table unloading method, system, device, and readable storage medium, which can convert a target flow table with a mask into a target accurate flow table by field completion, thereby enabling the target flow table to be unloaded to DDR that does not support masks. Compared with tcam memory and / or host memory, DDR has lower cost and power consumption.

[0044] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0045] Please refer to Figure 1 , Figure 1 This application provides a flowchart illustrating a flow table offloading method, which is applied to a processor and includes:

[0046] S11: Identify the template type of the target flow table;

[0047] Specifically, the method for converting a target flow table into an exact flow table in this application is as follows: the target flow table is templated and divided into multiple template types according to the actual scenario. Each template type of the target flow table corresponds to a target field. When converting the target flow table into an exact flow table, the template type of the target flow table is used to determine the corresponding target field in order to complete it into an exact flow table. Therefore, in this application, it is necessary to first identify the template type of the target flow table.

[0048] As a preferred embodiment, identifying the template type of the target flow table includes:

[0049] Receive the target flow table sent by the target hardware. The target flow table includes the source flow table and the extension header. The extension header includes the template ID (Identity) of the target flow table.

[0050] Parse the extension header to obtain the template ID of the target flow table;

[0051] The template type of the target flow table is determined based on the template ID.

[0052] In one specific embodiment, the template type of the target flow table can be identified as follows: based on the target flow table sent by the target hardware, where the target flow table includes a source flow table and an extension header, and the template ID of the source flow table is written in the extension header, the specific method for identifying the template type of the target flow table is as follows: parse the extension header in the target flow table to obtain the template ID in the extension header, identify it as the template ID of the target flow table, and determine the template type of the target flow table according to the preset template ID-template type correspondence.

[0053] In a preferred embodiment, the target hardware sends a target flow table, including:

[0054] Receive the source flow table and identify its characteristic information;

[0055] Determine the template ID of the source flow table based on the feature information;

[0056] Encapsulate the template ID into the extension header;

[0057] The target hardware sends the extended header and source flow table to the processor as the target flow table.

[0058] This embodiment aims to provide a common implementation method for sending target flow tables via DDR. Specifically, the target hardware first receives the source flow table, then identifies the feature information of the received source flow table, determines the template ID of the source flow table based on the identified feature information, encapsulates the source flow table with an extension header, encapsulates the determined template ID into the extension header, and sends the extension header and the source flow table as a whole as the target flow table to the processor so that the processor can identify the template type of the target flow table.

[0059] As a preferred embodiment, after determining the template ID of the source flow table based on the feature information, the method further includes:

[0060] Determine whether this is the first time the source flow table corresponding to the template ID has been received;

[0061] If so, proceed to the step of encapsulating the template ID into the extension header;

[0062] If not, the template ID is used as the index to call the exact flow table stored within itself corresponding to the template ID and perform the dispatch processing.

[0063] Furthermore, each time the target hardware receives a source flow table, it determines whether this is the first time it has received the source flow table. If it is the first time, it means that the target hardware's DDR (Double Data Rate) does not store the exact flow table corresponding to the source flow table, and it cannot be directly invoked. Therefore, it proceeds to the subsequent step of encapsulating the template ID into the extension header. If it is not the first time, it means that the target hardware's DDR has previously unloaded the exact flow table corresponding to this source flow table and stores this exact flow table in the target hardware's DDR. In this case, the exact flow table can be directly invoked, and subsequent distribution or forwarding processing can be performed.

[0064] Specifically, each precise flow table includes a template ID. In this application, the precise flow table is accessed by using the template ID as an index to find the precise flow table corresponding to the template ID.

[0065] As a preferred embodiment, determining whether it has received the source flow table corresponding to the template ID for the first time includes:

[0066] Determine whether there is an exact flow table corresponding to the template ID based on the template ID and the pre-stored correspondence between the template ID and the exact flow table;

[0067] If it does not exist, then it is determined that the source flow table corresponding to the template ID has been received for the first time;

[0068] If it exists, it is determined that this is not the first time the source flow table corresponding to the template ID has been received.

[0069] This embodiment aims to provide a specific implementation method for determining whether the target hardware has received the source flow table corresponding to the template ID for the first time. Specifically, after the target hardware receives each offloaded precise flow table, since the precise flow table includes template ID information, the target hardware's DDR will store a preset template ID-precise flow table correspondence. Therefore, after identifying the template ID of the source flow table, this application uses the template ID as an index to search whether the target hardware's DDR stores a precise flow table corresponding to the template ID according to the preset template ID-precise flow table correspondence. If it exists, it is determined that it is not the first time the source flow table corresponding to the template ID has been received; otherwise, it is determined that it is the first time the source flow table corresponding to the template ID has been received, and the step of encapsulating the template ID into the extension header is initiated.

[0070] As a preferred embodiment, after parsing the extension header to obtain the template ID of the target flow table, the method further includes:

[0071] Write the template ID into the cache module so that the template type of the target flow table can be determined later based on the template ID in the cache module.

[0072] Furthermore, in this application, after obtaining the template ID of the target flow table, in a specific embodiment, the pmd (Poll Mode Driver) parses the extended header of the target flow table to obtain the template ID, and OVS performs subsequent steps such as determining the target fields based on the template ID. In this application, after the pmd driver parses the extended header to obtain the template ID, it writes the template ID into the cache module. At this time, OVS reads the template ID from the cache module to determine the template type of the target flow table.

[0073] S12: Determine the target field based on the identified template type and the preset template type-field correspondence;

[0074] Specifically, a preset template-field correspondence is pre-set. This correspondence is established in advance according to the actual application scenario. The step of establishing this correspondence can be executed only once at the beginning or once when the preset template-field correspondence needs to be adjusted, without needing to be executed repeatedly.

[0075] Specifically, after identifying the template type of the target flow table, the target field corresponding to the template type is found and determined according to the preset template-field correspondence, using the template type as an index, so as to complete the target flow table in the future.

[0076] S13: Use the target field to complete the target flow table to obtain the target exact flow table;

[0077] Specifically, after determining the target field corresponding to the template type of the received target flow table, the target flow table is completed using the target field to convert the target flow table into a target precise flow table, thereby solving the problem of the mask in the target flow table. At this time, the target precise flow table can be unloaded to the DDR that does not support the mask.

[0078] S14: Upon receiving the unloading information, unload the target precise flow table into the DDR of the target hardware.

[0079] After converting the target flow table into the target precise flow table, if an unloading message is received, the target precise flow table is directly unloaded into the DDR of the target hardware.

[0080] In summary, the flow table offloading method of this application identifies the template type of the target flow table; determines the target field based on the identified template type and the preset template type-field correspondence; completes the target flow table using the target field to obtain the target precise flow table; and offloads the target precise flow table to the DDR of the target hardware upon receiving offloading information. This application can convert a masked target flow table into a target precise flow table through field completion, thereby enabling the offloading of the target flow table to DDR, which does not support masks. Compared with tcam memory and / or host memory, DDR has lower cost and power consumption.

[0081] Specifically, in one embodiment, the steps of the above-described flow table unloading method are as follows:

[0082] (1) The target hardware receives the source flow table and identifies the template ID of the source flow table based on the feature information of the source flow table;

[0083] (2) The target hardware determines whether its DDR stores an exact flow table corresponding to the template ID based on the template ID. If it exists, it directly calls the exact flow table and performs subsequent distribution processing, etc.

[0084] (3) If the exact flow table corresponding to the template ID does not exist in DDR, then set an extension header for the source flow table, write the identified template ID into the extension header, and send the extension header and the source flow table as the target flow table to the pmd driver.

[0085] (4) The pmd driver parses the extension header, obtains the template ID, stores it in the cache module (mbuf), and sends the target flow table to OVS.

[0086] (5) OVS obtains the template ID based on the content stored in the cache module, and determines the template type of the target flow table based on the template ID;

[0087] (6) Determine the corresponding target fields based on the determined template type;

[0088] (7) Use the target field to complete the target flow table to obtain the target precise flow table;

[0089] (8) Upon receiving the unloading information, the target precise flow table is unloaded into the DDR of the target hardware.

[0090] To address the aforementioned technical problems, this application also provides a flow table unloading system, please refer to... Figure 2 , Figure 2 This application provides a structural block diagram of a flow table offloading system, which is applied to a processor and includes:

[0091] The identification unit 21 is used to identify the template type of the target flow table;

[0092] Field determination unit 22 is used to determine the target field based on the identified template type and the preset template type-field correspondence;

[0093] Completion unit 23 is used to complete the target flow table using the target field to obtain the target accurate flow table;

[0094] The unloading unit 24 is used to unload the target precise flow table into DDR when receiving unloading information.

[0095] For a description of the flow table unloading system, please refer to the above embodiments; this application will not repeat it here.

[0096] To address the aforementioned technical problems, this application also provides a flow table unloading device, please refer to... Figure 3 , Figure 3 A structural block diagram of a flow table unloading device provided in this application, the device comprising:

[0097] Memory 31 is used to store computer programs;

[0098] The processor 32 is configured to implement the steps of the flow table unloading method described above when storing a computer program.

[0099] For a description of the flow table unloading device, please refer to the above embodiments; this application will not repeat it here.

[0100] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the flow table offloading method described above. For a description of the computer-readable storage medium, please refer to the above embodiments; further details will not be repeated here.

[0101] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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 limitations, 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 said element.

[0102] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for unloading flow tables, characterized in that, Applied to processors, including: Identify the template type of the target flow table; The target field is determined based on the identified template type and the preset template type-field correspondence; The target flow table is completed using the target field to obtain the target precise flow table; Upon receiving the unloading information, the target precise flow table is unloaded into the DDR of the target hardware; Identify the template type of the target flow table, including: Receive a target flow table sent by the target hardware, the target flow table including a source flow table and an extension header, the extension header including the template ID of the target flow table; The extended header is parsed to obtain the template ID of the target flow table; The template type of the target flow table is determined based on the template ID.

2. The flow table unloading method as described in claim 1, characterized in that, After parsing the extended header to obtain the template ID of the target flow table, the method further includes: The template ID is written into the cache module so that the template type of the target flow table can be determined subsequently based on the template ID in the cache module.

3. The flow table unloading method as described in claim 1, characterized in that, The target hardware sends the target flow table, including: Receive the source flow table and identify the characteristic information of the source flow table; The template ID of the source flow table is determined based on the aforementioned feature information; The template ID is encapsulated into the extension header; The extended header and the source flow table are sent to the processor as the target flow table.

4. The flow table unloading method as described in claim 3, characterized in that, After determining the template ID of the source flow table based on the feature information, the method further includes: Determine whether it is the first time it has received the source flow table corresponding to the template ID; If so, proceed to the step of encapsulating the template ID into the extension header; If not, then using the template ID as an index, the system calls the exact flow table stored within itself corresponding to the template ID and performs the distribution processing.

5. The flow table unloading method as described in claim 4, characterized in that, Determining whether it is the first time it has received the source flow table corresponding to the template ID includes: Determine whether there exists an exact flow table corresponding to the template ID based on the template ID and the corresponding relationship between the preset template ID and the exact flow table stored in the template ID; If it does not exist, then it is determined that the source flow table corresponding to the template ID has been received for the first time; If it exists, it is determined that this is not the first time the source flow table corresponding to the template ID has been received.

6. A flow table unloading system, characterized in that, Applied to processors, including: The identification unit is used to identify the template type of the target flow table; The field determination unit is used to determine the target field based on the identified template type and the preset template type-field correspondence. The completion unit is used to complete the target flow table using the target field to obtain the target accurate flow table; The unloading unit is used to unload the target precise flow table to the DDR of the target hardware when receiving the unloading information; The identification unit is specifically used for: Receive a target flow table sent by the target hardware, the target flow table including a source flow table and an extension header, the extension header including the template ID of the target flow table; The extended header is parsed to obtain the template ID of the target flow table; The template type of the target flow table is determined based on the template ID.

7. A flow table unloading device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the flow table unloading method as described in any one of claims 1-5 while storing a computer program.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the flow table offloading method as described in any one of claims 1-5.