Flow table deployment method, computer equipment and medium
By hybridly deploying the flow table in random access memory and tri-state content addressing memory, using preset thresholds and dynamic adjustment of the conversion ratio, the problem of difficult to take into account in the prior art stream table specifications and forwarding performance is achieved, and efficient flow table offloading and data forwarding performance is achieved.
Patent Information
- Application Number
- CN202411844760.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-12-16
AI Technical Summary
The prior art is difficult to meet the requirements of flow table specifications and forwarding performance at the same time, especially under the limited hardware resource limitations on the forwarding chip.
A flow table deployment method is provided. By hybrid deployment of flow tables in random access memory and tri-state content addressing memory, using preset thresholds to distinguish different scenario types, dynamically adjust the conversion ratio of precision flow tables and masked flow tables to improve the specifications and response speed of flow table offloading.
It realizes high data forwarding performance and high resource utilization, meets the requirements of flow table specifications and forwarding performance, and avoids soft forwarding problems caused by failed flow table unloading.
Smart Images

Figure CN119316349B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a flow table deployment method, computer equipment and medium. Background Art
[0002] With the development of cloud computing networks, data centers and other applications, the performance requirements for data forwarding services are getting higher and higher. Using dedicated hardware such as forwarding chips to carry data forwarding services is the key to improving forwarding performance. However, due to the limited hardware resources on dedicated hardware, as the flow table specifications are greatly improved, it is difficult to meet the requirements of flow table specifications and forwarding performance at the same time.
[0003] To this end, the present application provides a flow table deployment method, computer device and medium to address the technical difficulties in the prior art. Summary of the invention
[0004] In a first aspect, the present application provides a flow table deployment method. The flow table deployment method includes: when the flow table specification of the flow table to be uninstalled is less than a preset threshold, deploying the flow table to be uninstalled in a random access memory; when the flow table specification of the flow table to be uninstalled is greater than the preset threshold, deploying the flow table to be uninstalled in a ternary content addressable memory and the random access memory according to a first hybrid deployment method, the first hybrid deployment method includes: reading a first number of flow table items of a precise flow table each time, and then, when the free space of the random access memory is sufficient to accommodate the flow table items of the first number of precise flow tables, adding the flow table items of the first number of precise flow tables to the precise flow table in the random access memory for precise matching, and, when the free space of the random access memory is insufficient to accommodate the flow table items of the first number of precise flow tables, converting the flow table items of the first number of precise flow tables to obtain a second number of flow table items of a mask flow table, and then adding the flow table items of the second number of mask flow tables to the mask flow table in the ternary content addressable memory for mask matching, wherein the first number is dynamically adjustable.
[0005] Through the first aspect of the present application, it supports the simultaneous unloading of precise flow tables and mask flow tables, and also supports the joint use of ternary content addressable memory and random access memory to provide the storage resources required for flow table unloading. Using the preset threshold as a reference indicator, different scenario types can be distinguished, and a suitable flow table forwarding model can be selected according to the flow table specifications to avoid unloading all flow tables to the random access memory, which will cause the flow table unloading to fail and can only go to soft forwarding. The respective characteristics of the random access memory and the ternary content addressable memory are utilized, and the respective characteristics of the precise flow table and the mask flow table are also utilized. The specifications of the flow table unloading are equivalently improved, and the random access memory is fully utilized to improve the response speed, thereby achieving high data forwarding performance and high resource utilization, while meeting the requirements of flow table specifications and forwarding performance.
[0006] In a possible implementation of the first aspect of the present application, the flow table items of the first number of precise flow tables include flow table items of multiple precise flow tables with repeated feature fields, wherein converting the flow table items of the first number of precise flow tables to obtain the flow table items of the second number of mask flow tables includes: using mask calculation to merge the repeated feature fields in the flow table items of the multiple precise flow tables to obtain flow table items of the mask flow tables corresponding to the flow table items of the multiple precise flow tables.
[0007] In a possible implementation manner of the first aspect of the present application, the repeated characteristic field is one or more of the following: source machine physical address, source network protocol address, source port, destination machine physical address, destination network protocol address, destination port, network protocol.
[0008] In a possible implementation of the first aspect of the present application, the flow table entries of the multiple precise flow tables each have the same destination machine physical address and the same destination port, the flow table entries of the multiple precise flow tables each have a different destination network protocol address, and the flow table entries of the mask flow table corresponding to the flow table entries of the multiple precise flow tables have the same destination machine physical address, the same destination port, and the destination network protocol address represented by the mask, wherein the destination network protocol address range covered by the destination network protocol address represented by the mask includes at least the different destination network protocol addresses respectively possessed by the flow table entries of the multiple precise flow tables.
[0009] In a possible implementation of the first aspect of the present application, the flow table entries of the multiple precise flow tables include multiple repeated feature fields and at least one non-repeated feature field, the multiple repeated feature fields are merged into the corresponding feature fields in the flow table entries of the mask flow table corresponding to the flow table entries of the multiple precise flow tables, and the at least one non-repeated feature field is represented by a mask in the flow table entries of the mask flow table corresponding to the flow table entries of the multiple precise flow tables.
[0010] In a possible implementation manner of the first aspect of the present application, the repeated characteristic field is determined based on a message data format associated with the flow table to be offloaded.
[0011] In a possible implementation manner of the first aspect of the present application, the second number is smaller than the first number.
[0012] In a possible implementation manner of the first aspect of the present application, the first number is determined based on the priority of flow table forwarding efficiency relative to the priority of storage resource utilization.
[0013] In a possible implementation of the first aspect of the present application, when the priority of the flow table forwarding efficiency is higher than the priority of the storage resource utilization, the first number is a first value; when the priority of the flow table forwarding efficiency is lower than the priority of the storage resource utilization, the first number is a second value, and the first value is smaller than the second value.
[0014] In a possible implementation of the first aspect of the present application, the flow table deployment method is implemented by a first-in-first-out memory, and the flow table to be unloaded is input into the first-in-first-out memory one by one. When the queue depth of the first-in-first-out memory reaches a preset depth, the first-in-first-out memory is emptied to output the first number of flow table entries of the precise flow table, wherein the first number is dynamically adjusted by dynamically adjusting the preset depth.
[0015] In a possible implementation manner of the first aspect of the present application, the preset depth is determined based on a maximum depth of the first-in-first-out memory and a preset ratio.
[0016] In a possible implementation of the first aspect of the present application, the preset ratio is determined based on the application scenario of the flow table deployment method and the probability distribution of flow table entries of the precise flow table with repeated feature fields appearing in the flow table to be uninstalled.
[0017] In a possible implementation manner of the first aspect of the present application, the preset threshold is determined based on application scenario requirements.
[0018] In a possible implementation of the first aspect of the present application, the flow table deployment method also includes: each time a flow table entry in the precise flow table in the random access memory is deleted, the last valid flow table entry in the mask flow table in the ternary content addressable memory is precisely converted and moved to the precise flow table in the random access memory.
[0019] In a second aspect, an embodiment of the present application further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a method according to any one of the implementation modes of any of the above aspects when executing the computer program.
[0020] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects.
[0021] In a fourth aspect, an embodiment of the present application further provides a computer program product, which includes instructions stored on a computer-readable storage medium, and when the instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0023] Figure 1 A flow chart of a flow table deployment method provided in an embodiment of the present application;
[0024] Figure 2 A schematic diagram of a flow table deployment provided in an embodiment of the present application;
[0025] Figure 3 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0027] It should be understood that, in the description of this application, "at least one" means one or more, and "a plurality of" means two or more. In addition, unless otherwise specified, the words "first", "second", etc. are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
[0028] Figure 1 A flow chart of a flow table deployment method provided in an embodiment of the present application. Figure 1 As shown, the flow table deployment method includes the following steps.
[0029] Step S101: when the flow table specification of the flow table to be uninstalled is smaller than a preset threshold, deploying the flow table to be uninstalled in a random access memory.
[0030] Step S103: when the flow table specification of the flow table to be offloaded is greater than the preset threshold, deploying the flow table to be offloaded in the ternary content addressable memory and the random access memory according to a first hybrid deployment mode.
[0031] The first hybrid deployment method includes: reading a first number of flow table items of a precise flow table each time, and then, when the free space of the random access memory is sufficient to accommodate the flow table items of the first number of precise flow tables, adding the flow table items of the first number of precise flow tables to the precise flow tables in the random access memory for precise matching, and, when the free space of the random access memory is insufficient to accommodate the flow table items of the first number of precise flow tables, converting the flow table items of the first number of precise flow tables to obtain a second number of flow table items of a mask flow table, and then adding the flow table items of the second number of mask flow tables to the mask flow table in the ternary content addressable memory for mask matching, wherein the first number is dynamically adjustable.
[0032] See also Figure 1 In the technical field of cloud computing network and hardware acceleration offloading, special forwarding chips are relied on to carry data forwarding services. For this purpose, the native flow table needs to be offloaded to the cache on the forwarding chip. The storage resources on the forwarding chip are limited. In addition to providing storage space for flow table offloading, it also needs to carry various processing tasks such as remote direct memory access. The forwarding chip can also be understood as message transceiver hardware, which is used to provide message transceiver functions. Multiple memories are deployed on it. These memories can be divided into ternary content addressable memory (TCAM) and random access memory (RAM). Among them, the random access memory is characterized by fast access speed and small size. It is suitable for precise matching, that is, for storing precise flow tables. The feature fields of flow table items in the precise flow table are all visible. The three-state content addressable memory is characterized by slow access speed, built-in mask calculation, large size, suitable for fuzzy matching, that is, for storing mask flow tables. The feature fields of flow table items in the mask flow table are partially visible, that is, with masks. Figure 1 The flow table deployment method shown supports the simultaneous unloading of precise flow tables and mask flow tables, and also supports the joint use of ternary content addressable memory and random access memory to provide the storage resources required for flow table unloading, and can achieve high data forwarding performance and high resource utilization.
[0033] Continue reading Figure 1In step S101, when the flow table specification of the flow table to be unloaded is less than the preset threshold, the flow table to be unloaded is deployed in the random access memory. In this way, for the case where the flow table specification is less than the preset threshold, such as 100,000 flow table items, such an unloaded flow table is more suitable for deployment in the random access memory, so as to maximize the flow table forwarding performance and improve the response speed. In application scenarios such as cloud computing networks and data centers, it may be necessary to unload flow tables with larger flow table specifications, such as flow tables in the order of millions or tens of millions. However, these large-scale flow tables unloaded to special hardware such as message transceiver hardware may contain only a part of the flow table items required for the current flow table matching. Therefore, if all the flow tables to be unloaded with flow table specifications exceeding the preset threshold are deployed in the random access memory, a large amount of storage space is required, and resource utilization may be low. For this reason, in step S103, when the flow table specification of the flow table to be unloaded is greater than the preset threshold, the flow table to be unloaded is deployed in the ternary content addressable memory and the random access memory according to the first hybrid deployment method. In this way, using the preset threshold as a reference indicator, different scenario types can be distinguished. The flow table specifications of the flow table to be unloaded in some scenario types are not large, which is suitable for the flow table forwarding model with high performance as the main optimization direction, so it is suitable to be deployed in a random access memory; the flow table specifications of the flow table to be unloaded in some scenario types are large, which is suitable for the flow table forwarding model with a balanced design between high performance and high flow table specifications, so it is suitable to adopt the first hybrid deployment method to deploy the flow table to be unloaded in the three-state content addressable memory and the random access memory. In this way, a suitable flow table forwarding model can be selected according to the flow table specifications to avoid unloading all flow tables into the random access memory, which leads to the failure of flow table unloading and can only go to soft transfer. Here, the first hybrid deployment method utilizes the respective characteristics of the random access memory and the three-state content addressable memory, that is, the random access memory has a fast access speed, a small specification, and is suitable for storing precise flow tables, and the three-state content addressable memory has a slow access speed, comes with mask calculation, a large specification, and is suitable for storing mask flow tables. In addition, the first hybrid deployment method utilizes the respective characteristics of the precise flow table and the mask flow table, that is, the characteristic fields of the flow table items in the precise flow table are fully visible and used for precise matching, and the characteristic fields of the flow table items in the mask flow table are partially visible, have their own masks and are used for fuzzy matching.Specifically, the first hybrid deployment method includes: reading a first number of flow table entries of the precise flow table each time, and then, when the free space of the random access memory is sufficient to accommodate the flow table entries of the first number of precise flow tables, adding the flow table entries of the first number of precise flow tables to the precise flow table in the random access memory for precise matching, and, when the free space of the random access memory is insufficient to accommodate the flow table entries of the first number of precise flow tables, converting the flow table entries of the first number of precise flow tables to obtain a second number of flow table entries of the mask flow table, and then adding the flow table entries of the second number of mask flow tables to the mask flow table in the ternary content addressable memory for mask matching, wherein the first number is dynamically adjustable.
[0034] Continue reading Figure 1 The first hybrid deployment method utilizes the respective characteristics of the random access memory and the ternary content addressable memory, and obtains the second number of flow table entries of the mask flow table by converting the flow table entries of the first number of precise flow tables, thereby utilizing the characteristic of the mask calculation of the ternary content addressable memory, and merging the flow table entries of multiple precise flow tables, which can be equivalent to improving the flow table specifications. For example, merging 200,000 flow table entries of the precise flow table can be equivalent to 10,000 flow table entries of the mask flow table, that is, 10,000 flow table entries of the mask flow table in the ternary content addressable memory is equivalent to 200,000 flow table entries of the precise flow table in the random access memory. By increasing the conversion ratio, for example, 1 flow table entry of the mask flow table is equivalent to 200 flow table entries of the precise flow table, the flow table specifications can be equivalently improved to a greater extent. In this way, each time a certain number (for example, the first number) of flow table entries of the precise flow table are read from the flow table to be unloaded, they are then given priority in being sent to the random access memory, that is, when the free space of the random access memory is sufficient to accommodate the flow table entries of the first number of precise flow tables, the flow table entries of the first number of precise flow tables are added to the precise flow table in the random access memory for precise matching. If the free space of the random access memory is insufficient to accommodate the flow table entries of the first number of precise flow tables, they are converted and sent to the three-state content addressable memory. In this way, the requirements of flow table specifications and forwarding performance are met at the same time.
[0035] Continue reading Figure 1, the first hybrid deployment method can be achieved by globally addressing the precise flow table in the random access memory and the mask flow table in the ternary content addressable memory, for example, setting the flow table index of the precise flow table in the random access memory to a range of 1 to 100,000, and setting the flow table index of the mask flow table in the ternary content addressable memory to a range of 100,000 and 1 to 110,000. In this way, according to the flow table index, it can be conveniently determined whether to send it directly to the precise flow table in the random access memory, or to send it to the mask flow table in the ternary content addressable memory after conversion. In the case of mixed use of random access memory and ternary content addressable memory, the precise match is placed in the random access memory, and only when the capacity in the random access memory is insufficient, consider unloading the flow table to the ternary content addressable memory. That is, when there are not enough free indexes in the random access memory, a flow table with a mask is generated, and then the mask flow table and the real field value are inserted into the hash table of the software's ternary content addressable memory, and only the masked flow table is written to the hardware's ternary content addressable memory, while the real field may not be sent to the hardware. By utilizing the characteristic of the ternary content addressable memory's built-in mask calculation, that is, the characteristic field of the flow table item of the mask flow table in the ternary content addressable memory is built-in mask and partially visible, it can better adapt to the statistical characteristics of the message data flow in actual applications. In application scenarios such as cloud computing networks and data centers, multiple message data flows may come from the same source, go to the same destination, pass through the same communication link, be sent from the same port, and be received by the same port, etc. Therefore, taking the five-tuple information as an example, the flow table entries associated with each of these multiple message data flows may have repeated characteristic fields, such as the same destination network protocol address (Destination IP, DIP) or the same source port (source port, sport), or the same destination machine physical address (Destination MAC, DMAC).For example, there may be 10 precise flow table entries, each with the following characteristic fields: (1) DMAC=11:22:33:44:55:66, DIP=1.1.1.2, sport=100; (2) DMAC=11:22:33:44:55:66, DIP=1.1.1.3, sport=100; (3) DMAC=11:22:33:44:55:66, DIP=1.1.1.4, sport=100; (4) DMAC=11:22:33:44:55:66, DIP=1.1.1.5, sport=100; (5) DMAC=11:22:33:44:55:66, DIP=1.1.1 .6, sport=100; (6) DMAC=11:22:33:44:55:66, DIP=1.1.1.7, sport=100; (7) DMAC=11:22:33:44:55:66, DIP=1.1.1.8, sport=100; (8) DMAC=11:22:33:44 :55:66, DIP=1.1.1.9, sport=100; (9) DMAC=11:22:33:44:55:66, DIP=1.1.1.10, sport=100; (10) DMAC=11:22:33:44:55:66, DIP=1.1.1.11, sport=100. It can be seen that the flow table items of these 10 precise flow tables have repeated characteristic fields, and the DMAC field and the sport field are the same, but the DIP field is different. Moreover, the first 24 bits in the DIP field are the same, but the last 8 bits are different. In this way, by converting the flow table items of the first number of precise flow tables to obtain the flow table items of the second number of mask flow tables, the characteristic of the mask calculation of the ternary content addressable memory is utilized to merge the flow table items of multiple precise flow tables, which is equivalent to improving the flow table specifications. For example, the flow table items of the above 10 precise flow tables can be merged to obtain: DMAC= 11:22:33:44:55:66, DIP=1.1.1.0 / 24, sport=100. Furthermore, through mask calculation, it can be obtained that the mask of DMAC is ff:ff:ff:ff:ff:ff, the mask of DIP is ff:ff:ff:00, and the mask of sport is ff. In this way, the DMAC mask can represent up to 255 precise flow table entries, which means that using mask calculation, a mask flow table entry can match 255 precise flow table entries. If another mask is used, such as ff:ff:00:00, a maximum of 65535 precise flow table entries can be represented, which means that a mask flow table entry can match 65535 precise flow table entries.In this way, the first hybrid deployment method utilizes the respective characteristics of random access memory and ternary content addressable memory, and also utilizes the respective characteristics of precise flow table and mask flow table, which equivalently improves the specifications of flow table unloading, and makes full use of random access memory to improve response speed, so as to achieve high data forwarding performance and high resource utilization.
[0036] Continue reading Figure 1In order to make full use of the mask calculation characteristics of TCAM to merge the flow table items of the precise flow table, each time a flow table item is added to the RAM, the information of several flow table items should be read at one time, such as 10 or 20 items in a group, so that there is a high probability that the flow table items with repeated feature fields will be placed in the same group. In some embodiments, the hardware implementation can use a first-in-first-out (FIFO) memory to store the flow table items to be added. When the queue depth of the FIFO reaches a settable ratio, such as half or full, the flow table items in the FIFO are emptied and added as the same group. If there is not enough space in the RAM, the corresponding flow table with a mask is generated and placed in the TCAM. By adjusting the settable ratio of the queue depth of the FIFO, such as 30%, 50%, and 70%, it is equivalent to adjusting how many flow table items of the precise flow table are regarded as the same group to be converted into flow table items of the mask flow table. This settable ratio can be adjusted in real time. The specific reason for adjustment can be combined with the idleness of RAM. For example, when RAM is relatively idle, a higher settable ratio can be set. When RAM is relatively full, a lower settable ratio can be set. This helps to use RAM as much as possible and improve the efficiency of flow table forwarding. In addition, it can be combined with application scenarios. For example, in online non-real-time conferences (such as relying on text and files to interact instead of voice and video), dedicated security links and other applications, there is a high probability that there are a large number of flow table entries with repeated feature fields. At this time, a higher settable ratio can be set, and the storage advantages of TCAM can be fully utilized, which helps to store larger flow tables and improve the efficiency of storage resource utilization. Therefore, in scenarios with high requirements for response speed and flow table forwarding efficiency, this ratio can be adjusted in the direction of maximizing the full specification of RAM. For scenarios with a particularly large number of flow table entries and less high requirements for response speed, this ratio can be adjusted in the direction of maximizing the utilization of storage resources. FIFO can be a serial input and parallel output design to improve throughput efficiency. Furthermore, in the case of mixed use of RAM and TCAM, since there may be a situation where the flow table entries of the precise flow table are placed in the TCAM, each time the flow table entries of the precise flow table in the RAM are deleted, the last flow table entry of the mask flow table of the TCAM needs to be moved to the RAM. Because the flow table entries of the mask flow table of the TCAM may be equivalent to a large number of flow table entries of the precise flow table in the RAM, it can be set to trigger this move operation after deleting a certain number of flow table entries of the precise flow table in the RAM. In this way, by setting the first number to be dynamically adjustable, the first number, that is, the number of flow table entries of the precise flow table read each time, can be specifically set in combination with the needs of the application scenario, user needs, and, for example, the priority of flow table forwarding efficiency and the priority of storage resource utilization, which helps to dynamically adapt to complex and changing application environments.
[0037] In conclusion, Figure 1 The flow table deployment method shown supports the simultaneous unloading of precise flow tables and mask flow tables, and also supports the joint use of ternary content addressable memory and random access memory to provide the storage resources required for flow table unloading. Using the preset threshold as a reference indicator, different scenario types can be distinguished, and a suitable flow table forwarding model can be selected according to the flow table specifications to avoid unloading all flow tables to the random access memory, which will cause the flow table unloading to fail and can only be soft-forwarded. The respective characteristics of the random access memory and the ternary content addressable memory are utilized, and the respective characteristics of the precise flow table and the mask flow table are also utilized, which equivalently improves the specifications of the flow table unloading, and makes full use of the random access memory to improve the response speed, thereby achieving high data forwarding performance and high resource utilization, and meeting the requirements of flow table specifications and forwarding performance.
[0038] Figure 2 A schematic diagram of a flow table deployment provided in an embodiment of the present application. Figure 2 As shown, a plurality of memories are deployed on the message transceiver hardware 201 for message forwarding, and these memories can be divided into a ternary content addressable memory (Ternary Content Addressable Memory, TCAM) and a random access memory (random access memory, RAM). Figure 2 As exemplified in the figure, random access memory A211, random access memory B213, ternary content addressable memory A221, and ternary content addressable memory B223. It should be understood that any number of ternary content addressable memories and random access memories can be deployed on the message transceiver hardware 201, and memories of the same type can be regarded as a whole, and larger data specifications can be provided by splicing memories of the same type together. Memories of the same type have the same or similar data interface specifications, storage space specifications, etc. Among them, RAM has fast access speed and small specifications, and is suitable for precise matching, that is, for storing precise flow tables, in which the characteristic fields of flow table items in the precise flow tables are all visible. TCAM has a slower access speed, comes with its own mask calculation, and has a large specification. It is suitable for fuzzy matching, that is, for mask flow tables, in which the characteristic fields of flow table items in the mask flow tables are partially visible, that is, they are masked. Reference Figure 1 The flow table deployment method shown deploys the flow table to be uninstalled 203 on the message transceiver hardware 201.
[0039] Figure 2 The flow table deployment shown supports the simultaneous unloading of precise flow tables and mask flow tables, which effectively improves the specifications of flow table unloading, achieves high data forwarding performance and high resource utilization, and meets the requirements of flow table specifications and forwarding performance.
[0040] See also Figure 1 and Figure 2 In a possible implementation manner, the flow table items of the first number of precise flow tables include flow table items of multiple precise flow tables with repeated characteristic fields, wherein converting the flow table items of the first number of precise flow tables to obtain the flow table items of the second number of mask flow tables includes: using mask calculation to merge the repeated characteristic fields in the flow table items of the multiple precise flow tables to obtain the flow table items of the mask flow table corresponding to the flow table items of the multiple precise flow tables. In this way, using mask calculation and merging flow table items is equivalent to increasing the flow table specifications, so that a flow table item of a mask flow table is equivalent to the flow table items of multiple precise flow tables, and based on the proportion of repeated characteristic fields in the flow table items of the precise flow tables, the flow table specifications can be more significantly increased by increasing the conversion ratio, which is conducive to meeting the requirements of flow table specifications and forwarding performance at the same time.
[0041] In some embodiments, the repeated characteristic fields are one or more of the following: source machine physical address, source network protocol address, source port, destination machine physical address, destination network protocol address, destination port, network protocol. In this way, using mask calculation and merging flow table items is equivalent to increasing the flow table specifications, so that the flow table items of a mask flow table are equivalent to the flow table items of multiple precise flow tables, and based on the proportion of repeated characteristic fields in the flow table items of the precise flow table, the flow table specifications can be more significantly equivalently increased by increasing the conversion ratio, which is conducive to meeting the requirements of flow table specifications and forwarding performance at the same time.
[0042] In some embodiments, the flow table entries of the multiple precise flow tables each have the same destination machine physical address and the same destination port, the flow table entries of the multiple precise flow tables each have a different destination network protocol address, and the flow table entries of the mask flow table corresponding to the flow table entries of the multiple precise flow tables have the same destination machine physical address, the same destination port, and the destination network protocol address represented by the mask, wherein the destination network protocol address range covered by the destination network protocol address represented by the mask at least includes the different destination network protocol addresses each of the flow table entries of the multiple precise flow tables has. In this way, the characteristic of the mask calculation of the three-state content addressable memory is utilized, that is, the characteristic field of the flow table entry of the mask flow table in the three-state content addressable memory is self-contained mask and partially visible, so that the statistical characteristics of the message data flow in the actual application can be better adapted. In application scenarios such as cloud computing networks and data centers, multiple message data flows may come from the same source, go to the same destination, pass through the same communication link, be sent from the same port, and be received by the same port, etc. In addition, the first hybrid deployment method utilizes the respective characteristics of random access memory and ternary content addressable memory, and also utilizes the respective characteristics of precise flow table and mask flow table, which equivalently improves the specifications of flow table unloading, and makes full use of random access memory to improve response speed, so as to achieve high data forwarding performance and high resource utilization.
[0043] In some embodiments, the flow table entries of the multiple precise flow tables include multiple repeated feature fields and at least one non-repeated feature field, the multiple repeated feature fields are merged into the corresponding feature fields in the flow table entries of the mask flow table corresponding to the flow table entries of the multiple precise flow tables, and the at least one non-repeated feature field is represented by a mask in the flow table entries of the mask flow table corresponding to the flow table entries of the multiple precise flow tables. In this way, the first hybrid deployment method utilizes the respective characteristics of the random access memory and the ternary content addressable memory, and also utilizes the respective characteristics of the precise flow table and the mask flow table, equivalently improves the specifications of the flow table unloading, and makes full use of the random access memory to improve the response speed, which can achieve high data forwarding performance and high resource utilization.
[0044] In a possible implementation, the repeated characteristic field is determined based on the message data format associated with the flow table to be offloaded, so as to flexibly adapt to various message data formats and meet the requirements of flow table specifications and forwarding performance at the same time.
[0045] In a possible implementation manner, the second number is smaller than the first number. In this way, the flow table specification is equivalently increased, which helps to adapt to the unloading requirements of a large-scale flow table.
[0046] In one possible implementation, the first number is determined based on the priority of flow table forwarding efficiency relative to the priority of storage resource utilization. In this way, in scenarios where response speed and flow table forwarding efficiency are required to be high, this ratio can be adjusted in the direction of maximizing RAM full specifications. For scenarios where the number of flow table items is particularly large and the response speed requirement is not so high, this ratio can be adjusted in the direction of maximizing storage resource utilization. Therefore, by setting the first number based on the priority of flow table forwarding efficiency relative to the priority of storage resource utilization, it is possible to create a traffic forwarding model that is more adapted to the needs of the current application scenario, which is conducive to meeting the requirements of flow table specifications and forwarding performance at the same time.
[0047] In some embodiments, when the priority of the flow table forwarding efficiency is higher than the priority of the storage resource utilization, the first number is a first value, and when the priority of the flow table forwarding efficiency is lower than the priority of the storage resource utilization, the first number is a second value, and the first value is less than the second value. In this way, a traffic forwarding model that is more adapted to the needs of the current application scenario is created, which is conducive to meeting the requirements of flow table specifications and forwarding performance at the same time.
[0048] In a possible implementation, the flow table deployment method is implemented by a first-in-first-out memory, and the flow table to be unloaded is input into the first-in-first-out memory one by one. When the queue depth of the first-in-first-out memory reaches a preset depth, the first-in-first-out memory is emptied to output the first number of flow table items of the precise flow table, wherein the first number is dynamically adjusted by dynamically adjusting the preset depth. In order to make full use of the mask calculation characteristics of TCAM to merge the flow table items of the precise flow table, each time a flow table item is added to the RAM, the information of several flow table items should be read at one time, such as 10 or 20 items in a group, so that there is a high probability that the flow table items with repeated feature fields will be placed in the same group. Here, the hardware implementation method can use a first-in-first-out FIFO memory to store the flow table items to be added. When the queue depth of the FIFO reaches a settable ratio, such as half or full, the flow table items in the FIFO are emptied and added as the same group. If there is not enough space in the RAM, the corresponding flow table with a mask is generated and placed in the TCAM. By adjusting the settable ratio of the FIFO queue depth, such as 30%, 50%, and 70%, it is equivalent to adjusting how many flow table entries of the precise flow table are regarded as the same group to be converted into flow table entries of the mask flow table. This settable ratio can be adjusted in real time. The specific reason for adjustment can be combined with the idleness of RAM. For example, when the RAM is relatively idle, a higher settable ratio can be set. When the RAM is relatively full, a lower settable ratio can be set. This helps to use the RAM as much as possible and improve the efficiency of flow table forwarding. In addition, it can be combined with application scenarios. For example, in online non-real-time conferences (such as relying on text and files to interact instead of voice and video), dedicated security links and other applications, there is a high probability that there are a large number of flow table entries with repeated feature fields. At this time, a higher settable ratio can be set, and the storage advantages of TCAM can be fully utilized, which helps to store larger flow tables and improve the efficiency of storage resource utilization. Therefore, in scenarios with high requirements for response speed and flow table forwarding efficiency, this ratio can be adjusted in the direction of maximizing the full specification of RAM. For scenarios with a particularly large number of flow table items and less high requirements for response speed, this ratio can be adjusted in the direction of maximizing the utilization of storage resources. FIFO can be a serial-in and parallel-out design to improve throughput efficiency. In addition, in the case of mixed use of RAM and TCAM, because there may be cases where flow table items of precise flow tables are placed in TCAM, each time the flow table items of the precise flow table in RAM are deleted, the last flow table item of the mask flow table of TCAM needs to be moved to RAM. Because the flow table items of the mask flow table of TCAM may be equivalent to the flow table items of a larger number of precise flow tables in RAM, it can be set to trigger this move operation after deleting a certain number of flow table items of the precise flow table in RAM.In this way, by setting the first number to be dynamically adjustable, the first number can be specifically set in combination with the needs of the application scenario, user needs, and, for example, the priority of flow table forwarding efficiency and the priority of storage resource utilization, that is, the number of flow table items of the precise flow table read each time. This helps to dynamically adapt to complex and changing application environments.
[0049] In some embodiments, the preset depth is determined based on the maximum depth of the FIFO memory and a preset ratio. In this way, the first quantity is dynamically adjusted based on the FIFO memory, which helps to dynamically adapt to complex and changing application environments.
[0050] In some embodiments, the preset ratio is determined based on the application scenario of the flow table deployment method and the probability distribution of the flow table items of the precise flow table with repeated characteristic fields appearing in the flow table to be uninstalled. In applications such as online non-real-time conferences (such as interacting with text and files instead of voice and video), dedicated security links, there is a high probability that there are a large number of flow table items with repeated characteristic fields. At this time, a higher settable ratio can be set, and the storage advantages of TCAM can be fully utilized, which is helpful for storing larger flow tables and improving the efficiency of storage resource utilization. Similarly, in application scenarios such as cloud computing networks and data centers, multiple message data flows may come from the same source, go to the same destination, pass through the same communication link, be sent from the same port, and be received by the same port. Therefore, taking the five-tuple information as an example, the flow table items associated with each of these multiple message data flows may have repeated characteristic fields, such as the same destination network protocol address (Destination IP, DIP) or the same source port (source port, sport), or the same destination machine physical address (Destination MAC, DMAC). Therefore, in scenarios where the response speed and flow table forwarding efficiency are high, the ratio can be adjusted in the direction of maximizing the RAM full specification, and in scenarios where the number of flow table entries is particularly large and the response speed requirement is not so high, the ratio can be adjusted in the direction of maximizing the storage resource utilization. In this way, the first quantity is dynamically adjusted based on the first-in-first-out memory, which helps to dynamically adapt to complex and changing application environments.
[0051] In a possible implementation, the preset threshold is determined based on application scenario requirements. In this way, the first quantity is dynamically adjusted based on the first-in-first-out memory, which helps to dynamically adapt to complex and changing application environments.
[0052] In a possible implementation, the flow table deployment method further includes: each time a flow table entry in the precise flow table in the random access memory is deleted, the last valid flow table entry in the mask flow table in the ternary content addressable memory is precisely converted and moved to the precise flow table in the random access memory. Here, considering that the access speed of the random access memory is relatively fast, when deleting the flow table entry of the precise flow table in the random access memory, the last flow table entry in the ternary content addressable memory is moved, and the precise processing is performed and then added to the random access memory. In this way, it is helpful to fully utilize the entries in the random access memory and improve the flow table forwarding performance.
[0053] Figure 3 3 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application, and the computing device 300 includes: one or more processors 310, a communication interface 320 and a memory 330. The processor 310, the communication interface 320 and the memory 330 are interconnected via a bus 340. Optionally, the computing device 300 may also include an input / output interface 350, and the input / output interface 350 is connected to an input / output device for receiving parameters set by a user, etc. The computing device 300 can be used to implement some or all of the functions of the device embodiment or system embodiment in the above-mentioned embodiment of the present application; the processor 310 can also be used to implement some or all of the operating steps of the method embodiment in the above-mentioned embodiment of the present application. For example, the specific implementation of the various operations performed by the computing device 300 can refer to the specific details in the above-mentioned embodiments, such as the processor 310 is used to perform some or all of the steps in the above-mentioned method embodiment or some or all of the operations in the above-mentioned method embodiment. For another example, in an embodiment of the present application, the computing device 300 may be used to implement part or all of the functions of one or more components in the above-mentioned apparatus embodiment. In addition, the communication interface 320 may be specifically used to perform the communication functions necessary to implement the functions of these apparatuses and components, and the processor 310 may be specifically used to perform the processing functions necessary to implement the functions of these apparatuses and components.
[0054] It should be understood that Figure 3 The computing device 300 may include one or more processors 310, and the multiple processors 310 may provide processing capabilities in a parallel connection mode, a serial connection mode, a serial-parallel connection mode, or any connection mode, or the multiple processors 310 may form a processor sequence or a processor array, or the multiple processors 310 may be divided into a main processor and an auxiliary processor, or the multiple processors 310 may have different architectures such as a heterogeneous computing architecture. In addition, Figure 3The computing device 300 shown in the figure, and the related structural description and functional description are exemplary and non-limiting. In some exemplary embodiments, the computing device 300 may include Figure 3 More or fewer components may be shown, or some components may be combined or separated, or may have a different arrangement of components.
[0055] The processor 310 may have a variety of specific implementation forms. For example, the processor 310 may include a central processing unit (CPU), a graphic processing unit (GPU), a neural-network processing unit (NPU), a tensor processing unit (TPU) or a data processing unit (DPU), etc., and the embodiment of the present application does not specifically limit it. The processor 310 may also be a single-core processor or a multi-core processor. The processor 310 may be a combination of a CPU and a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. The processor 310 may also be implemented using a logic device with built-in processing logic alone, such as an FPGA or a digital signal processor (DSP). The communication interface 320 may be a wired interface or a wireless interface for communicating with other modules or devices. The wired interface may be an Ethernet interface, a local interconnect network (LIN), etc., and the wireless interface may be a cellular network interface or a wireless local area network interface, etc.
[0056] The memory 330 may be a non-volatile memory, such as a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The memory 330 may also be a volatile memory, which may be a random access memory (RAM) used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM). The memory 330 may also be used to store program codes and data, so that the processor 310 calls the program codes stored in the memory 330 to execute some or all of the operation steps in the above method embodiment, or to execute the corresponding functions in the above device embodiment. Figure 3 Show more or fewer components, or have different component configurations.
[0057] The bus 340 may be a peripheral component interconnect express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus 340 may be divided into an address bus, a data bus, a control bus, etc. In addition to the data bus, the bus 340 may also include a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0058] The method and device provided in the embodiments of the present application are based on the same inventive concept. Since the principles of solving the problems in the methods and devices are similar, the embodiments, implementation methods, examples or implementation methods of the methods and devices can refer to each other, and the repeated parts will not be repeated. The embodiments of the present application also provide a system, which includes multiple computing devices, and the structure of each computing device can refer to the structure of the computing device described above. The functions or operations that can be implemented by the system can refer to the specific implementation steps in the above method embodiments and / or the specific functions described in the above device embodiments, which will not be repeated here.
[0059] The present application also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer device (such as one or more processors), the method steps in the above method embodiment can be implemented. The specific implementation of the processor of the computer-readable storage medium in executing the above method steps can refer to the specific operations described in the above method embodiment and / or the specific functions described in the above device embodiment, which will not be repeated here.
[0060] It should be understood by those skilled in the art that the embodiments of the present application may be provided as methods, systems, or computer program products. The present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. The embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The present application may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiments of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. Computer-readable storage media can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media. Available media can be magnetic media (such as floppy disks, hard disks, tapes), optical media, or semiconductor media. Semiconductor media can be solid-state hard disks, random access memory, flash memory, read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, registers, or any other form of suitable storage media.
[0061] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. Each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0062] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. The steps in the method of the embodiment of the present application can be adjusted in order, merged or deleted according to actual needs; the modules in the system of the embodiment of the present application can be divided, merged or deleted according to actual needs. If these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims
1. A flow table deployment method, characterized in that: The flow table deployment method includes: When the flow table specification of the flow table to be uninstalled is less than a preset threshold, deploying the flow table to be uninstalled in a random access memory; When the flow table specification of the flow table to be uninstalled is greater than the preset threshold, the flow table to be uninstalled is deployed in the ternary content addressable memory and the random access memory according to the first hybrid deployment mode, The first hybrid deployment method includes: reading a first number of flow table items of a precise flow table each time, and then, when the free space of the random access memory is sufficient to accommodate the flow table items of the first number of precise flow tables, adding the flow table items of the first number of precise flow tables to the precise flow tables in the random access memory for precise matching, and, when the free space of the random access memory is insufficient to accommodate the flow table items of the first number of precise flow tables, converting the flow table items of the first number of precise flow tables to obtain a second number of flow table items of a mask flow table, and then adding the flow table items of the second number of mask flow tables to the mask flow table in the ternary content addressable memory for mask matching, wherein the first number is dynamically adjustable.
2. The flow table deployment method according to claim 1, characterized in that: The flow table items of the first number of precise flow tables include flow table items of multiple precise flow tables with repeated feature fields, wherein converting the flow table items of the first number of precise flow tables to obtain the flow table items of the second number of mask flow tables includes: using mask calculation to merge the repeated feature fields in the flow table items of the multiple precise flow tables to obtain flow table items of the mask flow tables corresponding to the flow table items of the multiple precise flow tables.
3. The flow table deployment method according to claim 2, characterized in that: The repeated characteristic fields are one or more of the following: source machine physical address, source network protocol address, source port, destination machine physical address, destination network protocol address, destination port, network protocol.
4. The flow table deployment method according to claim 3, characterized in that: The flow table entries of the multiple precise flow tables each have the same destination machine physical address and the same destination port, the flow table entries of the multiple precise flow tables each have a different destination network protocol address, and the flow table entries of the mask flow table corresponding to the flow table entries of the multiple precise flow tables have the same destination machine physical address, the same destination port, and the destination network protocol address represented by the mask, wherein the destination network protocol address range covered by the destination network protocol address represented by the mask at least includes the different destination network protocol addresses respectively possessed by the flow table entries of the multiple precise flow tables.
5. The flow table deployment method according to claim 2, characterized in that: The flow table entries of the multiple precise flow tables include multiple repeated feature fields and at least one non-repeated feature field, the multiple repeated feature fields are merged into corresponding feature fields in the flow table entries of the mask flow table corresponding to the flow table entries of the multiple precise flow tables, and the at least one non-repeated feature field is represented by a mask in the flow table entries of the mask flow table corresponding to the flow table entries of the multiple precise flow tables.
6. The flow table deployment method according to claim 2, characterized in that: The repeated characteristic field is determined based on the message data format associated with the flow table to be offloaded.
7. The flow table deployment method according to claim 1, characterized in that: The second number is smaller than the first number.
8. The flow table deployment method according to claim 1, characterized in that: The first number is determined based on a priority of flow table forwarding efficiency relative to a priority of storage resource utilization.
9. The flow table deployment method according to claim 8, characterized in that: When the priority of the flow table forwarding efficiency is higher than the priority of the storage resource utilization, the first number is a first value; when the priority of the flow table forwarding efficiency is lower than the priority of the storage resource utilization, the first number is a second value, and the first value is smaller than the second value.
10. The flow table deployment method according to claim 1, characterized in that: The flow table deployment method is implemented through a first-in-first-out memory, and the flow table to be unloaded is input into the first-in-first-out memory one by one. When the queue depth of the first-in-first-out memory reaches a preset depth, the first-in-first-out memory is emptied to output the first number of flow table entries of the precise flow table, wherein the first number is dynamically adjusted by dynamically adjusting the preset depth.
11. The flow table deployment method according to claim 10, characterized in that: The preset depth is determined based on a maximum depth of the FIFO memory and a preset ratio.
12. The flow table deployment method according to claim 11, characterized in that: The preset ratio is determined based on an application scenario of the flow table deployment method and a probability distribution of flow table entries of a precise flow table having repeated characteristic fields appearing in the flow table to be uninstalled.
13. The flow table deployment method according to claim 1, characterized in that: The preset threshold is determined based on application scenario requirements.
14. The flow table deployment method according to claim 1, characterized in that: The flow table deployment method further includes: Each time a flow table entry in the precise flow table in the random access memory is deleted, the last valid flow table entry in the mask flow table in the ternary content addressable memory is precisely converted and then moved to the precise flow table in the random access memory.
15. A computer device, characterized in that: The computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 14 when executing the computer program.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which, when executed on a computer device, cause the computer device to perform the method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Large-scale OpenFlow flow table hierarchical storage architecture and accelerated searching method
CN108337172A
Flow key lookup involving multiple simultaneous CAM operations to identify hash values in a hash bucket
US20140153571A1