Traffic speed limiting device and method based on hardware unloading
By offloading the packet rate limiting function to hardware and combining it with the token bucket algorithm, the problem of excessive software resource usage is solved, efficient flow control and system performance improvement are achieved, and it can adapt to changing needs of complex application scenarios.
Patent Information
- Application Number
- CN202410658347.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-05-27
AI Technical Summary
In the existing technology, the packet rate limiting function relies on software implementation, which leads to excessive software resource usage and affects system performance. Furthermore, limited hardware resources make it difficult to meet the changing needs of complex application scenarios.
By offloading the packet rate limiting function to specialized hardware, utilizing inter-module isolation and parallel processing, and combining the token bucket algorithm configuration parameters, the dual purposes of overall traffic bandwidth limitation and refined traffic bandwidth limitation are achieved, and the flow table is decoupled. Forwarding and speed limit control improve parallelism and system efficiency.
It achieves high throughput driven by data streams, adapts to changes in stream speed limit requirements in real time, improves system operating efficiency, makes full use of hardware resources, and avoids excessive occupation of software resources.
Smart Images

Figure CN118250228B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a flow rate limiting device and method based on hardware offloading. Background Art
[0002] With the development of technologies such as cloud computing and big data, network devices such as network cards and gateways need to process a large number of messages. In order to prevent malicious bandwidth occupation, in order to avoid network congestion and improve network service quality under the premise of ensuring normal business, the message rate is limited by configuring the flow table. In the prior art, the message rate limit function is completed by software such as open virtual switch (open vswitch, OVS), which parses and matches messages and then executes actions. However, software such as OVS itself carries multiple core functions. If a single business function such as message rate limit function occupies a large amount of resources, it will affect the other core functions, which is not conducive to improving the overall system performance. By unloading the message rate limit function to specialized hardware such as data processing unit (DPU), the software can be relieved of the burden and let the software focus on the processing of core business. However, the realization of the message rate limit function by hardware is limited by the limited computing power resources and limited storage resources of the hardware, and it is necessary to consider the changes in the requirements of complex and changing application scenarios.
[0003] To this end, the present application provides a traffic speed limiting device and method based on hardware unloading, which are used to address the technical difficulties in the prior art. Summary of the invention
[0004] In the first aspect, the present application provides a traffic speed limiting device based on hardware unloading. The traffic speed limiting device includes: a receiving module, for receiving a first message packet; a first module, connected to the receiving module, the first module is used to determine whether the first message packet hits the first flow table for flow speed limiting action in the first module or the second flow table corresponding to the first flow table in the software to generate a first control signal, and when the first message packet hits the first flow table or the second flow table, the first module is also used to generate a first value of a token bucket algorithm configuration parameter associated with the first message packet; a second module, connected to the receiving module and the first module, the second module is used to determine whether the first message packet hits the third flow table for flow table forwarding action in the second module or the third flow table in the software corresponding to the first flow table. A fourth flow table corresponding to the third flow table, and when the first message packet hits the third flow table or the fourth flow table, the second module is also used to generate a port speed limiting result of the first message packet based on the initial value of the token bucket algorithm configuration parameter, wherein the second module is also used to generate a flow speed limiting result of the first message packet based on the first value of the token bucket algorithm configuration parameter from the first module; an output module, connected to the first module and the second module, the output module is used to: based on the first control signal, selectively based on the port speed limiting result of the first message packet or based on the port speed limiting result of the first message packet and the flow speed limiting result of the first message packet, execute the message speed limiting associated with the first message packet.
[0005] Through the first aspect of the present application, by configuring the values of different token bucket algorithm configuration parameters, the dual purposes of overall traffic bandwidth limitation and refined traffic bandwidth limitation are achieved, and the same algorithm model is reused to fully utilize the limited computing power and storage resources on the hardware; by utilizing module isolation and parallel processing, the parallelism in data processing is improved; the combination of overall port speed limitation and refined flow speed limitation is achieved, and the control of flow table forwarding and flow table speed limitation is decoupled, achieving high throughput driven by data flow, which helps to reflect the changes in flow speed limitation requirements in real time and improve the system operation efficiency.
[0006] In a possible implementation of the first aspect of the present application, the first module is also used to, when the first message packet does not hit the first flow table, send the first message packet to the software to determine whether the first message packet hits the second flow table.
[0007] In a possible implementation manner of the first aspect of the present application, when the first packet does not hit the first flow table and hits the second flow table, the hardware unloads the matching portion of the first packet in the second flow table to the first flow table.
[0008] In a possible implementation of the first aspect of the present application, the first control signal is used to indicate: the first message packet hits the first flow table or the second flow table, or the first message packet does not hit the first flow table and does not hit the second flow table.
[0009] In a possible implementation of the first aspect of the present application, the second module is also used to, when the first message packet does not hit the third flow table, send the first message packet to the software and determine whether the first message packet hits the fourth flow table.
[0010] In a possible implementation of the first aspect of the present application, when the first packet does not hit the third flow table and hits the fourth flow table, the hardware unloads the matching part of the first packet in the fourth flow table to the third flow table.
[0011] In a possible implementation manner of the first aspect of the present application, the third flow table is a hard-switch flow table, and the fourth flow table is a soft-switch flow table.
[0012] In a possible implementation manner of the first aspect of the present application, the judgment of the first module on the first message packet and the judgment of the second module on the first message packet are at least partially performed synchronously.
[0013] In a possible implementation manner of the first aspect of the present application, at least before the second module generates the port rate limiting result of the first message packet, the first module generates the first control signal.
[0014] In a possible implementation of the first aspect of the present application, the token bucket algorithm configuration parameter is used to configure the token bucket algorithm model of the second module, and the token bucket algorithm model is used to determine whether a given data flow rate meets a given speed limit requirement, wherein the initial value of the token bucket algorithm configuration parameter is based on the total traffic bandwidth of the port to which the traffic speed limiting device belongs, and the first value of the token bucket algorithm configuration parameter is based on the traffic bandwidth of the flow to which the first message packet belongs.
[0015] In a possible implementation of the first aspect of the present application, the port speed limiting result of the first message packet indicates whether the data flow rate of the flow to which the first message packet belongs meets the speed limit requirement of the port to which the traffic speed limiting device belongs, and the flow speed limiting result of the first message packet indicates whether the data flow rate of the flow to which the first message packet belongs meets the speed limit requirement of the flow to which the first message packet belongs.
[0016] In a possible implementation manner of the first aspect of the present application, the token bucket algorithm model is a dual-rate three-color bucket algorithm or a single-rate two-color bucket algorithm.
[0017] In a possible implementation of the first aspect of the present application, when the first message packet hits the first flow table or the second flow table, the output module is used to: based on the first control signal, based on the port speed limiting result of the first message packet and the flow speed limiting result of the first message packet, perform the message speed limiting associated with the first message packet.
[0018] In a possible implementation of the first aspect of the present application, when the first message packet does not hit the first flow table and does not hit the second flow table, the output module is used to: based on the first control signal and based on the port speed limiting result of the first message packet, execute the message speed limiting associated with the first message packet.
[0019] In a possible implementation of the first aspect of the present application, the first module performs aging processing on the first flow table based on a first aging mechanism, and the second module performs aging processing on the third flow table based on a second aging mechanism, and the first aging mechanism and the second aging mechanism are decoupled.
[0020] In a possible implementation manner of the first aspect of the present application, an initial value of the token bucket algorithm configuration parameter is set when the traffic rate limiting device is deployed and remains unchanged during the operation of the traffic rate limiting device.
[0021] In a possible implementation manner of the first aspect of the present application, the flow rate limiting device is deployed on the logic side of the host machine, and the software is deployed on the driver side of the host machine.
[0022] In the second aspect, the present application provides a traffic speed limiting method based on hardware unloading. The traffic speed limiting method is applied to a traffic speed limiting device, which includes a receiving module, a first module connected to the receiving module, a second module connected to the receiving module and the first module, and an output module connected to the first module and the second module. The traffic speed limiting method includes: receiving a first message packet through the receiving module; judging through the first module whether the first message packet hits the first flow table for flow speed limiting action in the first module or the second flow table corresponding to the first flow table in the software to generate a first control signal, and when the first message packet hits the first flow table or the second flow table, generating a first value of a token bucket algorithm configuration parameter associated with the first message packet; judging through the second module Whether the first message packet hits the third flow table for flow table forwarding action in the second module or the fourth flow table corresponding to the third flow table in the software, and when the first message packet hits the third flow table or the fourth flow table, generating the port speed limiting result of the first message packet based on the initial value of the token bucket algorithm configuration parameter, wherein the second module is also used to generate the flow speed limiting result of the first message packet based on the first value of the token bucket algorithm configuration parameter from the first module; through the output module: based on the first control signal, selectively based on the port speed limiting result of the first message packet or based on the port speed limiting result of the first message packet and the flow speed limiting result of the first message packet, execute the message speed limiting associated with the first message packet.
[0023] Through the second aspect of the present application, by configuring the values of different token bucket algorithm configuration parameters, the dual purposes of overall traffic bandwidth limitation and refined traffic bandwidth limitation are achieved, and the same algorithm model is reused to fully utilize the limited computing power and storage resources on the hardware; by utilizing module isolation and parallel processing, the parallelism in data processing is improved; the combination of overall port speed limitation and refined flow speed limitation is achieved, and the control of flow table forwarding and flow table speed limitation is decoupled, achieving high throughput driven by data flow, which helps to reflect the changes in flow speed limitation requirements in real time and improve system operation efficiency.
[0024] In a third aspect, an embodiment of the present application further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a method according to any one of the implementation modes of any of the above aspects when executing the computer program.
[0025] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, which, when executed on a computer device, enable the computer device to execute a method according to any one of the implementation modes of any of the above aspects.
[0026] In a fifth aspect, an embodiment of the present application further provides a computer program product, which includes instructions stored on a computer-readable storage medium, and when the instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0028] Figure 1 A schematic diagram of a flow rate limiting device based on hardware offloading provided in an embodiment of the present application;
[0029] Figure 2 A flow chart of a method for limiting traffic speed based on hardware offloading provided in an embodiment of the present application;
[0030] Figure 3 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] The embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0032] 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.
[0033] Figure 1 Schematic diagram of a flow rate limiting device based on hardware offloading provided in an embodiment of the present application. Figure 1As shown, the flow rate limiting device includes a receiving module 110, a first module 120, a second module 130, and an output module 140. The receiving module 110 is used to receive a first message packet. The first module 120 is connected to the receiving module 110. The first module 120 is used to determine whether the first message packet hits the first flow table for flow rate limiting action in the first module 120 or the second flow table corresponding to the first flow table in the software to generate a first control signal, and when the first message packet hits the first flow table or the second flow table, the first module 120 is also used to generate a first value of a token bucket algorithm configuration parameter associated with the first message packet. The second module 130 is connected to the receiving module 110 and the first module 120. The second module 130 is used to determine whether the first message packet hits the third flow table for flow table forwarding action in the second module 130 or the fourth flow table corresponding to the third flow table in the software, and when the first message packet hits the third flow table or the fourth flow table, the second module 130 is also used to generate the port speed limit result of the first message packet based on the initial value of the token bucket algorithm configuration parameter. The second module 130 is also used to generate the flow speed limit result of the first message packet based on the first value of the token bucket algorithm configuration parameter from the first module 120. The output module 140 is connected to the first module 120 and the second module 130. The output module 140 is used to: based on the first control signal, selectively based on the port speed limit result of the first message packet or based on the port speed limit result of the first message packet and the flow speed limit result of the first message packet, execute the message speed limit associated with the first message packet.
[0034] Figure 1 The traffic speed limiting device based on hardware offloading shown is used in application fields such as cloud computing and big data. In these application fields, large-scale message data traffic needs to be processed. In the case of limited bandwidth resources, network congestion and malicious bandwidth occupation need to be avoided. Therefore, it is necessary to limit the message speed or traffic shaping. One way to limit the message speed is to rely on software such as open virtual switch (open vswitch, OVS). The software parses and matches the message and then executes the action. However, relying on software to limit the message speed may affect the multiple core functions carried by the software itself. If a large amount of resources are occupied by a single business function such as the message speed limiting function, it will affect the other core functions. For this reason, Figure 1The traffic speed limiting device based on hardware offloading shown, by offloading the message speed limiting function to special hardware, can release the software such as OVS from the processing task of message speed limiting, so as to focus on core functions such as traffic forwarding control. Furthermore, in order to make full use of the limited computing power and storage resources on the hardware, the parallelism in data processing is improved by optimizing the internal architecture and control mechanism, and the control of flow table forwarding and message speed limiting at the hardware offloading acceleration level is decoupled, which is conducive to improving the system operation efficiency, which is described in detail below.
[0035] See also Figure 1 , a receiving module 110 is used to receive a first message packet. Here, the receiving module 110 is responsible for processing tasks such as receiving messages and parsing messages. A first module 120 is connected to the receiving module 110. The first module 120 is used to determine whether the first message packet hits the first flow table for flow rate limiting action in the first module 120 or the second flow table corresponding to the first flow table in the software, thereby generating a first control signal, and when the first message packet hits the first flow table or the second flow table, the first module 120 is also used to generate a first value of the token bucket algorithm configuration parameter associated with the first message packet. Here, the first module 120 determines whether the first message packet hits based on the first flow table in the first module 120 and the second flow table corresponding to the first flow table in the software. The first flow table is in the first module 120, so the first flow table is unloaded by hardware to the first module 120, that is, the flow rate limiting device. The second flow table is in the software, so the synchronization between the first flow table and the second flow table can be achieved through an aging mechanism, an interruption mechanism, an upload and unloading mechanism, etc. The first flow table is used for flow rate limiting actions, therefore, if the first message packet hits the first flow table or the second flow table corresponding to the first flow table, it means that a targeted flow rate limiting action is subsequently performed. Here, when the first message packet hits the first flow table or the second flow table, the first module 120 is also used to generate a first value of a token bucket algorithm configuration parameter associated with the first message packet. Therefore, the first module 120 is responsible for making a judgment on whether the first message packet hits the first flow table or the second flow table, but the first module 120 itself does not perform a flow rate limiting action, but generates a first value of a token bucket algorithm configuration parameter associated with the first message packet when it is judged that the first message packet hits the first flow table or the second flow table.
[0036] Continue reading Figure 1, the second module 130 is connected to the receiving module 110 and the first module 120. The second module 130 is used to determine whether the first message packet hits the third flow table for flow table forwarding action in the second module 130 or the fourth flow table corresponding to the third flow table in the software, and when the first message packet hits the third flow table or the fourth flow table, the second module 130 is also used to generate the port speed limit result of the first message packet based on the initial value of the token bucket algorithm configuration parameter. Here, the second module 130 is responsible for the flow table forwarding processing on the hardware accelerated unloading. Specifically, the second module 130 is used to determine whether the first message packet hits the third flow table in the second module 130 or the fourth flow table corresponding to the third flow table in the software, where the third flow table is used for flow table forwarding action. Therefore, when the first message packet hits the third flow table or the fourth flow table, it means that the first message packet can be processed by flow table forwarding, and therefore it also means that the first message packet needs to meet the corresponding message speed limit requirements. The message speed limit requirement can be divided into the port speed limit requirement and the flow speed limit requirement. Here, the port speed limit requirement reflects the traffic bandwidth limit of the network port, that is, the overall traffic bandwidth limit. The flow speed limit requirement reflects the refined traffic bandwidth limit. For example, the traffic bandwidth of a certain network port can be 10 gigabytes (GB), and there can be 100 flows under the network port, of which the traffic bandwidth of a certain flow can be 100 megabytes (MB). Generally, after the service deployment and system initialization, during the service operation, the traffic bandwidth limit of the network port is maintained, while the number of flows forwarded through a certain network port and the bandwidth allocation between these flows may change dynamically. Considering the static characteristics of the port speed limit requirement and the dynamic characteristics of the flow speed limit requirement, here, the second module 130 first determines whether the first message packet hits the third flow table or the fourth flow table. If the first message packet does not hit the third flow table or the fourth flow table, it means that the message forwarding processing is not performed on the first message packet in the future, and the message can be discarded. If the first message packet hits the third flow table or the fourth flow table, this means that the first message packet can be subject to the overall port speed limit requirement. Therefore, the second module 130 generates the port speed limit result of the first message packet based on the initial value of the token bucket algorithm configuration parameter. Further, the second module 130 is also used to generate the flow speed limit result of the first message packet based on the first value of the token bucket algorithm configuration parameter from the first module 120. As mentioned above, if the first message packet hits the first flow table or the second flow table, this means that a targeted flow speed limit action is subsequently performed on the first message packet. Therefore, the second module 130 is also used to generate the flow speed limit result of the first message packet based on the first value of the token bucket algorithm configuration parameter from the first module 120.In this way, the second module 130, respectively, generates the port speed limit result of the first message packet based on the initial value of the token bucket algorithm configuration parameter, and generates the flow speed limit result of the first message packet based on the first value of the token bucket algorithm configuration parameter from the first module 120. Here, the initial value of the token bucket algorithm configuration parameter and the first value of the token bucket algorithm configuration parameter are both for the algorithm model for the message speed limit function built into the first module 120, such as the dual-rate three-color token bucket algorithm. By configuring different values of the token bucket algorithm configuration parameters, the dual purposes of overall traffic bandwidth limitation and refined traffic bandwidth limitation can be achieved, and the same algorithm model can be reused, so that the limited computing power resources and storage resources on the hardware can be fully utilized.
[0037] Continue reading Figure 1After the receiving module 110 receives the first message packet, the first module 120 and the second module 130 respectively implement respective data processing operations. As described above, the first module 120 is responsible for making a judgment on whether the first message packet hits the first flow table or the second flow table, but the first module 120 itself does not perform the flow rate limiting action, but generates the first value of the token bucket algorithm configuration parameter associated with the first message packet when it is judged that the first message packet hits the first flow table or the second flow table. The second module 130 is responsible for flow table forwarding processing, that is, judging whether to forward the first message packet, and is responsible for generating port rate limiting results to apply port rate limiting processing to the first message packet. Depending on the judgment result of the first module 120, that is, whether the first message packet hits the first flow table or the second flow table, the second module 130 is also responsible for generating refined flow rate limiting results. In this way, through the above-mentioned optimization design of the hardware internal structure and control mechanism, the parallelism in data processing can be improved, and the first module 120 is used to determine whether the first message packet hits the first flow table or the second flow table, and the second module 130 is used to determine whether the first message packet hits the third flow table or the fourth flow table. Among them, the first flow table is used for flow rate limiting action, the third flow table is used for flow table forwarding action, and the first flow table and the third flow table are both hardware-unloaded to the flow rate limiting device. Therefore, by looking up the first flow table through the first module 120, it may trigger the failure to hit the first flow table, and send it to the software to look up the second flow table and the subsequent process of hardware unloading; similarly, by looking up the third flow table through the second module 130, it may trigger the failure to hit the third flow table, and send it to the software to look up the fourth flow table and the subsequent process of hardware unloading. Therefore, by the first module 120, it is determined whether the first message packet hits the first flow table or the second flow table, and then when the first message packet hits the first flow table or the second flow table, the first value of the token bucket algorithm configuration parameter associated with the first message packet is generated. This means that when the second module 130 generates the port speed limit result of the first message packet, the second module 130 should have received the first value of the token bucket algorithm configuration parameter associated with the first message packet from the first module 120. Therefore, after the second module 130 generates the port speed limit result of the first message packet, it can generate the port speed limit result of the first message packet. If the second module 130 receives the first value of the token bucket algorithm configuration parameter associated with the first message packet from the first module 120 before the second module 130 generates the port speed limit result of the first message packet, the first value can be cached, so that after or before the port speed limit result of the first message packet is generated, the port speed limit result of the first message packet can be generated. In this way, the isolation and parallel processing of the first module 120 and the second module 130 are utilized to improve the parallelism in data processing.Further, the algorithm model for the message speed limit function of the second module 130 can be reused, so the initial value of the token bucket algorithm configuration parameter and the first value of the token bucket algorithm configuration parameter are both for the algorithm model for the message speed limit function built into the first module 120, such as the dual-rate three-color token bucket algorithm. Further, the port speed limit requirement is static, but the refined flow speed limit requirement is dynamic, and sometimes there may be no flow speed limit requirement, that is, each flow competes for the total bandwidth together. Therefore, the second module 130, regardless of whether it has received the first value of the token bucket algorithm configuration parameter associated with the first message packet from the first module 120, that is, under the premise of not being affected by the judgment result of the first module 120, the second module 130 generates the port speed limit result of the first message packet based on the initial value of the token bucket algorithm configuration parameter. In this way, by configuring the initial value of the token bucket algorithm configuration parameter in the second module 130, the port speed limit requirement can be met, and the first value of the token bucket algorithm configuration parameter associated with the first message packet is generated by the first module 120, so as to achieve flexible adaptation to various message speed limit function requirements. Further, the second module 130 is not only responsible for flow table forwarding processing, but also responsible for generating port speed limit results and flow speed limit results. However, the second module 130 itself generates the port speed limit result of the first message packet based on the initial value of the token bucket algorithm configuration parameter. Therefore, after the service deployment and system initialization, the initial value of the token bucket algorithm configuration parameter in the second module 130 is configured, that is, the built-in algorithm model for the message speed limit function in the second module 130 is initialized, such as the dual-rate three-color token bucket algorithm. The second module 130 does not actively adjust the algorithm model, but passively receives the first value of the token bucket algorithm configuration parameter from the first module 120, thereby generating the flow speed limit result of the first message packet. Therefore, although the second module 130 is responsible for generating the port speed limit result and the flow speed limit result, the second module 130 itself can independently generate the port speed limit result (this is because the port speed limit requirement is inevitable and is static during the service operation process), and the second module 130 needs to cooperate with the first module 120 to generate the flow speed limit result. The benefit of such a design is that it helps to achieve the decoupling between the control of flow table forwarding and message speed limiting at the hardware unloading acceleration level. By optimizing the first module 120, such as upgrading or replacing the firmware, the first value of the token bucket algorithm configuration parameter generated by the first module 120 can be changed, which in turn can affect the flow speed limiting result generated by the second module 130. By optimizing the second module 130, such as upgrading or replacing the firmware, the mechanism of flow table forwarding processing can be changed, such as updating the third flow table used for flow table forwarding actions. In this way, the combination of overall port speed limiting and refined flow speed limiting is achieved, and the respective controls of flow table forwarding and flow table speed limiting are decoupled.After the initial value of the token bucket algorithm configuration parameter is initialized and set to meet the port speed limit requirement, the change of the flow speed limit requirement can be reflected in real time by updating the first module 120, that is, affecting the first value of the token bucket algorithm configuration parameter generated by the first module 120. In addition, by updating the third flow table used for the flow table forwarding action in the second module 130, the change in the flow table forwarding control can be reflected in real time.
[0038] Continue reading Figure 1, an output module 140 is connected to the first module 120 and the second module 130. The output module 140 is used to: based on the first control signal, selectively based on the port speed limit result of the first message packet or based on the port speed limit result of the first message packet and the flow speed limit result of the first message packet, execute the message speed limit associated with the first message packet. As mentioned above, the first module 120 is used to determine whether the first message packet hits the first flow table for flow speed limit action in the first module 120 or the second flow table corresponding to the first flow table in the software to generate the first control signal. Therefore, when the first message packet does not hit the first flow table or the second flow table, it means that the flow speed limit action does not need to be executed. Therefore, the output module 140 can execute the message speed limit associated with the first message packet after receiving the port speed limit result of the first message packet from the second module 130 (the port speed limit requirement must exist and is static during the service operation process), that is, the message speed limit associated with the first message packet is executed based on the port speed limit result of the first message packet. When the first packet hits the first flow table or the second flow table, it means that the flow rate limiting action needs to be performed. Therefore, the output module 140 can ensure through a cache mechanism that after receiving the port rate limiting result of the first packet and the flow rate limiting result of the first packet, the message rate limiting associated with the first packet is performed based on the port rate limiting result of the first packet and the flow rate limiting result of the first packet. In this way, by using the parallel processing between the first module 120 and the second module 130, the output module 140 can be instructed through the first control signal so that the output module 140 can choose to perform the message rate limiting associated with the first packet based on the port rate limiting result of the first packet after receiving the port rate limiting result of the first packet from the second module 130, or can choose to perform the message rate limiting associated with the first packet based on the port rate limiting result of the first packet and the flow rate limiting result of the first packet after receiving the port rate limiting result of the first packet from the second module 130. In combination with the above, the second module 130 generates the port speed limit result of the first message packet based on the initial value of the token bucket algorithm configuration parameter, and generates the flow speed limit result of the first message packet based on the first value of the token bucket algorithm configuration parameter from the first module 120. In this way, not only the algorithm model in the second module 130 is reused, but also a high throughput driven by data flow is achieved. For example, when the application scenario does not require a refined flow speed limit action, which means that the judgment result of the first module 120 is a miss, the first control signal will indicate that the output module 140 does not need to wait for the second module 130 to generate the flow speed limit result of the first message packet, thereby speeding up the data throughput.When the application scenario requires a refined flow rate limiting action, the first flow table in the first module 120 may be updated through aging and hardware unloading, so that subsequent packets will hit the first flow table, so that the first control signal indicates that the output module 140 needs to wait for the port rate limiting result and the flow rate limiting result before executing the message rate limiting. In this way, through the isolation and respective optimization design between the first module 120 and the second module 130, it is helpful to reflect the changes in the flow rate limiting requirements in real time and improve the system operation efficiency.
[0039] In conclusion, Figure 1 The traffic speed limiting device based on hardware offloading shown achieves the dual purposes of overall traffic bandwidth limitation and refined traffic bandwidth limitation by configuring the values of different token bucket algorithm configuration parameters, reuses the same algorithm model to make full use of the limited computing power resources and storage resources on the hardware; utilizes isolation between modules and parallel processing to improve the parallelism in data processing; realizes the combination of overall port speed limitation and refined flow speed limitation, and decouples the respective controls of flow table forwarding and flow table speed limitation, realizes high throughput driven by data flow, helps to reflect the changes in flow speed limitation requirements in real time and improves the system operation efficiency.
[0040] In a possible implementation, the first module 120 is also used to, when the first message packet does not hit the first flow table, send the first message packet to the software to determine whether the first message packet hits the second flow table. In some embodiments, when the first message packet does not hit the first flow table and hits the second flow table, the hardware unloads the matching part of the first message packet in the second flow table to the first flow table. In some embodiments, the first control signal is used to indicate: the first message packet hits the first flow table or the second flow table, or the first message packet does not hit the first flow table and does not hit the second flow table. In this way, the parallelism of data processing is improved by using isolation between modules and parallel processing; the combination of overall port speed limit and refined flow speed limit is realized, and the control of flow table forwarding and flow table speed limit is decoupled, so as to achieve high throughput driven by data flow, which helps to reflect the changes in flow speed limit requirements in real time and improve the system operation efficiency.
[0041] In a possible implementation, the second module 130 is also used to, when the first packet does not hit the third flow table, send the first packet to the software and determine whether the first packet hits the fourth flow table. In some embodiments, when the first packet does not hit the third flow table and hits the fourth flow table, the hardware unloads the matching part of the first packet in the fourth flow table to the third flow table. In some embodiments, the third flow table is a hard-converted flow table, and the fourth flow table is a soft-converted flow table. In this way, the parallelism of data processing is improved by using isolation between modules and parallel processing; the combination of overall port speed limit and refined flow speed limit is realized, and the control of flow table forwarding and flow table speed limit is decoupled, so as to achieve high throughput driven by data flow, which helps to reflect the changes in flow speed limit requirements in real time and improve the system operation efficiency. In addition, hardware unloading acceleration is achieved.
[0042] In a possible implementation, the judgment of the first module 120 on the first message packet and the judgment of the second module 130 on the first message packet are at least partially performed synchronously. The first module 120 is used to judge whether the first message packet hits the first flow table or the second flow table, and then when the first message packet hits the first flow table or the second flow table, a first value of the token bucket algorithm configuration parameter associated with the first message packet is generated. This means that when the second module 130 generates the port speed limit result of the first message packet, the second module 130 should have received the first value of the token bucket algorithm configuration parameter associated with the first message packet from the first module 120. Therefore, after the second module 130 generates the port speed limit result of the first message packet, it can generate the port speed limit result of the first message packet. If the second module 130 receives the first value of the token bucket algorithm configuration parameter associated with the first message packet from the first module 120 before the second module 130 generates the port speed limit result of the first message packet, the first value can be cached, so that the port speed limit result of the first message packet can be generated after or before the port speed limit result of the first message packet is generated. In this way, the isolation and parallel processing of the first module 120 and the second module 130 are utilized to improve the parallelism in data processing.
[0043] In a possible implementation, at least before the second module 130 generates the port speed limit result of the first message packet, the first module 120 generates the first control signal. As described above, the first module 120 is used to determine whether the first message packet hits the first flow table for flow speed limit action in the first module 120 or the second flow table corresponding to the first flow table in software, thereby generating the first control signal. In this way, not only the algorithm model in the second module 130 is reused, but also a high throughput driven by data flow is achieved.
[0044] In a possible implementation, the token bucket algorithm configuration parameter is used to configure the token bucket algorithm model of the second module, and the token bucket algorithm model is used to determine whether a given data flow rate meets a given speed limit requirement, wherein the initial value of the token bucket algorithm configuration parameter is based on the total flow bandwidth of the port to which the flow speed limit device belongs, and the first value of the token bucket algorithm configuration parameter is based on the flow bandwidth of the flow to which the first message packet belongs. In this way, by configuring the initial value of the token bucket algorithm configuration parameter in the second module 130, the port speed limit requirement can be met, and by generating the first value of the token bucket algorithm configuration parameter associated with the first message packet through the first module 120, the requirements of flexible adaptation to various message speed limit functions are achieved. The initial value of the token bucket algorithm configuration parameter and the first value of the token bucket algorithm configuration parameter are both for the algorithm model for the message speed limit function built into the first module 120, such as the dual-rate three-color token bucket algorithm. By configuring different values of the token bucket algorithm configuration parameters, the dual purposes of overall flow bandwidth limitation and refined flow bandwidth limitation can be achieved, and the same algorithm model can be reused, so that the limited computing power resources and storage resources on the hardware can be fully utilized.
[0045] In some embodiments, the port speed limiting result of the first message packet indicates whether the data flow rate of the flow to which the first message packet belongs meets the speed limit requirement of the port to which the flow speed limiting device belongs, and the flow speed limiting result of the first message packet indicates whether the data flow rate of the flow to which the first message packet belongs meets the speed limit requirement of the flow to which the first message packet belongs. In some embodiments, the token bucket algorithm model is a dual-speed three-color bucket algorithm or a single-speed two-color bucket algorithm. In this way, the dual purposes of overall traffic bandwidth limitation and refined traffic bandwidth limitation are achieved, the combination of overall port speed limitation and refined flow speed limitation is achieved, and the respective controls of flow table forwarding and flow table speed limitation are decoupled, achieving high throughput driven by data flow, which helps to reflect the changes in flow speed limitation requirements in real time and improve system operation efficiency.
[0046] In a possible implementation, when the first packet hits the first flow table or the second flow table, the output module 140 is used to: based on the first control signal, based on the port speed limit result of the first packet and the flow speed limit result of the first packet, execute the message speed limit associated with the first packet. In some embodiments, when the first packet does not hit the first flow table and does not hit the second flow table, the output module 140 is used to: based on the first control signal, based on the port speed limit result of the first packet, execute the message speed limit associated with the first packet. The first module 120 is used to determine whether the first packet hits the first flow table for flow speed limit action in the first module 120 or the second flow table corresponding to the first flow table in the software to generate a first control signal. When the first packet hits the first flow table or the second flow table, it means that the flow rate limiting action needs to be performed. Therefore, the output module 140 can ensure through a cache mechanism that after receiving the port rate limiting result of the first packet and the flow rate limiting result of the first packet, the message rate limiting associated with the first packet is performed based on the port rate limiting result of the first packet and the flow rate limiting result of the first packet. In this way, by using the parallel processing between the first module 120 and the second module 130, the output module 140 can be instructed through the first control signal so that the output module 140 can choose to perform the message rate limiting associated with the first packet based on the port rate limiting result of the first packet after receiving the port rate limiting result of the first packet from the second module 130, or can choose to perform the message rate limiting associated with the first packet based on the port rate limiting result of the first packet and the flow rate limiting result of the first packet after receiving the port rate limiting result of the first packet from the second module 130.
[0047] In a possible implementation, the first module performs aging processing on the first flow table based on a first aging mechanism, and the second module performs aging processing on the third flow table based on a second aging mechanism, and the first aging mechanism and the second aging mechanism are decoupled. In this way, the control of flow table forwarding and flow table rate limiting are decoupled, and the isolation and respective optimization designs between the first module 120 and the second module 130 help to reflect the changes in flow rate limiting requirements in real time and improve the system operation efficiency.
[0048] In a possible implementation, the initial value of the token bucket algorithm configuration parameter is set when the flow rate limiting device is deployed and remains unchanged during the operation of the flow rate limiting device. The port speed limit requirement is inevitable and is static during the service operation process. After the service deployment and system initialization, the initial value of the token bucket algorithm configuration parameter in the second module 130 is configured, that is, the built-in algorithm model for the message speed limit function in the second module 130 is initialized, such as the dual-rate three-color token bucket algorithm. In this way, by configuring the initial value of the token bucket algorithm configuration parameter in the second module 130, the port speed limit requirement can be met.
[0049] In a possible implementation, the flow rate limiting device is deployed on the logic side of the host machine, and the software is deployed on the driver side of the host machine. In this way, by offloading the message rate limiting function to dedicated hardware, software such as OVS can be released from the task of processing message rate limiting, thereby focusing on core functions such as flow forwarding control. Furthermore, in order to make full use of the limited computing power and storage resources on the hardware, the parallelism of data processing is improved by optimizing the internal architecture and control mechanism, and the control of flow table forwarding and message rate limiting at the hardware offload acceleration level is decoupled, which is conducive to improving the system operation efficiency.
[0050] Figure 2 A flow chart of a method for limiting traffic speed based on hardware offloading provided in an embodiment of the present application. Figure 2 The flow rate limiting method shown is applied to a flow rate limiting device, which includes a receiving module, a first module connected to the receiving module, a second module connected to the receiving module and the first module, and an output module connected to the first module and the second module. Figure 2 The flow rate limiting method shown includes the following steps.
[0051] Step S210: Receive a first message packet through a receiving module.
[0052] Step S220: Through the first module, determine whether the first message packet hits the first flow table for flow rate limiting action in the first module or the second flow table corresponding to the first flow table in the software to generate a first control signal, and when the first message packet hits the first flow table or the second flow table, generate a first value of the token bucket algorithm configuration parameter associated with the first message packet.
[0053] Step S230: Through the second module, determine whether the first message packet hits the third flow table used for flow table forwarding action in the second module or the fourth flow table corresponding to the third flow table in the software, and when the first message packet hits the third flow table or the fourth flow table, generate the port speed limit result of the first message packet based on the initial value of the token bucket algorithm configuration parameter, wherein the second module is also used to generate the flow speed limit result of the first message packet based on the first value of the token bucket algorithm configuration parameter from the first module.
[0054] Step S240: through the output module: based on the first control signal, selectively based on the port speed limiting result of the first packet or based on the port speed limiting result of the first packet and the flow speed limiting result of the first packet, execute the message speed limiting associated with the first packet.
[0055] Figure 2 The traffic speed limiting method based on hardware offloading shown in the figure achieves the dual purposes of overall traffic bandwidth limitation and refined traffic bandwidth limitation by configuring the values of different token bucket algorithm configuration parameters, and reuses the same algorithm model to make full use of the limited computing power and storage resources on the hardware; utilizes isolation between modules and parallel processing to improve the parallelism in data processing; realizes the combination of overall port speed limiting and refined flow speed limiting, and decouples the respective controls of flow table forwarding and flow table speed limiting, achieving high throughput driven by data flow, which helps to reflect the changes in flow speed limiting requirements in real time and improve the system operation efficiency.
[0056] Figure 33 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application, and the computing device 300 includes: one or more processors 310, a communication interface 320 and a memory 330. The processor 310, the communication interface 320 and the memory 330 are interconnected via a bus 340. Optionally, the computing device 300 may also include an input / output interface 350, and the input / output interface 350 is connected to an input / output device for receiving parameters set by a user, etc. The computing device 300 can be used to implement some or all of the functions of the device embodiment or system embodiment in the above-mentioned embodiment of the present application; the processor 310 can also be used to implement some or all of the operating steps of the method embodiment in the above-mentioned embodiment of the present application. For example, the specific implementation of the various operations performed by the computing device 300 can refer to the specific details in the above-mentioned embodiments, such as the processor 310 is used to perform some or all of the steps in the above-mentioned method embodiment or some or all of the operations in the above-mentioned method embodiment. For another example, in an embodiment of the present application, the computing device 300 may be used to implement part or all of the functions of one or more components in the above-mentioned apparatus embodiment. In addition, the communication interface 320 may be specifically used to perform the communication functions necessary to implement the functions of these apparatuses and components, and the processor 310 may be specifically used to perform the processing functions necessary to implement the functions of these apparatuses and components.
[0057] It should be understood that Figure 3 The computing device 300 may include one or more processors 310, and the multiple processors 310 may provide processing capabilities in a parallel connection mode, a serial connection mode, a serial-parallel connection mode, or any connection mode, or the multiple processors 310 may form a processor sequence or a processor array, or the multiple processors 310 may be divided into a main processor and an auxiliary processor, or the multiple processors 310 may have different architectures such as a heterogeneous computing architecture. In addition, Figure 3 The computing device 300 shown in the figure, and the related structural description and functional description are exemplary and non-limiting. In some exemplary embodiments, the computing device 300 may include Figure 3 More or fewer components may be shown, or some components may be combined or separated, or may have a different arrangement of components.
[0058] The processor 310 may have a variety of specific implementation forms. For example, the processor 310 may include a central processing unit (CPU), a graphic processing unit (GPU), a neural-network processing unit (NPU), a tensor processing unit (TPU) or a data processing unit (DPU), etc., and the embodiment of the present application does not specifically limit it. The processor 310 may also be a single-core processor or a multi-core processor. The processor 310 may be a combination of a CPU and a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. The processor 310 may also be implemented using a logic device with built-in processing logic alone, such as an FPGA or a digital signal processor (DSP). The communication interface 320 may be a wired interface or a wireless interface for communicating with other modules or devices. The wired interface may be an Ethernet interface, a local interconnect network (LIN), etc., and the wireless interface may be a cellular network interface or a wireless local area network interface, etc.
[0059] The memory 330 may be a non-volatile memory, such as a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The memory 330 may also be a volatile memory, which may be a random access memory (RAM) used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM). The memory 330 may also be used to store program codes and data, so that the processor 310 calls the program codes stored in the memory 330 to execute some or all of the operation steps in the above method embodiment, or to execute the corresponding functions in the above device embodiment. Figure 3 Show more or fewer components, or have different component configurations.
[0060] The bus 340 may be a peripheral component interconnect express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus 340 may be divided into an address bus, a data bus, a control bus, etc. In addition to the data bus, the bus 340 may also include a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0061] The method and device provided in the embodiments of the present application are based on the same inventive concept. Since the principles of solving the problems in the methods and devices are similar, the embodiments, implementation methods, examples or implementation methods of the methods and devices can refer to each other, and the repeated parts will not be repeated. The embodiments of the present application also provide a system, which includes multiple computing devices, and the structure of each computing device can refer to the structure of the computing device described above. The functions or operations that can be implemented by the system can refer to the specific implementation steps in the above method embodiments and / or the specific functions described in the above device embodiments, which will not be repeated here.
[0062] The present application also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer device (such as one or more processors), the method steps in the above method embodiment can be implemented. The specific implementation of the processor of the computer-readable storage medium in executing the above method steps can refer to the specific operations described in the above method embodiment and / or the specific functions described in the above device embodiment, which will not be repeated here.
[0063] It should be understood by those skilled in the art that the embodiments of the present application may be provided as methods, systems, or computer program products. The present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. The embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The present application may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiments of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. Computer-readable storage media can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media. Available media can be magnetic media (such as floppy disks, hard disks, tapes), optical media, or semiconductor media. Semiconductor media can be solid-state hard disks, random access memory, flash memory, read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, registers, or any other form of suitable storage media.
[0064] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. Each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0065] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. The steps in the method of the embodiment of the present application can be adjusted in order, merged or deleted according to actual needs; the modules in the system of the embodiment of the present application can be divided, merged or deleted according to actual needs. If these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims
1. A flow rate limiting device based on hardware unloading, characterized in that: The flow rate limiting device comprises: A receiving module, used for receiving a first message packet; A first module, connected to the receiving module, the first module is used to determine whether the first message packet hits the first flow table for flow rate limiting action in the first module or the second flow table corresponding to the first flow table in the software to generate a first control signal, and when the first message packet hits the first flow table or the second flow table, the first module is also used to generate a first value of a token bucket algorithm configuration parameter associated with the first message packet; A second module is connected to the receiving module and the first module, the second module is used to determine whether the first message packet hits the third flow table for flow table forwarding action in the second module or the fourth flow table corresponding to the third flow table in the software, and when the first message packet hits the third flow table or the fourth flow table, the second module is also used to generate a port speed limit result of the first message packet based on the initial value of the token bucket algorithm configuration parameter, wherein the second module is also used to generate a flow speed limit result of the first message packet based on the first value of the token bucket algorithm configuration parameter from the first module; an output module connected to the first module and the second module, the output module being configured to: based on the first control signal, selectively perform message speed limiting associated with the first message packet based on a port speed limiting result of the first message packet or based on the port speed limiting result of the first message packet and a flow speed limiting result of the first message packet, The first flow table and the third flow table are both offloaded to the flow rate limiting device by hardware, and the second flow table and the fourth flow table are both in the software.
2. The flow rate limiting device according to claim 1, characterized in that: The first module is further configured to, when the first message packet does not hit the first flow table, send the first message packet to the software to determine whether the first message packet hits the second flow table.
3. The flow rate limiting device according to claim 2, characterized in that: When the first packet does not hit the first flow table but hits the second flow table, the hardware unloads the matching portion of the first packet in the second flow table to the first flow table.
4. The flow rate limiting device according to claim 3, characterized in that: The first control signal is used to indicate that: the first packet hits the first flow table or the second flow table, or the first packet does not hit the first flow table and does not hit the second flow table.
5. The flow rate limiting device according to claim 1, characterized in that: The second module is further configured to, when the first message packet does not hit the third flow table, send the first message packet to the software and determine whether the first message packet hits the fourth flow table.
6. The flow rate limiting device according to claim 5, characterized in that: When the first packet does not hit the third flow table but hits the fourth flow table, the hardware unloads the matching portion of the first packet in the fourth flow table to the third flow table.
7. The flow rate limiting device according to claim 6, characterized in that: The third flow table is a hard-transfer flow table, and the fourth flow table is a soft-transfer flow table.
8. The flow rate limiting device according to claim 1, characterized in that: The determination of the first module on the first message packet and the determination of the second module on the first message packet are at least partially performed synchronously.
9. The flow rate limiting device according to claim 1, characterized in that: At least before the second module generates the port speed limiting result of the first message packet, the first module generates the first control signal.
10. The flow rate limiting device according to claim 1, characterized in that: The token bucket algorithm configuration parameters are used to configure the token bucket algorithm model of the second module, and the token bucket algorithm model is used to determine whether a given data flow rate meets a given speed limit requirement, wherein the initial value of the token bucket algorithm configuration parameters is based on the total traffic bandwidth of the port to which the traffic speed limiting device belongs, and the first value of the token bucket algorithm configuration parameters is based on the traffic bandwidth of the flow to which the first message packet belongs.
11. The flow rate limiting device according to claim 10, characterized in that: The port speed limiting result of the first message packet indicates whether the data flow rate of the flow to which the first message packet belongs meets the speed limit requirement of the port to which the traffic speed limiting device belongs, and the flow speed limiting result of the first message packet indicates whether the data flow rate of the flow to which the first message packet belongs meets the speed limit requirement of the flow to which the first message packet belongs.
12. The flow rate limiting device according to claim 11, characterized in that: The token bucket algorithm model is a dual-speed three-color bucket algorithm or a single-speed two-color bucket algorithm.
13. The flow rate limiting device according to claim 1, characterized in that: When the first packet hits the first flow table or the second flow table, the output module is used to: based on the first control signal, based on the port speed limiting result of the first packet and the flow speed limiting result of the first packet, perform the message speed limiting associated with the first packet.
14. The flow rate limiting device according to claim 13, characterized in that: When the first message packet does not hit the first flow table and does not hit the second flow table, the output module is used to: based on the first control signal and based on the port speed limit result of the first message packet, perform message speed limit associated with the first message packet.
15. The flow rate limiting device according to claim 1, characterized in that: The first module performs aging processing on the first flow table based on a first aging mechanism, and the second module performs aging processing on the third flow table based on a second aging mechanism, and the first aging mechanism and the second aging mechanism are decoupled.
16. The flow rate limiting device according to claim 1, characterized in that: The initial values of the token bucket algorithm configuration parameters are set when the traffic rate limiting device is deployed and remain unchanged during the operation of the traffic rate limiting device.
17. The flow rate limiting device according to claim 1, characterized in that: The flow rate limiting device is deployed on the logic side of the host machine, and the software is deployed on the driver side of the host machine.
18. A traffic speed limiting method based on hardware offloading, characterized in that: The flow rate limiting method is applied to a flow rate limiting device, which includes a receiving module, a first module connected to the receiving module, a second module connected to the receiving module and the first module, and an output module connected to the first module and the second module. The flow rate limiting method includes: Receiving a first message packet through the receiving module; By means of the first module, it is determined whether the first message packet hits a first flow table for flow rate limiting action in the first module or a second flow table corresponding to the first flow table in the software, thereby generating a first control signal, and when the first message packet hits the first flow table or the second flow table, a first value of a token bucket algorithm configuration parameter associated with the first message packet is generated; By means of the second module, it is determined whether the first message packet hits the third flow table for flow table forwarding action in the second module or the fourth flow table corresponding to the third flow table in the software, and when the first message packet hits the third flow table or the fourth flow table, a port speed limit result of the first message packet is generated based on the initial value of the token bucket algorithm configuration parameter, wherein the second module is further used to generate the flow speed limit result of the first message packet based on the first value of the token bucket algorithm configuration parameter from the first module; By means of the output module: based on the first control signal, selectively based on the port speed limiting result of the first message packet or based on the port speed limiting result of the first message packet and the flow speed limiting result of the first message packet, executing the message speed limiting associated with the first message packet, The first flow table and the third flow table are both offloaded to the flow rate limiting device by hardware, and the second flow table and the fourth flow table are both in the software.
Citation Information
Patent Citations
Flow table hardware unloading method, equipment and medium
CN115150328A
Random hardware flow table unloading method
CN117873588A
Message processing method for data processing unit, computer equipment and medium
CN117909031A
Hardware and software router
US20220345397A1
Fragmented packet traffic rate limiting method, and DPU fragmented packet forwarding method and apparatus
WO2024088423A1
