A flow table unloading method and device
By classifying and dividing the matches and operation sets in the flow table, repeated offloading to the hardware is avoided, thus solving the problems of large hardware storage space and CPU performance consumption in the prior art, and achieving more efficient flow table offloading.
Patent Information
- Application Number
- CN202211654685.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-22
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2042-12-22
AI Technical Summary
The existing flow table unloading method occupies a large amount of hardware memory, frequent software and hardware interactions, and consumes CPU performance.
By dividing the matches in the flow table into at least one category, if the same table entries exist in a certain category between different flow tables, it will not be repeatedly unloaded to the hardware; the operation sets in the flow table are divided into a common operation set and a private operation set. If the same table entries exist in the common operation set, it will not be repeatedly unloaded to the hardware.
Saves hardware storage space, reduces the number of software and hardware interactions, and improves CPU performance.
Smart Images

Figure CN116032837B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a flow table unloading method and device. Background Art
[0002] With the rapid development of cloud computing and data center related technologies, business layer requirements and data traffic are increasing. In order to improve data forwarding performance and packet receiving and sending speed, various hardware acceleration technologies are used to meet the rapidly growing high network bandwidth application requirements while reducing the occupation of host computing resources. Among them, hardware offload technology has been widely used. Hardware offload refers to the transfer of certain functions originally undertaken by software to hardware implementation. In data transmission and network communication, software such as operating systems generally control the forwarding of messages. By unloading the data path (Data Path) fast forward flow table (Flow Table) generated by the software to the hardware, the message forwarding speed can be increased and the forwarding performance can be improved. However, the existing flow table offloading method occupies a large amount of hardware memory, the software and hardware interact frequently, and the central processing processor (CPU) performance is consumed. Summary of the invention
[0003] The embodiments of the present application provide a flow table unloading method and device, which can save hardware storage space, reduce the number of software and hardware interactions, and improve CPU performance.
[0004] In the first aspect, an embodiment of the present application provides a flow table unloading method, including: dividing the matching items in the flow table into at least one category; determining whether there is an entry in the first linked list of the current record that is the same as the first entry in the first category of the at least one category, and the entry in the first linked list is of the same type as the entry in the first category; if not, establishing the first entry in the first category and unloading the first entry in the first category to hardware; if present, increasing the count of the first entry in the first linked list, and not unloading the first entry to hardware. By dividing the matching items in the flow table into at least one category, if the same entry exists in a category between different flow tables, there is no need to repeatedly unload the entry to hardware, thereby saving hardware storage space.
[0005] In one possible design, the operation set in the flow table is divided into a common operation set and a private operation set; it is determined whether there is an entry in the common operation linked list of the current record that is identical to the second entry in the common operation set; if not, the second entry in the common operation set is established, and the second entry in the common operation set is unloaded to hardware; if so, the count of the second entry in the common operation linked list is increased, and the second entry in the common operation set is not unloaded to hardware.
[0006] By dividing the matching items in the flow table into at least one category, if the same table item exists in a category between different flow tables, there is no need to repeatedly unload the table item to the hardware, thereby saving hardware storage space. By dividing the operation set in the flow table into a shared operation set and a private operation set, if the same table item exists in the shared operation set between different flow tables, there is no need to repeatedly unload the table item to the hardware, thereby saving hardware storage space. In addition, if the corresponding table item already exists in the category or shared operation set in the hardware, there is no need to repeatedly unload it, thereby reducing the interaction frequency between software and hardware and improving CPU performance.
[0007] In another possible design, all the table items in the private operation set are established; and all the table items in the private operation set are unloaded to hardware. Since the utilization rate of the table items in the private operation set is low, for the table items in the private operation set of each flow table, private operation set table items can be established and unloaded to hardware to improve the success rate of data forwarding.
[0008] In another possible design, the matching items in the flow table are input into a trained network service model, and the matching degree between each field in the matching items and a preset classification template is determined; and the matching items in the flow table are divided into at least one classification according to the matching degree. The matching items are classified by the network service model to improve the accuracy of classification.
[0009] In another possible design, when the length of time that the first entry has not been used exceeds a first preset threshold, the count of the first entry in the first linked list is reduced or the first entry is deleted from the hardware, so as to avoid storing the first entry when it has not been used for a long time and improve the utilization rate of the hardware.
[0010] In another possible design, when the second table item is not used for a period of time exceeding a second preset threshold, the count of the second table item in the shared operation linked list is reduced or the second table item is deleted from the hardware, so as to avoid storing the second table item when it is not used for a long time and improve the utilization rate of the hardware.
[0011] In another possible design, the at least one classification includes one or more of tunnel classification, data link layer L2 classification, network layer L3 classification, and transport layer L4 classification.
[0012] In a second aspect, an embodiment of the present application provides a flow table unloading device, the device comprising:
[0013] A classification module, used for classifying matching items in the flow table into at least one classification;
[0014] A search module, used for determining whether there is an entry in a first linked list of a current record that is the same as a first entry in a first category of the at least one category, and the entry in the first linked list is of the same type as the entry in the first category;
[0015] An unloading module is used to establish the first table item in the first category if it does not exist, and unload the first table item in the first category to the hardware; if it exists, increase the count of the first table item in the first linked list, and do not unload the first table item to the hardware.
[0016] In another possible design, the classification module is further used to divide the operation set in the flow table into a common operation set and a private operation set;
[0017] The search module is further used to determine whether there is an entry in the common operation chain list of the current record that is the same as the second entry in the common operation set;
[0018] The unloading module is also used to establish the second table entry in the shared operation set if it does not exist, and unload the second table entry in the shared operation set and the first private operation set to the hardware; if it exists, increase the count of the second table entry in the shared operation linked list, and only unload the private operation set to the hardware.
[0019] In another possible design, the unloading module is further used to establish all table entries in the private operation set; and unload all table entries in the private operation set to hardware.
[0020] In another possible design, the classification module is also used to input the matching items in the flow table into a trained network business model to determine the matching degree between each field in the matching items and a preset classification template; and according to the matching degree, divide the matching items in the flow table into at least one classification.
[0021] In another possible design, the unloading module is further used to reduce the count of the first entry in the first linked list or delete the first entry from the hardware when the length of time during which the first entry has not been used exceeds a first preset threshold.
[0022] In another possible design, the unloading module is further used to reduce the count of the second table entry in the shared operation list or delete the second table entry from the hardware when the length of time during which the second table entry has not been used exceeds a second preset threshold.
[0023] In another possible design, the at least one classification includes one or more of tunnel classification, data link layer L2 classification, network layer L3 classification, and transport layer L4 classification.
[0024] The operations and beneficial effects performed by the flow table unloading device can refer to the method and beneficial effects described in the first aspect above, and the repeated parts will not be repeated.
[0025] In the third aspect, the present application provides a flow table unloading device, which can be an OVS, or a device in an OVS, or a device that can be used in combination with an OVS. Among them, the flow table unloading device can also be a chip system. The flow table unloading device can execute the method described in the first aspect. The functions of the flow table unloading device can be implemented by hardware, or by hardware executing corresponding software implementations. The hardware or software includes one or more modules corresponding to the above functions. The module can be software and / or hardware. The operations and beneficial effects performed by the flow table unloading device can refer to the methods and beneficial effects described in the first aspect above, and the repeated parts will not be repeated.
[0026] In a fourth aspect, the present application provides a computing device, comprising a processor and a memory, wherein the memory is used to store a computer program, and when the processor calls the computer program in the memory, the method described in any one of the first aspects is executed.
[0027] In a fifth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and when the computer program is executed, the method described in any one of the first aspects is implemented.
[0028] In a sixth aspect, the present application provides a computer program product comprising a computer program, which, when executed, enables the method described in any one of the first aspects to be implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.
[0030] Figure 1 It is a flow chart of flow table unloading;
[0031] Figure 2It is a flowchart of a flow table unloading method provided in an embodiment of the present application;
[0032] Figure 3 It is a flowchart of another flow table unloading method provided in an embodiment of the present application;
[0033] Figure 4 It is a structural schematic diagram of a flow table unloading device provided in an embodiment of the present application;
[0034] Figure 5 It is a structural diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application.
[0036] 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.
[0037] The flow table unloading method belongs to the category of hardware offload technology, which is generally understood as unloading the flow table matching, message forwarding, data forwarding and other functions originally implemented by software to hardware for execution. In application scenarios such as cloud computing and data centers, the flow table unloading method and related equipment and media are applied to virtual switches, network cards, etc. Specifically, a virtual switch is obtained by integrating multiple physically connected switches using virtualization technology, and is used to provide network services at the data link layer. An architecture of multi-layer virtual switches is called the Open VSwitch architecture, referred to as the OVS architecture. The OVS architecture is characterized by the decoupling of the control layer and the forwarding layer. A unified controller is used at the control layer to determine the transmission path of all data packets in the network, and then the switch performs data transmission at the forwarding layer. Among them, the controller is responsible for controlling the forwarding rules, and the switch is only responsible for executing the forwarding work under the forwarding rules. The OVS architecture supports user mode and kernel mode, also known as user space and kernel space. Data interaction between kernel space and user space, or switching between kernel state and user state, generally causes delays and losses, resulting in performance degradation. To this end, the OVS architecture uses the Data Plane Development Kit (DPDK) technology, so that user-state data is forwarded directly to the network card without passing through the operating system. Specifically, the OVS architecture combines DPDK technology, and data forwarding is achieved through flow table matching, in which the specific network function or interface of the network card corresponds to one or more data paths (Data Path), and the data packets of the data flow are directed to the corresponding data path through flow table matching. In other words, the user-state OVS can unload the flow table to hardware such as the network card through the DPDK flow table unloading channel or the interface that DPDK opens to the user-state OVS for calling, thus realizing user-state operations, eliminating data interaction between kernel space and user space and the intervention of the operating system, thereby improving performance. Generally speaking, there can be multiple flow tables, each flow table has multiple table entries (Flow Entry), and each table entry has multiple match fields (Match Fields). User-state OVS uses cache flow tables on the hardware cache. These hardware cache cache flow tables are used to directly forward user-state data to the corresponding data path, such as the corresponding module on the network card. They can be understood as data path fast-forward flow tables, and such data path fast-forward flow tables are generally stored on the hardware cache, such as random access memory (RAM).Therefore, the OVS architecture combines DPDK technology to enable user-state data (such as user data) to find matching entries through the cache flow table or data path fast-forward flow table on the hardware cache, that is, the message hits the data path fast-forward flow table, and then the data is directly forwarded to the corresponding data path or network card interface for data forwarding and message forwarding.
[0038] Flow table unloading refers to specifying a part of a coprocessor or smart network card to specifically implement the above-mentioned flow table matching and data forwarding functions (including message forwarding and network communication). Therefore, the flow table cached in the hardware is also called a hard-converted flow table. Flow table matching and data forwarding are performed through the hard-converted flow table, such as performing hard conversion of messages based on the hard-converted flow table, which has the advantages of high operating efficiency and low latency. In contrast, the flow table cached in the user space is called a soft-converted flow table. Flow table matching and data forwarding are performed through the soft-converted flow table, such as performing soft conversion of messages based on the soft-converted flow table, which can utilize the rich applications, data and development tools in the user space. In the user space, a data path fast-converted flow table (which can correspond to a certain soft-converted flow table) can be generated or the transmission path of the current flow data packet can be determined, and then the data path fast-converted flow table in the user state is sent to the hardware cached flow table or the hard-converted flow table. Such sending of the data path fast-forward flow table to the hardware cache flow table or hard-forward flow table corresponds to the above-mentioned flow table unloading, which is conducive to the subsequent execution of flow table matching and data forwarding through the hard-forward flow table, such as performing hard-forwarding of messages based on the hard-forward flow table.
[0039] In the existing technical solution, the complete flow table is parsed into multiple table items and unloaded to the hardware. Each table item includes a mapping relationship between a matching item (key) and an operation set (action). Among them, the key is unloaded to the hardware to guide the hardware matching; the action is unloaded to the hardware to guide the hardware forwarding. For example, when unloading a 1K flow table, it is necessary to store 1K of key and action table items in RAM.
[0040] like Figure 1 As shown, Figure 1 The flow table unloading process diagram is as follows: S101, OVS generates multiple flow tables. S102, filters all received packets. S103, parses multiple different flow tables to obtain multiple matching items. S104, parses multiple different flow tables to obtain multiple operation sets. S105, assembles multiple matching items and multiple operation sets into a flow table, and unloads to hardware.
[0041] However, the above flow table unloading process has the following disadvantages: (1) The key unloaded from the flow table is the complete key in multiple flow tables. If there is overlap in tunnel, L2, L3 or L4 in multiple flow tables, only the complete keys in multiple flow tables can be unloaded to the hardware. This wastes the RAM memory space of the hardware. (2) The action unloaded from the flow table is the complete action in multiple flow tables. If there are some identical actions in the action operations in multiple flow tables, for example, the Network Address Translation (NAT) action may be mapped to the same Internet Protocol (IP) address or port. Therefore, the complete actions in multiple flow tables must be unloaded to the hardware, wasting the RAM memory space of the hardware. (3) The addition and deletion of each table item in the flow table will cause the addition and deletion of software and hardware, resulting in frequent interaction between software and hardware and consumption of CPU performance.
[0042] In order to solve the above technical problems, the embodiments of the present application provide the following solutions.
[0043] like Figure 2 As shown, Figure 2 : is a flow chart of a flow table unloading method provided in an embodiment of the present application. The method mainly includes the following steps:
[0044] S201: Divide matching items in a flow table into at least one category.
[0045] Each flow table may include a mapping relationship between a matching item (key) and an operation set (action), and the matching item may include multiple message header fields, and the multiple message header fields include one or more of a source address, a source port number, a destination address, a destination port number, a virtual extended LAN (Virtual Extensible LAN, VXLAN), a protocol, an external virtual LAN (OuterVLAN), an internal virtual LAN (Inter VLAN) and a virtual port (Virtual Port, vPort). The operation set may include a forwarding operation and all other operations performed on the message corresponding to the operation set between the forwarding operations.
[0046] The packet header fields of all flow tables can be divided into four categories: tunnel, data link layer (L2), network layer (L3), and transport layer (L4). The matching items in each flow table can fall into one or more of the tunnel, L2, L3, and L4 categories.
[0047] Specifically, the matching items in the flow table can be input into the trained network service model to determine the matching degree between each field in the matching item and the preset classification template; and the matching items in the flow table are divided into at least one classification according to the matching degree. The preset classification templates include tunnel classification templates, L2 classification templates, L3 classification templates, and L4 classification templates. For example, if the matching degree between the first field in the matching item and the L2 classification template is greater than a preset threshold, the first field in the matching item is divided into the L2 classification.
[0048] Optionally, before classifying the matching items in the flow table using the trained network service model, each field and classification label in the matching items may be input into the network service model to be trained in advance to obtain the trained network service model.
[0049] Optionally, before dividing the matching items in the flow table into at least one classification, OVS can generate a flow table and forward the received data packets through the flow table. Further, the received data packets can be filtered, for example, Address Resolution Protocol (ARP) data packets, mirror data packets or multicast data packets are filtered out, and the ARP data packets, mirror data packets or multicast data packets are not forwarded through the flow table.
[0050] S202, determine whether there is an entry in the first linked list of the current record that is the same as the first entry in the first category of at least one category, and the entry in the first linked list is of the same type as the entry in the first category. If not, execute S203. If so, execute S204.
[0051] Specifically, four types of linked lists have been saved in the software memory (such as peripheral memory), and the four linked lists include a tunnel linked list, an L2 linked list, an L3 linked list, and an L4 linked list, and each linked list may include one or more table items. Among them, the first linked list can be any one of the tunnel linked list, the L2 linked list, the L3 linked list, and the L4 linked list. OVS can determine whether there are table items in the corresponding classification in the matching items of the flow table in each linked list. For example, if the matching items in the flow table are divided into tunnel classification and L2 classification, determine whether there are table items of tunnel classification in the tunnel linked list currently recorded, and whether there are table items of L2 classification in the L2 linked list currently recorded.
[0052] In particular, if there is no entry in the first linked list, that is, when the flow table is generated for the first time, the first entry in the first category can be directly established in the first linked list.
[0053] S203, establish the first table item in the first category, and unload the first table item in the first category to hardware. If the first table item is not recorded in the first linked list, establish the first table item in the first linked list so that data is forwarded through the first table item after being unloaded to hardware (such as RAM).
[0054] S204: Increase the count of the first entry in the first linked list, and do not unload the first entry to hardware.
[0055] For example, the count of the first entry in the first linked list may be increased by 1. If the first entry has been recorded in the first linked list, it is not necessary to repeatedly record the first entry in the first linked list to avoid repeated offloading to the hardware and occupying the storage space of the hardware.
[0056] Optionally, when the length of time that the first table item has not been used exceeds a first preset threshold, the count of the first table item in the first linked list is reduced or the first table item is deleted from the hardware. The first preset threshold may be 5 minutes or 10 minutes. For example, after the first table item is unloaded into the hardware, if the first table item has not been used for more than 5 minutes, the count of the first table item in the first linked list is reduced by 1. If the first table item has not been used for more than 5 minutes again, the count of the first table item in the first linked list is continued to be reduced by 1. If the first table item has not been used since it was unloaded into the hardware, the first table item may be directly deleted from the hardware.
[0057] In an embodiment of the present application, by dividing the matching items in the flow table into at least one category, if the same table item exists in a category between different flow tables, there is no need to repeatedly unload the table item to the hardware, thereby saving hardware storage space.
[0058] like Figure 3 As shown, Figure 3 : is a flow chart of another flow table unloading method provided in an embodiment of the present application. The method mainly includes the following steps:
[0059] S301: Divide matching items in a flow table into at least one category.
[0060] S302: Determine whether there is an entry in the first linked list of the current record that is the same as the first entry in the first category of the at least one category.
[0061] S303: If it does not exist, create the first table item in the first category; if it does exist, increase the count of the first table item in the first linked list.
[0062] S301-S303 are the same as the above-mentioned S201-S204. The implementation process of S301-S303 can refer to the above-mentioned S201-S204, which will not be repeated here.
[0063] S304: Divide the operation set in the flow table into a shared operation set and a private operation set.
[0064] The common operation set (action) may be a common data forwarding operation, such as L2, SET MAC or SET WLAN operations, etc. The private operation set (action) may be an uncommon data forwarding operation.
[0065] Specifically, the operation set in the flow table can be input into a trained operation classification model, and the operation set in the flow table can be classified by the operation classification model. Optionally, before the operation set in the flow table is classified by the operation classification model, the operation set and the classification label can be input into the operation classification model to be trained to obtain a trained operation classification model.
[0066] S305: Determine whether there is an entry in the common operation chain list of the current record that is the same as the second entry in the common operation set.
[0067] Specifically, a shared operation linked list has been stored in the software memory (e.g., peripheral memory), and the shared operation linked list may include one or more table items. For example, if the operation set in the flow table is divided into a public operation set and a private operation set, it is determined whether the shared operation linked list of the current record contains a table item of the public operation set in the flow table.
[0068] In particular, if there is no entry in the shared operation linked list, that is, when the flow table is generated for the first time, the second entry in the shared operation set can be directly established in the shared operation linked list.
[0069] S306: If it does not exist, create the second table entry in the shared operation set; if it does exist, increase the count of the second table entry in the shared operation linked list.
[0070] In the case where the second table item is not recorded in the shared operation linked list, the first table item is established in the shared operation linked list so as to forward data through the second table item after unloading to the hardware (e.g., RAM). In the case where the second table item has been recorded in the shared operation linked list, it is not necessary to repeatedly record the second table item in the shared operation linked list to avoid repeated unloading to the hardware and occupying the storage space of the hardware.
[0071] Increasing the count of the second entry in the shared operation linked list may include: adding +1 to the count of the first entry in the first linked list.
[0072] S307: Establish all entries in the private operation set.
[0073] Since the utilization rate of the table entries in the private operation set is low, for the private operation set of each flow table, all the table entries in the private operation set can be established and unloaded to the hardware, thereby improving the success rate of data forwarding.
[0074] S308: Unload the first table item in the established first category, the second table item in the common operation set, and all table items in the private operation set to hardware. For table items with increased counts, do not unload them to hardware.
[0075] Optionally, when the length of time that the second table item has not been used exceeds a second preset threshold, the count of the second table item in the shared operation chain list is reduced or the second table item is deleted from the hardware. The second preset threshold may be 5 minutes or 10 minutes. For example, after the second table item is unloaded into the hardware, if the second table item has not been used for more than 5 minutes, the count of the second table item in the shared operation chain list is reduced by 1, and if the second table item has not been used for more than 5 minutes again, the count of the second table item in the shared operation chain list is continued to be reduced by 1. If the second table item has not been used since it was unloaded into the hardware, the second table item may be directly deleted from the hardware.
[0076] Optionally, the index of the table item whose count is increased can be saved in the hardware. For example, if the same first table item exists in the L2 classification of flow table 1 and flow table 2, and the same second table item exists in the common operation set, the flow_index and action_index of flow table 2 can be recorded in the hardware, so that the first table item in the L2 classification of flow table 2 can be indexed by flow_index, and the second table item in the common operation set of flow table 2 can be indexed by action_index.
[0077] For example, if VOC generates two flow tables, flow table 1 includes: Key: A1+B1+C1+D1, Action: E1+E2, and flow table 2 includes: Key: A1+B1+C1+D2, Action: E1+E3. Among them, A represents the tunnel classification of the key in the flow table, B represents the L2 classification of the key in the flow table, C represents the L3 classification of the key in the flow table, and D represents the L4 classification of the key in the flow table. E represents the action in the flow table. A1 is an entry in the tunnel classification, B1 is an entry in the L2 classification, C1 is an entry in the L3 classification, and D1 and D2 are two different entries in the L4 classification. E1 is a public action, and E2 and E3 are private actions.
[0078] It can be seen that the table item A1 in the tunnel category in flow table 1 and flow table 2 is the same, the table item B1 in the L2 category is the same, the table item C1 in the L3 category is the same, and the table item D1 in the L4 category in flow table 1 is different from the table item D2 in the L4 category in flow table 2. Therefore, all the table items in flow table 1 can be unloaded to the hardware, and only the table item D2 in the L4 category in flow table 2 and the private operation set E3 can be unloaded to the hardware. Finally, the table item content saved by the hardware is: flow table 1: Key: A1+B1+C1+D1, Action: E1+E2; flow table 2: Key: D2, Action: E3. It should be noted that the following content of flow table 2 is actually saved in the hardware: Key: flow_index+D2; Action: action_index+E3. Among them, flow_index represents A1+B1+C1, and action_index represents E1.
[0079] It should be noted that flow_index is not limited to indexing one or more types of flow tables. Different indexes can index A1+B1+C1 (tunnel messages) or B1+C1 (non-tunnel messages). Similarly, action_index is not limited to indexing one common action, but can also index multiple common actions.
[0080] After the above operation, there is no need to repeatedly store the table items A1+B1+C1 in the Key in the flow table 2 and the common operation set E1 in the Action, thus saving the storage space of the hardware.
[0081] In an embodiment of the present application, by dividing the matching items in the flow table into at least one category, if the same table item exists in a certain category between different flow tables, it is not necessary to repeatedly unload the table item to the hardware, thereby saving the storage space of the hardware. By dividing the operation set in the flow table into a shared operation set and a private operation set, if the same table item exists in the shared operation set between different flow tables, it is not necessary to repeatedly unload the table item to the hardware, thereby saving the storage space of the hardware. In addition, if the corresponding table item already exists in the category or shared operation set in the hardware, it is not necessary to repeatedly unload it, thereby reducing the interaction frequency between software and hardware and improving the performance of the CPU.
[0082] The embodiment of the present application can divide the functional modules of OVS according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation. The following is an example of dividing each functional module according to each function.
[0083] See also Figure 4 , Figure 4 40 is a schematic diagram of the structure of a flow table unloading device provided in an embodiment of the present application. The flow table unloading device may include a classification module 401, a search module 402 and an unloading module 403.
[0084] In one possible design, the flow table unloading device may implement the steps or processes executed by the OVS in the above method embodiment. For example, it may be implemented jointly by the OVS and a chip or circuit that can provide a software and hardware interface.
[0085] A classification module 401, configured to classify matching items in a flow table into at least one classification;
[0086] A search module 402 is used to determine whether there is an entry in a first linked list of the current record that is the same as a first entry in a first category of the at least one category, and the entry in the first linked list is of the same type as the entry in the first category;
[0087] The unloading module 403 is used to establish the first table item in the first category and unload the first table item in the first category to the hardware if it does not exist; if it exists, increase the count of the first table item in the first linked list and do not unload the first table item to the hardware.
[0088] Optionally, the classification module 401 is further used to divide the operation set in the flow table into a shared operation set and a private operation set;
[0089] The search module 402 is further used to determine whether there is an entry in the common operation chain list of the current record that is the same as the second entry in the common operation set;
[0090] The unloading module 403 is also used to establish the second table entry in the shared operation set if it does not exist, and unload the second table entry in the shared operation set and the first private operation set to the hardware; if it exists, increase the count of the second table entry in the shared operation linked list, and only unload the private operation set to the hardware.
[0091] Optionally, the unloading module 403 is further configured to establish all entries in the private operation set; and unload all entries in the private operation set to hardware.
[0092] Optionally, the classification module 401 is also used to input the matching items in the flow table into the trained network business model, determine the matching degree between each field in the matching items and the preset classification template; and divide the matching items in the flow table into at least one classification according to the matching degree.
[0093] Optionally, the unloading module 403 is further configured to reduce the count of the first entry in the first linked list or delete the first entry from the hardware when the length of time during which the first entry has not been used exceeds a first preset threshold.
[0094] Optionally, the unloading module 403 is further configured to reduce the count of the second entry in the shared operation list or delete the second entry from the hardware when the length of time during which the second entry has not been used exceeds a second preset threshold.
[0095] Optionally, the at least one classification includes one or more of tunnel classification, data link layer L2 classification, network layer L3 classification and transport layer L4 classification.
[0096] It should be noted that the implementation of each module can also refer to Figure 2 or Figure 3 The corresponding description of the method embodiment shown executes the methods and functions performed by OVS in the above embodiments.
[0097] Figure 5 is a schematic diagram of a computing device provided in an embodiment of the present application. The computing device can be applied to OVS to perform the above Figure 2 or Figure 3 The functions of OVS in the method embodiment shown, or the steps or processes executed by OVS in the above method embodiment are implemented.
[0098] like Figure 5 As shown, the computing device includes a processor 501 and a transceiver 502. Optionally, the computing device also includes a memory 503. The processor 501, the transceiver 502 and the memory 503 can communicate with each other through an internal connection path to transmit control and / or data signals. The memory 503 is used to store a computer program, and the processor 501 is used to call and run the computer program from the memory 503 to control the transceiver 502 to send and receive signals. Optionally, the computing device may also include an antenna for sending the uplink data or uplink control signaling output by the transceiver 502 through a wireless signal.
[0099] The processor 501 can be used with Figure 4The classification module 401, the search module 402 and the unloading module 403 correspond to each other, and can be combined with the memory 503 to form a processing device, and the processor 501 is used to execute the program code stored in the memory 503 to implement the above functions. In specific implementation, the memory 503 can also be integrated into the processor 501, or independent of the processor 501.
[0100] The transceiver 502 may also be referred to as a transceiver unit or a transceiver module. The transceiver 502 may include a receiver (or receiver, receiving circuit) and a transmitter (or transmitter, transmitting circuit). The receiver is used to receive signals, and the transmitter is used to transmit signals.
[0101] It should be understood that Figure 5 The computing device shown is capable of implementing Figure 2 or Figure 3 The various processes of OVS involved in the method embodiment shown. The operations and / or functions of each module in the computing device are respectively to implement the corresponding processes in the above method embodiment. For details, please refer to the description in the above method embodiment. To avoid repetition, the detailed description is appropriately omitted here.
[0102] The processor 501 can be used to execute the actions implemented by the OVS described in the previous method embodiment, and the transceiver 502 can be used to execute the sending or receiving action. Please refer to the description in the previous method embodiment for details, which will not be repeated here.
[0103] Among them, the processor 501 can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the contents disclosed in this application. The processor 501 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and so on. The communication bus 504 can be a peripheral component interconnect standard PCI bus or an extended industrial standard structure EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5Only one thick line is used to represent it, but it does not mean that there is only one bus or one type of bus. The communication bus 504 is used to realize the connection communication between these components. Among them, the transceiver 502 in the embodiment of the present application is used to communicate signaling or data with other node devices. The memory 503 may include volatile memory, such as nonvolatile dynamic random access memory (NVRAM), phase change random access memory (PRAM), magnetoresistive random access memory (MRAM), etc., and may also include non-volatile memory, such as at least one disk storage device, electronically erasable programmable read-only memory (EEPROM), flash memory devices, such as NOR flash memory or NAND flash memory, semiconductor devices, such as solid state disk (SSD), etc. The memory 503 may also be at least one storage device located away from the aforementioned processor 501. The memory 503 may also optionally store a set of computer program codes or configuration information. Optionally, the processor 501 may also execute a program stored in the memory 503. The processor may cooperate with the memory and the transceiver to execute any method and function of the computing device in the above-mentioned application embodiment.
[0104] The embodiment of the present application also provides a chip system, which includes a processor for supporting a computing device to implement the functions involved in any of the above embodiments, such as generating or processing the flow table unloading involved in the above method. In one possible design, the chip system may also include a memory, which is used for the necessary program instructions and data of the computing device. The chip system can be composed of a chip, or it can include a chip and other discrete devices. Among them, the input and output of the chip system correspond to the receiving and sending operations of the computing device of the method embodiment.
[0105] The embodiment of the present application also provides a flow table unloading device, including a processor and a memory. The memory is used to store a computer program, and the processor is used to execute the method in the above method embodiment.
[0106] According to the method provided in the embodiment of the present application, the present application also provides a computer program product, the computer program product comprising: a computer program, when the computer program is run on a computer, causes the computer to execute Figure 2 or Figure 3A method according to any one of the embodiments shown.
[0107] According to the method provided in the embodiment of the present application, the present application also provides a computer-readable medium, which stores a computer program, and when the computer program is run on a computer, the computer executes Figure 2 or Figure 3 A method according to any one of the embodiments shown.
[0108] 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 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, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (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 data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a high-density digital video disc (DVD)), or a semiconductor medium (eg, a solid state disc (SSD)).
[0109] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A flow table unloading method, characterized in that: The method comprises: Divide the matching items in the flow table into at least one category; Determine whether there is an entry in the first linked list of the current record that is the same as a first entry in a first category of the at least one category, and the entry in the first linked list is of the same type as the entry in the first category; If it does not exist, then create the first table item in the first category and unload the first table item in the first category to the hardware; if it does exist, then increase the count of the first table item in the first linked list and do not unload the first table item to the hardware; Dividing the operation set in the flow table into a shared operation set and a private operation set; Determine whether there is an entry in the common operation linked list of the current record that is the same as the second entry in the common operation set; If it does not exist, then create the second table entry in the shared operation set and unload the second table entry in the shared operation set to the hardware; if it does exist, then increase the count of the second table entry in the shared operation linked list and do not unload the second table entry in the shared operation set to the hardware.
2. The method according to claim 1, characterized in that The method further comprises: Establishing all entries in the private operation set; All entries in the private operation set are offloaded to hardware.
3. The method according to claim 1, characterized in that The dividing the matching items in the flow table into at least one category includes: Inputting the matching items in the flow table into the trained network service model, and determining the matching degree between each field in the matching items and the preset classification template; According to the matching degree, matching items in the flow table are divided into at least one category.
4. The method according to claim 1, characterized in that The method further comprises: When the length of time during which the first entry is not used exceeds a first preset threshold, the count of the first entry in the first linked list is reduced or the first entry is deleted from the hardware.
5. The method according to claim 1, characterized in that The method further comprises: When the length of time during which the second table entry is not used exceeds a second preset threshold, the count of the second table entry in the shared operation linked list is reduced or the second table entry is deleted from the hardware.
6. The method according to any one of claims 1 to 5, characterized in that: The at least one classification includes one or more of a tunnel classification, a data link layer L2 classification, a network layer L3 classification, and a transport layer L4 classification.
7. A flow meter unloading device, characterized in that: The device comprises: A classification module, used for classifying matching items in the flow table into at least one classification; A search module, used for determining whether there is an entry in a first linked list of a current record that is the same as a first entry in a first category of the at least one category, and the entry in the first linked list is of the same type as the entry in the first category; an unloading module, configured to, if the first table item in the first category does not exist, create the first table item in the first category and unload the first table item in the first category to the hardware; if the first table item in the first linked list exists, increase the count of the first table item in the first linked list and do not unload the first table item to the hardware; The classification module is further used to divide the operation set in the flow table into a common operation set and a private operation set; The search module is further used to determine whether there is an entry in the common operation chain list currently recorded that is the same as the second entry in the common operation set; The unloading module is also used to establish the second table item in the shared operation set if it does not exist, and unload the second table item in the shared operation set to the hardware; if it exists, increase the count of the second table item in the shared operation linked list, and only unload the private operation set to the hardware.
8. A computing device, characterized in that The method comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program so that the computing device executes the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Message transmission method applied to DPU and related device
CN114726788A