Flow table splitting method, device and medium
By splitting the flow table into multiple types of key-value tables and cascading tables, the problems of flow table resource waste and insufficient length are solved, and the rational allocation of resources and efficient packet forwarding are achieved.
Patent Information
- Application Number
- CN202411723825.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2044-11-28
AI Technical Summary
In data communication and chip design, wasted or insufficient length of flow table entries leads to low forwarding efficiency and an inability to meet the needs of various service flows.
By splitting the flow table into various types of key-value table entries and cascading tables, including key-value fields and different cascading action units, the information layout is optimized to adapt to the length requirements of different business flows.
This effectively avoids resource waste, provides sufficiently long table entries, improves flow table resource utilization and packet forwarding performance, and enhances product competitiveness.
Smart Images

Figure CN119603214B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data communication and chip design, and particularly relates to a flow table splitting method, device and medium. BACKGROUND
[0002] In the technical field of data communication and chip design, in the process of data communication, when data packets are transmitted and communicated between different devices, the generation, transmission, analysis, matching and forwarding of the data packets are involved. In the process of data packet processing, the intelligent network card chip completes functions such as message analysis, key value matching, message editing and forwarding, and important information required in the above data packet processing process is obtained by querying a flow table. Therefore, the storage and reading and writing of the flow table need to occupy a large amount of resources, and the chip design aspect needs to focus on reducing resource consumption. With the development of cloud computing, big data, artificial intelligence and other applications, there are various business flows, and the lengths of the key value information and action information of these business flows are long or short, which may cause waste of flow table item resources or insufficient length of the flow table item, and is not conducive to improving flow table forwarding efficiency and reducing resource occupation.
[0003] Therefore, an embodiment of the present application provides a flow table splitting method, device and medium, which optimizes the design by splitting the flow table item, re-plans the information layout in the flow table item, realizes reasonable allocation and full use of resources, and is helpful to adapt to the needs of various business flows. SUMMARY
[0004] In a first aspect, the present application provides a flow table splitting method. The flow table splitting method comprises: determining a plurality of flow table entries of a first flow table, wherein each of the plurality of flow table entries comprises a key-value field segment and an action field segment, the key-value field segment is used for table matching, and the action field segment is used for executing one or more flow table entry actions; splitting the first flow table into a first key-value table and a first cascade table, wherein the first key-value table comprises a plurality of key-value table entries, the plurality of key-value table entries correspond to the plurality of flow table entries one by one, each of the plurality of key-value table entries comprises a key-value field segment for recording a key-value field segment of a flow table entry corresponding to the key-value table entry, the plurality of key-value table entries are divided into first-type key-value table entries, second-type key-value table entries, and third-type key-value table entries, the first-type key-value table entries comprise a key-value field segment and a normal action unit, the second-type key-value table entries comprise a key-value field segment and a first-level cascade action unit, the third-type key-value table entries comprise a key-value field segment, a first-level cascade action unit, and a second-level cascade action unit, the normal action unit comprises an action type and execution action data, the first-level cascade action unit comprises a first-level cascade type and a first-level table entry index, the second-level cascade action unit comprises a second-level cascade type and a second-level table entry index, the first-level table entry index and the second-level table entry index are respectively used for pointing to cascade table entries in different areas of the first cascade table, and the cascade table entries comprise an action type and execution action data.
[0005] Through the first aspect of the present application, by means of the combination of the plurality of types of key-value table entries and the normal action unit, the first-level cascade action unit, and the second-level cascade action unit, the first-type key-value table entries, the second-type key-value table entries, and the third-type key-value table entries are provided, which can effectively adapt to the length requirement of the action field segment of the message of different service flows, avoid the waste of table entry resources, provide a long enough table entry length, improve the idle waste of flow table resources, fully utilize the resources of the table entries, adapt to the requirements and scenarios of various services, and improve the product competitiveness.
[0006] In a possible implementation manner of the first aspect of the present application, the first-type key-value table entries are used for a first service flow, the second-type key-value table entries are used for a second service flow, and the third-type key-value table entries are used for a third service flow, the action information of the first service flow is less than that of the second service flow, and the action information of the second service flow is less than that of the third service flow.
[0007] In a possible implementation manner of the first aspect of the present application, the cascade table entry resources in the first cascade table are shared between the plurality of key-value table entries included in the first key-value table.
[0008] In a possible implementation of the first aspect of the present application, the first level table entry index is used for mapping from the first key-value table to a first region in the first cascade table, and the second level table entry index is used for mapping from the first key-value table to a second region in the first cascade table, the first region being non-overlapping with the second region.
[0009] In a possible implementation of the first aspect of the present application, the first level cascade type corresponds to the first region, the second level cascade type corresponds to the second region, the first level cascade action unit is configured to search for a matched cascade table entry in the first region according to the first level cascade type and the first level table entry index, and the second level cascade action unit is configured to search for a matched cascade table entry in the second region according to the second level cascade type and the second level table entry index.
[0010] In a possible implementation of the first aspect of the present application, the data length of each key-value table entry included in the first key-value table is the same.
[0011] In a possible implementation of the first aspect of the present application, the data length of the key-value table entry divided into the first type key-value table entry, the data length of the key-value table entry divided into the second type key-value table entry, and the data length of the key-value table entry divided into the third type key-value table entry are the same.
[0012] In a possible implementation of the first aspect of the present application, the key-value field segment of each key-value table entry included in the first key-value table is determined based on a message data format and a communication protocol specification.
[0013] In a possible implementation of the first aspect of the present application, the first type key-value table entry does not include the first level cascade action unit or the second level cascade action unit, the second type key-value table entry further includes a normal action unit, and the third type key-value table entry further includes a normal action unit.
[0014] In a possible implementation of the first aspect of the present application, the one or more flow table entry actions include message parsing, message editing, and message forwarding.
[0015] In a second aspect, the embodiments of the present application further provide a computer device, which comprises a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and the processor implements the method according to any of the implementation manners of any of the above aspects when executing the computer program.
[0016] In a third aspect, the embodiments of the present application further provide a computer readable storage medium, which stores computer instructions, and the computer instructions, when executed on a computer device, cause the computer device to perform the method according to any one of the implementation manners of any one of the aspects above.
[0017] In a fourth aspect, the embodiments of the present application further provide a computer program product, which comprises instructions stored on a computer readable storage medium, and the instructions, when executed on a computer device, cause the computer device to perform the method according to any one of the implementation manners of any one of the aspects above. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0019] Figure 1 A flowchart of a flow table splitting method provided by the embodiments of the present application is shown.
[0020] Figure 2 A reference table obtained by the flow table splitting method provided by the embodiments of the present application is shown. Figure 1 A schematic diagram of the first key value table and the first cascade table obtained by the flow table splitting method shown.
[0021] Figure 3 A structural schematic diagram of a computer device provided by the embodiments of the present application is shown. DETAILED DESCRIPTION
[0022] The embodiments of the present application will be further described in detail below with reference to the drawings.
[0023] It should be understood that in the description of the present application, "at least one" means one or more than one, and "multiple" means two or more than two. In addition, the words "first", "second", etc. are used only for the purpose of distinguishing the description, unless otherwise specified, and cannot be understood as indicating or implying relative importance, nor can it be understood as indicating or implying order.
[0024] Figure 1 A flowchart of a flow table splitting method provided by the embodiments of the present application is shown. As shown in the figure, Figure 1 The flow table splitting method comprises the following steps.
[0025] Step S101: determining a plurality of flow table entries of a first flow table, wherein each of the plurality of flow table entries comprises a key value field segment for table matching and an action field segment for performing one or more flow table entry actions.
[0026] Step S103: splitting the first flow table into a first key value table and a first cascade table.
[0027] With reference to Figure 1 , the first key value table comprises a plurality of key value table entries corresponding to the plurality of flow table entries, each of the plurality of key value table entries comprises a key value field segment for recording a key value field segment of a flow table entry corresponding to the key value table entry, the plurality of key value table entries are divided into first type key value table entries, second type key value table entries and third type key value table entries, the first type key value table entries comprise a key value field segment and a normal action unit, the second type key value table entries comprise a key value field segment and a first level cascade action unit, the third type key value table entries comprise a key value field segment, a first level cascade action unit and a second level cascade action unit, the normal action unit comprises an action type and execution action data, the first level cascade action unit comprises a first level cascade type and a first level table entry index, the second level cascade action unit comprises a second level cascade type and a second level table entry index, the first level table entry index and the second level table entry index are respectively used to point to a cascade table entry of a different area in the first cascade table, the cascade table entry comprises an action type and execution action data.
[0028] Figure 1The flow table splitting method shown can be applied to the field of data communication and chip design technology. In the field of data communication and chip design technology, during the data communication process, when data packets are transmitted and communicated between different devices, data packet generation, transmission, analysis, matching, forwarding, etc. are involved. In the process of processing data packets, the intelligent network card chip completes functions such as message analysis, key value matching, message editing and forwarding, and the important information required in the above data packet processing process is obtained by querying the flow table. Therefore, the storage and read-write of the flow table need to occupy a large amount of resources, and it is also a key consideration from the perspective of reducing resource consumption in chip design. With the development of cloud computing, big data, artificial intelligence and other applications, there are various types of service flows, and the length of the key value information and action information of each service flow is different, so some service flows have short key value information and action information, and some service flows have long key value information and action information. In order to improve the message forwarding performance, the flow tables of multiple service flows with different lengths of key value information and action information need to be stored and read-write through special hardware such as an intelligent network card chip, that is, they are offloaded to special hardware using hardware acceleration offloading technology. Therefore, not only enough space in the flow table entry is needed to provide a long enough data length to accommodate long key value information and action information, but also the waste of table entry resources caused by the remaining space in the flow table entry needs to be considered. Figure 1 The flow table splitting method shown optimizes the design of flow table entries by splitting them, re-plans the information layout in the flow table entries, and achieves reasonable allocation and full utilization of resources, which helps to adapt to the needs of various service flows. The following will be described in further detail.
[0029] Figure 1The flow table splitting method shown improves the structure design of the flow table, splits the first flow table into a first key-value table and a first cascade table on the basis of determining the plurality of flow table entries of the first flow table, and thus introduces the plurality of key-value table entries included in the first key-value table and the cascade table entries included in the first cascade table. Moreover, by the combination of the first key-value table and the first cascade table, the combination of the plurality of types of key-value table entries and the combination of the normal action unit, the first cascade action unit and the second cascade action unit, the length requirement of the message action domain segment of different service flows can be effectively adapted. By letting the normal action unit include an action type and execution action data, thus, the first type of key-value table entry including the key-value domain segment and the normal action unit can adapt to the service flow with a lower length requirement of the message action domain segment, and only the normal action unit included in the first key-value table can meet the message action requirement after the table matching, which is conducive to improving the message forwarding performance. By letting the first cascade action unit include a first cascade type and a first table entry index, and further pointing to the cascade table entry in the corresponding region of the first cascade table, the action type and execution action data included in the cascade table entry are obtained, thus, the second type of key-value table entry including the key-value domain segment and the first cascade action unit can adapt to the service flow with a medium length requirement of the message action domain segment. By letting the second cascade action unit include a second cascade type and a second table entry index, and further pointing to the cascade table entry in the corresponding region of the first cascade table, the action type and execution action data included in the cascade table entry are obtained, thus, the third type of key-value table entry including the key-value domain segment, the first cascade action unit and the second cascade action unit can adapt to the service flow with a higher length requirement of the message action domain segment. Here, by providing three different types of action units, the normal action unit includes an action type and execution action data, thus, the first type of key-value table entry including the key-value domain segment and the normal action unit in the first key-value table can meet the requirement of flow table table matching and message action execution, which means that by letting the first type of key-value table entry adapt to the service flow with a lower length requirement of the message action domain segment, i.e. converting the flow table entry corresponding to the service flow with a lower length requirement of the message action domain segment in the plurality of flow table entries of the first flow table into the first type of key-value table entry, the table entry resources can be fully utilized, not only avoiding the waste of table entry resources but also providing a long enough table entry length, and only the normal action unit included in the first key-value table can meet the message action requirement after the table matching, which is conducive to improving the message forwarding performance.Further, the first-level cascading action unit includes a first-level cascading type and a first-level table item index, and the second-level cascading action unit includes a second-level cascading type and a second-level table item index, and the first-level table item index and the second-level table item index are respectively used to point to the cascading table items in different areas of the first cascading table. In this way, the second-type key-value table item including the key-value domain segment and the first-level cascading action unit can realize mapping to the specified area of the first cascading table by using the first-level table item index, and in this way, the table item resources on the first cascading table can be shared and indicated by the first-level table item index, and can adapt to the service flow with medium length requirement of the packet action domain segment. Further, the third-type key-value table item including the key-value domain segment, the first-level cascading action unit and the second-level cascading action unit can realize mapping to different areas of the first cascading table by using the first-level table item index and the second-level table item index respectively, and in this way, the table item resources on the first cascading table can be shared and indicated by the first-level table item index and the second-level table item index, and can adapt to the service flow with high length requirement of the packet action domain segment.
[0030] In summary, Figure 1 The flow table splitting method shown provides the first-type key-value table item, the second-type key-value table item and the third-type key-value table item by the combination of the multiple types of key-value table items and the ordinary action unit, the first-level cascading action unit and the second-level cascading action unit, which can effectively adapt to the length requirement of the packet action domain segment of different service flows, avoid the waste of table item resources and provide sufficient table item length, improve the idle waste condition of the flow table resources, fully utilize the table item resources, adapt to the requirements and scenarios of various services, and improve the product competitiveness.
[0031] Figure 2 A reference for the embodiments of the present application Figure 1 The schematic diagram of the first key-value table and the first cascading table obtained by the flow table splitting method shown. As shown in Figure 2 As shown, a plurality of flow table items of the first flow table are determined first, wherein each of the plurality of flow table items includes a key-value domain segment and an action domain segment, the key-value domain segment is used for table matching, and the action domain segment is used for executing one or more flow table item actions. Then, the first flow table is split into Figure 2The first key-value table 201 and the first cascade table 203 are shown. The first key-value table 201 includes a plurality of key-value table entries (key-value table entry A 210, key-value table entry B 220, key-value table entry C 230). The plurality of key-value table entries (key-value table entry A 210, key-value table entry B 220, key-value table entry C 230) correspond one-to-one to the plurality of flow table entries, and each of the plurality of key-value table entries (key-value table entry A 210, key-value table entry B 220, key-value table entry C 230) includes a key-value field segment for recording a key-value field segment of the flow table entry corresponding to the key-value table entry. The plurality of key-value table entries are divided into first-type key-value table entries, second-type key-value table entries, and third-type key-value table entries, the first-type key-value table entries include key-value field segments and normal action units, the second-type key-value table entries include key-value field segments and first-level cascade action units, and the third-type key-value table entries include key-value field segments, first-level cascade action units, and second-level cascade action units, the normal action units include action types and execution action data, the first-level cascade action units include first-level cascade types and first-level table entry indexes, and the second-level cascade action units include second-level cascade types and second-level table entry indexes, the first-level table entry indexes and the second-level table entry indexes are respectively used to point to cascade table entries in different areas of the first cascade table 203, and the cascade table entries include action types and execution action data.
[0032] Reference is made to Figure 2 The key-value table entry A 210 includes a key-value field segment A 211, a normal action unit A 212, a normal action unit B 213, and a normal action unit C 214, and here, the key-value table entry A 210 is a first-type key-value table entry. The key-value table entry B 220 includes a key-value field segment B 221, a normal action unit D 222, a normal action unit E 223, and a first-level cascade action unit A 224, and here, the key-value table entry B 220 is a second-type key-value table entry. The key-value table entry C 230 includes a key-value field segment C 231, a normal action unit F 232, a first-level cascade action unit B 234, and a second-level cascade action unit A 233, and here, the key-value table entry C 230 is a third-type key-value table entry. The first cascade table 203 includes a plurality of cascade table entries, Figure 2The cascade table table entry A 291, the cascade table table entry B 292, the cascade table table entry C 293, the cascade table table entry D 294, and the cascade table table entry E 281, the cascade table table entry F 282, the cascade table table entry G 283 are shown in the figure. Here, the first level table entry index of the first level cascade action unit A 224 included in the key value table table entry B 220 points to the cascade table table entry B 292 in the first cascade table 203, and the first level table entry index of the first level cascade action unit B 234 included in the key value table table entry C 230 points to the cascade table table entry C 293 in the first cascade table 203. The first level table entry index of the second level cascade action unit A 233 included in the key value table table entry C 230 points to the cascade table table entry G 283 in the first cascade table 203. As can be seen, the cascade table table entry A 291, the cascade table table entry B 292, the cascade table table entry C 293, the cascade table table entry D 294 in the first cascade table 203 belong to one designated area for corresponding the first level cascade action unit included in the key value table table entry in the first key value table 201, for example Figure 2 The first level cascade action unit A 224 included in the key value table table entry B 220 and the first level cascade action unit B 234 included in the key value table table entry C 230 are shown. In contrast, the cascade table table entry E 281, the cascade table table entry F 282, the cascade table table entry G 283 belong to another designated area for corresponding the second level cascade action unit included in the key value table table entry in the first key value table 201, for example Figure 2 The second level cascade action unit A 233 included in the key value table table entry C 230 is shown. In this way, the first level table entry index and the second level table entry index are used to realize mapping to different areas of the first cascade table 203 respectively, so that the table entry resources on the first cascade table 203 can be shared and indicated by the first level table entry index and the second level table entry index, which can adapt to the length requirement of the message action domain segment of the service flow.
[0033] In summary, Figure 2 The first key value table 201 and the first cascade table 203 shown provide the first type key value table table entry, the second type key value table table entry and the third type key value table table entry through the combination of multiple types of key value table table entries and the combination of the normal action unit, the first level cascade action unit and the second level cascade action unit, which can effectively adapt to the length requirement of the message action domain segment of different service flows, not only avoid the waste of table entry resources but also provide sufficient table entry length, which can improve the idle waste of flow table resources, fully utilize the table entry resources, adapt to the requirements and scenarios of various services, and improve the product competitiveness.
[0034] Reference Figure 1 and Figure 2In a possible implementation, the first type of key-value table entry is used for a first service flow, the second type of key-value table entry is used for a second service flow, and the third type of key-value table entry is used for a third service flow. The action information of the first service flow is less than that of the second service flow, and the action information of the second service flow is less than that of the third service flow. In this way, the length requirement of the service flow on the packet action domain segment can be effectively adapted, the waste of table entry resources is avoided, and a long enough table entry length is provided, which can improve the idle waste of flow table resources, fully utilize the table entry resources, adapt the requirements and scenarios of various services, and improve the product competitiveness.
[0035] In a possible implementation, the table entry resources in the first cascade table are shared between the plurality of key-value table entries included in the first key-value table. In this way, the length requirement of the service flow on the packet action domain segment can be effectively adapted, the waste of table entry resources is avoided, and a long enough table entry length is provided, which can improve the idle waste of flow table resources, fully utilize the table entry resources, adapt the requirements and scenarios of various services, and improve the product competitiveness.
[0036] In a possible implementation, the first level table entry index is used for mapping from the first key-value table to a first region in the first cascade table, and the second level table entry index is used for mapping from the first key-value table to a second region in the first cascade table. The first region and the second region are non-overlapping. In this way, the table entry resources of the first cascade table can be efficiently utilized, the length requirement of the service flow on the packet action domain segment can be effectively adapted, the waste of table entry resources is avoided, and a long enough table entry length is provided, which can improve the idle waste of flow table resources, fully utilize the table entry resources, adapt the requirements and scenarios of various services, and improve the product competitiveness.
[0037] In some embodiments, the first level cascade type corresponds to the first region, and the second level cascade type corresponds to the second region. The first level cascade action unit is configured to search, based on the first level cascade type, a matching cascade table entry in the first region according to the first level table entry index, and the second level cascade action unit is configured to search, based on the second level cascade type, a matching cascade table entry in the second region according to the second level table entry index. In this way, the first level table entry index and the second level table entry index can be used to respectively implement mapping to different regions of the first cascade table, the table entry resources on the first cascade table can be shared and indicated by the first level table entry index and the second level table entry index, and the service flow with a high length requirement on the packet action domain segment can be adapted.
[0038] In a possible implementation, the data length of the key-value field of each of the plurality of key-value table entries included in the first key-value table is the same. In this way, the storage resource can be fully utilized, and the packet forwarding efficiency can be improved.
[0039] In a possible implementation, the data length of the key-value table entry classified as the first type of key-value table entry, the data length of the key-value table entry classified as the second type of key-value table entry, and the data length of the key-value table entry classified as the third type of key-value table entry are the same. In this way, the storage resource can be fully utilized, and the packet forwarding efficiency can be improved.
[0040] In a possible implementation, the key-value field of each of the plurality of key-value table entries included in the first key-value table is determined based on a packet data format and a communication protocol specification. In this way, the application environment requirements can be adapted.
[0041] In a possible implementation, the first type of key-value table entry does not include the first level of cascade action unit and the second level of cascade action unit, the second type of key-value table entry further includes a normal action unit, and the third type of key-value table entry further includes a normal action unit. In this way, by combining the plurality of types of key-value table entries and the normal action unit, the first level of cascade action unit, and the second level of cascade action unit, the first type of key-value table entry, the second type of key-value table entry, and the third type of key-value table entry are provided, the length requirements of the packet action field of different service flows can be effectively adapted, the waste of table entry resources is avoided, and the length of the table entry is long enough, the idle and waste of the flow table resource can be improved, the table entry resource can be fully utilized, various service requirements and scenarios can be adapted, and the product competitiveness is improved.
[0042] In a possible implementation, the one or more flow table entry actions include packet analysis, packet editing, and packet forwarding. In this way, the intelligent network card chip can support various functions in the process of processing the data packet.
[0043] Figure 3is a structural schematic diagram of a computing device provided in an embodiment of the present application. The computing device 300 includes one or more processors 310, a communication interface 320, and a memory 330. The processor 310, the communication interface 320, and the memory 330 are connected to each other through a bus 340. Optionally, the computing device 300 can further include an input / output interface 350 connected with an input / output device for receiving a parameter set by a user, etc. The computing device 300 can be used to implement part or all of the functions of the device embodiments or the system embodiments in the above-described embodiments of the present application; the processor 310 can also be used to implement part or all of the operation steps of the method embodiments in the above-described embodiments of the present application. For example, the specific implementation of the computing device 300 performing various operations can refer to the specific details in the above-described embodiments, for example, the processor 310 is used to perform part or all of the steps in the above-described method embodiments or part or all of the operations in the above-described method embodiments. For another example, in the embodiments of the present application, the computing device 300 can be used to implement part or all of the functions of one or more components in the above-described device embodiments, in addition, the communication interface 320 can be specifically used for communication functions necessary for implementing the functions of these devices, components, etc., and the processor 310 can be specifically used for processing functions necessary for implementing the functions of these devices, components, etc.
[0044] It should be understood that, Figure 3 The computing device 300 can include one or more processors 310, and the plurality of processors 310 can cooperatively provide processing capability in a parallel connection manner, a serial connection manner, a serial-parallel connection manner, or any connection manner, or the plurality of processors 310 can constitute a processor sequence or a processor array, or the plurality of processors 310 can be divided into a main processor and an auxiliary processor, or the plurality of processors 310 can have different architectures such as using a heterogeneous computing architecture. In addition, Figure 3 The computing device 300 shown, the related structural description and functional description are exemplary and non-limiting. In some exemplary embodiments, the computing device 300 can include more or fewer components than those shown, or combine certain components, or split certain components, or have a different arrangement of components. Figure 3 The computing device 300 shown, the related structural description and functional description are exemplary and non-limiting. In some exemplary embodiments, the computing device 300 can include more or fewer components than those shown, or combine certain components, or split certain components, or have a different arrangement of components.
[0045] The processor 310 can have various specific implementations. For example, the processor 310 can include one or a combination of central processing units (CPUs), graphic processing units (GPUs), neural-network processing units (NPUs), tensor processing units (TPUs), data processing units (DPUs), and the like, and embodiments of the present application are not limited in this regard. The processor 310 can also be a single core processor or a multiple core processor. The processor 310 can be a combination of a CPU and a hardware chip. The hardware chip can be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The processor 310 can also be implemented by a logic device with built-in processing logic, such as an FPGA or a digital signal processor (DSP), etc. The communication interface 320 can be a wired interface or a wireless interface, used for communication with other modules or devices. The wired interface can be an Ethernet interface, a local interconnect network (LIN), etc., and the wireless interface can be a cellular network interface or a wireless local area network interface, etc.
[0046] The memory 330 can be a non-volatile memory, for example, a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically EPROM (EEPROM), or a flash memory. The memory 330 can also be a volatile memory, which can be a random access memory (RAM) used as an external cache. By way of example, and not limitation, many forms of RAM can be used, for example, a static RAM (SRAM), a dynamic RAM (DRAM), a synchronous DRAM (SDRAM), a double data rate SDRAM (DDR SDRAM), an enhanced SDRAM (ESDRAM), a synchlink DRAM (SLDRAM), and a direct rambus RAM (DR RAM). The memory 330 can also be used for storing programs codes and data to facilitate the processor 310 to invoke the program codes stored in the memory 330 to execute a portion or all of the procedures of the above method embodiments, or to execute the related functions of the above device embodiments. Moreover, the computing device 300 can contain more or less components, or have different configurations of components, than those shown in the drawings. Figure 3 More or less components can be used, or different configurations of components can be used.
[0047] The bus 340 can be a peripheral component interconnect express (PCIe) bus, or an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus 340 can be divided into an address bus, a data bus, a control bus, etc. In addition to including a data bus, the bus 340 can also include a power bus, a control bus, a status signal bus, etc. However, for the sake of clarity,Figure 3 Only one bus or bus type is used in the figure, but it is understood that the computer system 100 can use more buses or bus types.
[0048] The method and device provided by the embodiments of the present application are based on the same inventive concept, and the embodiments, implementation manners, examples or implementation modes of the method and device are similar in principle for solving problems, and thus the embodiments, implementation manners, examples or implementation modes of the method and device can be referred to each other, and the repeated parts will not be described herein. The embodiments of the present application further provide a system, which includes a plurality of computing devices, and the structure of each computing device can refer to the structure of the computing device described above. The functions or operations that can be implemented by the system can refer to the specific implementation steps in the above method embodiments and / or the specific functions described in the above device embodiments, and will not be described herein.
[0049] The embodiments of the present application further provide a computer readable storage medium, which stores computer instructions, and when the computer instructions run on a computer device (such as one or more processors), the method steps in the above method embodiments can be implemented. The specific implementation of the processor of the computer readable storage medium in executing the above method steps can refer to the specific operations described in the above method embodiments and / or the specific functions described in the above device embodiments, and will not be described herein.
[0050] Those skilled in the art will appreciate that embodiments of the present application can be readily used as a method, apparatus, or computer program product. Embodiments of the present application can be implemented in hardware, software, firmware, or any combination thereof. Embodiments of the present application can be implemented in software and / or firmware to operate on a computer or other programmable processing device, which can be a general purpose computer, a special purpose computer, a computer network, or other programmable processing device to produce a machine, such that the computer program product, when loaded and / or executed on the computer or other programmable processing device, can implement processes or functions described herein. Such computer program product can be a computer- readable storage medium having computer readable program code embodied therein, which causes a computer to function in a particular manner, such that the computer
[0051] The computer program instructions can also be loaded onto a computer, other programmable processing device, or network device to cause a series of operations to be performed on the computer, other programmable processing device, or network device to produce a computer implemented process such that the instructions which execute on the computer or other programmable processing device implement the functions / acts specified in the flowchart and / or block diagram block or blocks. Figure 1 The flowchart and / or block diagram in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each flowchart and / or block diagram can represent a method, module, and / or portion of code which comprises one or more executable instructions implemented in computer readable program code to be executed by a processor system, such as a general purpose computer, special purpose computer, embedded processor, or Figure 1 The flowchart and / or block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each flowchart and / or block diagram can represent a method, module, and / or portion of code which comprises one or more executable instructions implemented in computer readable program code to be executed by a processor system, such as a general purpose computer, special purpose computer, embedded processor, or Figure 1one or more processes and / or functions specified in the flow block or blocks Figure 1 These computer program instructions can also be loaded into computer or other programmable data processing devices, so that a series of operation steps are performed on the computer or other programmable data processing devices to generate computer-implemented processes, thus the instructions executed on the computer or other programmable data processing devices provide a process for implementing the function specified in the flow block or blocks. Figure 1 one or more processes and / or functions specified in the flow block or blocks Figure 1 one or more processes and / or functions specified in the flow block or blocks
[0052] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments. Obviously, those skilled in the art can make various modifications and variations to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. The steps in the method of the embodiments of the present application can be adjusted, combined or deleted according to actual needs; the modules in the system of the embodiments of the present application can be divided, combined or deleted according to actual needs. If these modifications and variations of the embodiments of the present application belong to the scope of the claims of the present application and the equivalent technologies thereof, the present application also intends to include these modifications and variations.
Claims
1. A flow table splitting method, characterized by, The flow table splitting method comprises: determining a plurality of flow table entries of a first flow table, wherein each of the plurality of flow table entries comprises a key-value field segment for table matching and an action field segment for performing one or more flow table entry actions; splitting the first flow table into a first key-value table and a first cascade table, wherein the first key-value table comprises a plurality of key-value table entries corresponding to the plurality of flow table entries, each of the plurality of key-value table entries comprises a key-value field segment for recording a key-value field segment of a flow table entry corresponding to the key-value table entry, the plurality of key-value table entries are divided into first-type key-value table entries, second-type key-value table entries, and third-type key-value table entries, the first-type key-value table entries comprise a key-value field segment and a normal action unit, the second-type key-value table entries comprise a key-value field segment and a first-level cascade action unit, the third-type key-value table entries comprise a key-value field segment, a first-level cascade action unit, and a second-level cascade action unit, the normal action unit comprises an action type and execution action data, the first-level cascade action unit comprises a first-level cascade type and a first-level table entry index, the second-level cascade action unit comprises a second-level cascade type and a second-level table entry index, the first-level table entry index and the second-level table entry index are respectively used for pointing to cascade table entries in different regions of the first cascade table, and the cascade table entries comprise an action type and execution action data.
2. The flow table splitting method of claim 1, wherein, The first-type key-value table entries are used for a first service flow, the second-type key-value table entries are used for a second service flow, and the third-type key-value table entries are used for a third service flow, action information of the first service flow is less than that of the second service flow, and action information of the second service flow is less than that of the third service flow.
3. The flow table splitting method of claim 1, wherein, Cascade table entry resources in the first cascade table are shared between the plurality of key-value table entries comprised by the first key-value table.
4. The flow table splitting method of claim 1, wherein, The first-level table entry index is used for mapping from the first key-value table to a first region in the first cascade table, and the second-level table entry index is used for mapping from the first key-value table to a second region in the first cascade table, the first region and the second region are non-overlapping.
5. The flow table splitting method of claim 4, wherein, The first-level cascade type corresponds to the first region, the second-level cascade type corresponds to the second region, the first-level cascade action unit is used for searching a matching cascade table entry in the first region according to the first-level table entry index based on the first-level cascade type, and the second-level cascade action unit is used for searching a matching cascade table entry in the second region according to the second-level table entry index based on the second-level cascade type.
6. The flow table splitting method of claim 1, wherein, The data length of the key-value field segment of each of the plurality of key-value table entries comprised by the first key-value table is the same.
7. The flow table splitting method of claim 1, wherein, The data length of the key-value table entries classified into the first type key-value table entries is the same, the data length of the key-value table entries classified into the second type key-value table entries is the same, and the data length of the key-value table entries classified into the third type key-value table entries is the same.
8. The flow table splitting method of claim 1, wherein, The key-value field segment of each of the plurality of key-value table entries included in the first key-value table is determined based on a message data format and a communication protocol specification.
9. The flow table splitting method of claim 1, wherein, The first type key-value table entry does not include the first level cascade action unit and the second level cascade action unit, the second type key-value table entry further includes a normal action unit, and the third type key-value table entry further includes a normal action unit.
10. The flow table splitting method of claim 1, wherein, The one or more flow table entry actions include message analysis, message editing, and message forwarding.
11. A flow table splitting device, characterized by, The flow table splitting device includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the method according to any one of claims 1 to 10 when executing the computer program.
12. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions, and when the computer instructions are executed on a computer device, the computer device executes the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Method and device for searching multistage flow table
CN103354522A
Network-switching-chip-based realization method for microcode and stream table
CN106533943A