Flow table resource management method and device and electronic equipment

By distributing idle shared flow tables in the load balancing group, the problem of insufficient effective flow table resource management is solved, and the equipment load balancing capability and utilization of flow table resources are improved.

CN119544637APending Publication Date: 2025-02-28SUZHOU CENTEC COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411446089.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

In the prior art, when dealing with network congestion, the flow table resource management is not effective enough, which leads to the failure to select the appropriate flow table in time when members of the load balancing group unexpectedly down or up, affecting network performance.

Method used

By obtaining the flow table usage information of the load balancing group, we can determine whether the target flow table collection is in a state of few free flow tables. If so, an idle shared flow table is distributed for the target flow table group to update the flow table collection and ensure that there are sufficient flow table resources in dynamic load balancing.

Benefits of technology

Effectively utilize flow table resources, enhance equipment load balancing capabilities, avoid performance degradation when flow tables are full or port unexpectedly, improve the utilization rate of flow table resources, and reduce resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544637A_ABST
    Figure CN119544637A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a flow table resource management method and device and electronic equipment, and relates to the technical field of communication. The method comprises: obtaining flow table usage information of a target flow table set corresponding to a target load balancing group determined from load balancing groups of a network device, the flow table usage information being used for indicating a flow table occupation condition corresponding to the target flow table set, and the target flow table set being used in dynamic load balancing; the flow table storing the information in the target flow table set is aged based on the aging time, and the aged flow table is an idle flow table; and judging whether the target flow table set is in a state of few idle flow tables according to the flow table use information, if so, distributing idle shared flow tables for the target load balancing group to update the target flow table set, and the distributed shared flow tables being used for storing forwarding information corresponding to the target load balancing group. Therefore, the load balancing capability of the equipment can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a flow table resource management method, device and electronic device. Background Art

[0002] With the development of technologies such as switching chips and the rapid growth of network bandwidth requirements, the forwarding processing capabilities of switching equipment have been greatly improved. In the past 10 years, the port bandwidth of switching equipment has experienced a leap of 10,000 times from 10M to 100G. However, with the gradual expansion of network scale, the bandwidth required for backbone links is also increasing. For example, in an enterprise network, the traffic of all devices will be aggregated to the core layer before being forwarded to other networks, and then forwarded to other networks by the core layer devices. If the link bandwidth of the core layer devices is not enough, link congestion is likely to occur, and link congestion will cause data transmission delays or even packet loss, which will have a negative impact on network performance transmission, resulting in slower data transmission speed, increased latency, data loss and other problems. Therefore, the link bandwidth requirements for core layer devices are very high. In order to solve the problem of network congestion, the industry has made a lot of efforts, such as optimizing network topology, multi-link load balancing, and increasing network bandwidth. The commonly used multi-link load balancing is to bundle multiple physical interfaces into a logical interface and use it as a load balancing group to achieve the functions of increasing bandwidth, improving reliability and load balancing.

[0003] Initially, the static load balancing (SLB) technology was born to ensure the orderly transmission of traffic in the network. A typical example is to perform hash calculation based on the five-tuple of the message to determine whether the message is the same flow. The same flow is forwarded from the same member exit in the load balancing group. However, SLB cannot perceive the quality and status of the links in the network to make balancing adjustment strategies such as path switching.

[0004] In order to solve the load imbalance problem caused by SLB's inability to perceive link status, dynamic load balancing (DLB) technology has emerged. The need for orderly transmission of messages was taken into consideration when DLB was designed. DLB divides the traffic of the same five-tuple into more fine-grained FlowLets at a certain time interval (generally based on the aging time setting). Each FlowLet performs hash calculation through the five-tuple and forwards it by looking up the flow table. If the required information is not found, the outbound port with the best link quality in the current load balancing group is selected for forwarding, and then a flow table is learned to achieve the purpose of traffic order preservation. Obviously, the function of DLB ​​is limited by the flow table specifications. When the flow table is full within the same time interval, it degenerates into SLB, and cannot cope with the unexpected situation that the member of the load balancing group cannot be selected after the flow table is full. Therefore, it is necessary to manage the flow table reasonably to enhance the load balancing capability of the device. Summary of the invention

[0005] The embodiments of the present application provide a flow table resource management method, device, electronic device and readable storage medium, which can effectively utilize table entry resources, increase the load balancing capability of the device, and avoid the unexpected situation where a member of the load balancing group cannot be selected after the member is accidentally down or up because the flow table pre-allocated to the load balancing group is occupied.

[0006] The embodiments of the present application can be implemented as follows:

[0007] In a first aspect, an embodiment of the present application provides a flow table resource management method, the method comprising:

[0008] Obtaining flow table usage information of a target flow table set corresponding to a target load balancing group determined from a load balancing group of a network device, wherein the flow table usage information is used to indicate the occupancy of a flow table corresponding to the target flow table set, the target flow table set is used in dynamic load balancing, and a flow table storing information in the target flow table set is aged based on an aging time, and the aged flow table is an idle flow table;

[0009] Determining whether the target flow table set is in a first preset state according to the flow table usage information, wherein the first preset state indicates that there are few idle flow tables;

[0010] If it is determined that the target flow table set is in the first preset state, an idle shared flow table is distributed to the target load balancing group to update the target flow table set, wherein the distributed shared flow table is used to store forwarding information corresponding to the target load balancing group.

[0011] In a second aspect, an embodiment of the present application provides a flow table resource management device, the device comprising:

[0012] An information acquisition module, used to obtain flow table usage information of a target flow table set corresponding to a target load balancing group determined from a load balancing group of a network device, wherein the flow table usage information is used to indicate the occupancy of a flow table corresponding to the target flow table set, the target flow table set is used in dynamic load balancing, and a flow table storing information in the target flow table set is aged based on an aging time, and the aged flow table is an idle flow table;

[0013] A judging module, configured to judge whether the target flow table set is in a first preset state according to the flow table usage information, wherein the first preset state indicates that there are few idle flow tables;

[0014] A management module is used to distribute idle shared flow tables to the target load balancing group to update the target flow table set when it is determined that the target flow table set is in the first preset state, wherein the allocated shared flow table is used to store forwarding information corresponding to the target load balancing group.

[0015] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the flow table resource management method described in the aforementioned embodiment.

[0016] In a fourth aspect, an embodiment of the present application provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the flow table resource management method as described in the foregoing embodiment is implemented.

[0017] The flow table resource management method, device, electronic device and readable storage medium provided in the embodiments of the present application first obtain the flow table usage information of the target flow table set corresponding to the target load balancing group determined from the load balancing group of the network device, and then determine whether the target flow table set is in a first preset state with few idle flow tables based on the flow table usage information, and distribute idle shared flow tables to the target load balancing group when it is determined that the target flow table set is in the first preset state to change the target flow table set. Among them, the flow table usage information is used to indicate the occupancy of the flow table corresponding to the target flow table set, the target flow table set is used for use in dynamic load balancing, the flow table storing information in the target flow table set is aged based on the aging time, and the aged flow table is an idle flow table; the allocated shared flow table is used to store the forwarding information corresponding to the target load balancing group. In this way, by allocating idle shared flow tables to the target flow table set when it is determined that there are few idle flow tables in the target flow table set based on the flow table usage information of the target flow table set corresponding to the target load balancing group, not only can dynamic management of the flow table be achieved, the negative balancing capability of the device can be increased, and the situation where the flow table is full or the port is accidentally down or up can be prevented, but also the table item resources of the flow table can be saved, the utilization rate can be improved, and the waste of resources can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 A block diagram of an electronic device provided in an embodiment of the present application;

[0020] Figure 2 This is a schematic diagram of load balancing;

[0021] Figure 3 Schematic diagram of DLB ​​routing;

[0022] Figure 4 One of the flow diagrams of the flow table resource management method provided in the embodiment of the present application;

[0023] Figure 5 for Figure 4 A schematic flow chart of the sub-steps included in step S120;

[0024] Figure 6 for Figure 4 A schematic flow chart of the sub-steps included in step S130;

[0025] Figure 7The second flowchart of the flow table resource management method provided in the embodiment of the present application;

[0026] Figure 8 for Figure 7 A schematic flow chart of the sub-steps included in step S140;

[0027] Fig. 9 A block diagram of a flow table resource management device provided in an embodiment of the present application.

[0028] Icon: 100 - electronic device; 110 - memory; 120 - processor; 130 - communication unit; 200 - flow table resource management device; 210 - information acquisition module; 220 - judgment module; 230 - management module. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0030] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

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

[0032] In order to maintain the order of traffic and enhance the load balancing capability of the device, flow table learning and aging can be performed. FlowLet performs hash calculation through the five-tuple, and searches the flow table through the hash value. If a flow table with forwarding information is found, forwarding is performed according to the flow table and the aging time is updated; if a flow table with forwarding information is not found, the member port with the smallest load is selected for forwarding and a piece of forwarding information is learned and saved in the flow table (i.e., a flow table is learned). An aging time can be set for the flow table. If the flow table is not used in the forwarding process for a period of time, that is, no message is forwarded based on the forwarding information in the flow table for a period of time, then the flow table is aged and deleted, that is, the forwarding information stored in the flow table is deleted to make the flow table an idle flow table. An idle flow table is a flow table that does not store forwarding information, that is, it is not occupied or used, and can be used to save forwarding information. An idle flow table can also be called an available flow table.

[0033] The specific implementation process of the above method is as follows: the administrator can manually create a load balancing group, configure the five-tuple hash calculation rules and flow table aging time interval, and then add members to the load balancing group; when a FlowLet needs to pass through the load balancing group and be sent to the next device, the hash algorithm will be used to check the flow table. If there is a flow table that stores the forwarding information, it will be forwarded according to the flow table and the aging time of the flow table will be updated. If there is no flow table that stores the forwarding information, the member port with the smallest load will be selected for forwarding and a flow table will be learned. The learned flow table will age within a period of time according to the configured time interval. The size of the flow table of a load balancing group is specified when the load balancing group is created. If not specified, one is configured by default. The specifications of the flow table of a load balancing group can be expressed by the number of flow tables. For example, the total number of flow tables of a load balancing group is pre-specified as 16.

[0034] In the above method, the size of the flow table needs to be manually specified. After the specification, the flow table size remains unchanged. This method has low flexibility and high requirements on the technology, management, and maintenance of network administrators. In addition, the above method has the following shortcomings: because the DLB performance is limited by the size of the flow table, it cannot cope with the unexpected situation that the new flow cannot select the member after the flow table is full and the load balancing group member is accidentally down or up.

[0035] In response to the above situation, the embodiments of the present application provide a flow table resource management method, device, electronic device and readable storage medium to obtain the usage of the load balancing group flow table and allocate idle flow tables to it when there are few idle flow tables, thereby ensuring the high availability of DLB ​​and providing support for the flexibility and high availability of the dynamic load balancing features in the switching device.

[0036] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0037] Please refer to Figure 1 , Figure 1 A block diagram of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may be a network device that uses a flow table for dynamic load balancing, or a control unit in the network device. The control device may be a switching device, such as a switch. The electronic device 100 may include a memory 110, a processor 120, and a communication unit 130. The memory 110, the processor 120, and the communication unit 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components may be electrically connected to each other via one or more communication buses or signal lines.

[0038] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.

[0039] The processor 120 is used to read / write data or programs stored in the memory 110 and execute corresponding functions. For example, the memory 110 stores a flow table resource management device 200, and the flow table resource management device 200 includes at least one software function module that can be stored in the memory 110 in the form of software or firmware. The processor 120 executes various functional applications and data processing by running software programs and modules stored in the memory 110, such as the flow table resource management device 200 in the embodiment of the present application, that is, implementing the flow table resource management method in the embodiment of the present application.

[0040] The communication unit 130 is used to establish a communication connection between the electronic device 100 and other communication terminals through a network, and to send and receive data through the network.

[0041] It should be understood that Figure 1 The structure shown is only a schematic diagram of the structure of the electronic device 100. The electronic device 100 may also include Figure 1 More or fewer components as shown, or with Figure 1Different configurations are shown. It is worth noting that Figure 1 The components shown can be implemented by hardware, software or a combination thereof. That is to say, the implementation of the processing flow of the flow table resource management method in the above embodiment is not limited to the processor reading and running pure computer-readable program code from the memory, but can also be implemented by hardware or logic devices.

[0042] It should be understood here that improvements to a technology can be divided into hardware improvements (for example, improvements to circuit structures such as diodes, transistors, switches, etc.) and software improvements (improvements to method flows). However, with the development of technology, many improvements to method flows today can be regarded as direct improvements to hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement to a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and make a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. Among them, VHDL (Very High Speed ​​Integrated Circuit Hardware Description Language) and Verilog are currently the most commonly used. Those skilled in the art should also be aware that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0043] The following first describes the load balancing involved in this application and message sending based on dynamic load balancing.

[0044] like Figure 2 As shown, the switch device 1 includes three ports, port 1, port 2, and port 3, and the ports 1, port 2, and port 3 are set as members of a load balancing group. The switch device 1 can select which member of the load balancing group to use to send the message currently required to be sent to the switch device 2.

[0045] Combine the following Figure 3 The DLB routing is described.

[0046] exist Figure 2 As shown in the load balancing group basis, such as Figure 3 As shown, when the port of the switching device receives a message, it can process the message accordingly (for example, decoding), and the processed message will be sent to the forwarding plane through different data paths. The forwarding plane here can be simply understood as a switching chip.

[0047] When the switch chip receives the data message that needs to be processed, it performs corresponding parsing and classification operations on the message, and then further processes the message (for example, based on ACL (Access Control List) processing). The message that cannot be processed is discarded; the message that can be processed is sent to the corresponding processing module of the load balancing group in the switch chip through the corresponding data path for routing. Figure 3 As shown in the DLB routing diagram, the routing module will first find the index (port identifier) ​​of the port that is up (i.e. online) and has the smallest load in the load balancing group. If there are multiple ports with the same load and up, one is randomly selected. A hash value is also calculated based on the characteristics of the message to query the flow table corresponding to the load balancing group. Among them, the hash value can be calculated based on the five-tuple of the message. The hash value can index a flow table.

[0048] Each flow table corresponding to the load balancing group is set with an available flag. If the available flag is 0, it means that the flow table corresponding to the flow table flag does not store forwarding information. If the available flag is not 0, it means that the flow table corresponding to the flow table flag stores forwarding information.

[0049] If the flow table flag of the found flow table is 0, the index of the port that is up and has the smallest load in the load balancing group is used to obtain the forwarding information corresponding to the index, and the message is forwarded from the port corresponding to the index based on the forwarding information, and the forwarding information is learned into the found flow table, that is, the forwarding information is saved in the found flow table.

[0050] The forwarding information in a flow table is used to indicate the corresponding egress information. Optionally, the forwarding information may include the index of the corresponding port and the ID of the channel to be used, so as to indicate which channel of the corresponding port is used to forward the message.

[0051] Through the forwarding mechanism of DLB ​​that relies on querying the flow table, it can be seen that when the flow table is full (that is, the flow table resources pre-allocated to a load balancing group are all stored with forwarding information), whether it is a new flow or an old flow, the flow table is queried through the hash value, and the flag bit of the flow table is 1, and the flow table will eventually be queried for forwarding, resulting in the flow table specifications limiting the forwarding strategy of the message.

[0052] The aging timer will scan the flow table periodically according to the aging time. When a flow table storing forwarding information is scanned for the first time, its aging flag will be set; after the second scan, the aging flag will be compared. If it has been set, the flow table will be aged and deleted, that is, the forwarding information in the flow table will be deleted. The aging mechanism is used to ensure the reuse of the dlb flow table (that is, to achieve the reuse of flow table resources). Among them, the aging time can be configured separately, and it is a default value for initialization when it is not configured. If the aging flag of a flow table is set, when forwarding the received message, the flow table is found, and the message is forwarded according to the forwarding information in the flow table, the aging flag of the flow table is modified to not set. If the aging flag of a flow table is not set, when forwarding the received message, the flow table is found, and the message is forwarded according to the forwarding information in the flow table, the aging flag of the flow table is kept not set. Optionally, it can be set to 1 when set and 0 when not set.

[0053] Among them, the port load calculation method and the hash calculation rules based on the characteristics of the message can be pre-configured according to actual needs. For example, there are three modes for calculating port load, such as port load, queue load, and port + queue load; the hash calculation rules can be selected, such as calculating the hash value based on at least one of macsa (source mac address), macda (destination mac address), ipsa (source IP address), ipda (destination IP address), survival hop count ttl, etc.

[0054] The following describes how to control flow table resources to change the amount of flow table resources of a load balancing group in the above dynamic load balancing method, thereby enhancing the load balancing capability of the device.

[0055] Please refer to Figure 4 , Figure 4This is one of the flow diagrams of the flow table resource management method provided in the embodiment of the present application. The method can be applied to the above electronic device. The specific process of the flow table resource management method is described in detail below. In this embodiment, the method may include steps S110 to S130.

[0056] Step S110: Obtain flow table usage information of a target flow table set corresponding to a target load balancing group determined from the load balancing group of the network device.

[0057] In this embodiment, at least one load balancing group may be provided in the network device, and a load balancing group may be determined from the at least one load balancing group as the current target load balancing group. The flow table usage of the target flow table set corresponding to the target load balancing group may be obtained in any manner. The flow tables in the target flow table set are all used to store the forwarding information corresponding to the target load balancing group, and the target flow table set includes at least one flow table, that is, the target load balancing group has at least one flow table resource.

[0058] The flow table usage information is used to indicate the occupancy of the flow table corresponding to the target flow table set. If forwarding information is stored in a flow table, it means that the flow table is occupied (also referred to as being used), and the flow table is not an idle flow table. If forwarding information is not stored in a flow table, it means that the flow table is not occupied, the flow table is an idle flow table, and the flow table can be used to store the learned forwarding information.

[0059] The target flow table set is used in dynamic load balancing, that is, in the aforementioned DLB routing, and the use process is as follows: when a message that needs to be processed is received, the message is sent to the load balancing group for processing by identifying relevant information. The load balancing group will forward the message by calculating the port load and looking up the flow table (that is, querying the flow table set corresponding to the load balancing group). To ensure the order of traffic, if a flow table storing forwarding information is not found, a flow table will be learned (a forwarding information is learned and saved in the flow table). The flow table storing forwarding information in the target flow table set is aged based on the aging time, and the aged flow table is an idle flow table, which can be used to store newly learned forwarding information.

[0060] Step S120: determining whether the target flow table set is in a first preset state according to the flow table usage information.

[0061] When the flow table usage information of the target flow table set is obtained, it can be determined based on the flow table usage information whether the target flow table set is in a first preset state, wherein the first preset state indicates that there are few idle flow tables. That is, it is determined whether the target flow table set has few idle flow tables based on the flow table usage information indicating the flow table usage.

[0062] Optionally, the flow table usage information may include a usage rate (i.e., occupancy rate) or a usage number, etc. In the case where the flow table usage information includes a usage rate, the usage rate may be compared with a preset usage rate. If the usage rate is greater than or equal to the preset usage rate, it is directly determined that the target flow table set is in a first preset state with a small number of idle flow tables; if the usage rate is less than the preset usage rate, it is directly determined that the target flow table set is not in the first preset state with a small number of idle flow tables. In the case where the flow table usage information includes a usage number, it is directly determined that the target flow table set is in a first preset state with a small number of idle flow tables when the usage number is greater than or equal to the target usage number; and when the usage number is less than the target usage number, it is directly determined that the target flow table set is not in the first preset state with a small number of idle flow tables. Among them, the target usage number may be equal to or slightly less than the total number of flow tables in the target flow table set. It is worth noting that the above is only an example, and the specific method of judging whether the target flow table set is in the first preset state according to the flow table usage information can be set in combination with actual needs, and is not specifically limited here.

[0063] Step S130: If it is determined that the target flow table set is in the first preset state, an idle shared flow table is distributed to the target load balancing group to update the target flow table set.

[0064] When it is determined that there are few idle flow tables in the target flow table set, the idle shared flow tables are distributed to the target load balancing group to update the target flow table set. The flow table resources of the updated target flow table set are more than the flow table resources of the target flow table set before the update. Among them, the allocated shared flow tables are used to store the forwarding information corresponding to the target load balancing group. In this way, when there are few idle flow tables in the target flow table set, the idle shared flow tables can be allocated to the target load balancing group to use the allocated idle shared flow tables to store the newly learned forwarding information, thereby enhancing the load balancing capability of the device. Moreover, the shared flow tables are allocated. When there are multiple load balancing groups in the network device, they are resources that can be used by at least two load balancing groups in the network device. In this way, the utilization rate of table resource can be improved and resource waste can be reduced.

[0065] Optionally, in an embodiment, it may be first determined whether the flow table resource management function is enabled. If the management is enabled, the flow table resource management method provided in the embodiment of the present application may be executed.

[0066] Optionally, in this embodiment, a round of scanning can be performed periodically, in which the load balancing groups that need to perform flow table resource management are sequentially used as target load balancing groups, and the flow table usage information of the target flow table set of the target load balancing group is obtained. Among them, the load balancing groups that need to perform flow table resource management can be specifically determined in combination with actual needs, for example, some load balancing groups among multiple load balancing groups in a network device can be used as load balancing groups that need to perform flow table resource management.

[0067] Optionally, each load balancing group in the network device where the target load balancing group is located can be used as the target load balancing group in turn. That is, after waiting for a preset time, each load balancing group in the network device where the target load balancing group is located can be used as the target load balancing group in turn, and the flow table usage information of the target flow table set can be obtained. In this way, the flow table usage information of each load balancing group in the network device can be dynamically monitored, and the flow table resource management of the corresponding load balancing group can be performed according to the dynamically monitored flow table usage information.

[0068] Optionally, in this embodiment, the number of occupied flow tables needs to be counted in the process of obtaining the flow table usage information of the target flow table set. Each flow table may be provided with an available flag bit active. When the available flag bit active corresponding to a flow table is set, it indicates that the flow table has been used (i.e., it has been occupied); when the available flag bit active corresponding to a flow table is not set, it indicates that the flow table is not used (i.e., it has not been occupied). The available flag bit active of each flow table in the target flow table set can be read according to the total number of flow tables flownum of the target flow table set and the offset offerset read each time. If the current flow table active is set, it means that the flow table has been used, and the counting pointer is accumulated, so as to obtain the number of occupied flow tables. The total number of flow tables flownum of the target flow table set is used to determine whether the available flag bit active of each flow table in the target flow table set has been read.

[0069] Optionally, in this embodiment, if the flow table usage information of the target flow table set is not read, it can be directly determined that the target flow table set is normal, that is, not in the first preset state. If the flow table usage information of the target flow table set is read, it can be determined whether the target flow table set is in the first preset state according to the flow table usage information.

[0070] Optionally, as a possible implementation, Figure 5 The method shown in FIG. 1 determines whether the target flow table set is in the first preset state. Figure 5 , Figure 5 for Figure 4Schematic diagram of the flow of sub-steps included in step S120. In this embodiment, step S120 may include sub-steps S121 to S124.

[0071] Sub-step S121, determining whether the flow table occupancy value corresponding to the flow table usage information is greater than or equal to a preset occupancy value, and updating a first statistical number according to a first determination result obtained.

[0072] The first statistical number is used to indicate the number of consecutive times that the flow table occupancy value corresponding to the target flow table set is greater than or equal to a preset occupancy value.

[0073] Sub-step S122, determining whether the updated first statistical number is less than the first preset number.

[0074] If the updated first statistical number is less than the first preset number, sub-step S123 is executed.

[0075] Sub-step S123: determining that the target flow table set is not in the first preset state.

[0076] If the updated first statistical number is not less than the first statistical number, sub-step S124 is executed.

[0077] Sub-step S124: determining whether the target flow table set is in the first preset state.

[0078] In this embodiment, the flow table usage information may include a flow table occupancy value, or include information for indicating a flow table occupancy value, which may be determined in combination with actual needs. A flow table occupancy value may be determined based on the flow table usage information. Optionally, the flow table occupancy value is a usage rate or a usage quantity, and correspondingly, the preset occupancy value is also a usage rate or a usage quantity; wherein, in the case where the flow table occupancy value is a usage quantity, the numerical value of the preset occupancy value may be equal to the total number of flow tables in the target flow table set or slightly less than the total number of flow tables in the target flow table set. Optionally, it may be manually configured in advance, in which case the configured value may be used as the preset occupancy value; if it is not manually configured in advance, the default value may be used as the preset occupancy value.

[0079] Determine whether the flow table occupancy value corresponding to the flow table usage information is greater than or equal to the preset occupancy value. If the flow table occupancy value is greater than or equal to the preset occupancy value, it means that the flow table occupancy corresponding to the target flow table set this time meets the preset distribution requirements, and then the first statistical number corresponding to the target flow table set can be increased and updated to obtain the updated first statistical number. The first statistical number is used to indicate the consecutive number of times that the flow table occupancy value corresponding to the target flow table set is greater than or equal to the preset occupancy value. It can be understood that if the flow table occupancy value corresponding to the target flow table set this time is greater than or equal to the preset occupancy value, the saved first statistical number can be updated by adding 1; if the flow table occupancy value corresponding to the target flow table set this time is less than the preset occupancy value, the saved first statistical number can be modified to 0. The updated first statistical number indicates the consecutive number of times the flow table occupancy value corresponding to the current target flow table set is greater than or equal to the preset occupancy value.

[0080] Next, determine whether the updated first statistical number is less than the first preset number. The first preset number can be 1 or greater than 1. The first preset number can be set in combination with actual needs and is not specifically limited here. If the updated first statistical number is less than the first preset number, it is determined that the target flow table set is not in the first preset state with few idle flow tables; if the updated first statistical number is greater than or equal to the first preset number, it is determined that the target flow table set is in the first preset state with few idle flow tables.

[0081] In this embodiment, a certain flow table resource can be allocated to each load balancing group in the network device during initialization, and a section of flow table resources can be reserved as a shared flow table (i.e., a share flow table). The size of the reserved shared flow table specification can be set according to actual needs. It can be seen that the target flow table set includes an initial flow table subset initially allocated to the target load balancing group.

[0082] Optionally, after determining that the target flow table set is in a first preset state with few idle flow tables, idle shared flow tables can be determined from the shared flow tables, and a certain number of idle shared flow tables can be distributed to the target load balancing group. Optionally, the number of distributions can be determined based on the flow table usage information, and the worse the availability, the greater the number of distributions. For example, if it is determined based on the flow table usage information that there are very few idle flow tables, a first number of idle shared flow tables can be distributed; if it is determined based on the flow table usage information that there are generally few idle flow tables, a second number of idle shared flow tables can be distributed, and the second number is less than the first number.

[0083] The flow table resources used as shared flow tables can be called shared flow table sets. As a possible implementation method, in order to facilitate distribution and management, the shared flow table set can be pre-divided into multiple shared flow table subsets. The number of shared flow tables in each shared flow table subset can be the same or different, which can be determined in combination with actual needs. According to the subset distribution information corresponding to the multiple shared flow table subsets, the idle shared flow table subsets can be distributed to the target load balancing group. Among them, the subset distribution information is used to indicate the shared flow table subsets that have been distributed and the shared flow table subsets that have not been distributed in the above-mentioned multiple shared flow table subsets. For example, a vector can be used to record the subset distribution information. If a certain position of the vector is 0, it means that the shared flow table subset corresponding to the position is not currently distributed, can be distributed, or is idle; if a certain position of the vector is 1, it means that the shared flow table subset corresponding to the position is currently distributed, cannot be distributed, or is not idle.

[0084] Optionally, to reduce the complexity of resource management, Figure 6 The method shown is based on the shared flow table subset for shared flow table distribution. Figure 6 , Figure 6 for Figure 4 Schematic diagram of the flow of sub-steps included in step S130. In this embodiment, step S130 may include sub-steps S131 to S135.

[0085] Sub-step S131, judging whether the target flow table set includes a shared flow table according to the flow table distribution information corresponding to the target load balancing group.

[0086] In the case where the target flow table set includes a shared flow table, sub-step S132 is executed.

[0087] Sub-step S132, obtaining first attribute information of the first shared flow table subset distributed to the target load balancing group last time.

[0088] The first attribute information is used to indicate the position of the first shared flow table subset in the shared flow table set.

[0089] Sub-step S133: judging whether a second shared flow table subset adjacent to the first shared flow table subset has been distributed according to the first attribute information and the subset distribution information.

[0090] If the adjacent second shared flow table subset has been distributed, sub-step S134 is executed.

[0091] Sub-step S134, this termination distributes the idle shared flow table subset to the target load balancing group.

[0092] If the adjacent second shared flow table subsets have not been distributed, that is, there is an undistributed second shared flow table subset in the adjacent second shared flow table subsets, sub-step S135 is executed.

[0093] Sub-step S135, distributes an undistributed second shared flow table subset to the target load balancing group, and updates the subset distribution information and the flow table distribution information.

[0094] In this embodiment, it is first determined whether there is an idle shared flow table subset in the current shared flow table set according to the subset distribution information. If there is no idle shared flow table subset in the current shared flow table set, sub-step S134 can be directly executed: this time, the idle shared flow table subset for the target load group is terminated.

[0095] If there is an idle shared flow table subset in the current shared flow table set, it can be determined whether the target flow table set includes the shared flow table previously distributed to the target load balancing group based on the flow table distribution information corresponding to the target load balancing group. The flow table distribution information corresponding to the target load balancing group includes the attribute information of each shared flow table subset currently included in the target flow table set. It can be understood that if the flow table distribution information corresponding to the target load balancing group is empty, it means that the current target flow table set does not include a shared flow table. The attribute information can be used to determine the position of the corresponding shared flow table subset in the shared flow table set, for example, including the total number of shared flow tables in the shared flow table subset flownum and the corresponding shared flow table position identifier offerset.

[0096] In the case where there is an idle shared flow table subset in the current shared flow table set and the target flow table set does not include a shared flow table, an idle shared flow table subset can be distributed to the target load balancing group, and the flow table distribution information and subset distribution information are updated accordingly. In the case where an idle shared flow table subset is distributed to the target load balancing group, the target flow table set is updated accordingly, and the updated target flow table set includes the newly distributed shared flow table subset. In this case, the updated first statistical number can also be updated to 0, so that it is convenient to judge whether the idle shared flow table needs to be distributed for the updated target flow table set in the future.

[0097] Optionally, when the shared flow table set includes idle shared flow tables and the target flow table set does not include shared flow tables, an idle shared flow table subset can be randomly selected and distributed to the target load balancing group, or a shared flow table subset corresponding to the least significant bit can be selected from the above vector and distributed to the target load balancing group. The shared flow table subset corresponding to the significant bit is an idle shared flow table subset.

[0098] In the case where there is an idle shared flow table subset in the current shared flow table set and the target flow table set includes a shared flow table, the first attribute information of the first shared flow table subset distributed to the target load balancing group last time can be obtained from the flow table distribution information corresponding to the load balancing group, and the first shared flow table subset is the shared flow table subset distributed by the target load balancing group last time. Afterwards, it can be determined whether the second shared flow table subset adjacent to the first shared flow table has been distributed in combination with the subset distribution information. If the adjacent second shared flow table subset has been distributed, sub-step S134 is executed: the distribution of idle shared flow table subsets to the target load balancing group is terminated this time. If there is an undistributed second shared flow table subset in the adjacent second shared flow table subset, a shared flow table subset adjacent to the first shared flow table subset and undistributed can be distributed to the target load balancing group as an idle second shared flow table subset, and the subset distribution information and the flow table distribution information are updated. Similarly, when an idle second shared flow table subset is distributed to the target load balancing group, the updated first statistical number can also be updated to 0. It is understandable that if the target load balancing group is not distributed with an idle shared flow table, the updated first statistical number is maintained.

[0099] Among them, optionally, in the above judgment process, the "adjacent second shared flow table subset" can be the shared flow table subsets on the left and right sides of the first shared flow table subset, that is, two shared flow table subsets; when judging whether the second shared flow table subset adjacent to the first shared flow table subset has been distributed, it can be judged whether the shared flow table subset adjacent to the first shared flow table subset and located after the first shared flow table subset has been distributed. If it has not been distributed, the shared flow table subset can be distributed to the target load balancing group. If it has been distributed, it can be judged whether the shared flow table subset adjacent to the first shared flow table subset and located before the first shared flow table subset has been distributed. Alternatively, in the above judgment process, the "adjacent second shared flow table subset" can be the shared flow table subset adjacent to the first shared flow table subset and located after the first shared flow table subset, that is, only one shared flow table subset. The specific setting can be combined with actual needs.

[0100] Optionally, as a possible implementation, during the process of distributing the shared flow table, it is also possible to detect whether the distribution is successful. If the distribution fails, the first statistical number after the update can be updated to 0, and the failure log is recorded and the failure information is reported so that the administrator can locate the problem and analyze the cause. The failure log may include the time, the identifier of the corresponding load balancing group, the flow table usage information, etc.

[0101] Optionally, the number of distribution failures can also be counted. The number of distribution failures can be the total number of distribution failures counted, or the number of consecutive distribution failures counted. One load balancing group can be set to correspond to one distribution failure number, or all load balancing groups that need to perform flow table resource management can be set to correspond to one distribution failure number. It can be determined whether the number of distribution failures is greater than or equal to the preset number of distribution failures. If it is greater than or equal to, a prompt message is displayed indicating whether to close flow table resource management.

[0102] In the above embodiment, the usage of the flow table of the load balancing group is dynamically detected. When there is a burst of traffic that causes the flow table of the load balancing group to be used up, but the shared flow table resources are not used up, the flow table of the load balancing group is dynamically expanded, thereby coping with the limitation of the load balancing group caused by the burst of traffic that causes the flow table to be full. The inventor of the present application has found through research that the above method is likely to cause the shared flow table resources to be used up after a period of time. When there is a need to create another load balancing group or to distribute the shared flow table to a load balancing group, there are not enough resources. In order to alleviate the above problem, in this embodiment, if Figure 7 As shown, according to the situation of different load balancing groups, not only whether the group triggers flow table distribution, but also whether the group triggers flow table recovery can be determined. Corresponding strategies can be made for different load balancing groups to achieve dynamic management of flow tables.

[0103] Please refer to Figure 7 , Figure 7 The second flowchart of the flow table resource management method provided in the embodiment of the present application is as follows. In this embodiment, after step S120, the method may further include steps S140 to S150.

[0104] Step S140: determining whether the target flow table set is in a second preset state according to the flow table usage information.

[0105] The second preset state indicates that there are many idle flow tables.

[0106] If it is determined that the target flow table set is in the second preset state, step S150 is executed.

[0107] Step S150: reclaiming the idle flow tables in the target flow table set corresponding to the target load balancing group.

[0108] In the case where it is determined through step S120 that the target flow table set is not in the first preset state with a small number of idle flow tables, it can be determined whether the target flow table set is in the second preset state with a large number of idle flow tables based on the flow table usage information. If it is determined that the target flow table set is not in the second preset state, the idle flow tables of the target flow table set may not be recycled. If it is determined that the target flow table set is in the second preset state, the idle flow tables in the target flow table set are recycled as idle shared flow tables. Among them, the method of determining whether the target flow table set is in the second preset state with a large number of idle flow tables based on the flow table usage information can be specifically determined according to actual needs. Optionally, it can be similar to the method of determining whether the target flow table set is in the first preset state with a small number of idle flow tables based on the flow table usage information.

[0109] If the flow table usage information of the target flow table set is not read, it can be directly determined that the target flow table set is not in the second preset state.

[0110] As a possible implementation, Figure 8 The method shown in the figure determines whether the target flow table set is in the second preset state with many idle flow tables. Figure 8 , Figure 8 for Figure 7 Schematic diagram of the flow of sub-steps included in step S140. In this embodiment, step S140 may include sub-steps S141 to S145.

[0111] Sub-step S141, determining whether the target flow table set includes a shared flow table.

[0112] Sub-step S142, judging whether the current flow table occupancy meets the preset recycling requirement according to the flow table usage information, and updating the second statistical number according to the obtained second judgment result.

[0113] The second statistical number is used to indicate the number of consecutive times that the flow table occupancy corresponding to the target flow table set meets the preset recycling requirement.

[0114] Sub-step S143, determining whether the updated second statistical number is less than a second preset number.

[0115] If the target flow table set includes a shared flow table and the updated second statistical number is not less than a second preset number, sub-step S144 is executed.

[0116] Sub-step S144, determining whether the target flow table set is in the second preset state.

[0117] If the target flow table set does not include a shared flow table, or the second statistical number is less than a second preset number, sub-step S145 is executed.

[0118] Sub-step S145: determining that the target flow table set is not in the second preset state.

[0119] In this embodiment, when the target flow table set includes a shared flow table, idle flow table recycling is performed, and after recycling, the recycled idle flow table is used as an idle shared flow table. The target flow table set includes an initial flow table subset initially allocated to the target load balancing group. It can be first determined whether the target flow table set includes a shared flow table. Optionally, it can be determined whether the target flow table set includes a shared flow table based on the flow table distribution information corresponding to the target flow table set. If the target flow table set does not include a shared flow table, it can be determined that the target flow table set is not in the second preset state, and flow table recycling is not performed on the target flow table set.

[0120] According to the flow table usage information obtained this time, it is determined whether the flow table occupancy meets the preset recycling requirement, and the second statistical number is updated according to the second judgment result obtained. The preset recycling requirement can be determined according to actual requirements. For example, if the number of unoccupied flow tables is greater than a preset number, or the usage rate of the initial flow table is less than the preset usage rate, it is determined that the preset recycling requirement is met.

[0121] If the second judgment result obtained indicates that the current flow table occupancy does not meet the preset recycling requirement, the saved second statistical initial number can be updated to 0. If the second judgment result obtained indicates that the current flow table occupancy meets the preset recycling requirement, the saved second statistical initial number can be updated by adding 1. The updated second statistical number indicates the continuous number of times that the flow table occupancy corresponding to the current target flow table set meets the preset recycling requirement.

[0122] Determine whether the second statistical number after update is less than the second preset number. Among them, the second preset number can be 1 or greater than 1. The second preset number can be set in combination with actual needs and is not specifically limited here. If the second statistical number after update is less than the second preset number, it is determined that the target flow table set is not in the second preset state with many idle flow tables. If the second statistical number after update is not less than the second preset number, and the target flow table set includes shared flow tables, it is determined that the target flow table set is in the second preset state with many idle flow tables.

[0123] In order to facilitate the distribution and recovery of shared flow tables, in this embodiment, the shared flow table set includes multiple shared flow table subsets. When it is necessary to recover idle flow tables for the target flow table set, the subset distribution information corresponding to the multiple shared flow table subsets can be updated to recover idle flow tables in the target flow table set, thereby obtaining at least one idle shared flow table subset. The obtained at least one idle shared flow table subset is used as the shared flow table subset in the target flow table set, and the flow table distribution information is updated. The updated subset distribution information is used to indicate that at least one shared flow table subset previously distributed to the target load balancing group is currently not distributed, and the updated flow table distribution information is used to indicate that some shared flow table subsets previously distributed to the target load balancing group are no longer in the target flow table set. In this case, the updated second statistical number can also be updated to 0.

[0124] Optionally, only one idle shared flow table subset may be recovered each time the shared flow table subset is recovered, and the number of flow tables in the shared flow table subset is equal to the number of flow tables in a shared flow table subset included in the target flow table set.

[0125] It is worth noting that the distribution and recovery of the shared flow table is performed based on a single load balancing group. All load balancing groups can be scanned in sequence, and the above-mentioned flow table resource management can be performed for each load balancing group.

[0126] The flow table resource management method provided in the embodiment of the present application dynamically obtains the usage of the flow table of the load balancing group, thereby automatically making a relative flow table control strategy to ensure the high availability of DLB. The above method is a flexible flow table control mechanism. When the mechanism is applied to load balancing, a dynamic load balancing method based on adaptive shared flow tables can be obtained, which can provide support for the flexibility and high availability of the dynamic load balancing feature in the switching device.

[0127] In this embodiment, the device will reserve a section of flow table resources for shared use during initialization. After enabling this solution, the device will dynamically obtain the use of the DLB flow table. When the flow table usage exceeds the corresponding distribution threshold (i.e., the distribution condition is met), the distribution of the share flow table is triggered. When the flow table usage does not exceed the corresponding threshold for a certain number of periods (i.e., the recycling condition is met), the recycling of the share flow table resources is triggered. The dynamic period can be manually set by the administrator or can be a preset default value. The threshold used to determine whether the recycling condition is met may not be equal to the threshold used to determine whether the distribution condition is met.

[0128] In this embodiment, the DLB load balancing group can be traversed to dynamically detect the usage of the flow table of each load balancing group. If it is abnormal, the flow table distribution is triggered. If it is normal, it is determined whether the flow table recovery is satisfied. If it is satisfied, the flow table recovery is triggered, otherwise the detection is continued. In this way, the flow table resource management of each DLB load balancing group in the setting can be performed, thereby enhancing the load balancing capability of the device. In addition, after the flow table is distributed and the flow table is recovered, it can be detected whether the distribution and recovery are successful, and wait for an interval time to detect the next load balancing group. Among them, the interval time is configurable and can be flexibly adjusted according to different situations and application scenarios. In the case of unsuccessful distribution or unsuccessful recovery, the failure log can be recorded and the failure information can be reported. The information may include: time, the identifier of the corresponding load balancing group, allocation failure or recovery failure, flow table usage information, etc., so that the administrator can locate the problem and analyze the cause.

[0129] For burst traffic, there may be large traffic, many entries, and long duration, which may easily cause the flow table to be full. Optionally, in this embodiment, a monitoring module may be set for flow table detection, and the monitoring module will periodically monitor the usage of the flow table.

[0130] Optionally, not only failure information can be recorded, but also information on successful distribution and successful recovery. In this way, not only can dynamic management of flow table resources be achieved, but it can also help administrators analyze the generation time of burst traffic and the use of flow tables in each period, providing support for network optimization.

[0131] The following is an example to illustrate the above flow table resource management method.

[0132] The specifications of shared flow tables can be configured globally. For example, if there are currently 8192 flow table specifications, a maximum of 2048 can be globally configured to be reserved as shared flow tables. All load balancing groups can share shared flow tables through distribution and recovery mechanisms. Each load balancing group records the flownum and offerset of the distributed shared flow tables. Flownum is the number of shared flow tables distributed to the load balancing group, and offerset is the index of the shared flow table. The index of the shared flow table can start from 8192-2048+1. A 128-bit vector can also be set to record distributed flow tables and undistributed flow tables. If 1 bit is set to 1, it means that 16 flow tables have been distributed; after the flow table is recovered, the corresponding bit position of the vector will be set to 0.

[0133] Under the above settings, suppose a dynamic load balancing group is created now. By default, the dynamic load balancing group is assigned 16 initial flow tables. The flow table distribution condition is set as follows: as long as the usage rate is 1, the flow table recycling condition is met. The flow table recycling condition is set as follows: as long as the shared flow table has been distributed and the number of idle flow tables at a time is 16, the flow table recycling condition is met.

[0134] Assuming that there are 30 flows arriving at the group at this time, the detection determines that the group flow table has been learned, and the flow table distribution is triggered. At this time, the vector corresponding to the shared flow table is queried, and the least significant bit is set after it is found, and the offerset and flownum corresponding to the vector are recorded for the load balancing group to record the shared flow table of the load balancing group. If no valid bit is found in the vector, it means that the shared flow table has been distributed, and the distribution is terminated to detect the next dynamic load balancing group. If the shared flow table distributed for the first time is also full, the second distribution is triggered. The difference here is that the second distribution finds the vector mark bit corresponding to the previous distribution through the offerset and flownum corresponding to the previous distribution of the load balancing group, and determines whether the next bit of the vector mark bit is valid. If the next bit is valid, the shared flow table is distributed, the next bit in the vector is set, and the offerset and flownum of the shared flow table corresponding to this distribution are recorded for the load balancing group. If the next bit is invalid, the distribution is terminated.

[0135] When it is detected that the number of idle flow tables in the load balancing group flow table is greater than or equal to 16 and the shared flow table has been distributed, the flow table recycling is triggered. The vector flag bit can be found according to the offerset corresponding to the shared flow table allocated to the load balancing group, set it to 0, and clear the offerset and flownum corresponding to the recycled shared flow table in the flow table distribution record of the load balancing group.

[0136] The above method can effectively utilize table resources, increase the load balancing capability of the device, and reduce the maintenance and management costs of the administrator for the switching device. In the above method, the usage of the DLB flow table is calculated. When the usage of the flow table exceeds the corresponding threshold, the distribution of the share flow table is triggered; when the usage of the flow table does not exceed the corresponding threshold for a certain number of cycles (that is, the recycling condition is met), the recycling of the share flow table resources is triggered, so that the adaptive management of the flow table by the switching device is realized, thereby improving the ability of the switching device to respond to burst traffic, and providing a more flexible, convenient and powerful support tool for the load balancing of the switching device.

[0137] In order to execute the corresponding steps in the above embodiments and various possible methods, a flow table resource management device 200 is provided below. Optionally, the flow table resource management device 200 may adopt the above Figure 1 The device structure of the electronic device 100 is shown. Fig. 9 , Fig. 9 A block diagram of a flow table resource management device 200 provided in an embodiment of the present application. It should be noted that the basic principle and technical effects of the flow table resource management device 200 provided in this embodiment are the same as those of the above-mentioned embodiments. For the sake of brief description, for parts not mentioned in this embodiment, reference can be made to the corresponding contents in the above-mentioned embodiments. In this embodiment, the flow table resource management device 200 may include: an information acquisition module 210, a judgment module 220 and a management module 230.

[0138] The information acquisition module 210 is used to obtain the flow table usage information of the target flow table set corresponding to the target load balancing group determined from the load balancing group of the network device. The flow table usage information is used to indicate the occupancy of the flow table corresponding to the target flow table set, the target flow table set is used in dynamic load balancing, and the flow table storing information in the target flow table set is aged based on the aging time, and the aged flow table is an idle flow table.

[0139] The determination module 220 is configured to determine whether the target flow table set is in a first preset state according to the flow table usage information, wherein the first preset state indicates that there are few idle flow tables.

[0140] The management module 230 is used to distribute idle shared flow tables to the target load balancing group to update the target flow table set when determining that the target flow table set is in the first preset state. The distributed shared flow table is used to store forwarding information corresponding to the target load balancing group.

[0141] In this embodiment, the judgment module 220 is also used to determine whether the target flow table set is in a second preset state based on the flow table usage information when it is determined that the target flow table set is not in the first preset state, wherein the second preset state indicates that there are many idle flow tables; the management module 230 is also used to recycle the idle flow tables in the target flow table set corresponding to the target load balancing group when it is determined that the target flow table set is in the second preset state.

[0142] Optionally, the above modules can be stored in the form of software or firmware. Figure 1 The memory 110 shown in the figure may be fixed in the operating system (OS) of the electronic device 100 and may be Figure 1 Meanwhile, the data and program codes required for executing the above modules may be stored in the memory 110.

[0143] An embodiment of the present application also provides a readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the flow table resource management method is implemented.

[0144] In summary, the embodiments of the present application provide a flow table resource management method, device, electronic device and readable storage medium, which first obtains the flow table usage information of the target flow table set corresponding to the target load balancing group determined from the load balancing group of the network device, and then determines whether the target flow table set is in a first preset state with few idle flow tables based on the flow table usage information, and distributes idle shared flow tables to the target load balancing group when it is determined that the target flow table set is in the first preset state to change the target flow table set. Among them, the flow table usage information is used to indicate the occupancy of the flow table corresponding to the target flow table set, the target flow table set is used for use in dynamic load balancing, the flow table storing information in the target flow table set is aged based on the aging time, and the aged flow table is an idle flow table; the allocated shared flow table is used to store the forwarding information corresponding to the target load balancing group. In this way, by allocating idle shared flow tables to the target flow table set when it is determined that there are few idle flow tables in the target flow table set based on the flow table usage information of the target flow table set corresponding to the target load balancing group, not only can dynamic management of the flow table be achieved, the negative balancing capability of the device can be increased, and the situation where the flow table is full or the port is accidentally down or up can be prevented, but also the table item resources of the flow table can be saved, the utilization rate can be improved, and the waste of resources can be reduced.

[0145] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0146] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0147] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0148] The above description is only an optional embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A flow table resource management method, characterized in that: The method comprises: Obtaining flow table usage information of a target flow table set corresponding to a target load balancing group determined from a load balancing group of a network device, wherein the flow table usage information is used to indicate the occupancy of a flow table corresponding to the target flow table set, the target flow table set is used in dynamic load balancing, and a flow table storing information in the target flow table set is aged based on an aging time, and the aged flow table is an idle flow table; Determining whether the target flow table set is in a first preset state according to the flow table usage information, wherein the first preset state indicates that there are few idle flow tables; If it is determined that the target flow table set is in the first preset state, an idle shared flow table is distributed to the target load balancing group to update the target flow table set, wherein the distributed shared flow table is used to store forwarding information corresponding to the target load balancing group.

2. The method according to claim 1, characterized in that Determining whether the target flow table set is in a preset state according to the flow table usage information includes: Determine whether the flow table occupancy value corresponding to the flow table usage information is greater than or equal to a preset occupancy value, and update a first statistical number according to the first judgment result obtained, wherein the first statistical number is used to indicate the number of consecutive times that the flow table occupancy value corresponding to the target flow table set is greater than or equal to the preset occupancy value; Determine whether the updated first statistical number is less than the first preset number; If not less than, determining that the target flow table set is in the first preset state; If it is less than, it is determined that the target flow table set is not in the first preset state.

3. The method according to claim 1, characterized in that The target flow table set includes an initial flow table subset initially allocated to the target load balancing group, the shared flow table set includes multiple shared flow table subsets, and the distribution of idle shared flow tables to the target load balancing group includes: According to the subset distribution information corresponding to the multiple shared flow table subsets, the idle shared flow table subsets are distributed to the target load balancing group, wherein the subset distribution information is used to indicate the shared flow table subsets that have been distributed and the shared flow table subsets that have not been distributed among the multiple shared flow table subsets.

4. The method according to claim 3, characterized in that The distributing the idle shared flow table subsets to the target load balancing group according to the subset distribution information corresponding to the multiple shared flow table subsets includes: According to the flow table distribution information corresponding to the target load balancing group, determining whether the target flow table set includes a shared flow table; In a case where the target flow table set includes a shared flow table, obtaining first attribute information of a first shared flow table subset distributed to the target load balancing group last time, wherein the first attribute information is used to indicate a position of the first shared flow table subset in the shared flow table set; According to the first attribute information and the subset distribution information, determining whether a second shared flow table subset adjacent to the first shared flow table subset has been distributed; If the adjacent second shared flow table subset has been distributed, the distribution of the idle shared flow table subset to the target load balancing group is terminated this time; If there is an undistributed second shared flow table subset in the adjacent second shared flow table subsets, an undistributed second shared flow table subset is distributed to the target load balancing group, and the subset distribution information and the flow table distribution information are updated.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: If it is determined that the target flow table set is not in the first preset state, judging whether the target flow table set is in a second preset state according to the flow table usage information, wherein the second preset state indicates that there are many idle flow tables; If it is determined that the target flow table set is in the second preset state, the idle flow tables in the target flow table set corresponding to the target load balancing group are recycled.

6. The method according to claim 5, characterized in that Determining whether the target flow table set is in a second preset state according to the flow table usage information includes: Determining whether the target flow table set includes a shared flow table; Determine whether the flow table occupancy of this time meets the preset recycling requirement according to the flow table usage information, and update the second statistical number according to the second judgment result obtained, wherein the second statistical number is used to indicate the consecutive number of times that the flow table occupancy corresponding to the target flow table set meets the preset recycling requirement; Determine whether the updated second statistical number is less than the second preset number; If the target flow table set includes a shared flow table and the updated second statistical number is not less than a second preset number, determining that the target flow table set is in the second preset state; If the target flow table set does not include a shared flow table, or the second statistical number is less than a second preset number, it is determined that the target flow table set is not in the second preset state.

7. The method according to claim 6, characterized in that The target flow table set includes an initial flow table subset initially allocated to the target load balancing group, the shared flow table set includes multiple shared flow table subsets, and determining whether the target flow table set includes a shared flow table includes: According to the flow table distribution information corresponding to the target load balancing group, determining whether the target flow table set includes a shared flow table; The recycling of idle flow tables in the target flow table set corresponding to the target load balancing group includes: The subset distribution information corresponding to the multiple shared flow table subsets is updated to recycle the idle flow tables in the target flow table set to obtain at least one idle shared flow table subset, and the flow table distribution information is updated, wherein the subset distribution information is used to indicate the shared flow table subsets that have been distributed and the shared flow table subsets that have not been distributed among the multiple shared flow table subsets, and the obtained at least one idle shared flow table subset is used as the shared flow table subset in the target flow table set.

8. The method according to any one of claims 1 to 4, characterized in that: The obtaining of flow table usage information of a target flow table set corresponding to a target load balancing group determined from a load balancing group of a network device includes: After waiting for a preset time period, each load balancing group in the network device is taken as the target load balancing group in turn, and flow table usage information of the target flow table set is obtained.

9. A flow table resource management device, characterized in that: The device comprises: An information acquisition module, used to obtain flow table usage information of a target flow table set corresponding to a target load balancing group determined from a load balancing group of a network device, wherein the flow table usage information is used to indicate the occupancy of a flow table corresponding to the target flow table set, the target flow table set is used in dynamic load balancing, and a flow table storing information in the target flow table set is aged based on an aging time, and the aged flow table is an idle flow table; A judging module, configured to judge whether the target flow table set is in a first preset state according to the flow table usage information, wherein the first preset state indicates that there are few idle flow tables; A management module is used to distribute idle shared flow tables to the target load balancing group to update the target flow table set when it is determined that the target flow table set is in the first preset state, wherein the allocated shared flow table is used to store forwarding information corresponding to the target load balancing group.

10. An electronic device, characterized in that: It includes a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the flow table resource management method described in any one of claims 1-8.