Method, computer device and medium for hardware flow table management
By selecting the appropriate flow table matching template and data length, the flexibility of the data format and length of the hardware flow table is ensured, which solves the problem of resource waste caused by fixed formats and lengths, achieves efficient resource utilization, and adapts to complex data service transmission requirements.
Patent Information
- Application Number
- CN202410985170.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-07-23
AI Technical Summary
The fixed data format and length in the existing hardware flow table makes it difficult to fully utilize the physical storage space, resulting in resource waste and low resource utilization, and it is difficult to meet complex and changeable data service transmission requirements.
By selecting multiple flow table matching templates and data lengths corresponding to the packets, the flow table items are ensured to have sufficiently flexible data formats and lengths, and multiple flow table matching templates and corresponding multiple data lengths are used to provide different granularities of the feature table. , ensure that the flow table entry can meet the flow table matching requirements, and determine the flow table entry operation that needs to be performed by parsing the operation type identifier.
It improves resource utilization, adapts to various complex and changing data service transmission requirements, simplifies the design and management of hardware flow tables, and improves the overall reading speed and data service processing capabilities.
Smart Images

Figure CN118524059B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, computer device and medium for hardware flow table management. Background Art
[0002] In application scenarios such as cloud computing and data centers, data service processing is often accelerated by offloading to hardware flow tables, such as traffic forwarding through hardware flow tables. In the prior art, flow table items in hardware flow tables use a fixed data format, including using a fixed length to store feature fields and operation fields, so the length of each flow table item in the hardware flow table is the same. Considering that the hardware flow table has to cope with complex and changeable application environments and handle various data service transmission requirements, the hardware flow table with a fixed data format and length in the prior art is difficult to fully utilize the physical storage space, resulting in resource waste and low resource utilization. However, if a hardware flow table with an adjustable data format and length is used, it is necessary to ensure that the flow table item has a sufficiently flexible data format to meet the corresponding flow table matching requirements and has a sufficiently large length to store the corresponding flow table item feature field and flow table item operation field and other information, which brings challenges to the hardware flow table management.
[0003] To this end, the present application provides a method, computer device and medium for hardware flow table management, which are used to address the technical difficulties in the prior art. Summary of the invention
[0004] In a first aspect, the present application provides a method for hardware flow table management. The method includes: based on first message delivery information for flow table matching, selecting a first flow table matching template corresponding to the first message delivery information from a plurality of flow table matching templates, wherein the feature table includes at least one feature field, the data length of each of the at least one feature field is one of a plurality of preset data lengths, the plurality of flow table matching templates correspond to the plurality of data lengths one by one, the first flow table matching template corresponds to the first data length of the plurality of data lengths, the at least one feature field is respectively associated with an operation type identifier, and the operation type identifier indicates at least one flow table entry operation; based on the first data length, determining one or more feature fields having the first data length in the at least one feature field, and then delivering the first message delivery information to the one or more feature fields for flow table matching; in response to the first message delivery information hitting a first feature field in the one or more feature fields, based on the first operation type identifier associated with the first feature field, obtaining a first operation field associated with the first feature field, and then splicing the first feature field, the first operation type identifier and the first operation field to obtain a first flow table entry corresponding to the first message delivery information.
[0005] Through the first aspect of the present application, in view of the phased characteristics of the flow table matching process of the hardware flow table, that is, first performing feature matching and comparison and then executing the corresponding flow table item operation when a hit is found, that is, when a matching flow table item exists, a variety of flow table matching templates and corresponding multiple data lengths are used to provide different granularities of the feature table, which can ensure that the flow table item has a sufficiently flexible data format to meet the corresponding flow table matching requirements and has a sufficiently large length to store the corresponding flow table item feature field, and the hardware flow table with adjustable data format and length can be pre-designed to maximize resource utilization; by parsing each feature field separately The first operation type identifier is connected to determine the number and specific content of the flow table entry operations that need to be performed, and then the corresponding operation field is obtained in a targeted manner, and the first characteristic field, the first operation type identifier and the first operation field are spliced to obtain the first flow table entry corresponding to the first message sending information, thereby ensuring that the flow table entry has a sufficiently flexible data format to meet the corresponding flow table matching requirements and has a sufficiently large length to store the corresponding flow table entry characteristic field and flow table entry operation field and other information; at the same time, it provides the hardware flow table with flexibility in data format and length, and flexible adaptation to various complex and changeable data service transmission requirements.
[0006] In a possible implementation of the first aspect of the present application, the at least one feature field is associated with a corresponding operation field based on the respectively associated operation type identifier, the operation type identifier respectively associated with the at least one feature field and the operation field respectively associated with the at least one feature field together constitute an operation table, and the feature table and the operation table together constitute a hardware flow table.
[0007] In a possible implementation manner of the first aspect of the present application, the flow table entry in the hardware flow table is composed of a feature field in the feature table and an operation type identifier and an operation field in the operation table that satisfy a corresponding relationship.
[0008] In a possible implementation of the first aspect of the present application, the operation type identifier associated with at least one characteristic field is a two-dimensional code with a fixed length, and each setting on the two-dimensional code is used to indicate a flow table item operation to be executed in a preset flow table item operation capability set, and the flow table item operation capability set represents all possible flow table item operations supported by the hardware flow table.
[0009] In a possible implementation of the first aspect of the present application, the feature table and the operation table are respectively allocated different parts of the same physical storage space, and the operation type identifier associated with the at least one feature field is located in the allocated part of the operation table, or is simultaneously located in the allocated part of the feature table and the allocated part of the operation table.
[0010] In a possible implementation manner of the first aspect of the present application, the length of the operation type identifier respectively associated with the at least one characteristic field is fixed, and the length of the operation field respectively associated with the at least one characteristic field is determined based on the type of the operation field respectively associated with the at least one characteristic field.
[0011] In a possible implementation of the first aspect of the present application, based on the first operation type identifier associated with the first feature field, obtaining the first operation field associated with the first feature field includes: performing address offset calculation based on the data length of the first feature field and the length of the first operation type identifier, thereby determining the starting address of the first operation field based on the address of the first feature field, and determining the length of the first operation field based on the first operation type identifier.
[0012] In a possible implementation of the first aspect of the present application, the multiple flow table matching templates correspond one-to-one to the multiple message information combinations used for flow table matching, and the multiple message information combinations include: a first message information combination that only includes message layer 2 information, a second message information combination that includes message layer 2 information and message layer 3 information, and a third message information combination that includes message layer 2 information, message layer 3 information, and message layer 4 information.
[0013] In a possible implementation manner of the first aspect of the present application, the message layer 2 information is a message machine address, the message layer 3 information is a network protocol address, and the message layer 4 information is a port address.
[0014] In a possible implementation of the first aspect of the present application, the flow table matching is implemented through pipeline processing of a multi-level flow table cascade matching unit, and the multi-level flow table cascade matching unit matches the second layer information of the message, matches the third layer information of the message, and matches the fourth layer information of the message.
[0015] In a possible implementation of the first aspect of the present application, the multiple flow table matching templates correspond one-to-one to multiple flow table matching requirements, and the multiple flow table matching requirements are determined based on communication protocols, security protocols, network communication environments, and user needs.
[0016] In a possible implementation of the first aspect of the present application, the multiple data lengths include a maximum data length and half of the maximum data length, the characteristic field with the maximum data length corresponds to a full-table flow table entry, and the characteristic field with half of the maximum data length corresponds to a half-table flow table entry.
[0017] In a possible implementation manner of the first aspect of the present application, the multiple data lengths also include one quarter of the maximum data length, and the feature fields having one quarter of the maximum data length correspond to one quarter of the table flow table entries.
[0018] In a possible implementation manner of the first aspect of the present application, the at least one flow table entry operation is one or more of the following: forwarding operation, storage operation, network protocol address editing operation, port editing operation, flow table statistics operation, virtual LAN addition operation, virtual LAN removal operation.
[0019] In a possible implementation of the first aspect of the present application, the feature fields with the same data length in the at least one feature field constitute the same feature field block, and the positioning of the at least one feature field is based on the global number of each of the at least one feature field, or based on the block number and internal relative number of the feature field block in which each of the at least one feature field is located.
[0020] In a possible implementation of the first aspect of the present application, the multiple data lengths include a maximum data length and half of the maximum data length, the characteristic fields having the maximum data length constitute a first characteristic field block, the characteristic fields having half of the maximum data length constitute a second characteristic field block, the size of the first characteristic field block is the same as the size of the second characteristic field block, and the maximum number of characteristic fields that the first characteristic field block can accommodate is half of the maximum number of characteristic fields that the second characteristic field block can accommodate.
[0021] In a second aspect, an embodiment of the present application further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a method according to any one of the implementation modes of any of the above aspects when executing the computer program.
[0022] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects.
[0023] In a fourth aspect, an embodiment of the present application further provides a computer program product, which includes instructions stored on a computer-readable storage medium, and when the instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions of 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 some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0025] Figure 1 A flowchart of a method for hardware flow table management provided in an embodiment of the present application;
[0026] Figure 2 A schematic diagram of a hardware flow table provided in an embodiment of the present application;
[0027] Figure 3 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0029] It should be understood that, in the description of this application, "at least one" means one or more, and "a plurality of" means two or more. In addition, unless otherwise specified, the words "first", "second", etc. are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
[0030] Figure 1 A flowchart of a method for hardware flow table management provided in an embodiment of the present application. Figure 1 As shown, the method includes the following steps.
[0031] Step S102: Based on the first message sending information used for flow table matching, select a first flow table matching template corresponding to the first message sending information from multiple flow table matching templates, wherein the feature table includes at least one feature field, and the data length of each of the at least one feature field is one of the preset multiple data lengths, and the multiple flow table matching templates correspond to the multiple data lengths one by one, and the first flow table matching template corresponds to the first data length of the multiple data lengths, and the at least one feature field is respectively associated with an operation type identifier, and the operation type identifier indicates at least one flow table item operation.
[0032] Step S104: Based on the first data length, determine one or more characteristic fields in the at least one characteristic field that have the first data length, and then send the first message to send information to the one or more characteristic fields for flow table matching.
[0033] Step S106: In response to the first message sending information hitting the first feature field among the one or more feature fields, based on the first operation type identifier associated with the first feature field, obtain the first operation field associated with the first feature field, and then concatenate the first feature field, the first operation type identifier and the first operation field to obtain a first flow table entry corresponding to the first message sending information.
[0034] See also Figure 1In application scenarios such as cloud computing and data centers, the hardware flow table is located in dedicated hardware such as smart network cards or data processors. The hardware flow table provides functions such as flow table matching, flow table statistics, and flow table processing. The hardware flow table and the software flow table are relative concepts. The software flow table is located in the system host. By unloading the software flow table to the hardware flow table, the loss of uploading and downloading can be saved, which is conducive to accelerating data service processing. The flow table matching process of the hardware flow table and the software flow table is similar. Both are matched according to the feature field (key). When a match is found, the corresponding action field (action) is executed, such as forwarding the data packet to the specified port. The flow table (table) includes at least one flow table entry. A flow table entry includes a feature field and an action field, and can also include other fields, such as a flow entry identifier (Flow ID) field, and other functional identifiers. These various fields or domains together constitute a flow table entry. Generally, if the size of the feature field and the action field are fixed, that is, the length of the data bit width is fixed, this means that the length of the data bit width of each flow table entry is also fixed. The use of a fixed data bit width length and a fixed flow table entry structure means that the actual physical space occupied by each flow table entry in the same flow table is the same. Therefore, the total size of the flow table depends on the depth of the flow table, that is, the number of flow table entries in the flow table. This is convenient in terms of memory management, reading and writing flow tables, and adding and deleting flow table entries. However, it also brings about a waste of resources. For example, the physical memory space actually required by a flow table entry may be much smaller than the length of the data bit width of the allocated standardized flow table entry. For another example, a flow table entry may not use the functional identifiers, various fields, various domains, etc. provided by the standardized flow table entries. These idle fields and identifiers do not play a practical role, but still occupy actual physical space. Therefore, on the one hand, it is difficult to fully utilize the physical storage space by using a hardware flow table with a fixed data format and length, resulting in resource waste and low resource utilization; on the other hand, using a hardware flow table with an adjustable data format and length requires ensuring that the flow table items have a sufficiently flexible data format to meet the corresponding flow table matching requirements and have a sufficiently large length to store the corresponding flow table item feature fields and flow table item operation fields and other information. For example, a flow table item may only need to perform one flow table item operation after being hit, but another flow table item may need to perform three flow table item operations when being hit. In addition, depending on the specific data service transmission scenario, different flow table items may correspond to different flow table matching requirements, thus bringing challenges to the design and management of hardware flow tables with adjustable data formats and lengths. The following is combined with Figure 1 A detailed description is given of how a method for hardware flow table management provided in a specific embodiment of the present application simultaneously provides flexibility in data format and length of the hardware flow table and flexible adaptation to various complex and changing data service transmission requirements.
[0035] Continue reading Figure 1, in step S102, based on the first message delivery information for flow table matching, a first flow table matching template corresponding to the first message delivery information is selected from a plurality of flow table matching templates. The feature table includes at least one feature field, the data length of each of the at least one feature field is one of the preset multiple data lengths, the multiple flow table matching templates correspond to the multiple data lengths one by one, the first flow table matching template corresponds to the first data length of the multiple data lengths, and the at least one feature field is respectively associated with an operation type identifier, and the operation type identifier indicates at least one flow table item operation. The first message delivery information is used for flow table matching. As mentioned above, the flow table matching process of the hardware flow table and the software flow table is similar, and both are matched according to the feature field. When a match is found, that is, when a matching flow table item exists, the corresponding operation field is executed. The first message delivery information for flow table matching may have different data formats and information contents, and therefore has different lengths, due to factors such as specific communication protocol specifications, customer requirements for input and output customization, and application scenario requirements. For example, the first message sent down information may be the message layer 2 information obtained by unpacking the message packet, also called the message's L2, which means that the information content of the first message sent down information used for flow table matching comes from the message's L2, such as the machine address; for another example, the first message sent down information may be the message layer 3 information obtained by unpacking the message packet, also called the message's L3, which means that the information content of the first message sent down information used for flow table matching comes from the message's L3, such as the network protocol address; for another example, the first message sent down information may be the message layer 4 information obtained by unpacking the message packet, also called the message's L4, which means that the information content of the first message sent down information used for flow table matching comes from the message's L4, such as the port information. Therefore, in application scenarios such as cloud computing and data centers, the hardware flow table needs to cope with large-scale traffic forwarding and processing requirements. Some messages only need to match the machine address, so only the message's L2 needs to be sent down, and some messages need to match both the machine address and the network protocol address, so the message's L2 plus L3 needs to be sent down. Therefore, depending on the actual flow table matching requirements, the first message sent down information may have different data formats and information contents, which means that the length of the first message sent down information, that is, the size of the physical storage space required to be occupied, may also be different. The first message sent down information is used to match the flow table with the flow table items in the hardware flow table. Therefore, the flow table items in the hardware flow table need to have a sufficiently flexible data format to meet the corresponding flow table matching requirements and have a sufficiently large length to store the corresponding flow table item feature fields and flow table item operation fields and other information.As described above, if a hardware flow table with a fixed data format and length is used, it is necessary to design the fixed length of each flow table item taking into account the size of the physical storage space required for flow table matching in extreme cases. This may result in some message sending information and the corresponding flow table items not fully utilizing the allocated physical storage space. For example, a flow table item that only needs to send L2 for flow table matching of messages generally requires less physical storage space than a flow table item that needs to send L2 plus L3 for flow table matching of messages. Therefore, designing a fixed length of flow table items based on the flow table matching requirements of the latter may result in a waste of resource utilization in the former.
[0036] Continue reading Figure 1 In order to flexibly adapt to various complex and changeable data service transmission requirements, and to simplify the complexity of the design and management of the hardware flow table as much as possible, in particular, it is necessary to ensure the overall reading speed of the hardware flow table to ensure high-performance data service processing capabilities, multiple flow table matching templates are prepared in advance, so that each time a flow table match is required, the first flow table matching template corresponding to the first message sending information is selected from the multiple flow table matching templates based on the first message sending information. Here, the feature table includes at least one feature field, and the data length of each of the at least one feature field is one of the preset multiple data lengths, and the multiple flow table matching templates correspond to the multiple data lengths one by one. In this way, by selecting different flow table matching templates, the data length that is most suitable for the first message sending information can be selected, and the granularity of the feature table that adapts to the first message sending information can be selected. For example, the maximum granularity of the feature table represents the maximum data length of the feature field of the feature table, which can be set to 256 bits, and the minimum granularity of the feature table represents the minimum data length of the feature field of the feature table, which can be set to 128 bits. By presetting a variety of data lengths, different granularities of the feature table can be provided. In this way, when matching the flow table, according to the matching conditions, it is possible to determine which information of the message needs to be sent down, and the corresponding flow table matching template can be selected. For example, some messages only need to match the machine address, so only the L2 of the message needs to be sent down, then the flow table matching template corresponding to the L2 of the matching message can be selected. According to the selected corresponding flow table matching template, the corresponding data length can be determined, and then sent down to flow table items of different lengths for subsequent operations, such as adding flow table items, deleting flow table items, or rewriting flow table items. In this way, by using a variety of flow table matching templates and corresponding multiple data lengths, different granularities of the feature table are provided, which can ensure that the flow table items have a sufficiently flexible data format to meet the corresponding flow table matching requirements and have a sufficiently large length to store the corresponding flow table item feature fields, and the resource utilization rate can be maximized by pre-designing a hardware flow table with an adjustable data format and length.
[0037] Continue reading Figure 1, after step S102, step S104 is performed. In step S104, based on the first data length, one or more feature fields having the first data length in the at least one feature field are determined, and then the first message delivery information is sent to the one or more feature fields for flow table matching. In this way, by using a variety of flow table matching templates and corresponding multiple data lengths, different granularities of feature tables are provided, which improves resource utilization while meeting the requirements of flow table matching. When matching the flow table, according to the matching conditions, it can be determined which information of the message needs to be sent, and the corresponding flow table matching template can be selected. For example, some messages only need to match the machine address, so only the L2 of the message needs to be sent, then the flow table matching template corresponding to the L2 of the matching message can be selected. According to the selected corresponding flow table matching template, the corresponding data length can be determined, and then sent to the corresponding flow table entry for subsequent operations. Here, after determining the first data length, the first message delivery information is sent to the one or more feature fields for flow table matching. After step S104, step S106 is performed. In step S106, in response to the first message sending information hitting the first feature field in the one or more feature fields, based on the first operation type identifier associated with the first feature field, the first operation field associated with the first feature field is obtained, and then the first feature field, the first operation type identifier and the first operation field are spliced to obtain the first flow table entry corresponding to the first message sending information. Here, the at least one feature field is respectively associated with an operation type identifier, and the operation type identifier indicates at least one flow table entry operation. As mentioned above, the flow table matching process of the hardware flow table and the software flow table is similar, and both are matched based on the feature field. When a match is found, that is, when a flow table entry exists, the corresponding operation field is executed. By using a variety of flow table matching templates and corresponding multiple data lengths, different granularities of the feature table are provided, which can ensure that the flow table entry has a sufficiently flexible data format to meet the corresponding flow table matching requirements and has a sufficiently large length to store the corresponding flow table entry feature field. It can be seen that the standardization of the feature fields in the feature table is achieved through the preset multiple data lengths, that is, the data length of each of the at least one feature field is one of the preset multiple data lengths, which means that the real physical storage space can be planned according to the data lengths of each feature field. For example, feature fields with the same data length are put together, which helps to improve the read and write speed of the feature fields, and is also conducive to improving the overall efficiency. Furthermore, different flow table items may need to perform different flow table item operations after being hit. For example, a certain flow table item may only need to perform one flow table item operation after being hit, but another flow table item may need to perform three flow table item operations when being hit.However, it is difficult to predict in advance how many flow table operations each flow table entry will perform after being hit, as well as the specific contents of these flow table operations. Therefore, it is necessary to provide sufficiently high flexibility in the design and management of the hardware flow table. Here, by making the at least one characteristic field associated with an operation type identifier, the operation type identifier indicates at least one flow table operation, so that the number and specific contents of the flow table operations to be performed can be determined by parsing the operation type identifier associated with each characteristic field. Further, in step S106, based on the first operation type identifier associated with the first characteristic field, the first operation field associated with the first characteristic field is obtained. Here, the length of the first operation field is not fixed, depending on the number and specific contents of the specific flow table operation indicated by the first operation field. It may be a flow table operation such as forwarding to a specified port, or it may be a combination of multiple flow table operations. In step S106, the first characteristic field, the first operation type identifier and the first operation field are spliced to obtain the first flow table entry corresponding to the first message sending information. In this way, when the first message sending information hits the first characteristic field, the data length of the first characteristic field, that is, the first data length, is known. By parsing the first operation type identifier associated with the first characteristic field, the number and specific content of the flow table entry operations that need to be performed can be determined, so that the length of the first operation field can be determined, and then the length of the complete flow table entry can be determined. Finally, the first characteristic field, the first operation type identifier and the first operation field are spliced to obtain the first flow table entry corresponding to the first message sending information.
[0038] Continue reading Figure 1The flow table matching process of the hardware flow table is divided into two stages. The first stage is to perform feature matching and comparison to detect whether there are flow table items that meet the flow table matching conditions in the hardware flow table. Then, the second stage is to perform the corresponding flow table item operation when a hit is found, that is, a matching flow table item exists. Therefore, for the first stage of the flow table matching process of the hardware flow table, that is, feature matching and comparison, a variety of flow table matching templates and corresponding multiple data lengths are used to provide different granularities of feature tables, which can ensure that the flow table items have a sufficiently flexible data format to meet the corresponding flow table matching requirements and a sufficiently large length to store the corresponding flow table item feature fields. In addition, the hardware flow table with adjustable data format and length can be pre-designed to maximize resource utilization. For example, the standardization of feature fields in the feature table is achieved through the preset multiple data lengths, and adjacent address segments are allocated to feature fields with the same data length through the planning of real physical storage space. In the second stage of the flow table matching process of the hardware flow table, considering that different flow table items may need to perform different flow table item operations after being hit, and how many flow table item operations each flow table item needs to perform after being hit and the specific contents of these flow table item operations are difficult to predict in advance, for this reason, by making the at least one characteristic field associated with the operation type identifier respectively, the number and specific contents of the flow table item operations to be performed can be determined by parsing the operation type identifier associated with each characteristic field respectively, and then the corresponding operation field is obtained in a targeted manner. The operation type identifier can adopt a globally unified data format and length, which is conducive to simplifying the complexity of the hardware flow table in design and management, and is also conducive to improving the overall reading speed. In the case where the first message sends information that hits the first characteristic field, the data length of the first characteristic field, that is, the first data length, is known. By parsing the first operation type identifier associated with the first characteristic field, the number and specific contents of the flow table item operations to be performed can be determined, so that the length of the first operation field can be determined, and then the length of the complete flow table item can be determined. Finally, the first characteristic field, the first operation type identifier and the first operation field are spliced to obtain the first flow table item corresponding to the first message sending information. In this way, it is ensured that the flow table entry has a sufficiently flexible data format to meet the corresponding flow table matching requirements and has a sufficiently large length to store information such as the corresponding flow table entry feature field and flow table entry operation field.
[0039] In conclusion, Figure 1The method for hardware flow table management shown in the figure aims at the staged characteristics of the flow table matching process of the hardware flow table, that is, first performing feature matching and comparison and then executing the corresponding flow table item operation when a hit is found, that is, when a matching flow table item exists, a plurality of flow table matching templates and corresponding plurality of data lengths are used to provide different granularities of feature tables, which can ensure that the flow table items have a sufficiently flexible data format to meet the corresponding flow table matching requirements and have a sufficiently large length to store the corresponding flow table item feature fields, and the hardware flow table with adjustable data format and length can be pre-designed to maximize resource utilization; by parsing each feature field, The first flow table item corresponding to the first message sending information is obtained by specifically obtaining the first characteristic field, the first operation type identifier and the first operation field, thereby ensuring that the flow table item has a sufficiently flexible data format to meet the corresponding flow table matching requirements and has a sufficiently large length to store the corresponding flow table item characteristic field and flow table item operation field and other information; at the same time, it provides the hardware flow table with flexibility in data format and length, and flexible adaptation to various complex and changeable data service transmission requirements.
[0040] In a possible implementation, the at least one feature field is associated with a corresponding operation field based on the operation type identifier associated with each, and the operation type identifier associated with the at least one feature field and the operation field associated with the at least one feature field together constitute an operation table, and the feature table and the operation table together constitute a hardware flow table. In this way, through the design of the feature table and the operation table, the stage characteristics of the flow table matching process of the hardware flow table are corresponded. Among them, the design of the feature table is for the first stage, that is, feature matching and comparison, and the design of the operation table is for the second stage, that is, when a hit, that is, a matching flow table entry exists, the corresponding flow table entry operation is executed. In this way, through the table entries of different granularities in the feature table, such as feature fields with different data lengths, it can be ensured that the flow table entry has a sufficiently flexible data format to meet the corresponding flow table matching requirements and has a sufficiently large length to store the corresponding flow table entry feature field, and the hardware flow table with adjustable data format and length can be pre-designed to maximize resource utilization. Further, considering that in the second stage of the flow table matching process of the hardware flow table, it is difficult to predict in advance how many flow table operations each flow table item needs to perform after being hit and the specific contents of these flow table operations, a flexible splicing method is provided. By parsing the first operation type identifier associated with the first feature field, the number and specific contents of the flow table operations to be performed can be determined, so that the length of the first operation field can be determined, and then the length of the complete flow table item can be determined. Finally, the first feature field, the first operation type identifier and the first operation field are spliced to obtain the first flow table item corresponding to the first message sending information. In some embodiments, the operation table may include multiple items of the same size, such as 64-bit items, which are used to store information related to flow table item operations, and one item can correspond to one flow table item operation. Therefore, if a flow table item needs to perform a flow table item operation after being hit, a complete flow table item can be obtained by splicing one item of the operation table; if a flow table item needs to perform three flow table item operations after being hit, a complete flow table item can be obtained by splicing three items of the operation table. Combine the following Figure 2 Further details are given.
[0041] Figure 2 A schematic diagram of a hardware flow table provided in an embodiment of the present application. Figure 2As shown, the hardware flow table 200 includes a feature table 202 and an operation table 204. The feature table 202 includes an entry A210 of the feature table 202, an entry B212 of the feature table 202, an entry C220 of the feature table 202, an entry D222 of the feature table 202, an entry E224 of the feature table 202, and an entry F226 of the feature table 202. The operation table 204 includes an entry A230 of the operation table 204, an entry B232 of the operation table 204, an entry C240 of the operation table 204, an entry D242 of the operation table 204, an entry E244 of the operation table 204, and an entry F246 of the operation table 204. Here, the entry A210 of the feature table 202 and the entry B212 of the feature table 202 represent the maximum granularity of the feature table, that is, the maximum data length of the feature field of the feature table, which can be set to 256 bits. Furthermore, the table entry A210 of the feature table 202 and the table entry A230 of the operation table 204 are used together to form a complete flow table entry. The table entry B212 of the feature table 202 and the table entry B232 of the operation table 204 are used together to form a complete flow table entry. The table entry C220 of the feature table 202, the table entry D222 of the feature table 202, the table entry E224 of the feature table 202, and the table entry F226 of the feature table 202 represent the minimum granularity of the feature table, that is, the minimum data length of the feature field of the feature table, which can be set to 128 bits. Furthermore, the table entry C220 of the feature table 202 and the table entry C240 of the operation table 204 are used together to form a complete flow table entry. The table entry D222 of the feature table 202 and the table entry D242 of the operation table 204 are used together to form a complete flow table entry. The entry E224 of the feature table 202 and the entry E244 of the operation table 204 are used together to form a complete flow table entry. The entry F226 of the feature table 202 and the entry F246 of the operation table 204 are used together to form a complete flow table entry. It should be understood that Figure 2 The correspondence between the feature table 202 and the operation table 204 shown is only exemplary. The operation table 204 may include more entries, and an entry in the feature table 202 may correspond to more than one entry in the operation table 204. In this way, through the entries of different granularities in the feature table 202, such as feature fields with different data lengths, it can be ensured that the flow table items have a sufficiently flexible data format to meet the corresponding flow table matching requirements and have a sufficiently large length to store the corresponding flow table item feature fields, and the hardware flow table 200 with adjustable data format and length can be pre-designed to maximize resource utilization; by providing a flexible splicing method and standardized entries in the operation table 204, the hardware flow table 200 is provided with flexibility in data format and length and flexible adaptation to various complex and changeable data service transmission requirements.
[0042] Continue reading Figure 1In some embodiments, the flow table entry in the hardware flow table is composed of the feature field in the feature table and the operation type identifier and operation field in the operation table that satisfy the corresponding relationship. In this way, the hardware flow table is provided with flexibility in data format and length, and is flexible to adapt to various complex and changeable data service transmission requirements.
[0043] In some embodiments, the operation type identifier associated with the at least one characteristic field is a two-dimensional code with a fixed length, and each position on the two-dimensional code is used to indicate the flow table item operation to be executed in the preset flow table item operation capability set, and the flow table item operation capability set represents all possible flow table item operations supported by the hardware flow table. For example, 8 bits can be used to define the flow table item operation capability set, which is used to characterize the maximum support of the hardware for unloading, for example, six types of flow table item operations: forwarding operation, network protocol address editing operation, port editing operation, flow table statistics operation, virtual LAN addition operation, and virtual LAN removal operation. Each position on the two-dimensional code is used to indicate the corresponding flow table item operation to be executed in a specific order. For example, the position of the first bit in the two-dimensional code is used to indicate whether the forwarding operation is to be executed. It can be set to 1 to execute the forwarding operation, and to 0 not to execute the forwarding operation. In this way, by parsing the operation type identifier associated with each characteristic field, the number and specific content of the flow table entry operations to be performed are determined, and then the corresponding operation field is obtained in a targeted manner, and the first characteristic field, the first operation type identifier and the first operation field are spliced to obtain the first flow table entry corresponding to the first message sending information, ensuring that the flow table entry has a sufficiently flexible data format to meet the corresponding flow table matching requirements and has a sufficiently large length to store the corresponding flow table entry characteristic field and flow table entry operation field and other information; at the same time, it provides the hardware flow table with flexibility in data format and length and flexible adaptation to various complex and changeable data service transmission requirements. In addition, the operation type identifier can adopt a globally unified data format and length, which is conducive to simplifying the complexity of the hardware flow table in design and management, and is also conducive to improving the overall reading speed.
[0044] In some embodiments, the feature table and the operation table are respectively allocated different parts of the same physical storage space, and the operation type identifier associated with the at least one feature field is located in the portion where the operation table is allocated, or is located at the same time in the portion where the feature table is allocated and the portion where the operation table is allocated. The design of the feature table and the operation table corresponds to the stage characteristics of the flow table matching process of the hardware flow table. Among them, the design of the feature table is for the first stage, that is, feature matching and comparison, and the design of the operation table is for the second stage, that is, when a hit or matching flow table entry exists, the corresponding flow table entry operation is executed. Generally, the operation type identifier is located in the portion where the operation table is allocated. If the portion where the feature table is allocated still has a surplus after storing the feature field, it can be used to store the operation type identifier, that is, the operation type identifier associated with the at least one feature field is located at the same time in the portion where the feature table is allocated and the portion where the operation table is allocated. In this way, it is conducive to maximizing the utilization of hardware resources.
[0045] In some embodiments, the length of the operation type identifier associated with the at least one feature field is fixed, and the length of the operation field associated with the at least one feature field is determined based on the type of the operation field associated with the at least one feature field. In this way, the operation type identifier can adopt a globally unified data format and length, which is conducive to simplifying the complexity of the hardware flow table in design and management, and is also conducive to improving the overall reading speed. In addition, it is ensured that the flow table item has a sufficiently flexible data format to meet the corresponding flow table matching requirements and has a sufficiently large length to store information such as the corresponding flow table item feature field and flow table item operation field, providing the flexibility of the hardware flow table in data format and length and flexible adaptation to various complex and changeable data service transmission requirements. In some examples, based on the first operation type identifier associated with the first feature field, obtaining the first operation field associated with the first feature field includes: based on the data length of the first feature field and the length of the first operation type identifier, performing address offset calculation, thereby determining the first address of the first operation field based on the address of the first feature field, and determining the length of the first operation field based on the first operation type identifier. In the case where the first message sending information hits the first characteristic field, the data length of the first characteristic field, that is, the first data length, is known. By parsing the first operation type identifier associated with the first characteristic field, the number and specific content of the flow table entry operations that need to be performed can be determined, so that the length of the first operation field can be determined, and then the length of the complete flow table entry can be determined. Finally, the first characteristic field, the first operation type identifier and the first operation field are spliced to obtain the first flow table entry corresponding to the first message sending information. In this way, it is ensured that the flow table entry has a sufficiently flexible data format to meet the corresponding flow table matching requirements and has a sufficiently large length to store the corresponding flow table entry characteristic field and flow table entry operation field and other information. In addition, through address offset calculation, the complexity of the hardware flow table in design and management is simplified. For example, after the flow table hits, the corresponding operation field can be spliced to obtain all the information for executing the operation.
[0046] In a possible implementation, the multiple flow table matching templates correspond one-to-one to the multiple message information combinations used for flow table matching, and the multiple message information combinations include: a first message information combination including only message layer 2 information, a second message information combination including message layer 2 information and message layer 3 information, and a third message information combination including message layer 2 information, message layer 3 information, and message layer 4 information. In this way, by selecting different flow table matching templates, the data length that best suits the first message sent information can be selected, and the granularity of the feature table that adapts to the first message sent information can also be selected. By using multiple flow table matching templates and corresponding multiple data lengths, different granularities of the feature table are provided, which can ensure that the flow table items have a sufficiently flexible data format to meet the corresponding flow table matching requirements and have a sufficiently large length to store the corresponding flow table item feature fields, and the resource utilization rate can be maximized by pre-designing a hardware flow table with an adjustable data format and length.
[0047] In some embodiments, the message layer 2 information is the message machine address, the message layer 3 information is the network protocol address, and the message layer 4 information is the port address. In this way, by using a variety of flow table matching templates and corresponding multiple data lengths, different granularities of feature tables are provided, which can ensure that the flow table items have a sufficiently flexible data format to meet the corresponding flow table matching requirements and have a sufficiently large length to store the corresponding flow table item feature fields, and can maximize resource utilization by pre-designing hardware flow tables with adjustable data formats and lengths.
[0048] In some embodiments, the flow table matching is implemented by pipeline processing of a multi-level flow table cascade matching unit, and the multi-level flow table cascade matching unit matches the second layer information of the message, matches the third layer information of the message, and matches the fourth layer information of the message. In this way, by using a variety of flow table matching templates and corresponding multiple data lengths, different granularities of feature tables are provided, which can ensure that the flow table items have a sufficiently flexible data format to meet the corresponding flow table matching requirements and have a sufficiently large length to store the corresponding flow table item feature fields, and the hardware flow table with adjustable data format and length can be pre-designed to maximize resource utilization. In addition, compared with the fixed one-time matching of all information, the flow table matching is implemented by pipeline processing of a multi-level flow table cascade matching unit, which can avoid sending a large amount of duplicate information, and the feature information used for flow table matching can be divided into L2, L3, and L4 for matching respectively. Only one flow table can be sent for the same information, thereby greatly saving flow table space.
[0049] In a possible implementation, the multiple flow table matching templates correspond to multiple flow table matching requirements one by one, and the multiple flow table matching requirements are determined based on communication protocols, security protocols, network communication environments, and user needs. In this way, hardware resources are fully utilized to ensure that flow table delivery specifications are met, and it can be ensured that flow table items have a sufficiently flexible data format to meet the corresponding flow table matching requirements and have a sufficiently large length to store the corresponding flow table item feature fields. In addition, hardware flow tables with adjustable data formats and lengths can be pre-designed to maximize resource utilization, while providing flexibility in data formats and lengths for hardware flow tables and flexible adaptation to various complex and changing data service transmission requirements.
[0050] In a possible implementation, the multiple data lengths include a maximum data length and half of the maximum data length, the feature field having the maximum data length corresponds to a full-table flow table entry, and the feature field having half of the maximum data length corresponds to a half-table flow table entry. In this way, by selecting different flow table matching templates, the data length that is most suitable for the information sent by the first message can be selected, and the granularity of the feature table that adapts to the information sent by the first message can be selected. For example, the maximum granularity of the feature table represents the maximum data length of the feature field of the feature table, which can be set to 256 bits, and the minimum granularity of the feature table represents the minimum data length of the feature field of the feature table, which can be set to 128 bits. By presetting multiple data lengths, different granularities of the feature table can be provided. In this way, when matching the flow table, according to the matching conditions, it can be determined which information of the message needs to be sent, and the corresponding flow table matching template can be selected. By utilizing a variety of flow table matching templates and corresponding multiple data lengths, different granularities of feature tables are provided, ensuring that flow table items have a sufficiently flexible data format to meet the corresponding flow table matching requirements and a sufficiently large length to store the corresponding flow table item feature fields. In addition, resource utilization can be maximized by pre-designing hardware flow tables with adjustable data formats and lengths.
[0051] In some embodiments, the multiple data lengths also include one-quarter of the maximum data length, and the feature fields having one-quarter of the maximum data length correspond to one-quarter of the flow table entries. In this way, by using multiple flow table matching templates and corresponding multiple data lengths, different granularities of feature tables are provided, which can ensure that the flow table entries have a sufficiently flexible data format to meet the corresponding flow table matching requirements and have a sufficiently large length to store the corresponding flow table entry feature fields, and can maximize resource utilization by pre-designing hardware flow tables with adjustable data formats and lengths.
[0052] In one possible implementation, the at least one flow table entry operation is one or more of the following: forwarding operation, storage operation, network protocol address editing operation, port editing operation, flow table statistics operation, virtual LAN addition operation, virtual LAN removal operation. By parsing the first operation type identifier associated with the first characteristic field, the number and specific content of the flow table entry operations to be performed can be determined, so that the length of the first operation field can be determined, and then the length of the complete flow table entry can be determined. Finally, the first characteristic field, the first operation type identifier and the first operation field are spliced to obtain the first flow table entry corresponding to the first message sending information. In this way, it is ensured that the flow table entry has a sufficiently flexible data format to meet the corresponding flow table matching requirements and has a sufficiently large length to store information such as the corresponding flow table entry characteristic field and the flow table entry operation field.
[0053] In a possible implementation, the feature fields with the same data length in the at least one feature field constitute the same feature field block, and the positioning of the at least one feature field is based on the global number of each of the at least one feature field, or based on the block number and internal relative number of the feature field block where the at least one feature field is located. In order to further optimize the flow table item search, the feature fields of the same granularity are put together, so that a feature field block can be formed. Each feature field, regardless of the granularity, has a global number for global positioning. The size of a feature field block can be defined to be equal to a fixed number of feature fields of the maximum granularity, for example, the feature fields of 512 full table items constitute a feature field block. Each feature field block also has its own block number, and there is an internal relative number inside the feature field block to distinguish the feature fields in the same feature field block. For example, assuming that the feature field blocks are all feature fields of half-table items, therefore, the physical storage space occupied by the feature field block composed of the feature fields of 512 full table items, if used to store the feature fields of half-table items, means that 1024 feature fields of half-table items can be stored. In this way, through multiple feature field blocks, feature fields of the same granularity can be put together, thereby forming a relative cluster distribution of feature fields of different granularities on the entire hardware flow table. Moreover, the global number of each feature field can be converted through the block number and internal relative number of the feature field block.
[0054] In some embodiments, the multiple data lengths include a maximum data length and half of the maximum data length, the feature field with the maximum data length constitutes a first feature field block, the feature field with half of the maximum data length constitutes a second feature field block, the size of the first feature field block is the same as the size of the second feature field block, and the maximum number of feature fields that the first feature field block can accommodate is half of the maximum number of feature fields that the second feature field block can accommodate. In this way, two dimensions of flexibility are provided. One dimension is that the granularity of the feature field, that is, the data length of the feature field can be flexibly adapted, and the feature field of the maximum granularity is divided by an even number relationship, such as a half table and a quarter table, which can meet the flow table matching while saving space by using a smaller granularity feature field. Here, the full table refers to the feature field with the maximum data length constituting the first feature field block, and the half table refers to the feature field with half of the maximum data length constituting the second feature field block. Because they are all divided according to an even number relationship, these feature fields of different granularities can be integrated according to the length of the feature field of the maximum granularity. In addition, feature fields of the same granularity can be put together. Another dimension is the operation field. Different types of flow table operations require different lengths, and the specific number and combination of flow table operations defined by different flow table entries may also be different. For this reason, a unified fixed-length operation type identifier is provided. By parsing the operation type identifier, the specific flow table operation to be performed can be determined, and then the operation field can be obtained and spliced, so that the storage space can be fully utilized.
[0055] Figure 33 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application, and 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 interconnected via a bus 340. Optionally, the computing device 300 may also include an input / output interface 350, and the input / output interface 350 is connected to an input / output device for receiving parameters set by a user, etc. The computing device 300 can be used to implement some or all of the functions of the device embodiment or system embodiment in the above-mentioned embodiment of the present application; the processor 310 can also be used to implement some or all of the operating steps of the method embodiment in the above-mentioned embodiment of the present application. For example, the specific implementation of the various operations performed by the computing device 300 can refer to the specific details in the above-mentioned embodiments, such as the processor 310 is used to perform some or all of the steps in the above-mentioned method embodiment or some or all of the operations in the above-mentioned method embodiment. For another example, in an embodiment of the present application, the computing device 300 may be used to implement part or all of the functions of one or more components in the above-mentioned apparatus embodiment. In addition, the communication interface 320 may be specifically used to perform the communication functions necessary to implement the functions of these apparatuses and components, and the processor 310 may be specifically used to perform the processing functions necessary to implement the functions of these apparatuses and components.
[0056] It should be understood that Figure 3 The computing device 300 may include one or more processors 310, and the multiple processors 310 may provide processing capabilities in a parallel connection mode, a serial connection mode, a serial-parallel connection mode, or any connection mode, or the multiple processors 310 may form a processor sequence or a processor array, or the multiple processors 310 may be divided into a main processor and an auxiliary processor, or the multiple processors 310 may have different architectures such as a heterogeneous computing architecture. In addition, Figure 3 The computing device 300 shown in the figure, and the related structural description and functional description are exemplary and non-limiting. In some exemplary embodiments, the computing device 300 may include Figure 3 More or fewer components may be shown, or some components may be combined or separated, or may have a different arrangement of components.
[0057] The processor 310 may have a variety of specific implementation forms. For example, the processor 310 may include a central processing unit (CPU), a graphic processing unit (GPU), a neural-network processing unit (NPU), a tensor processing unit (TPU) or a data processing unit (DPU), etc., and the embodiment of the present application does not specifically limit it. The processor 310 may also be a single-core processor or a multi-core processor. The processor 310 may be a combination of a CPU and a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may 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 may also be implemented using a logic device with built-in processing logic alone, such as an FPGA or a digital signal processor (DSP). The communication interface 320 may be a wired interface or a wireless interface for communicating with other modules or devices. The wired interface may be an Ethernet interface, a local interconnect network (LIN), etc., and the wireless interface may be a cellular network interface or a wireless local area network interface, etc.
[0058] The memory 330 may be a non-volatile memory, such as a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The memory 330 may also be a volatile memory, which may be a random access memory (RAM) used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM). The memory 330 may also be used to store program codes and data, so that the processor 310 calls the program codes stored in the memory 330 to execute some or all of the operation steps in the above method embodiment, or to execute the corresponding functions in the above device embodiment. Figure 3 Show more or fewer components, or have different component configurations.
[0059] The bus 340 may be a peripheral component interconnect express (PCIe) bus, 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 may be divided into an address bus, a data bus, a control bus, etc. In addition to the data bus, the bus 340 may also include a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0060] The method and device provided in the embodiments of the present application are based on the same inventive concept. Since the principles of solving the problems in the methods and devices are similar, the embodiments, implementation methods, examples or implementation methods of the methods and devices can refer to each other, and the repeated parts will not be repeated. The embodiments of the present application also provide a system, which includes multiple 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, which will not be repeated here.
[0061] The present application also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer device (such as one or more processors), the method steps in the above method embodiment 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 embodiment and / or the specific functions described in the above device embodiment, which will not be repeated here.
[0062] It should be understood by those skilled in the art that the embodiments of the present application may be provided as methods, systems, or computer program products. The present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. The embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The present application may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiments of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. Computer-readable storage media can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media. Available media can be magnetic media (such as floppy disks, hard disks, tapes), optical media, or semiconductor media. Semiconductor media can be solid-state hard disks, random access memory, flash memory, read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, registers, or any other form of suitable storage media.
[0063] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. Each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0064] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. Obviously, those skilled in the art can make various changes and modifications 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 embodiment of the present application can be adjusted in order, merged or deleted according to actual needs; the modules in the system of the embodiment of the present application can be divided, merged or deleted according to actual needs. If these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims
1. A method for hardware flow table management, characterized in that: The method comprises: Based on the first message delivery information for flow table matching, a first flow table matching template corresponding to the first message delivery information is selected from a plurality of flow table matching templates, wherein the feature table includes at least one feature field, the data length of each of the at least one feature field is one of the preset multiple data lengths, the multiple flow table matching templates correspond to the multiple data lengths one by one, the first flow table matching template corresponds to the first data length of the multiple data lengths, the at least one feature field is respectively associated with an operation type identifier, and the operation type identifier indicates at least one flow table item operation; Based on the first data length, determine one or more characteristic fields having the first data length in the at least one characteristic field, and then send the first message sending information to the one or more characteristic fields for flow table matching; In response to the first message sending information hitting a first feature field in the one or more feature fields, based on a first operation type identifier associated with the first feature field, obtaining a first operation field associated with the first feature field, and then splicing the first feature field, the first operation type identifier and the first operation field to obtain a first flow table entry corresponding to the first message sending information, The at least one feature field is associated with a corresponding operation field based on the respectively associated operation type identifier, the operation type identifier respectively associated with the at least one feature field and the operation field respectively associated with the at least one feature field together constitute an operation table, and the feature table and the operation table together constitute a hardware flow table.
2. The method according to claim 1, characterized in that The flow table entry in the hardware flow table is composed of the feature field in the feature table and the operation type identifier and the operation field in the operation table that satisfy the corresponding relationship.
3. The method according to claim 1, characterized in that The operation type identifier associated with at least one characteristic field is a two-dimensional code with a fixed length, and each setting on the two-dimensional code is used to indicate a flow table item operation to be executed in a preset flow table item operation capability set, and the flow table item operation capability set represents all possible flow table item operations supported by the hardware flow table.
4. The method according to claim 1, characterized in that: The feature table and the operation table are respectively allocated different parts of the same physical storage space, and the operation type identifier associated with the at least one feature field is located in the part allocated to the operation table, or is simultaneously located in the part allocated to the feature table and the part allocated to the operation table.
5. The method according to claim 1, characterized in that The length of the operation type identifier respectively associated with the at least one characteristic field is fixed, and the length of the operation field respectively associated with the at least one characteristic field is determined based on the type of the operation field respectively associated with the at least one characteristic field.
6. The method according to claim 5, characterized in that Acquiring the first operation field associated with the first feature field based on the first operation type identifier associated with the first feature field includes: An address offset calculation is performed based on the data length of the first characteristic field and the length of the first operation type identifier, thereby determining the starting address of the first operation field based on the address of the first characteristic field, and determining the length of the first operation field based on the first operation type identifier.
7. The method according to claim 1, characterized in that The multiple flow table matching templates correspond one-to-one to the multiple message information combinations used for flow table matching, and the multiple message information combinations include: a first message information combination including only message layer 2 information, a second message information combination including message layer 2 information and message layer 3 information, and a third message information combination including message layer 2 information, message layer 3 information and message layer 4 information.
8. The method according to claim 7, characterized in that The message layer 2 information is the message machine address, the message layer 3 information is the network protocol address, and the message layer 4 information is the port address.
9. The method according to claim 7, characterized in that: The flow table matching is achieved through pipeline processing of a multi-level flow table cascade matching unit, and the multi-level flow table cascade matching unit matches the second layer information of the message, matches the third layer information of the message, and matches the fourth layer information of the message.
10. The method according to claim 1, characterized in that The multiple flow table matching templates correspond one-to-one to the multiple flow table matching requirements, and the multiple flow table matching requirements are determined based on communication protocols, security protocols, network communication environments, and user needs.
11. The method according to claim 1, characterized in that: The multiple data lengths include a maximum data length and half of the maximum data length. The characteristic field with the maximum data length corresponds to a full-table flow table entry, and the characteristic field with half of the maximum data length corresponds to a half-table flow table entry.
12. The method according to claim 11, characterized in that The multiple data lengths also include one quarter of the maximum data length, and the feature fields having one quarter of the maximum data length correspond to one quarter of the table flow table entries.
13. The method according to claim 1, characterized in that The at least one flow table entry operation is one or more of the following: a forwarding operation, a storage operation, a network protocol address editing operation, a port editing operation, a flow table statistics operation, a virtual local area network adding operation, and a virtual local area network removing operation.
14. The method according to claim 1, characterized in that The feature fields with the same data length in the at least one feature field constitute the same feature field block, and the positioning of the at least one feature field is based on the global number of each of the at least one feature fields, or based on the block number and internal relative number of the feature field block where each of the at least one feature field is located.
15. The method according to claim 14, characterized in that The multiple data lengths include a maximum data length and half of the maximum data length, the characteristic fields having the maximum data length constitute a first characteristic field block, the characteristic fields having half of the maximum data length constitute a second characteristic field block, the size of the first characteristic field block is the same as the size of the second characteristic field block, and the maximum number of characteristic fields that the first characteristic field block can accommodate is half of the maximum number of characteristic fields that the second characteristic field block can accommodate.
16. A computer device, characterized in that: The computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 15 when executing the computer program.
17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which, when executed on a computer device, cause the computer device to perform the method according to any one of claims 1 to 15.
Citation Information
Patent Citations
Processing method and system based on flow table
CN104168203A
Link Failure Detection and Traffic Redirection in an Openflow Network
US20110286324A1
