A network device, table item processing method and medium

By configuring priority for the search processing unit and the result processing unit in the network device, the resource usage and aggregation processing of the search results are reduced, the search efficiency and robustness are improved, and the search results aggregation is solved in the existing technology across group memory banks search results in the previous technology Inefficiency problem.

CN118714074BActive Publication Date: 2024-11-08格创通信(浙江)有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411199745.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-11-08
Estimated Expiration
2044-08-29

AI Technical Summary

Technical Problem

When existing network devices use TCAM to store ACLs, the search results of cross-group storage banks are inefficient, resource cost is high, robustness is poor, and there are frequent transfer operations during ACL management and expansion, resulting in insufficient efficiency and flexibility.

Method used

By configuring the search processing unit and the result processing unit of the priority relationship in the network device, the search processing unit of the high priority is passed to the keywords to the low priority processing unit and searches in each memory bank group, thereby reducing the Resource usage and efficiency improvement, avoid result aggregation processing, and directly output high-priority results.

Benefits of technology

It realizes the management and processing efficiency of finding results in network equipment, reduces resource usage costs, improves robustness and search efficiency, and reduces the complexity and migration operations of ACL table entry management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118714074B_ABST
    Figure CN118714074B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a network device, a table item processing method and a medium, which relates to the field of data processing technology and is applied to a network device, wherein a first search processing unit searches for a target table item matching a first search keyword in a first storage body under management, and a second search processing unit receives the first search keyword transmitted by the first search processing unit, and searches for a target table item matching the first search keyword in a second storage body under management; a first result processing unit obtains a result output situation, and transmits the result output situation to a second result processing unit, and the second result processing unit obtains a first hit situation of the target table item in the second storage body under management, and processes the first search result of the obtained target table item according to the result output situation and the first hit situation. Applying the technical solution provided by the embodiment of the present application can reduce the resource cost required for table lookup and improve robustness and efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a network device, a table entry processing method and a medium. Background Art

[0002] Currently, network devices such as routers and switches use ternary content addressable memory (TCAM) to store access control lists (ACLs) to obtain corresponding operations on messages.

[0003] In TCAM, ACL storage is implemented in units of banks. Multiple banks form a bank group, and each bank group is managed by a lookup processing unit (LPU). When banks across groups are used to store an ACL table entry, each LPU copies the key and sends it to the banks included in the managed bank group. The search results within each bank are first obtained, and then the external module performs unified aggregation processing to obtain the final search result output. However, during the transmission of the LPU copy key, the transmission queues within the network on chip (NOC) routing are independent, resulting in different times when the same key arrives at the banks included in different groups. After the table lookup is completed, the time when the search results within each group are obtained is also different. This places high design requirements on the external module to aggregate the search results of different groups and at different times. The resource cost required to achieve aggregation is relatively large, and the robustness and efficiency are low. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a network device, a table entry processing method and a medium to reduce the resource cost required for table lookup and improve robustness and efficiency. The specific technical solution is as follows:

[0005] In a first aspect, an embodiment of the present application provides a network device, including a TCAM, a plurality of search processing units and a plurality of result processing units connected to the TCAM; the TCAM includes a plurality of memory bank groups, each memory bank group includes a plurality of memory banks, each search processing unit and each result processing unit respectively manages a memory bank group;

[0006] Of the two search processing units of adjacent priorities, the first search processing unit with a higher priority is used to transmit the acquired first search keyword to the second search processing unit with a lower priority, and search for a target table entry matching the first search keyword in a first storage body included in the storage body group managed by the first search processing unit, where the first storage body belongs to the ACL corresponding to the first search keyword;

[0007] Of the two search processing units with adjacent priorities, the second search processing unit with a low priority is used to receive the first search keyword transmitted by the first search processing unit with a high priority, and search for a target table entry matching the first search keyword in a second storage body included in the storage body group managed by the second search processing unit, where the second storage body belongs to the ACL corresponding to the first search keyword;

[0008] Of the two result processing units of adjacent priorities, the first result processing unit with a higher priority is used to obtain a result output condition and transmit the result output condition to the second result processing unit with a lower priority, wherein the result output condition indicates an output condition of the first search result of the target table item;

[0009] Among the two result processing units with adjacent priorities, the second result processing unit with a low priority is used to receive the result output status transmitted by the first result processing unit with a high priority, and obtain the first hit status of the target table item in the second storage body included in the storage body group managed by the second result processing unit; according to the result output status and the first hit status, the first search result of the target table item obtained by the second result processing unit is processed.

[0010] In some embodiments, the first result processing unit is a result processing unit with the highest priority;

[0011] The first result processing unit is also used to obtain a second hit condition of the target table entry in the first storage body included in the storage body group managed by the first result processing unit; if the second hit condition indicates that the target table entry hits, output the first search result of the target table entry obtained by the first result processing unit.

[0012] In some embodiments, the second result processing unit is specifically configured to output the first search result of the target table item obtained by the second result processing unit if the result output condition indicates that the first search result is not output and the first hit condition indicates that the target table item is hit.

[0013] In some embodiments, the second result processing unit is a result processing unit of the lowest priority;

[0014] The second result processing unit is further configured to generate and output a second search result that is a miss if the result output condition indicates that the first search result is not output and the first hit condition indicates that the target table entry is a miss.

[0015] In some embodiments, the second result processing unit is not a result processing unit of the lowest priority;

[0016] The second result processing unit is also used to generate a result output situation indicating that the first search result is not output if the result output situation indicates that the first search result is not output and the first hit situation indicates that the target table item is not hit; if the result output situation indicates that the first search result is output, or the result output situation indicates that the first search result is not output and the first hit situation indicates that the target table item is hit, then generate a result output situation indicating that the first search result is output.

[0017] In some embodiments, each storage body managed by the second result processing unit corresponds to a first bit string whose length is the number of storage bodies included in the storage body group, and each bit in the first bit string corresponds to a storage body managed by the first result processing unit; the bit corresponding to the first storage body in the first bit string corresponding to the second storage body is set to a first preset value.

[0018] In some embodiments, the result output is a second bit string whose length is the number of memory banks included in the memory bank group, and each bit in the second bit string corresponds to a memory bank managed by the first result processing unit;

[0019] The first result processing unit is specifically configured to set the bit corresponding to the first storage body in the second bit string to a second preset value if the first search result of the target table entry corresponding to the first storage body has been output;

[0020] The second result processing unit is specifically used to determine the first bit in the first bit string corresponding to the second storage body whose value is the first preset value; according to the value of the second bit in the second bit string that is in the same position as the first bit, and the first hit situation, the first search result of the target table item obtained by the second result processing unit is processed.

[0021] In some embodiments, each storage bank corresponds to a first queue, and the first queue is used to cache the search results;

[0022] A third result processing unit, configured to send a back pressure signal to a third search processing unit managing the third storage body when the number of search results cached in the first queue corresponding to the third storage body managed by the third result processing unit is greater than a preset number;

[0023] The third search processing unit is used to stop searching for a target table entry matching a second search keyword according to a received back pressure signal, where the second search keyword corresponds to an ACL to which the third storage body belongs.

[0024] In some embodiments, when the third search processing unit is not a search processing unit with the highest priority, the third search processing unit is further configured to send the back pressure signal to a higher level search processing unit after receiving the back pressure signal;

[0025] In the case that the third search processing unit is not the search processing unit with the lowest priority, the third search processing unit is further configured to stop sending the second search keyword to the next level search processing unit.

[0026] In some embodiments, each storage body corresponds to a second queue, and the second queue is used to cache ACL entries;

[0027] a fourth search processing unit, configured to obtain a write instruction of an ACL entry and pull up a load signal of a fourth storage body associated with the ACL entry;

[0028] The fourth storage body is used to read ACL entries from the second queue corresponding to the fourth storage body and write the read ACL entries into the fourth storage body during the period when the load signal is pulled high.

[0029] In some embodiments, when the fourth search processing unit is the search processing unit with the highest priority, the fourth search processing unit is specifically used to receive an ACL table entry write instruction sent by the upper layer software;

[0030] In the case that the fourth search processing unit is not the search processing unit with the highest priority, the fourth search processing unit is specifically configured to receive an ACL table entry write instruction sent by the previous level search processing unit.

[0031] In a second aspect, an embodiment of the present application provides a table entry processing method, which is applied to a network device, wherein the network device includes a TCAM, a plurality of search processing units connected to the TCAM, and a plurality of result processing units; the TCAM includes a plurality of storage body groups, each storage body group includes a plurality of storage bodies, and each search processing unit and each result processing unit respectively manages a storage body group;

[0032] Using two search processing units with adjacent priorities, the first search processing unit with a higher priority transmits the obtained first search keyword to the second search processing unit with a lower priority, and searches for a target table entry matching the first search keyword in a first storage body included in a storage body group managed by the first search processing unit, where the first storage body belongs to the ACL corresponding to the first search keyword;

[0033] Using two search processing units with adjacent priorities, a second search processing unit with a low priority receives a first search keyword transmitted by a first search processing unit with a high priority, and searches for a target table entry matching the first search keyword in a second storage body included in a storage body group managed by the second search processing unit, where the second storage body belongs to an ACL corresponding to the first search keyword;

[0034] Using two result processing units with adjacent priorities, a first result processing unit with a higher priority obtains a result output condition, and transmits the result output condition to a second result processing unit with a lower priority, wherein the result output condition indicates an output condition of the first search result of the target table item;

[0035] Among the two result processing units with adjacent priorities, the second result processing unit with a low priority receives the result output status transmitted by the first result processing unit with a high priority, and obtains the first hit status of the target table item in the second storage body included in the storage body group managed by the second result processing unit; according to the result output status and the first hit status, the first search result of the target table item obtained by the second result processing unit is processed.

[0036] In some embodiments, the first result processing unit is a result processing unit with the highest priority; and the method further comprises:

[0037] Utilize the first result processing unit to obtain the second hit condition of the target table entry in the first storage body included in the storage body group managed by the first result processing unit; if the second hit condition indicates that the target table entry hits, output the first search result of the target table entry obtained by the first result processing unit.

[0038] In some embodiments, the step of processing the first search result of the target table entry obtained by the second result processing unit according to the result output situation and the first hit situation includes:

[0039] If the result output condition indicates that the first search result is not output, and the first hit condition indicates that the target table entry is hit, the first search result of the target table entry obtained by the second result processing unit is output.

[0040] In some embodiments, the second result processing unit is a result processing unit with the lowest priority; and the method further comprises:

[0041] If the result output condition indicates that the first search result is not output, and the first hit condition indicates that the target table entry is not hit, then a second search result that is not hit is generated and output.

[0042] In some embodiments, the second result processing unit is not a result processing unit with the lowest priority; and the method further comprises:

[0043] If the result output situation indicates that the first search result is not output, and the first hit situation indicates that the target table entry is not hit, then a result output situation indicating that the first search result is not output is generated; if the result output situation indicates that the first search result is output, or, the result output situation indicates that the first search result is not output and the first hit situation indicates that the target table entry is hit, then a result output situation indicating that the first search result is output is generated.

[0044] In some embodiments, each storage body managed by the second result processing unit corresponds to a first bit string whose length is the number of storage bodies included in the storage body group, and each bit in the first bit string corresponds to a storage body managed by the first result processing unit; the bit corresponding to the first storage body in the first bit string corresponding to the second storage body is set to a first preset value.

[0045] In some embodiments, the result output is a second bit string whose length is the number of memory banks included in the memory bank group, and each bit in the second bit string corresponds to a memory bank managed by the first result processing unit;

[0046] The step of using the first result processing unit with a higher priority among two result processing units with adjacent priorities to obtain the result output situation comprises:

[0047] If the first search result of the target table entry corresponding to the first storage body has been output, using the first result processing unit with a higher priority among two result processing units with adjacent priorities to set the bit corresponding to the first storage body in the second bit string to a second preset value;

[0048] The step of processing the first search result of the target table entry obtained by the second result processing unit according to the result output situation and the first hit situation includes:

[0049] Determine the first bit in the first bit string corresponding to the second storage body whose value is the first preset value; process the first search result of the target table entry obtained by the second result processing unit according to the value of the second bit in the second bit string that is in the same position as the first bit, and the first hit condition.

[0050] In some embodiments, each storage bank corresponds to a first queue, and the first queue is used to cache the search result; the method further includes:

[0051] When the number of search results cached in the first queue corresponding to the third storage body managed by the third result processing unit is greater than a preset number, using the third result processing unit to send a back pressure signal to the third search processing unit managing the third storage body;

[0052] The third search processing unit is used to stop searching for a target table entry matching a second search keyword according to the received back pressure signal, wherein the second search keyword corresponds to the ACL to which the third storage body belongs.

[0053] In some embodiments, the method further comprises:

[0054] In the case where the third search processing unit is not the search processing unit with the highest priority, using the third search processing unit to send the back pressure signal to the next level search processing unit after receiving the back pressure signal;

[0055] In the case that the third search processing unit is not the search processing unit with the lowest priority, the third search processing unit is used to stop sending the second search keyword to the next-level search processing unit.

[0056] In some embodiments, each storage body corresponds to a second queue, and the second queue is used to cache ACL entries; the method further includes:

[0057] Using the fourth search processing unit, obtaining a write instruction of the ACL table entry, and pulling up a load signal of a fourth storage body associated with the ACL table entry;

[0058] By using the fourth memory bank, during the period when the load signal is pulled high, the ACL table entry is read from the second queue corresponding to the fourth memory bank, and the read ACL table entry is written into the fourth memory bank.

[0059] In some embodiments, the step of obtaining the write instruction of the ACL table entry by using the fourth search processing unit includes:

[0060] In the case where the fourth search processing unit is the search processing unit with the highest priority, using the fourth search processing unit to receive the write instruction of the ACL table item sent by the upper layer software;

[0061] In the case that the fourth search processing unit is not the search processing unit with the highest priority, the fourth search processing unit is used to receive the write instruction of the ACL table entry sent by the previous level search processing unit.

[0062] In some embodiments, the method further comprises:

[0063] Determine a fifth storage body to be enabled corresponding to the target ACL;

[0064] Keeping the data flow of the fifth memory bank closed;

[0065] After the table structure of the target ACL is added to the fifth storage body, the data flow of the fifth storage body is started.

[0066] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the above-mentioned table entry processing methods is implemented.

[0067] An embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute any of the above-mentioned table entry processing methods.

[0068] Beneficial effects of the embodiments of the present application:

[0069] In the technical solution provided by the embodiment of the present application, priorities are configured in advance for multiple search processing units and multiple result processing units included in the network device, and the first search processing unit with a high priority transmits the first search keyword to the second search processing unit with a low priority, so that the time difference when the same keyword arrives at the storage body included in each group is a fixed value, and the time difference when each group obtains the search result is also a fixed value, which is convenient for the network device to manage the search result. In addition, since the network device pre-configures the priority for each result processing unit, the first search result of the target table item obtained by each result processing unit also has a priority, and each low-priority second result processing unit can process the obtained first search result respectively according to the result output of the first result processing unit with a high priority. In this process, the network device processes the first search results from high priority to low priority in sequence, and no longer aggregates the search results obtained by each result processing unit to obtain the final search result output, which reduces the resource cost required for table lookup and improves the robustness and efficiency of result search.

[0070] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0072] Figure 1 is a first schematic diagram of a memory bank group;

[0073] Figure 2 is a second schematic diagram of a memory bank group;

[0074] Figure 3 is a third schematic diagram of a memory bank group;

[0075] Figure 4 A schematic diagram of the first structure of a network device provided in an embodiment of the present application;

[0076] Figure 5 A second structural diagram of a network device provided in an embodiment of the present application;

[0077] Figure 6 A third structural diagram of a network device provided in an embodiment of the present application;

[0078] Figure 7 A fourth structural diagram of a network device provided in an embodiment of the present application;

[0079] Figure 8 A flowchart of a table entry processing method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0080] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.

[0081] Currently, network devices such as routers and switches use TCAM to store ACLs and obtain corresponding operations on messages. As various user services continue to develop and the number of entries that need to be supported increases, the management efficiency and flexibility of ACLs are challenged. The continuous changes of ACLs during the business process require high-speed storage management of entries in TCAM. Complex business searches for fields of different lengths require the TCAM structure to be able to cope with search requirements of different granularities and perform corresponding aggregation processing of results to ensure the uniqueness of the final result.

[0082] In TCAM, ACL storage is implemented in units of storage bodies, and each storage body has a fixed depth and width. Due to the limitations of bus and hardware resources, storage bodies are often managed in groups. Multiple storage bodies constitute a storage body group, and each storage body group is managed by an LPU. The LPU can schedule a keyword copy to the storage bodies included in the managed storage body group every time, so that the storage body storing the corresponding ACL can search for the keyword.

[0083] In the prior art, a storage body of the same storage body group can be used to store an ACL. If the depth required by the current ACL exceeds the upper limit of the depth of a storage body, it is necessary to enable the idle storage bodies of the same group for depth expansion, and in subsequent keyword searches, priority processing is performed based on the hits of multiple storage bodies to obtain a unique search result. At this time, if there are no idle storage bodies in the same group, it is necessary to move other ACLs stored in other storage bodies of the same group to storage bodies of other storage body groups, or move the entire current ACL to storage bodies of other storage body groups. In addition, if it is necessary to add ACL table entries but there is no corresponding storage space in the enabled storage body, it is also necessary to enable the idle storage bodies of the same group for depth expansion, and this process may also result in a move operation.

[0084] Similarly, if the width required by the current ACL exceeds the upper limit of the width of a storage body, it is necessary to enable the idle storage bodies in the same group that are adjacent horizontally to expand the width, and in the subsequent keyword search, perform horizontal intersection processing based on the hits of multiple storage bodies to obtain a unique search result. At this time, if there is no suitable idle storage body in the same group, it is necessary to move other ACLs stored in other storage bodies in the same group to another storage body, or to move them to the storage body of other storage body groups, or to move the entire current ACL to the storage body of other storage body groups. The above process will perform a large number of move operations, which makes storage body management difficult and time-consuming.

[0085] Take the memory bank group including 8 memory banks as an example. Figure 1 In the memory bank group (i.e., TCAM group) shown in the figure, the LPU manages 8 memory banks. The TCAM group stores 3 ACLs, namely, Table (T) 0, T1, and T2. T0 occupies 2 memory banks horizontally, and T1 and T2 occupy 1 memory bank respectively. TB represents an idle memory bank, i.e., a memory bank that does not store ACLs.

[0086] If T1 needs to be deeply expanded and 5 free memory banks are enabled, what may happen is that 4 free memory banks in the TCAM group are occupied first, and then there are no extra free memory banks in the TCAM group. In this case, T0 or T2 can be moved to other memory bank groups, or T1 can be moved to other memory bank groups.

[0087] If you need to store an ACL with a width of 3, since there are 4 consecutive idle memory banks in the horizontal direction in the TCAM group, you can enable 3 consecutive idle memory banks in the horizontal direction without moving them to store the ACL. Figure 2As shown, since there are no three consecutive idle memory banks in the TCAM group in the horizontal direction, it is necessary to first perform an ACL move operation, such as moving T1 to an upper idle memory bank, and then store the new ACL.

[0088] In the process of dynamically adding and modifying ACL, migration operation is necessary, which makes storage management difficult and time-consuming. As the number of ACL entries increases, the number of ACL entries that need to be migrated increases, and the time consumption also increases significantly.

[0089] It can be seen that using the storage resources of a single storage group to store an ACL limits the flexibility of the group table. The fewer idle storage resources (i.e., idle storage bodies) that can be coordinated and called, the easier it is to trigger a move operation to adjust the structure. At the same time, the storage resources of a single storage group limit the upper limit of the number of ACL table items (i.e., the depth of the ACL), and lack the scalability to store deep ACLs.

[0090] Another approach in the prior art is to use storage bodies across groups to jointly store an ACL. When using storage bodies across groups to jointly store an ACL table entry, each LPU copies the keyword and sends it to the storage bodies included in the managed storage body group, so that the storage body storing the corresponding ACL searches for the keyword. Within each group, the search results of the storage bodies storing the same ACL are prioritized (i.e., in the case of depth expansion) and / or intersection processing (i.e., in the case of width expansion), and the search results within each group are first obtained. Then, the search results of each group are uniformly aggregated in the module outside the group (i.e., priority processing, taking the search results of the storage body group with the highest priority), so as to obtain the final search results (i.e., the search results of the keyword) output. When it is necessary to add or modify the ACL, if there is no free storage body in the same group, a free storage body is directly searched across groups to store the ACL table entry.

[0091] like Figure 3 The two memory banks shown, namely TCAM bank 1 and TCAM bank 2, are each managed by an LPU. TCAM bank 1 stores three ACLs, namely T0, T1, and T2, where T0 and T1 occupy two memory banks horizontally, and T2 occupies one memory bank. TCAM bank 2 stores two ACLs, namely T0 and T3, where T0 occupies two memory banks horizontally, and T3 occupies one memory bank. Figure 3 In the example, T0 uses cross-group storage. After obtaining the search results of TCAM group 1 and TCAM group 2 respectively, a TCAM result aggregator (TRA) module (i.e., an out-of-group module) is used to perform priority processing to obtain the final search result.

[0092] However, during the transmission of the LPU copy keyword, the transmission queues in the NOC routing are independent, resulting in different times when the same keyword arrives at the storage bodies included in different groups. After the table lookup (i.e., the ACL table entry) is completed, the time when the search results are obtained in each group is also different. This places high demands on the design of the out-of-group module to aggregate the search results of different groups and at different times. The out-of-group module needs to be able to process the search results at a certain interval, and some other adaptation mechanisms are required, such as the timeout mechanism. The resource cost required for the out-of-group module to achieve aggregation is relatively large, and the robustness and efficiency are low. If congestion occurs, the table lookup will be slow, the efficiency will be further reduced, and it may even be stuck. When assembling the table, since the storage body groups managed by each LPU are independent, there is still no way to coordinate the use of the storage resources of multiple storage body groups managed by multiple LPUs.

[0093] In addition, if resource cost is not considered, a large number of storage bodies can be directly put into the same storage body group for management, and the total number of storage bodies managed in the group can be increased to avoid the movement caused by adding and modifying ACLs. However, the number of multiplexer (MUX) buses increases rapidly with the increase in the number of storage bodies, and hardware resources are occupied.

[0094] The growth of the MUX bus is mainly reflected in two parts. The first is the keyword replication MUX bus. The LPU sends the keyword to each storage body under management through the replication MUX bus. When the number of storage bodies included in a storage body group increases from 8 to 16, the replication MUX bus increases from 1 to 8 to 1 to 16. In addition, due to the large area of ​​the storage body, the routing will be longer, causing timing tension. The second is the search result MUX bus. The search results output by the storage bodies included in a storage body group are sent to the search initiation unit through a search result MUX bus. When the number of storage bodies included in a storage body group increases from 8 to 16, the search result MUX bus increases from 8 to 1 to 16 to 1. At the same time, the increase in the length of keywords and search results will also lead to a further increase in the resources occupied by MUX.

[0095] In summary, as the current business requirements for ACL architecture gradually increase, flexibility and scalability are becoming more and more important. Under the premise of using the same number of TCAM storage bodies, it is hoped that user services can be implemented as flexibly as possible, the cost can be reduced, the waiting time can be reduced, and the resource consumption of the MUX bus can be minimized. In the prior art, when implementing ACL search, if a large number of storage bodies are put into the same storage body group for management, the hardware overhead is large, and as the number of ACL searches increases, the hardware connections increase exponentially. If the table entry migration function of TCAM is used, the ACL table entries stored in the global storage body are continuously adjusted, so that the table entries of the same ACL are as close as possible physically, and then the ACL is constructed in a single storage body group through the existing physical connections. In this way, due to the limited number of connections, the hardware overhead is reduced, but the table entry migration operation will be more frequent, resulting in a longer waiting time. If multiple storage body groups are independent of each other, and a cross-group storage body is used to jointly store an ACL, the confusion of the timing during the transmission of keywords and search results will make it difficult to aggregate the search results of multiple groups.

[0096] To solve the above problems, the present application provides a network device, such as Figure 4 As shown, it includes TCAM, multiple search processing units 41 connected to the TCAM, and multiple result processing units 42. The TCAM includes multiple storage groups 43, each storage group 43 includes multiple storage bodies, each search processing unit 41 and each result processing unit 42 respectively manages one storage group 43, and each storage group includes the same number of storage bodies. For ease of description, the following description is based on the example that each storage group includes 8 storage bodies. The number of storage groups included in the TCAM, the number of search processing units and result processing units included in the network device, the number of storage bodies included in each storage group, and the arrangement of the storage bodies in the storage group are not limited.

[0097] In the embodiment of the present application, the plurality of storage body groups 43 are pre-set with priorities, and the plurality of search processing units 41 and the plurality of result processing units 42 that manage the plurality of storage body groups are also pre-set with priorities. The plurality of search processing units 41 are sequentially connected according to the pre-set priority order, and the plurality of result processing units 42 are sequentially connected according to the pre-set priority order, and the search processing units 41 and the result processing units 42 that manage the same storage body group have the same priority.

[0098] Of the two search processing units of adjacent priorities, the first search processing unit with a higher priority is used to transmit the acquired first search keyword to the second search processing unit with a lower priority, and search for a target table entry matching the first search keyword in a first storage body included in the storage body group managed by the first search processing unit;

[0099] Of the two search processing units of adjacent priorities, the second search processing unit of low priority is used to receive the first search keyword transmitted by the first search processing unit of high priority, and search for a target table entry matching the first search keyword in a second storage body included in the storage body group managed by the second search processing unit;

[0100] Of the two result processing units of adjacent priorities, the first result processing unit with a higher priority is used to obtain the result output status and transmit the result output status to the second result processing unit with a lower priority, where the result output status indicates the output status of the first search result of the target table item;

[0101] Among the two result processing units with adjacent priorities, the second result processing unit with a lower priority is used to receive the result output status transmitted by the first result processing unit with a higher priority, and obtain the first hit status of the target table item in the second storage body included in the storage body group managed by the second result processing unit; according to the result output status and the first hit status, the first search result of the target table item obtained by the second result processing unit is processed.

[0102] In the technical solution provided by the embodiment of the present application, priorities are configured in advance for multiple search processing units and multiple result processing units included in the network device, and the first search processing unit with a high priority transmits the first search keyword to the second search processing unit with a low priority, so that the time difference when the same keyword arrives at the storage body included in each group is a fixed value, and the time difference when each group obtains the search result is also a fixed value, which is convenient for the network device to manage the search result. In addition, since the network device pre-configures the priority for each result processing unit, the first search result of the target table item obtained by each result processing unit also has a priority, and each low-priority second result processing unit can process the obtained first search result respectively according to the result output of the first result processing unit with a high priority. In this process, the network device processes the first search results from high priority to low priority in sequence, and no longer aggregates the search results obtained by each result processing unit to obtain the final search result output, which reduces the resource cost required for table lookup and improves the robustness and efficiency of result search.

[0103] In the embodiment of the present application, the first search keyword is any keyword to be matched with an entry of an ACL, that is, the first search keyword corresponds to an ACL (such as the first ACL). The first search keyword includes relevant information of the message, such as an Internet Protocol (IP) address, a Media Access Control (MAC) address, a port number, etc., and the content of the first search keyword is not limited here.

[0104] In the TCAM, multiple storage bodies included in multiple storage body groups store at least one ACL table entry, each storage body belongs to an ACL, and only stores the table entry of the ACL. Among the multiple search processing units included in the network device, the search processing unit corresponding to the first ACL (that is, the search processing unit that manages the storage body belonging to the first ACL) obtains the first search keyword. Other search processing units may not obtain the first search keyword to reduce resource consumption.

[0105] There can be one or more search processing units corresponding to the first ACL, and there is no limitation on this. For ease of description, the following description will take the case where there are multiple search processing units corresponding to the first ACL as an example, and the search processing unit corresponding to the first ACL will be referred to as the search processing unit, the search processing unit with the highest priority corresponding to the first ACL will be referred to as the search processing unit with the highest priority, and the search processing unit with the lowest priority corresponding to the first ACL will be referred to as the search processing unit with the lowest priority, without any limitation.

[0106] Among the multiple search processing units, for any two search processing units of adjacent priorities, the search processing unit with a higher priority is the first search processing unit, and the search processing unit with a lower priority is the second search processing unit. When the first search processing unit is the search processing unit with the highest priority, the first search processing unit can receive the search keyword sent by other units in the network device as the first search keyword, and transmit the first search keyword to the second search processing unit; when the first search processing unit is not the search processing unit with the highest priority, the first search processing unit can receive the search keyword transmitted by the upper-level search processing unit as the first search keyword, and transmit the first search keyword to the second search processing unit.

[0107] Each second search processing unit can determine whether the current second search processing unit is the search processing unit with the lowest priority. When the second search processing unit is not the search processing unit with the lowest priority, the second search processing unit continues to transmit the first search keyword to the next level search processing unit; when the second search processing unit is the search processing unit with the lowest priority, the second search processing unit no longer continues to transmit the first search keyword.

[0108] In an embodiment of the present application, the network device may also include multiple search initiating units (i.e., other units), each search initiating unit corresponds to an ACL, and is used to send a keyword corresponding to the ACL, and each search initiating unit is pre-configured with a corresponding ACL table identifier (Identity Document, ID) and a correspondence between the search processing unit with the highest priority. The search initiating unit corresponding to the first ACL (i.e., the first search initiating unit) can determine the search processing unit with the highest priority based on the correspondence, and send the first search keyword to the search processing unit. The way in which the search processing unit with the highest priority obtains the first search keyword is not limited here.

[0109] Each search processing unit obtains the first search keyword and the accompanying information corresponding to the first search keyword (i.e., the first accompanying information) at the same time. The search processing unit with the highest priority receives the first search keyword and the first accompanying information sent by the first search initiating unit, and transmits the first search keyword and the first accompanying information to the lower-level search processing unit step by step. The accompanying information may include at least one relevant information such as the table ID of the ACL (i.e., the first table ID), the keyword ID of the search keyword (i.e., the first keyword ID), etc., and the content of the accompanying information is not limited here.

[0110] Each search processing unit may be pre-configured with a correspondence between an ACL table ID and priority information. After obtaining the first accompanying information, each search processing unit may determine the priority information corresponding to the first table ID according to the first table ID in the first accompanying information, and determine whether the current search processing unit is the search processing unit with the lowest priority according to the priority information. Only when it is not the search processing unit with the lowest priority, the first search keyword and the first accompanying information are transmitted to the next-level search processing unit. In the embodiment of the present application, the priority information may be flag information indicating whether the current search processing unit is the search processing unit with the lowest priority, and the priority information is not limited here.

[0111] Each search processing unit can send the acquired first search keyword to each storage body included in the managed storage body group. In order to save search resources, each search processing unit can determine the storage body corresponding to the first table ID in the storage bodies included in the managed storage body group according to the first ACL, obtain the storage body belonging to the first ACL and enable it, and search for the ACL table entry (i.e., the target table entry) matching the first search keyword in the storage body belonging to the first ACL.

[0112] For any two search processing units of adjacent priorities, the storage body group managed by the first search processing unit is the first storage body group, and the storage bodies included in the first storage body group and belonging to the first ACL are the first storage bodies; similarly, the storage body group managed by the second search processing unit is the second storage body group, and the storage bodies included in the first storage body group and belonging to the first ACL are the second storage bodies.

[0113] In the embodiment of the present application, when each search processing unit also obtains the first accompanying information, each search processing unit can determine the storage body belonging to the first ACL according to the first table ID in the first accompanying information, which is represented by the third bit string. The correspondence between the table ID of the ACL and the third bit string is pre-configured in each search processing unit. The length of the third bit string is the number of storage bodies included in the storage body group. Each bit in the third bit string corresponds to a managed storage body, and the bit value corresponding to the storage body of the ACL corresponding to the table ID in the third bit string is a third preset value. The third preset value can be any value, such as 0, 1, etc., and there is no limitation on this. The bit value corresponding to other storage bodies in the third bit string can be any value that is not the third preset value, and there is no limitation on this.

[0114] Each search processing unit can determine the third bit string corresponding to the first table ID according to the first table ID in the first accompanying information, and the storage body corresponding to the bit whose value in the third bit string is the third preset value is the storage body belonging to the first ACL. Each search processing unit sends the third bit string to each storage body included in the managed storage body group. For each storage body, when the corresponding bit in the third bit string is the third preset value, the storage body is enabled, and the storage body searches for the target table entry that matches the first search keyword.

[0115] Each search processing unit may send the first search keyword to each storage body and then send the third bit string, or send the first search keyword and the third bit string to each storage body at the same time, which is not limited. Each search processing unit may also send the first search keyword and the first accompanying information to each storage body at the same time, which is not limited.

[0116] In an embodiment of the present application, each search processing unit is connected to each storage body included in the managed storage body group through a first MUX bus (i.e., a copy of the MUX bus), and information such as a first search keyword, a first accompanying information, and a third bit string are sent to each storage body through the first MUX bus. The specification of the first MUX bus is related to the number of storage bodies included in the storage body group. For example, when the number of storage bodies included in the storage body group is 8, the MUX bus is a 1-to-8 bus.

[0117] In the embodiment of the present application, each storage body belonging to the first ACL may have a different mapping to the first search keyword. Each storage body belonging to the first ACL may determine the mapping field to be searched in the first search keyword after receiving the first search keyword according to the mapping field of the pre-set search keyword, and search for the target table entry that matches the mapping field as the target table entry that matches the first search keyword.

[0118] After completing the search for the target entry, each storage body belonging to the first ACL can send the matching status of the target entry to the result processing unit that manages the storage body. The matching status can be a bit string (i.e., the fourth bit string) whose length is the depth of the storage body. Each bit in the fourth bit string corresponds to an ACL entry in the storage body. When any ACL entry matches the first search keyword, the value of the bit corresponding to the ACL entry in the fourth bit string is the fourth preset value. The fourth preset value can be any preset value, such as 0, 1, etc., which is not limited. When any ACL entry does not match the first search keyword, the value of the bit corresponding to the ACL entry in the fourth bit string can be any value that is not the fourth preset value, which is not limited. The depth of the storage body can be 1024, 2048, etc., which is not limited here.

[0119] Each result processing unit is connected to each managed storage body through a corresponding first channel (lane). Each storage body belonging to the first ACL can send the matching status of the target table item to the result processing unit managing the storage body based on the corresponding first channel, so that the result processing unit can perform subsequent processing according to the matching status of the target table item to obtain the hit status of the target table item, the first search result and the result output status.

[0120] In the embodiment of the present application, the hit situation indicates whether the first search keyword matches the target table item. When the hit situation indicates that the target table item is hit, it indicates that the first search keyword matches the target table item; when the hit situation indicates that the target table item is not hit, it indicates that the first search keyword does not match the target table item. The first search result is the result index (index) corresponding to the target table item when the target table item is hit. When the depth of the storage body is 1024, the length of the result index can be 10 bits, and the length of the result index is not limited here. The result output situation indicates that the current level result processing unit or the upper level result processing unit hits the target table item and outputs the first search result of the target table item. When the result output situation indicates that the first search result is output, it means that the current level result processing unit or the upper level result processing unit hits the target table item and outputs the first search result; when the result output situation indicates that the first search result is not output, it means that both the current level result processing unit and the upper level result processing unit do not hit the target table item and do not output the first search result.

[0121] Among the multiple result processing units, for any two result processing units of adjacent priorities, the result processing unit with a higher priority is the first result processing unit, and the result processing unit with a lower priority is the second result processing unit. Corresponding to the multiple search processing units mentioned above, the multiple result processing units in the embodiment of the present application are abbreviations of the result processing units corresponding to the first ACL.

[0122] The first result processing unit obtains the result output situation and transmits the result output situation to the second result processing unit. The specific manner in which the first result processing unit obtains the result output situation can be found in the following text and will not be described in detail here.

[0123] The second result processing unit receives the output result transmitted, and determines the hit status of each second storage body (i.e., the hit status of the target table item in each second storage body) according to the matching status of the target table item obtained by each second storage body under management, and then obtains the hit status of the target table item in all second storage bodies (i.e., the first hit status). For ease of description, the following description is taken as an example that a second result processing unit obtains the first hit status.

[0124] When there is only one second storage body managed by the second result processing unit, if the matching situation indicates that there is no match, that is, there is no bit with a value of the fourth preset value in the fourth bit string corresponding to the second storage body, the second result processing unit can determine that the hit situation of the second storage body indicates that the target table entry is not hit. If the matching situation indicates that there is a match, that is, there is a bit with a value of the fourth preset value in the fourth bit string corresponding to the second storage body, the second result processing unit can determine that the hit situation of the second storage body indicates that the target table entry is hit.

[0125] When there are multiple second storage banks managed by the second result processing unit, the second result processing unit may obtain the hit status of each second storage bank according to the extension types of the multiple second storage banks.

[0126] For example, when there is a second storage body with an extended width among multiple second storage bodies, the second result processing unit takes the intersection of the matching conditions of the target table items in the multiple second storage bodies with extended widths (that is, takes the intersection of multiple fourth bit strings), and obtains the matching condition after taking the intersection as the matching condition of the target table item in each second storage body with extended widths. If the matching condition after taking the intersection indicates a match, the second result processing unit can determine that the hit condition of each second storage body with extended widths indicates that the target table item is hit; if the matching condition after taking the intersection indicates a mismatch, the second result processing unit can determine that the hit condition of each second storage body with extended widths indicates that the target table item is not hit.

[0127] For another example, when there is a deeply expanded second storage body among the multiple second storage bodies, the way in which each deeply expanded second storage body obtains a hit condition is the same as the above case where there is only one second storage body, and the details can be found in the above description.

[0128] The second result processing unit can determine the hit situation of each second storage body in the above manner, and then obtain the first hit situation. In the embodiment of the present application, the first hit situation can be a fifth bit string whose length is the number of storage bodies included in the storage body group, and each bit in the fifth bit string corresponds to a storage body managed by the second result processing unit. When the hit situation of any second storage body indicates that the target table item is hit, the value of the bit corresponding to the second storage body in the fifth bit string is the fifth preset value. The fifth preset value can be any preset value, such as 0, 1, etc., which is not limited to this. When the hit situation of any second storage body indicates that the target table item is not hit, the bit value corresponding to the second storage body in the fifth bit string can be any value that is not the fifth preset value, and the bit values ​​corresponding to other storage bodies in the fifth bit string except the second storage body can also be any value that is not the fifth preset value, which is not limited to this.

[0129] When the bit value corresponding to any second storage body in the fifth bit string is the fifth preset value (i.e., the hit condition of any second storage body indicates that the target table item is hit), the second result processing unit determines that the first hit condition indicates that the target table item is hit; when the bit values ​​corresponding to all second storage bodies in the fifth bit string are not the fifth preset value (i.e., the hit conditions of all second storage bodies indicate that the target table item is not hit), it is determined that the first hit condition indicates that the target table item is not hit. The order in which the second result processing unit receives the result output and obtains the first hit condition is not limited here.

[0130] In an embodiment of the present application, the second result processing unit can obtain the search result of the second storage body according to the matching situation of the second storage body (when there is width expansion, it refers to the matching situation after the intersection), that is, obtain the first search secondary result of the target table item and the second search result that missed.

[0131] For the matching situation of each second storage body, if the matching situation indicates a match, the second result processing unit can determine at least one bit in the fourth bit string whose value is the fourth preset value, determine the result index corresponding to the lowest bit of the at least one bit, and obtain the first search result of the target table item. After obtaining the first search result, the second result processing unit can process the obtained first search result according to the result output of the upper-level result processing unit and the first hit situation of the current-level result processing unit (at this time, the first hit situation indicates that the target table item is hit). If the matching situations of multiple second storage bodies indicate a match, the second result processing unit can obtain multiple first search results and process the obtained multiple first search results.

[0132] For the matching situation of each second storage body, if the matching situation indicates that there is no match, the second result processing unit can determine that the target table item in the second storage body is not hit, and then determine the miss index to obtain a second search result of a miss. After obtaining the second search result, the second result processing unit can process the obtained second search result according to the result output of the upper-level result processing unit and the first hit situation of the current-level result processing unit (at this time, the first hit situation may indicate that the target table item is hit, or may indicate that the target table item is not hit). If the matching situation of multiple second storage bodies indicates that there is no match, the second result processing unit can obtain multiple second search results and process the obtained multiple second search results.

[0133] The order in which the second result processing unit obtains the first hit situation and the search result is not limited here.

[0134] In the embodiment of the present application, each result processing unit obtains the first accompanying path information of the first search keyword while obtaining the search result, and the first accompanying path information is output along with the search result in subsequent processing.

[0135] In the embodiment of the present application, when the first result processing unit is not the result processing unit with the highest priority, the first result processing unit can be used as the second result processing unit of the upper-level result processing unit to execute the corresponding steps of the second result processing unit. Similarly, when the second result processing unit is not the result processing unit with the lowest priority, the second result processing unit can be used as the first result processing unit of the lower-level result processing unit to execute the corresponding steps of the first result processing unit, and this is not limited.

[0136] Each result processing unit may be pre-configured with a correspondence between the ACL table ID and the priority information. After obtaining the search result and the first associated path information, each result processing unit may determine the priority information corresponding to the first table ID based on the first table ID in the first associated path information, and determine whether the current result processing unit is the result processing unit with the lowest / highest priority based on the priority information, which is similar to the correspondence between the table ID and the priority information pre-configured in the above-mentioned search processing unit, and will not be described in detail here.

[0137] In some embodiments, when the first result processing unit is the result processing unit with the highest priority, the first result processing unit is further used to obtain a second hit status of the target table entry in the first storage body included in the storage body group managed by the first result processing unit; if the second hit status indicates that the target table entry is hit, the first search result of the target table entry obtained by the first result processing unit is output.

[0138] In the technical solution provided in the embodiment of the present application, for the result processing unit with the highest priority, it is only necessary to determine whether to output the first search result obtained based on the hit status of the storage bodies included in the managed storage body group, without being affected by other result processing units, so as to give priority to the first search result of the result processing unit with the highest priority.

[0139] The first result processing unit obtains the second hit condition of the target table entry in the first storage body. The second hit condition can be a bit string (i.e., the fifth bit string) whose length is the number of storage bodies included in the storage body group. When the bit value corresponding to any first storage body in the fifth bit string is the fifth preset value, it is determined that the second hit condition indicates that the target table entry is hit; when the bit values ​​corresponding to all first storage bodies in the fifth bit string are not the fifth preset value, it is determined that the second hit condition indicates that the target table entry is not hit. The first result processing unit obtains the second hit condition in the same manner as the second result processing unit obtains the first hit condition. For details, please refer to the relevant description of obtaining the first hit condition.

[0140] In the embodiment of the present application, the first result processing unit also obtains the search result of the first storage body in the same way as the second result processing unit obtains the search result of the second storage body. For details, please refer to the relevant description of obtaining the search result of the second storage body.

[0141] Since there is no upper-level result processing unit, whether the first result processing unit outputs the search result is only related to the second hit situation. It can be considered that the result output situation obtained by the first result processing unit indicates that the first search result is not output.

[0142] When the second hit condition indicates that the target table entry is hit and the search result of the first storage bank acquired by the first result processing unit includes the first search result of the target table entry, the first result processing unit outputs the first search result.

[0143] In the embodiment of the present application, when multiple first search results are obtained, the first result processing unit can determine the first search result of the first storage body with the highest priority from the multiple first search results according to the preset priority order of the first storage body, and output the first search result. When one first search result is obtained, the first result processing unit can output the one first search result.

[0144] After determining the first search result, the first result processing unit may match the associated result corresponding to the first search result according to the pre-stored associated result table, output the associated result, and return the associated result to the unit that sent the first search keyword (such as the first search initiating unit).

[0145] In an embodiment of the present application, each result processing unit is connected to multiple search initiating units through multiple second MUX buses (i.e., search result MUX buses), and each bus in the second MUX buses is used to transmit the associated results of the search results of a storage body. Each result processing unit can determine the first search initiating unit that sends the first search keyword to the result processing unit based on the accompanying information (such as the first table ID), determine the output port corresponding to the first search initiating unit, place the associated result on the bus corresponding to the second MUX bus of the output port, and return the associated result to the search initiating unit through the second MUX bus. The specification of the second MUX bus is related to the number of storage bodies included in the storage body group. For example, when the number of storage bodies included in the storage body group is 8, the second MUX bus is an 8-to-1 bus.

[0146] The first result processing unit can obtain the first search result of the first storage body with the highest priority according to the second hit situation and the preset priority order of the first storage body. That is, the first result processing unit can determine one or more bits whose values ​​are the fifth preset values ​​from the fifth bit string, and determine the first storage body with the highest priority corresponding to the one or more bits according to the preset priority order of the first storage body, so as to obtain the first search result of the first storage body.

[0147] In an embodiment of the present application, the result processing unit may include a result output subunit and an index processing subunit, and the result output subunit and the index processing subunit are connected through the number of second channels of the storage bodies included in the storage body group, and each second channel corresponds to a storage body included in the storage body group. In this case, the first result processing unit may include a first result output subunit and a first index processing subunit.

[0148] The first result output subunit can obtain the search result and the second hit condition of the first storage body. When the second hit condition indicates that the target table item is hit and the search result of the first storage body obtained by the first result output subunit includes the first search result of the target table item, the first result output subunit outputs the obtained first search result of the target table item to the first index processing subunit.

[0149] The first index processing subunit can receive the first search result of the target table item sent by the first result output subunit, and match the associated result corresponding to the first search result according to the pre-stored associated result table, and return the associated result to the unit that sends the first search keyword (such as the first search initiation unit).

[0150] In the embodiment of the present application, the first result output subunit may output the first search result to the first index processing subunit through the second channel corresponding to the first storage body whose search result is the first search result.

[0151] When the first result output subunit obtains multiple first search results, the first result output subunit can output the multiple first search results to the first index processing subunit through the corresponding second channel. The first index processing subunit can receive the multiple first search results through the corresponding second channel, and determine the first search result received from the second channel with the highest priority from the multiple first search results according to the preset priority order of the first storage body (that is, the preset priority order of the second channel), and then determine the first search result of the first storage body with the highest priority, and match the associated result corresponding to the first search result according to the pre-stored associated result table.

[0152] When the search result of the first storage body includes the first search result of the target table item and the second search result that is not hit, the first result output subunit may output only the first search result or all the search results. When all the search results are output, the first result processing unit may output all the search results to the first index processing subunit through the corresponding second channel. The first index processing subunit may receive all the search results through the corresponding second channel, and determine the first search result of the first storage body with the highest priority from all the search results.

[0153] In addition to outputting the search result to the first index processing subunit, the first result output subunit may also output the second hit situation (i.e., the fifth bit string) to the first index processing subunit, and each bit in the fifth bit string is output through the second channel corresponding to the storage body corresponding to the bit. The first index processing subunit may receive each bit in the fifth bit string through the corresponding second channel, and determine the first search result of the first storage body with the highest priority according to the fifth bit string and the priority order of the preset second channel.

[0154] The first index processing subunit can determine in sequence, in accordance with the priority order of the preset second channels, starting from the second channel with the highest priority, whether the value of a bit in the fifth bit string received through the second channel is the fifth preset value, so as to determine whether the search result received through the second channel is the first search result, until the bit with the value of the fifth preset value is determined, and then the second channel receiving the bit and the first search result received through the second channel are determined, so as to determine the first search result of the first storage body with the highest priority.

[0155] The first index processing subunit may also determine one or more bits having a fifth preset value and one or more second channels receiving the one or more bits from each bit in the fifth bit string received through the corresponding second channel, and determine the first search result received from the second channel with the highest priority among the one or more second channels according to the preset priority order of the second channels, and then determine the first search result of the first storage body with the highest priority. The manner in which the first result output subunit outputs the search result and the first index processing subunit determines the first search result of the first storage body with the highest priority is not limited here.

[0156] When the second hit condition indicates that the target table entry is not hit, the search results of the first storage body obtained by the first result processing unit are all second search results that are not hits, and the first result processing unit does not output any second search result, that is, blocks the obtained second search result.

[0157] In an embodiment of the present application, the first result processing unit also generates a result output situation. The result output situation can be a second bit string with a length equal to the number of storage bodies included in the storage body group, and each bit in the second bit string corresponds to a storage body managed by the first result processing unit. When the first search result of the target table item corresponding to the first storage body has been output, the value of the bit corresponding to the first storage body in the second bit string is a second preset value. The second preset value can be any preset value, such as 0, 1, etc., and this is not limited. When the first search result of the target table item corresponding to the first storage body is not output, the value of the bit corresponding to the first storage body in the second bit string can be any value that is not the second preset value, and the value of the bit corresponding to other storage bodies in the second bit string except the first storage body can also be any value that is not the second preset value, and this is not limited.

[0158] In the case where the first result processing unit is the result processing unit with the highest priority, when the second hit condition indicates that the target table entry is hit, the first result processing unit outputs the first search result of the target table entry obtained, that is, the first result processing unit determines that the first search result of the target table entry corresponding to the first storage body has been output, and the first result processing unit sets the bit corresponding to the first storage body in the second bit string to the second preset value, generates a result output condition indicating the output of the first search result, and transmits it to the second result processing unit. When the first result processing unit outputs multiple first search results, the first result processing unit sets the bits corresponding to the corresponding multiple first storage bodies in the second bit string to the second preset value.

[0159] When the second hit condition indicates that the target table entry is not hit, the first result processing unit does not output the second search result, that is, the first result processing unit determines that the first search result of the target table entry corresponding to the first storage body is not output, and the first result processing unit sets the bit corresponding to the first storage body in the second bit string to any value that is not the second preset value, generates a result output condition indicating that the first search result is not output, and transmits it to the second result processing unit.

[0160] The first result processing unit may also directly use the first hit situation as the result output situation, that is, directly use the fifth bit string as the second bit string, and there is no limitation on this.

[0161] In some embodiments, each storage body managed by the second result processing unit corresponds to a first bit string whose length is the number of storage bodies included in the storage body group, and each bit in the first bit string corresponds to a storage body managed by the first result processing unit (i.e., the result processing unit at the previous level of the second result processing unit). The bit corresponding to the first storage body in the first bit string corresponding to the second storage body is set to the first preset value, indicating that the second storage body and the first storage body belong to the same ACL. The first preset value can be any preset value, such as 0, 1, etc., and this is not limited. The bits corresponding to the other storage bodies except the first storage body in the first bit string corresponding to the second storage body are set to any value that is not the first preset value, indicating that the second storage body and the other storage bodies do not belong to the same ACL.

[0162] The second result processing unit is specifically used to determine the first bit in the first bit string corresponding to the second storage body whose value is the first preset value; according to the value of the second bit in the second bit string that is in the same position as the first bit, and the first hit situation, the first search result of the target table item obtained by the second result processing unit is processed.

[0163] In the embodiment of the present application, the storage body corresponding to the first bit is the first storage body that belongs to the same ACL as the second storage body. After receiving the result output (i.e., the second bit string), the second result processing unit determines the second bit with the same position in the second bit string based on the first bit in the first bit string, and obtains the value of the second bit, thereby obtaining the output of the first search result of the target table item corresponding to the first storage body.

[0164] When the value of any second bit is the second preset value, the second result processing unit determines that the result output indicates that the first search result is output, and the first search result of the target table item corresponding to the first storage body has been output. When the values ​​of all second bits are not the second preset value, the second result processing unit determines that the result output indicates that the first search result is not output, and the first search result of the target table item corresponding to the first storage body has not been output.

[0165] In the technical solution provided in the embodiment of the present application, each second result processing unit adopts a pre-configured first bit string to enable the result processing of the second storage body belonging to the same ACL as the first storage body, so that the second result processing unit can accurately determine the output status of the target table item according to the result processing status of the first storage body in the result processing status.

[0166] In some embodiments, the second result processing unit processes the search result of the first storage bank according to the received result output and the obtained first hit. Specifically, it can be divided into the following situations.

[0167] In case a1, the result output condition indicates that the first search result is not output, and the first hit condition indicates that the target table entry is hit.

[0168] In case a1, the upper result processing unit of the second result processing unit does not output the first search result of the target table item, and the hit condition of any second storage body indicates that the target table item is hit, and the second result processing unit obtains the first search result of the target table item, then the second result processing unit outputs the obtained first search result of the target table item.

[0169] In an embodiment of the present application, when the second result processing unit is not the result processing unit with the lowest priority, the second result processing unit generates a result output situation indicating the output of the first search result, which is similar to the result output situation generated when the first result processing unit is the result processing unit with the highest priority. For details, please refer to the relevant description of the result output situation generated by the first result processing unit.

[0170] In case a2, the result output condition indicates that the first search result is not output, and the first hit condition indicates that the target table entry is not hit.

[0171] In case a2, the superior result processing unit of the second result processing unit does not output the first search result of the target entry, and the hit conditions of all second storage bodies indicate that the target entry is not hit, and the second result processing unit obtains a second search result of not hit.

[0172] In the case where the second result processing unit is the result processing unit with the lowest priority, the second result processing unit may output a missed second search result.

[0173] In the embodiment of the present application, when multiple second search results are obtained, the second result processing unit can determine the second search result of the second storage body with the lowest priority from the multiple second search results according to the priority order of the preset second storage body, and output the second search result. The second result processing unit can also randomly determine a second search result from the multiple second search results and output the second search result. When a second search result is obtained, the second result processing unit can output the second search result. This is not limited.

[0174] After determining the second search result, the second result processing unit can obtain the associated result corresponding to the missed second search result according to the pre-stored associated result table, output the associated result, and return the associated result to the unit that sent the first search keyword (such as the first search initiating unit).

[0175] In the embodiment of the present application, the second result processing unit may include a second result output subunit and a second index processing subunit.

[0176] The second result output subunit can obtain the search result and the first hit condition of the second storage body. When the first hit condition indicates that the target table entry is not hit and the second result output subunit obtains the second search result of the miss, the second result output subunit outputs the second search result of the miss to the second index processing subunit.

[0177] The second index processing subunit can receive the missed second search result sent by the second result output subunit, and obtain the associated result corresponding to the missed second search result according to the pre-stored associated result table, and return the associated result to the unit that sends the first search keyword (such as the first search initiation unit).

[0178] In the embodiment of the present application, the second result output subunit can output the second search result to the second index processing subunit through the second channel corresponding to the second storage body whose search result is the second search result. For ease of description, the following description is based on the example of the first result output subunit obtaining multiple second search results, which does not serve as a limitation. The second result output subunit can output the obtained multiple second search results to the second index processing subunit through the corresponding second channel, and the second index processing subunit can receive the multiple second search results through the corresponding second channel.

[0179] In addition to outputting the search result to the second index processing subunit, the second result output subunit may also output the first hit situation (i.e., the fifth bit string) to the second index processing subunit, and each bit in the fifth bit string is output through the second channel corresponding to the storage body corresponding to the bit. The second index processing subunit may receive each bit in the fifth bit string through the corresponding second channel.

[0180] The second index processing subunit can determine in sequence whether the value of a bit in the fifth bit string received through the second channel is the fifth preset value, starting from the second channel with the highest priority, according to the priority order of the preset second channels, so as to determine whether the search result received through the second channel is the first search result, until it is determined that the values ​​of all bits received through all second channels are not the fifth preset value, that is, it is determined that the search results received through all second channels are the second search results. The second index processing subunit determines the second search result received through the second channel with the lowest priority, or randomly determines a second search result from the received second search results, which is not limited.

[0181] In an embodiment of the present application, when the second result processing unit is the result processing unit with the lowest priority, the second result processing unit can generate and output a missed second search result after determining that the result output situation indicates that the first search result is not output and the first hit situation indicates that the target table entry is not hit, while other higher priority result processing units do not need to generate a missed second search result to save storage resources and computing resources.

[0182] When the second result processing unit is not the result processing unit with the lowest priority, the second result processing unit generates a result output situation indicating that the first search result has not been output, which is similar to the result output situation generated when the first result processing unit is the result processing unit with the highest priority. For details, please refer to the relevant description of the result output situation generated by the first result processing unit.

[0183] In case a3, the result output situation indicates that the first search result is output, and the first hit situation indicates that the target table entry is hit.

[0184] In case a3, the superior result processing unit of the second result processing unit outputs the first search result of the target table item, and the hit condition of any second storage body indicates that the target table item is hit, and the second result processing unit obtains the first search result of the target table item. In addition, since the superior result processing unit has output the first search result, the second result processing unit can shield the obtained first search result and does not output the first search result.

[0185] In the case where the second result processing unit is not the result processing unit with the lowest priority, the second result processing unit may generate a result output status indicating the output of the first search result. Since the superior result processing unit has output the first search result, the first search result of the target table item corresponding to the second storage body may be regarded as having been output, and the second result processing unit may generate a new second bit string, and set the bit corresponding to the second storage body in the new second bit string to a second preset value, to obtain a result output status indicating the output of the first search result, and transmit it to the second result processing unit.

[0186] Case a4: the result output condition indicates that the first search result is output, and the first hit condition indicates that the target table entry is not hit.

[0187] In case a2, the superior result processing unit of the second result processing unit does not output the first search result of the target table entry, and the hit conditions of all second storage bodies indicate that the target table entry is not hit, and the second result processing unit obtains a second search result of not hit. In addition, since the superior result processing unit has output the first search result, the second result processing unit can shield the obtained second search result and does not output the second search result.

[0188] In the case where the second result processing unit is not the result processing unit with the lowest priority, the second result processing unit may generate a result output condition indicating the output of the first search result. For details, please refer to the relevant description of the above situation a3.

[0189] In the technical solution provided by the embodiment of the present application, the second result processing unit performs different processing on the obtained search result according to the result output situation and the second hit situation. When the upper-level result processing unit has output the first search result, any search result obtained by the current-level result processing unit is shielded and no longer output to avoid affecting the output first search result; when the upper-level result processing unit has not output the first search result, the first search result or the second search result is output according to the priority of the current-level result processing unit.

[0190] In some embodiments, each storage body corresponds to a first queue, and the first queue is used to cache search results. The third result processing unit is used to send a back pressure signal to the third search processing unit that manages the third storage body when the number of search results cached in the first queue corresponding to the third storage body managed by the third result processing unit is greater than a preset number; the third search processing unit is used to stop searching for a target table entry that matches a second search keyword according to the received back pressure signal, and the second search keyword corresponds to the ACL to which the third storage body belongs.

[0191] In the embodiment of the present application, the first queue may be a first in first out (FIFO) queue or other queues, without limitation. The third result processing unit may be any result processing unit, the third storage body may be any storage body managed by the third result processing unit, and the third search processing unit may be any search processing unit, without limitation.

[0192] Each result processing unit includes a first queue corresponding to each storage body under management. Before outputting the search result (which may be the first search result or the second search result), each result processing unit writes the search result to be output into the first queue corresponding to the corresponding storage body. Each result processing unit monitors the number of search results cached in each first queue.

[0193] When the third result processing unit detects that the number of search results cached in the first queue corresponding to the managed third storage body is greater than the preset number, the third result processing unit determines that it cannot continue to receive the search results, and then sends a back pressure signal to the third search processing unit of the managed third storage body. The preset number can be any value, such as 100, 1000, etc., and can be set according to the depth of the first queue, and there is no limitation on this.

[0194] In the embodiment of the present application, the back pressure signal carries the table ID (i.e., the second table ID) of the ACL (i.e., the second ACL) to which the third storage body belongs. The third search processing unit receives the back pressure signal, and according to the second table ID carried by the back pressure signal, stops issuing a new search keyword (i.e., the second search keyword) corresponding to the second table ID to each storage body included in the managed storage body group, and stops searching for a target table entry matching the new second search keyword in the storage body belonging to the second ACL. This process does not affect the search of the second search keyword that has been issued by the storage body belonging to the second ACL.

[0195] In an embodiment of the present application, the third result processing unit may include a third result output subunit and a third index processing subunit. The third index processing subunit includes a first queue corresponding to each storage body under management, and after the third index processing subunit receives the search result through the corresponding second channel and determines a search result (which may be a first search result or a second search result), the search result is written into the corresponding first queue. The third index processing subunit monitors the number of search results cached in each first queue. When the third index processing subunit detects that the number of search results cached in the first queue corresponding to the third storage body is greater than a preset number, the third index processing subunit sends a back pressure signal to the corresponding third search processing unit.

[0196] In the technical solution provided in the embodiment of the present application, by sending a back pressure signal to the search processing unit, the search for the corresponding search keyword can be suspended when the number of search results in the first queue is greater than a preset number. This process does not affect the search for search keywords corresponding to other ACLs, thereby ensuring the search efficiency.

[0197] In some embodiments, when the third search processing unit is not the search processing unit with the highest priority, the third search processing unit is further used to send a back pressure signal to the search processing unit at the next level after receiving the back pressure signal. When the third search processing unit is not the search processing unit with the lowest priority, the third search processing unit is further used to stop sending the second search keyword to the search processing unit at the next level.

[0198] In the embodiment of the present application, when the third search processing unit is not the search processing unit with the highest priority, after the third search processing unit sends the received back pressure signal to the search processing unit at the previous level, the search processing unit at the previous level can serve as a new third search processing unit, and stop searching for the target table entry that matches the second search keyword according to the received back pressure signal. When the new third search processing unit is not the search processing unit with the highest priority, the back pressure signal continues to be sent to the search processing unit at the previous level until the back pressure signal is sent to the search processing unit with the highest priority (hereinafter referred to as the search processing unit with the highest priority) among the search processing units that manage the storage body belonging to the second ACL, and then the back pressure signal is stopped.

[0199] When the third search processing unit is the search processing unit with the highest priority, after receiving the back pressure signal, the third search processing unit will no longer send a back pressure signal to the upper-level search processing unit, and will stop the polling scheduling of the new second search keyword, stop sending the new second search keyword to each storage body included in the managed storage body group, and stop sending the new second search keyword to the lower-level search processing unit.

[0200] When the third search processing unit is not the search processing unit with the lowest priority, since the search processing unit at the upper level stops sending the new second search keyword, the third search processing unit cannot receive the new second search keyword, and cannot send the new second search keyword to each storage body included in the managed storage body group. In the embodiment of the present application, the above process does not affect the second search keyword that has been transmitted.

[0201] By applying the technical solution provided in the embodiment of the present application, back pressure signals are sent to the upper-level search processing units step by step, so that the search processing unit with the highest priority can stop polling scheduling for the new second search keyword, and stop sending the new second search keyword to the lower-level search processing unit, so as to stop searching for target table entries matching the new second search keyword in all storage bodies belonging to the second ACL.

[0202] In some embodiments, the network device can add entries to the storage body. Each storage body corresponds to a second queue, and the second queue is used to cache ACL entries. The fourth search processing unit is used to obtain a write instruction for the ACL entry and pull up a load signal of the fourth storage body associated with the ACL entry; the fourth storage body is used to read the ACL entry from the second queue corresponding to the fourth storage body during the period when the load signal is pulled high, and write the read ACL entry into the fourth storage body.

[0203] In the embodiment of the present application, the second queue can be a first-in-first-out (FIFO) queue or other queues, and this is not limited. The ACL table item can be a table item to be written to any ACL to which all storage bodies belong. For ease of description, the ACL table item is a table item to be written to the third ACL, and the storage body belonging to the third ACL is the fourth storage body associated with the ACL table item. The fourth search processing unit is any search processing unit that manages the fourth storage body.

[0204] Each storage body corresponds to a load signal, and the storage body can search for the search keyword while the load signal is pulled low. After the fourth search processing unit obtains the write instruction of the ACL table item, the fourth search processing unit determines each fourth storage body and the load signal of each fourth storage body according to the write instruction, and pulls up the load signal of each fourth storage body.

[0205] In the embodiment of the present application, the write instruction may carry the table ID of the third ACL (i.e., the third table ID). The fourth search processing unit may determine the load signal corresponding to the third table ID according to the correspondence between the pre-configured ACL table ID and the load signal and the third table ID carried in the write instruction, obtain the load signal of the fourth storage body, and pull it high.

[0206] Each fourth storage body does not search for the search key when the load signal is pulled high, that is, stops searching for the target entry matching the third search key corresponding to the third ACL. Each fourth storage body reads the ACL entry from the corresponding second queue and writes it into the fourth storage body.

[0207] In some embodiments, when the fourth search processing unit is the search processing unit with the highest priority, the fourth search processing unit is specifically used to receive write instructions for ACL table items sent by upper-level software; when the fourth search processing unit is not the search processing unit with the lowest priority, the fourth search processing unit is specifically used to receive write instructions for ACL table items sent by the upper-level search processing unit.

[0208] In the embodiment of the present application, when the fourth search processing unit is the search processing unit with the highest priority, the fourth search processing unit can receive the write instruction of the ACL table item from the upper-level software, and pass the received write instruction to the next-level search processing unit. The next-level search processing unit can serve as a new fourth search processing unit, receive the write instruction sent by the previous-level search processing unit, and continue to pass the received write instruction to the next-level search processing unit when the new fourth search processing unit is not the search processing unit with the lowest priority.

[0209] By applying the technical solution provided in the embodiment of the present application, when it is necessary to add a table entry to a storage body, the upper-layer software can first write the table entry to be written into the second queue, and send a write instruction to the corresponding search processing unit. Since each storage body corresponds to a load signal, when the load signal is pulled high, only the load signal of the storage body of the ACL corresponding to the table entry to be written can be pulled high so as not to affect the search of the search keywords of other ACLs. In addition, by transmitting the write instruction to the lower-level search processing unit step by step, multiple storage bodies of multiple storage body groups belonging to the same ACL can be written to the table entry to be written together, thereby improving the efficiency of adding table entries, and the time difference of the storage bodies included in each storage body group belonging to the same ACL stopping table lookup is a fixed value, and the time difference of starting to write the table entry to be written is also a fixed value, which is convenient for the management of network devices.

[0210] In some embodiments, the network device may enable a new storage body by: determining a fifth storage body to be enabled corresponding to the target ACL; keeping the data flow of the fifth storage body closed; and after adding the table structure of the target ACL to the fifth storage body, enabling the data flow of the fifth storage body.

[0211] In an embodiment of the present application, the network device can select an idle storage body as the fifth storage body in the storage body group to which the enabled storage body belonging to the target ACL belongs, or in the upper / lower level storage body group of the storage body group, based on the enabling status of the storage body belonging to the target ACL and the priority of the storage body to be enabled.

[0212] Afterwards, the network device configures the structure of the fifth storage body while keeping the data flow of the fifth storage body closed, that is, adding the table structure of the target ACL to the fifth storage body. The network device can configure the mapping field of the search keyword of the fifth storage body, write the table items to be written into the corresponding second queue, configure the priority information of the units (such as the search processing unit and the result processing unit) that manage the fifth storage body, and the depth threshold of the first queue. In addition, when the upper-level storage body group of the storage body group to which the fifth storage body belongs includes the sixth storage body belonging to the target ACL, the network device can also configure the fifth storage body's perception of the search result of the sixth storage body, that is, configure the first bit string corresponding to the fifth storage body.

[0213] The network device adds the table structure of the target ACL to the fifth storage body, opens the data flow of the fifth storage body, and enables the fifth storage body. The network device can also use the above method of adding table entries to the storage body to read the table entries to be written from the corresponding second queue and write the table entries into the fifth storage body.

[0214] By applying the technical solution provided in the embodiments of the present application, the network device configures the structure of the storage body while keeping the data flow of the storage body closed, so that the configured storage body can perform the search process. At the same time, it does not affect the normal data flow table lookup process of the target ACL when changing the configuration.

[0215] Below through Figure 5~Figure 7 The network device provided by the present application is described in detail. Take the storage body group including 8 storage bodies, and an ACL is stored in two storage body groups (i.e., TCAM group 1 and TCAM group 2) included in the TCAM as an example for explanation, then the search processing unit (i.e., scheduler) and result processing unit (i.e., aggregator) that manage these two storage body groups are also two, scheduler 1 and aggregator 1 manage TCAM group 1, and scheduler 2 and aggregator 2 manage TCAM group 2. In the embodiment of the present application, the scheduler, TCAM group and aggregator can be used as modules for table entry processing in the network device.

[0216] Figure 5 A second structural diagram of a network device provided in an embodiment of the present application. The aggregator can be divided into a result output subunit (i.e., a result outputter) and an index processing subunit (i.e., an index processor), that is, aggregator 1 can include a result outputter 1 and an index processor 1, and aggregator 2 can include a result outputter 2 and an index processor 2. TCAM group 1 stores 4 ACLs, namely, T0, T1, T2, and T3, wherein T0 and T1 occupy 2 storage bodies horizontally, T2 occupies 1 storage body, and T3 occupies 3 storage bodies. TCAM group 2 stores 4 ACLs, namely, T0, T2, T3, and T4, wherein T0 occupies 2 storage bodies horizontally, T4 occupies 4 storage bodies horizontally, and T2 and T3 occupy 1 storage body respectively.

[0217] Scheduler 1 receives the keyword (i.e., the first search keyword) sent by the search initiating unit (not shown in the figure), and schedules the keyword to the storage body in TCAM group 1. When scheduling the keyword, scheduler 1 also sends the keyword to scheduler 2, so that scheduler 2 schedules the keyword to the storage body in TCAM group 2, ensuring that the time difference of receiving the keyword between the storage body groups managed by the two schedulers is a fixed value, and the time difference of generating the search result is also the same value.

[0218] In result output device 1 and result output device 2, the hit situation in each TCAM group (i.e., the first hit situation or the second hit situation) is first obtained, and the hit mark (i.e., the result output situation, i.e., the first hit situation) is obtained. Result output device 1 transmits the hit mark obtained from each channel (i.e., the first channel), and result output device 2 senses the hit situation of result output device 1 according to the pre-configured sense enable (i.e., the first bit string) for result output device 1. The sense enable length of each storage body is 8 bits, and the sense enable of all storage bodies of result output device 2 is correspondingly configured as 8×8=64 bits.

[0219] When some storage bodies managed by result output device 2 and some storage bodies managed by result output device 1 together form an ACL, if the storage body managed by result output device 1 successfully hits the table lookup (i.e., the target table entry hits), result output device 1 receives the hit search result (i.e., the first search result) through the corresponding channel, and sends the hit search result to index processor 1 through the corresponding channel (i.e., the second channel). Storage bodies belonging to the same ACL among some storage bodies managed by result output device 2 can sense that the corresponding storage body table lookup successfully hits, and result output device 2 can shield the hit search result or the missed search result (i.e., the second search result) received from the corresponding channel. In this way, the search results of the high-priority storage body group are finally retained, and the search results of the low-priority storage body group are shielded, so that the returned results are unique.

[0220] If the storage managed by result output device 1 does not hit (i.e., the target table entry does not hit), that is, the storage included in the high-priority storage group does not hit, the missed search result will be shielded and not transmitted to the next level, and the possibility of hitting will be handed over to the storage group managed by result output device 2 (i.e., the low-priority storage group). If the storage managed by result output device 2 successfully hits the table lookup, result output device 2 receives the hit search result through the corresponding channel and sends the hit search result to index processor 2 through the corresponding channel; if the storage managed by result output device 2 does not hit, the missed search result will be sent to index processor 2 through the corresponding channel.

[0221] When the search result queue (i.e., the first queue) corresponding to any storage body is full, that is, when the number of search results cached in any first queue exceeds the preset number, it is necessary to back pressure the scheduler to stop searching for the keywords of the corresponding ACL. The index processor transmits the full signal (i.e., the back pressure signal) of the search result queue corresponding to each second channel to the scheduler, and maps it into back pressure on the ACL, that is, index processor 1 transmits the full signal to scheduler 1, and index processor 2 transmits the full signal to scheduler 2. After receiving the full signal, scheduler 2 transmits the full signal to scheduler 1. Scheduler 1 performs OR processing on the full signal of the search result queue corresponding to each second channel transmitted by index processor 1 and the full signal of the search result queue corresponding to each second channel transmitted by index processor 2, and obtains the corresponding ACL whose search result queue is full. Scheduler 1 prohibits the keywords of the corresponding ACL from participating in scheduling and continues to schedule keywords of other ACLs.

[0222] For ACLs that are added in depth, such as Figure 5 For example, when T3 has enabled three storage bodies in TCAM group 1 and needs to enable the fourth storage body, and there is no free storage body in TCAM group 1, the network device does not need to use the move operation to move T3's ACL table entries to storage bodies in other TCAM groups for management. Instead, the network device directly requisitions a storage body in another TCAM group, modifies the configuration, adjusts the table structure, and searches for free storage bodies in TCAM group 2 to add to T3.

[0223] Figure 6 and Figure 7 A schematic diagram of the structure of a network device provided in an embodiment of the present application. TCAM group 1 includes TCAM body (i.e. storage body) 0 to TCAM body 7, and TCAM group 2 includes TCAM body 0 to TCAM body 7. Figure 6 As shown, currently, one ACL enables TCAM bank 3 and TCAM bank 4 in TCAM group 1, and TCAM bank 0 in TCAM group 2.

[0224] When adding a table entry, if a new TCAM body needs to be enabled, the newly enabled TCAM body (i.e., TCAM body 1) is added to the ACL in the structure. Figure 7 The network device first keeps the data flow of TCAM body 1 and the corresponding channel closed, and temporarily does not add ACL in the structure, so as not to affect the normal data flow table lookup during the reconfiguration (that is, scheduler 1 sends the keyword to the storage body and scheduler 2 in TCAM group 1, and scheduler 2 sends the keyword to the storage body in TCAM group 2; after obtaining the search result, aggregator 1 and aggregator 2 respectively obtain the search result, and aggregator 1 transmits the hit identifier to aggregator 2. For details, please refer to the above Figure 5During the data flow shutdown period, complete the independent configuration of TCAM body 1. Then configure TCAM body 1 to sense TCAM body 3 and TCAM body 4 in TCAM group 1, and add TCAM body 1 to the ACL table structure. Finally, turn on the data flow switch of TCAM body 1 so that TCAM body 1 can start to participate in the table lookup.

[0225] Subsequent network devices can continuously write required table entries into the newly enabled TCAM body 1. The upper-level scheduler can transmit write instructions to the lower-level scheduler through the same transmission network used for transmitting the keyword. The scheduler can use a unified load indication signal (i.e., load signal) to allow each TCAM body to load table entries simultaneously. A FIFO queue (i.e., the second queue) with adjustable depth is provided at each TCAM body to store the data or mask of the ACL to be written (i.e., the table entry to be written). When the load indication signal mechanism is triggered, the scheduler also prohibits the ACL involved from participating in polling, thereby ensuring that when the table entry is loaded, the TCAM body to which it belongs can be temporarily suspended and will not receive a table query request. During the period when the load indication signal is pulled high, each TCAM body takes out the table entry in the FIFO queue and writes it into the TCAM body in each beat, and resumes the table query when the load indication signal is pulled low. The suspension time is configurable according to the number of table entries to be written. After receiving the write instruction, the scheduler can raise the load indication signal by the corresponding number of beats according to the pre-configured number of beats and send it out, thereby realizing the expansion and addition of table entries.

[0226] When the table is subsequently assembled, the network device can directly use all schedulers and all internal TCAM resources as one scheduler. The number and specifications of the MUX buses (i.e., the first MUX bus and the second MUX bus) do not double due to the increase in the number of TCAM bodies, but maintain the scale of a single group. The upper scheduler (i.e., the scheduler with a high priority) performs the scheduling tasks of all keywords of other schedulers, and the lower scheduler (i.e., the scheduler with a low priority) directly transfers the keywords transmitted downward.

[0227] By applying the technical solution provided in the embodiment of the present application, through the method of keyword transmission and search result transmission shielding, supplemented by back pressure transmission and loading flag mechanism, a cross-group TCAM storage body group table is realized without adding a large number of MUX buses, and the resources of multiple groups of TCAM storage bodies are used in a coordinated manner, which can realize synchronous loading of table items and ensure the uniqueness of returned results, realize cross-group flexible group tables, and reduce the design complexity of the subsequent modules. When dynamically adding table items, the demand for synchronous loading can be met, and a large number of table item transfers and frequent adjustments to the table structure can be avoided, which reduces the user waiting time. In addition, this architecture only adds a small amount of resource usage on the basis of the original MUX bus, controls the number of hardware connections, improves the scalability and flexibility of the architecture, and is an architecture with a high overall cost performance.

[0228] Corresponding to the above network device, the embodiment of the present application also provides a table entry processing method, such as Figure 8 As shown, a flow chart of a table entry processing method provided in an embodiment of the present application is provided. The above table entry processing method is applied to a network device, the network device includes a TCAM, a plurality of search processing units connected to the TCAM, and a plurality of result processing units; the TCAM includes a plurality of storage body groups, each storage body group includes a plurality of storage bodies, and each search processing unit and each result processing unit respectively manage a storage body group. The above table entry processing method includes the following steps.

[0229] Step S81, using the first search processing unit with a higher priority among the two search processing units with adjacent priorities, the first search processing unit with a higher priority transmits the obtained first search keyword to the second search processing unit with a lower priority, and searches for a target table entry matching the first search keyword in a first storage body included in the storage body group managed by the first search processing unit, and the first storage body belongs to the ACL corresponding to the first search keyword;

[0230] Step S82, using the second search processing unit with a lower priority among the two search processing units with adjacent priorities to receive the first search keyword transmitted by the first search processing unit with a higher priority, and searching for a target table entry matching the first search keyword in a second storage body included in the storage body group managed by the second search processing unit, the second storage body belonging to the ACL corresponding to the first search keyword;

[0231] Step S83, using the first result processing unit with a higher priority among two result processing units with adjacent priorities to obtain the result output status, and transmit the result output status to the second result processing unit with a lower priority, where the result output status indicates the output status of the first search result of the target table item;

[0232] Step S84, using the two result processing units with adjacent priorities, the second result processing unit with a low priority receives the result output status transmitted by the first result processing unit with a high priority, and obtains the first hit status of the target table item in the second storage body included in the storage body group managed by the second result processing unit; according to the result output status and the first hit status, the first search result of the target table item obtained by the second result processing unit is processed.

[0233] In the technical solution provided by the embodiment of the present application, priorities are configured in advance for multiple search processing units and multiple result processing units included in the network device, and the first search processing unit with a high priority transmits the first search keyword to the second search processing unit with a low priority, so that the time difference when the same keyword arrives at the storage body included in each group is a fixed value, and the time difference when each group obtains the search result is also a fixed value, which is convenient for the network device to manage the search result. In addition, since the network device pre-configures the priority for each result processing unit, the first search result of the target table item obtained by each result processing unit also has a priority, and each low-priority second result processing unit can process the obtained first search result respectively according to the result output of the first result processing unit with a high priority. In this process, the network device processes the first search results from high priority to low priority in sequence, and no longer aggregates the search results obtained by each result processing unit to obtain the final search result output, which reduces the resource cost required for table lookup and improves the robustness and efficiency of result search.

[0234] In some embodiments, the first result processing unit is a result processing unit with the highest priority; and the method further includes:

[0235] The first result processing unit is used to obtain a second hit condition of the target entry in the first storage body included in the storage body group managed by the first result processing unit; if the second hit condition indicates that the target entry hits, the first search result of the target entry obtained by the first result processing unit is output.

[0236] In some embodiments, the above step S84 includes:

[0237] If the result output condition indicates that the first search result is not output, and the first hit condition indicates that the target table entry is hit, the first search result of the target table entry obtained by the second result processing unit is output.

[0238] In some embodiments, the second result processing unit is a result processing unit with the lowest priority; and the method further includes:

[0239] If the result output condition indicates that the first search result is not output, and the first hit condition indicates that the target table entry is not hit, a second search result that is not hit is generated and output.

[0240] In some embodiments, the second result processing unit is not a result processing unit with the lowest priority; and the method further includes:

[0241] If the result output situation indicates that the first search result is not output, and the first hit situation indicates that the target table entry is not hit, then a result output situation indicating that the first search result is not output is generated; if the result output situation indicates that the first search result is output, or, the result output situation indicates that the first search result is not output and the first hit situation indicates that the target table entry is hit, then a result output situation indicating that the first search result is output is generated.

[0242] In some embodiments, each storage body managed by the above-mentioned second result processing unit corresponds to a first bit string whose length is the number of storage bodies included in the storage body group, and each bit in the first bit string corresponds to a storage body managed by the first result processing unit; the bit corresponding to the first storage body in the first bit string corresponding to the second storage body is set to a first preset value.

[0243] In some embodiments, the above-mentioned result output is a second bit string whose length is the number of memory banks included in the memory bank group, and each bit in the second bit string corresponds to a memory bank managed by the first result processing unit;

[0244] The above step S83 includes:

[0245] If the first search result of the target table entry corresponding to the first storage bank has been output, using the first result processing unit, the bit corresponding to the first storage bank in the second bit string is set to a second preset value;

[0246] The above step S84 includes:

[0247] Determine the first bit in the first bit string corresponding to the second storage body whose value is the first preset value; according to the value of the second bit in the second bit string that is in the same position as the first bit and the first hit condition, process the first search result of the target table entry obtained by the second result processing unit.

[0248] In some embodiments, each storage bank corresponds to a first queue, and the first queue is used to cache the search result; the method further includes:

[0249] When the number of search results cached in the first queue corresponding to the third storage body managed by the third result processing unit is greater than a preset number, the third result processing unit is used to send a back pressure signal to the third search processing unit managed by the third storage body;

[0250] The third search processing unit is used to stop searching for a target table entry matching a second search keyword according to the received back pressure signal, and the second search keyword corresponds to the ACL to which the third storage body belongs.

[0251] In some embodiments, the above method further comprises:

[0252] In the case where the third search processing unit is not the search processing unit with the highest priority, using the third search processing unit to send a back pressure signal to the next level search processing unit after receiving the back pressure signal;

[0253] In the case where the third search processing unit is not the search processing unit with the lowest priority, the third search processing unit is used to stop sending the second search keyword to the next-level search processing unit.

[0254] In some embodiments, each storage body corresponds to a second queue, and the second queue is used to cache ACL entries; the method further includes:

[0255] Using the fourth search processing unit, obtaining a write instruction of the ACL table entry, and pulling up a load signal of a fourth storage body associated with the ACL table entry;

[0256] The fourth memory bank is used to read the ACL table entry from the second queue corresponding to the fourth memory bank during the period when the load signal is pulled high, and the read ACL table entry is written into the fourth memory bank.

[0257] In some embodiments, the step of using the fourth search processing unit to obtain the write instruction of the ACL table entry includes:

[0258] In the case where the fourth search processing unit is the search processing unit with the highest priority, using the fourth search processing unit to receive the ACL table entry write instruction sent by the upper layer software;

[0259] In the case that the fourth search processing unit is not the search processing unit with the highest priority, the fourth search processing unit is used to receive the write instruction of the ACL table entry sent by the previous level search processing unit.

[0260] In some embodiments, the above method further comprises:

[0261] Determine a fifth storage body to be enabled corresponding to the target ACL;

[0262] Keep the data flow of the fifth memory bank closed;

[0263] After the table structure of the target ACL is added to the fifth storage body, the data flow of the fifth storage body is started.

[0264] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned table entry processing methods are implemented.

[0265] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any table entry processing method in the above embodiments.

[0266] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment 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. The 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, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0267] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0268] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the table entry processing method, storage medium, and program product embodiments, since they are basically similar to the network device embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the network device embodiment.

[0269] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. A network device, characterized in that: It includes a ternary content addressable memory TCAM, a plurality of search processing units and a plurality of result processing units connected to the TCAM; the TCAM includes a plurality of memory bank groups, each memory bank group includes a plurality of memory banks, each search processing unit and each result processing unit respectively manages a memory bank group; Of the two search processing units of adjacent priorities, the first search processing unit with a higher priority is used to transmit the acquired first search keyword to the second search processing unit with a lower priority, and search for a target table entry matching the first search keyword in a first storage body included in the storage body group managed by the first search processing unit, where the first storage body belongs to an access control list ACL corresponding to the first search keyword; Of the two search processing units with adjacent priorities, the second search processing unit with a low priority is used to receive the first search keyword transmitted by the first search processing unit with a high priority, and search for a target table entry matching the first search keyword in a second storage body included in the storage body group managed by the second search processing unit, where the second storage body belongs to the ACL corresponding to the first search keyword; Of the two result processing units of adjacent priorities, the first result processing unit with a higher priority is used to obtain a result output condition and transmit the result output condition to the second result processing unit with a lower priority, wherein the result output condition indicates an output condition of the first search result of the target table item; Among the two result processing units with adjacent priorities, the second result processing unit with a low priority is used to receive the result output status transmitted by the first result processing unit with a high priority, and obtain the first hit status of the target table item in the second storage body included in the storage body group managed by the second result processing unit; according to the result output status and the first hit status, the first search result of the target table item obtained by the second result processing unit is processed.

2. The network device according to claim 1, characterized in that: The first result processing unit is a result processing unit with the highest priority; The first result processing unit is also used to obtain a second hit condition of the target table entry in the first storage body included in the storage body group managed by the first result processing unit; if the second hit condition indicates that the target table entry hits, output the first search result of the target table entry obtained by the first result processing unit.

3. The network device according to claim 1, characterized in that: The second result processing unit is specifically configured to output the first search result of the target table entry obtained by the second result processing unit if the result output condition indicates that the first search result is not output and the first hit condition indicates that the target table entry is hit.

4. The network device according to claim 3, characterized in that: The second result processing unit is a result processing unit with the lowest priority; The second result processing unit is further configured to generate and output a second search result that is a miss if the result output condition indicates that the first search result is not output and the first hit condition indicates that the target table entry is a miss.

5. The network device according to claim 3, characterized in that: The second result processing unit is not a result processing unit with the lowest priority; The second result processing unit is also used to generate a result output situation indicating that the first search result is not output if the result output situation indicates that the first search result is not output and the first hit situation indicates that the target table item is not hit; if the result output situation indicates that the first search result is output, or the result output situation indicates that the first search result is not output and the first hit situation indicates that the target table item is hit, then generate a result output situation indicating that the first search result is output.

6. The network device according to claim 1, characterized in that: Each storage body managed by the second result processing unit corresponds to a first bit string whose length is the number of storage bodies included in the storage body group, and each bit in the first bit string corresponds to a storage body managed by the first result processing unit; the bit corresponding to the first storage body in the first bit string corresponding to the second storage body is set to a first preset value.

7. The network device according to claim 6, characterized in that: The result output is a second bit string whose length is the number of storage banks included in the storage bank group, and each bit in the second bit string corresponds to a storage bank managed by the first result processing unit; The first result processing unit is specifically configured to set the bit corresponding to the first storage body in the second bit string to a second preset value if the first search result of the target table entry corresponding to the first storage body has been output; The second result processing unit is specifically used to determine the first bit in the first bit string corresponding to the second storage body whose value is the first preset value; according to the value of the second bit in the second bit string that is in the same position as the first bit, and the first hit situation, the first search result of the target table item obtained by the second result processing unit is processed.

8. The network device according to claim 1, characterized in that: Each storage body corresponds to a first queue, and the first queue is used to cache the search results; A third result processing unit, configured to send a back pressure signal to a third search processing unit managing the third storage body when the number of search results cached in the first queue corresponding to the third storage body managed by the third result processing unit is greater than a preset number; The third search processing unit is used to stop searching for a target table entry matching a second search keyword according to a received back pressure signal, where the second search keyword corresponds to an ACL to which the third storage body belongs.

9. The network device according to claim 8, characterized in that: In the case where the third search processing unit is not the search processing unit with the highest priority, the third search processing unit is further configured to send the back pressure signal to the next higher level search processing unit after receiving the back pressure signal; In the case that the third search processing unit is not the search processing unit with the lowest priority, the third search processing unit is further configured to stop sending the second search keyword to the next level search processing unit.

10. The network device according to any one of claims 1 to 9, characterized in that: Each storage body corresponds to a second queue, and the second queue is used to cache ACL table entries; a fourth search processing unit, configured to obtain a write instruction of an ACL entry and pull up a load signal of a fourth storage body associated with the ACL entry; The fourth storage body is used to read ACL entries from the second queue corresponding to the fourth storage body and write the read ACL entries into the fourth storage body during the period when the load signal is pulled high.

11. The network device according to claim 10, characterized in that: In the case where the fourth search processing unit is the search processing unit with the highest priority, the fourth search processing unit is specifically configured to receive an ACL table entry write instruction sent by upper-layer software; In the case that the fourth search processing unit is not the search processing unit with the highest priority, the fourth search processing unit is specifically configured to receive an ACL table entry write instruction sent by the previous level search processing unit.

12. A table entry processing method, characterized in that: Applied to a network device, the network device comprises a ternary content addressable memory TCAM, a plurality of search processing units and a plurality of result processing units connected to the TCAM; the TCAM comprises a plurality of memory bank groups, each memory bank group comprises a plurality of memory banks, each search processing unit and each result processing unit respectively manages a memory bank group; Using two search processing units with adjacent priorities, the first search processing unit with a higher priority transmits the obtained first search keyword to the second search processing unit with a lower priority, and searches for a target table entry matching the first search keyword in a first storage body included in a storage body group managed by the first search processing unit, where the first storage body belongs to an access control list ACL corresponding to the first search keyword; Using two search processing units with adjacent priorities, a second search processing unit with a low priority receives a first search keyword transmitted by a first search processing unit with a high priority, and searches for a target table entry matching the first search keyword in a second storage body included in a storage body group managed by the second search processing unit, where the second storage body belongs to an ACL corresponding to the first search keyword; Using two result processing units with adjacent priorities, a first result processing unit with a higher priority obtains a result output condition, and transmits the result output condition to a second result processing unit with a lower priority, wherein the result output condition indicates an output condition of the first search result of the target table item; Among the two result processing units with adjacent priorities, the second result processing unit with a low priority receives the result output status transmitted by the first result processing unit with a high priority, and obtains the first hit status of the target table item in the second storage body included in the storage body group managed by the second result processing unit; according to the result output status and the first hit status, the first search result of the target table item obtained by the second result processing unit is processed.

13. The method according to claim 12, characterized in that The first result processing unit is a result processing unit with the highest priority; the method further comprises: Utilize the first result processing unit to obtain the second hit condition of the target table entry in the first storage body included in the storage body group managed by the first result processing unit; if the second hit condition indicates that the target table entry hits, output the first search result of the target table entry obtained by the first result processing unit.

14. The method according to claim 12, characterized in that The step of processing the first search result of the target table entry obtained by the second result processing unit according to the result output situation and the first hit situation includes: If the result output condition indicates that the first search result is not output, and the first hit condition indicates that the target table entry is hit, the first search result of the target table entry obtained by the second result processing unit is output.

15. The method according to claim 14, characterized in that The second result processing unit is a result processing unit with the lowest priority; the method further comprises: If the result output condition indicates that the first search result is not output, and the first hit condition indicates that the target table entry is not hit, then a second search result that is not hit is generated and output.

16. The method according to claim 14, characterized in that The second result processing unit is not a result processing unit with the lowest priority; and the method further comprises: If the result output situation indicates that the first search result is not output, and the first hit situation indicates that the target table entry is not hit, then a result output situation indicating that the first search result is not output is generated; if the result output situation indicates that the first search result is output, or, the result output situation indicates that the first search result is not output and the first hit situation indicates that the target table entry is hit, then a result output situation indicating that the first search result is output is generated.

17. The method according to claim 12, characterized in that Each storage body managed by the second result processing unit corresponds to a first bit string whose length is the number of storage bodies included in the storage body group, and each bit in the first bit string corresponds to a storage body managed by the first result processing unit; the bit corresponding to the first storage body in the first bit string corresponding to the second storage body is set to a first preset value.

18. The method according to claim 17, characterized in that The result output is a second bit string whose length is the number of storage banks included in the storage bank group, and each bit in the second bit string corresponds to a storage bank managed by the first result processing unit; The step of using the first result processing unit with a higher priority among two result processing units with adjacent priorities to obtain the result output situation comprises: If the first search result of the target table entry corresponding to the first storage body has been output, using the first result processing unit with a higher priority among two result processing units with adjacent priorities to set the bit corresponding to the first storage body in the second bit string to a second preset value; The step of processing the first search result of the target table entry obtained by the second result processing unit according to the result output situation and the first hit situation includes: Determine the first bit in the first bit string corresponding to the second storage body whose value is the first preset value; process the first search result of the target table entry obtained by the second result processing unit according to the value of the second bit in the second bit string that is in the same position as the first bit, and the first hit condition.

19. The method according to claim 12, characterized in that Each storage bank corresponds to a first queue, and the first queue is used to cache search results; the method further includes: When the number of search results cached in the first queue corresponding to the third storage body managed by the third result processing unit is greater than a preset number, using the third result processing unit to send a back pressure signal to the third search processing unit managing the third storage body; The third search processing unit is used to stop searching for a target table entry matching a second search keyword according to the received back pressure signal, wherein the second search keyword corresponds to the ACL to which the third storage body belongs.

20. The method according to claim 19, characterized in that The method further comprises: In the case where the third search processing unit is not the search processing unit with the highest priority, using the third search processing unit to send the back pressure signal to the next level search processing unit after receiving the back pressure signal; In the case that the third search processing unit is not the search processing unit with the lowest priority, the third search processing unit is used to stop sending the second search keyword to the next-level search processing unit.

21. The method according to any one of claims 12 to 20, characterized in that: Each storage body corresponds to a second queue, and the second queue is used to cache ACL table entries; the method further includes: Using the fourth search processing unit, obtaining a write instruction of the ACL table entry, and pulling up a load signal of a fourth storage body associated with the ACL table entry; By using the fourth memory bank, during the period when the load signal is pulled high, the ACL table entry is read from the second queue corresponding to the fourth memory bank, and the read ACL table entry is written into the fourth memory bank.

22. The method according to claim 21, characterized in that The step of using the fourth search processing unit to obtain the write instruction of the ACL table item includes: In the case where the fourth search processing unit is the search processing unit with the highest priority, using the fourth search processing unit to receive the write instruction of the ACL table item sent by the upper layer software; In the case that the fourth search processing unit is not the search processing unit with the highest priority, the fourth search processing unit is used to receive the write instruction of the ACL table entry sent by the previous level search processing unit.

23. The method according to any one of claims 12 to 20, characterized in that: The method further comprises: Determine a fifth storage body to be enabled corresponding to the target ACL; Keeping the data flow of the fifth memory bank closed; After the table structure of the target ACL is added to the fifth storage body, the data flow of the fifth storage body is started.

24. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 12 to 23 is implemented.