Packet rate limiting method, gateway device, smart network interface card, product, and storage medium

By offloading the speed limit operation of the gateway device to the smart network card and using the smart network card for speed limit control, the problem of excessive resource consumption of the gateway device when transmitting large amounts of data is solved, the performance of the gateway device is improved, and the development cost and compatibility requirements of the smart network card are reduced.

WO2025191387A1PCT designated stage Publication Date: 2025-09-18CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PTE LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/IB2025/052164
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-15
Filing Date
2025-02-28
Publication Date
2025-09-18

AI Technical Summary

Technical Problem

When gateway devices transmit large amounts of data, they occupy too many resources, resulting in reduced overall performance. Existing technologies are unable to effectively solve the problems of resource competition and traffic speed limiting.

Method used

By offloading the rate limit operation in the gateway device to the smart network card, the smart network card is used for rate limit control. The gateway device only performs queries and metadata generation, and the smart network card limits the message rate according to the target rate limit parameters.

Benefits of technology

It reduces the resource usage of gateway devices, improves the overall performance of gateway devices, reduces the development cost and compatibility requirements of smart network cards, and makes them more versatile.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure IB2025052164_18092025_PF_FP_ABST
    Figure IB2025052164_18092025_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a packet rate limiting method, a gateway device, a smart network interface card, a product, and a storage medium. In the packet rate limiting method, a gateway device can provide, on the basis of an information interaction format agreed upon with a smart network interface card, a packet and a corresponding target rate limiting identifier to the smart network interface card; and, on the basis of the information interaction format, the smart network interface card can identify the target rate limiting identifier and perform rate limiting control on the packet. Accordingly, the rate limiting operation in the gateway device is offloaded to the smart network interface card, so that when the gateway device receives a packet, there is no need to perform a rate limiting operation on the packet, thereby reducing resource consumption of the gateway device, enabling the gateway device to utilize more resources to perform other functions, and improving the overall performance of the gateway device.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Message rate limiting method, gateway device, smart network card, product and storage medium technical field

[0002]

[0001] The present disclosure relates to the field of computer technology, and more particularly to a message rate limiting method, a gateway device, an intelligent network card, a product, and a storage medium.

[0003] A gateway is a device that connects networks using different protocols. Acting as a gateway within a network, a gateway determines whether to forward user information outside the local network based on the IP (Internet Protocol) address of the device being used. It also receives and forwards information sent from external devices to devices within the local network.

[0004]

[0003] When a gateway device transmits a large amount of data, it needs to occupy a large amount of resources to perform traffic forwarding operations and traffic rate limiting operations. This resource competition leads to a decrease in the overall performance of the gateway device. Therefore, a new solution is needed.

[0005]

[0004] Various aspects of the present disclosure provide a message rate limiting method, a gateway device, an intelligent network card, a product, and a storage medium, which are used to perform flow control in a software and hardware collaborative manner to improve the performance of the gateway device.

[0006]

[0005] The present disclosure provides a message rate limiting method applicable to a gateway device, comprising: receiving a message to be forwarded; querying preset service rate limit information according to the message to obtain a target rate limit identifier corresponding to the message; and providing the message and the target rate limit identifier to the smart network card according to an information exchange format agreed upon with the smart network card, so that the smart network card performs rate limit control on the message according to the target rate limit identifier.

[0007]

[0006] Optionally, providing the message and the target speed limit identifier to the smart network card according to an information exchange format agreed upon with the smart network card includes: generating metadata information according to the target speed limit identifier and attributes of the message and in accordance with an information exchange format agreed upon between the gateway device and the smart network card; adding the metadata information to a header of the message, and sending the message with the added metadata information to the smart network card.

[0008]

[0007] Optionally, the method further includes: obtaining externally provided rate limit configuration data; updating the preset service rate limit information according to the rate limit rules in the rate limit configuration data; and / or transmitting a correspondence between at least one rate limit identifier and a rate limit parameter in the rate limit configuration data to the smart network card; wherein the rate limit parameters corresponding to any rate limit identifier include a committed burst size and a committed information rate.

[0008] Optionally, before adding the target rate limit identifier to the message, the method further includes: calculating a resource utilization rate of the gateway device; if the resource utilization rate of the gateway device is greater than a set threshold, determining that the smart network card performs a rate limit control operation on the message, and providing the message and the target rate limit identifier to the smart network card.

[0009]

[0009] Optionally, the method further includes: if the resource occupancy rate of the gateway device is less than or equal to the set threshold, obtaining a target speed limit parameter corresponding to the target speed limit identifier from the service speed limit information; and controlling the forwarding rate of the message according to the target speed limit parameter.

[0010]

[0010] The present disclosure also provides a message speed limiting method applicable to a smart network card, comprising: receiving a message sent by a gateway device, the message carrying a target speed limit identifier; parsing the data to be identified according to an information exchange format agreed upon with the gateway device to obtain a target speed limit identifier corresponding to the message; obtaining a target speed limit parameter corresponding to the target speed limit identifier from a correspondence between at least one speed limit identifier and a target speed limit parameter; and forwarding the message according to the target speed limit parameter.

[0011]

[0011] Optionally, before obtaining the target speed limit parameter corresponding to the target speed limit identifier from the correspondence between the at least one speed limit identifier and the target speed limit parameter, the method further includes: receiving the correspondence between the at least one speed limit identifier and the target speed limit parameter sent by the gateway, where the target speed limit parameter includes: a committed burst size and a committed information rate.

[0012]

[0012] Optionally, forwarding the message according to the target speed limit parameter includes: determining a token bucket, the capacity of the token bucket corresponding to the committed burst size in the target speed limit parameter; putting tokens into the token bucket according to the committed information rate in the target speed limit identifier; judging whether the number of remaining tokens in the token bucket is greater than or equal to the length of the message; if so, sending the message; if not, caching the message until the number of remaining tokens in the token bucket is greater than or equal to the length of the message, and then sending the message; wherein, when the message is sent, the token bucket is reduced by tokens corresponding to the data volume of the message.

[0013]

[0013] The embodiment of the present disclosure further provides a gateway device, comprising: a memory and a processor; the memory is used to store one or more computer instructions; the processor is used to execute the one or more computer instructions to execute the message rate limiting method provided in the embodiment of the present disclosure.

[0014]

[0014] The present disclosure also provides an intelligent network card, comprising: a communication module, configured to receive a message sent by a gateway device, the message carrying a target speed limit identifier; a hardware speed limit module, configured to obtain a target speed limit parameter corresponding to the target speed limit identifier from a correspondence between at least one speed limit identifier and a target speed limit parameter, and forward the message according to the target speed limit parameter.

[0015]

[0015] The embodiment of the present disclosure further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the message rate limiting method provided in the embodiment of the present disclosure.

[0016] The embodiments of the present disclosure further provide a computer program product, including: a computer program / instruction, which, when executed by a processor, can implement the message rate limiting method provided in the embodiments of the present disclosure.

[0016]

[0017] In the message speed limiting method provided by the embodiment of the present disclosure, the gateway device can provide the message and the corresponding target speed limit identifier to the smart network card according to the information exchange format agreed upon with the smart network card; the smart network card can identify the target speed limit identifier according to the information exchange format and perform speed limit control on the message. Based on this, the speed limit operation in the gateway device is offloaded to the smart network card, and then the gateway device does not need to perform the message speed limit operation when receiving the message, which reduces the resource occupation of the gateway device, so that the gateway device can use more resources to perform other functions and improve the overall performance of the gateway device. In addition, the query operation of the service speed limit information on the received message is performed by the gateway device instead of the smart network card, which can effectively reduce the development cost of the smart network card and reduce the compatibility requirements of the smart network card for service speed limit information in different formats, making the smart network card more universal. Illustrations

[0017]

[0018] The drawings described herein are intended to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are intended to explain the present disclosure and do not constitute an improper limitation of the present disclosure. In the drawings:

[0018]

[0019] FIG1 is a schematic diagram of a method for implementing message rate limiting in a gateway device;

[0019]

[0020] Figure 2 is a schematic diagram of a flow chart of a message rate limiting method executed by a gateway device according to an exemplary embodiment of the present disclosure;

[0020]

[0021] FIG3 is a schematic diagram of an information exchange format of metadata of a message provided by an exemplary embodiment of the present disclosure;

[0021]

[0022] Figure 4 is a schematic diagram of a flow chart of a message rate limiting method executed by a gateway device according to an exemplary embodiment of the present disclosure;

[0022]

[0023] FIG5 is a flow chart of a method for limiting message speed provided by another exemplary embodiment of the present disclosure when executed by a gateway device;

[0023]

[0024] FIG6 is a schematic diagram of the structure and interaction of a gateway system provided by an exemplary embodiment of the present disclosure;

[0024]

[0025] FIG7 is a schematic structural diagram of a gateway device provided by an exemplary embodiment of the present disclosure;

[0025]

[0026] FIG8 is a schematic diagram of the structure of a smart network card provided by an exemplary embodiment of the present disclosure.

[0026]

[0027] To further clarify the objectives, technical solutions, and advantages of this disclosure, the technical solutions of this disclosure will be described clearly and completely below in conjunction with specific embodiments of the disclosure and the corresponding drawings. Obviously, the described embodiments represent only a portion of the embodiments of this disclosure, and are not exhaustive. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of this disclosure without inventive effort are intended to fall within the scope of protection of this disclosure.

[0028] The terms used in the embodiments of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. As used in the embodiments of the present invention and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms. Unless the context clearly indicates otherwise, "a plurality" generally includes at least two, but does not exclude the inclusion of at least one.

[0027]

[0029] It should be understood that the term "and / or" used herein is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and A exists alone.

[0028]

[0030] It should also be noted that the terms "comprise," "include," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a product or system comprising a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such product or system. In the absence of further limitations, the phrase "comprising a..." does not preclude the presence of additional identical elements in the product or system comprising the elements.

[0029]

[0031] When a gateway device transmits a large amount of data, it requires significant resources to forward and limit traffic. As shown in Figure 1, after receiving a message, the network interface card (NIC) distributes the message to the gateway device. The gateway device uses query software running on it to query the service rate limit table and obtain the target rate limit identifier for the message. The gateway device then uses the rate limit software running on it to limit the message's rate based on the target rate limit identifier. Once the message is forwarded, the driver component forwards the message to the NIC, which then sends the message to the physical network. During this process, the query and rate limit software consume significant resources in the gateway device's CPU (central processing unit), resulting in limited resources available for operations such as protocol conversion, security and attack mitigation, firewalls, and address translation, which in turn reduces the overall performance of the gateway device.

[0030]

[0032] In one solution, the software program and service rate limit table used for traffic rate limiting on the gateway device can be offloaded to the hardware network interface card (NIC). When the NIC receives a packet, it queries the local service rate limit table to obtain the target rate limit parameters and then limits the packet based on the target rate limit parameters. However, the service rate limit table formats used in different application scenarios vary. For hardware NICs, compatibility with service rate limit tables of different formats requires complex design, resulting in poor scalability and versatility.

[0031]

[0033] In response to the above technical problems, a solution is provided in some embodiments of the present disclosure. The technical solutions provided by the embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.

[0032]

[0034] FIG2 is a flow chart of a message rate limiting method provided by an exemplary embodiment of the present disclosure. When the method is executed on a gateway device, it may include the steps shown in FIG2.

[0035] Step 201: Receive a message to be forwarded.

[0033]

[0036] Step 202: Query preset service speed limit information according to the message to obtain a target speed limit identifier corresponding to the message.

[0034]

[0037] Step 203: Provide the message and the target speed limit identifier to the smart network card according to the information exchange format agreed upon with the smart network card, so that the smart network card performs speed limit control on the message according to the target speed limit identifier.

[0035]

[0038] The message to be forwarded may be forwarded by a message forwarding device such as an intelligent network card, a switch, or a router connected to the gateway device. After receiving the message, the message forwarding device may forward the message to the gateway device according to preset routing information.

[0036]

[0039] The gateway device may query preset service speed limit information based on the message. In this embodiment, the preset service speed limit information is primarily used to describe the speed limit rules of the gateway device. In some embodiments, the preset service speed limit information may be described using a service speed limit table. The service speed limit table may describe the correspondence between message identifiers, speed limit conditions, and target speed limit identifiers. The message identifier may include at least one of the message's IP address, port number, and the physical address of the device to which the message corresponds. The speed limit condition may include at least one of a user tag, the type of network the message requests to access (e.g., public or private network), the type of service the message requests to access, and the time the message was sent. The service speed limit table may describe the target speed limit identifiers corresponding to messages with different identifiers and different speed limit conditions. For example, when a message with IP address 001 accesses the public network, the corresponding speed limit ID is 100L. For example, when a message with IP address 002 accesses service A during non-peak hours (such as 23:00-06:00), the corresponding speed limit ID is 1002.

[0037]

[0040] The gateway device can run query software that queries the preset service rate limit information based on the message's identification identifier to obtain the target rate limit identifier corresponding to the message. In some embodiments, after receiving the message, the gateway device can use the SmartNIC to perform rate limiting operations on the message to reduce resource usage of the gateway device itself. In this embodiment, the gateway device can provide the target rate limit identifier and the message to the SmartNIC.

[0038]

[0041] Optionally, when providing the message and target speed limit identifier to the smart network card, the gateway device may generate metadata information based on the target speed limit identifier and the message attributes, in accordance with the information exchange format agreed upon between the gateway device and the smart network card. The message attributes may include at least one of: whether the message's speed limit control is effective, the message length, the number of speed limit IDs corresponding to the message, and a version number. The version number refers to the version of the executable program running in the smart network card. As the functionality of the smart network card evolves, the executable program in the smart network card may be continuously updated. The gateway device may specify the version of the executable program in the smart gateway used to process the message in the metadata information. A single message may correspond to multiple speed limit IDs, allowing for multi-level speed limit operations to be performed on the message.

[0042] The information exchange format agreed upon by the gateway device and the SmartNIC is used to define the field organization and meaning of different fields in the metadata, so that the SmartNIC can understand the structured information in the metadata, thereby ensuring compatibility and interoperability between the gateway device and the SmartNIC.

[0039]

[0043] Figure 3 illustrates one implementation of the information exchange format. As shown in Figure 3, the information exchange format can specify the organization of the ID field, num field, Ver field, pkt length field, and meter_id field, as well as the number of bytes each field occupies. The ID field indicates whether metadata is valid. If rate limiting is required for a message, the ID field can be set to a specified value. Ver specifies the version number. The num field specifies the number of rate limit IDs. The pkt length field specifies the message length. The meter_id field specifies the rate limit ID and can be extended to specify multiple rate limit IDs.

[0040]

[0044] After generating metadata information, the gateway device may send the message and metadata information to the smart network card. In some optional embodiments, the gateway device may add the generated metadata information to the end or header of the message, or may add the metadata information to a designated field in the message, which is not limited in this embodiment.

[0041]

[0045] The smart network card is a device connected to a gateway device and used to forward messages sent from the gateway device. Furthermore, the smart network card can control the forwarding rate of the message according to the target rate limit parameter corresponding to the target rate limit identifier.

[0042]

[0046] In this implementation, the rate limiting operation in the gateway device is offloaded to the SmartNIC. Consequently, the gateway device does not need to perform rate limiting operations on received messages. This reduces gateway device resource usage, freeing up more resources for other functions and improving overall gateway performance. Furthermore, having the gateway device, rather than the SmartNIC, perform service rate limit information queries on received messages effectively reduces SmartNIC development costs and lowers the SmartNIC's compatibility requirements for service rate limit information in different formats, making the SmartNIC more versatile.

[0043]

[0047] In some optional embodiments, the gateway device may also be configured to obtain dynamically updated rate limit configuration data. Optionally, in this approach, the gateway device may obtain externally provided rate limit configuration data. This externally provided configuration data may be obtained from a designated network service via the SmartNIC, or manually imported into the gateway device by a user, without limitation in this embodiment. Optionally, if the rate limit configuration data includes updated rate limit rules, the gateway device may update the service rate limit information in the network card based on the rate limit rules in the rate limit configuration data. Optionally, if the rate limit configuration data includes an updated correspondence between at least one rate limit identifier and a rate limit parameter, the gateway device may send the correspondence between at least one rate limit identifier and a rate limit parameter in the rate limit configuration data to the SmartNIC.

[0044]

[0048] The target rate limit parameters may include the committed burst size (CBS) and committed information rate (CIR). The CBS indicates the maximum amount of data that the network can tolerate under burst conditions, measured in kbit / s. The committed information rate (CIR) refers to the information transmission rate under normal conditions on a specific virtual circuit reserved by the network, measured in kbit / s.

[0045]

[0049] Based on this implementation, the gateway device can dynamically obtain speed limit configuration data, thereby flexibly meeting speed limit requirements in different application scenarios.

[0046]

[0050] In some optional embodiments, the gateway device may determine whether to transfer the rate limiting operation to the Smart NIC based on its own resource availability. Optionally, before adding the target rate limit identifier to the message, the gateway device may calculate the gateway device's resource utilization. The resource utilization may be calculated based on a weighted calculation of at least one of the gateway device's CPU utilization, memory utilization, disk utilization, resource utilization, and packet loss rate. Optionally, if the gateway device's resource utilization is greater than a set threshold, the Smart NIC may be determined to perform rate limiting control on the message, and the message and target rate limit identifier may be provided to the Smart NIC. The set threshold may be an empirical value, such as 80%, 85%, or 90%, or another optional threshold.

[0047]

[0051] In some optional embodiments, if the resource utilization rate of the gateway device is less than or equal to the set threshold, the gateway device may obtain the target rate limit parameter corresponding to the target rate limit identifier from the service rate limit information and control the message forwarding rate based on the target rate limit parameter. The forwarding rate describes the amount of message data forwarded by the gateway device per unit time. In other words, when resources are relatively idle, the gateway device does not need to hand over the rate limit operation to the smart network interface card (INIC). Instead, the gateway device can use the locally running rate limit program to perform the message rate limit operation.

[0048]

[0052] In this implementation, the gateway device can flexibly choose to execute message rate limiting locally or by having the SmartNIC perform the rate limiting operation based on its own resource availability. Specifically, during peak traffic periods, the gateway device can process rate limiting operations for a portion of messages when resource utilization is low. If the rate limiting operation for these messages causes the resource utilization to exceed a set threshold, the gateway device can offload the rate limiting operation for subsequent messages to the SmartNIC. This allows the gateway device and the SmartNIC to share the load pressure generated by the rate limiting operation, ensuring good performance for both the network card and the gateway device.

[0049]

[0053] In addition to the aforementioned embodiments, the present disclosure also provides a method for limiting the message rate performed by a smart network card, which will be described below with reference to the accompanying drawings.

[0050]

[0054] FIG4 is a flow chart of a method for limiting packet rate provided by another exemplary embodiment of the present disclosure. When the method is executed by a smart network card, the method may include the steps shown in FIG4.

[0051]

[0055] Step 401: Receive a message sent by a gateway device, where the message carries data to be identified.

[0052]

[0056] Step 402: Parse the data to be identified according to the information exchange format agreed upon with the gateway device to obtain a target speed limit identifier corresponding to the message.

[0053]

[0057] Step 403: From the correspondence between at least one speed limit identifier and the target speed limit parameter, obtain the target speed limit parameter corresponding to the target speed limit identifier.

[0054]

[0058] Step 404: Forward the message according to the target rate limit parameter.

[0055]

[0059] In this embodiment, a Smart NIC refers to a network card that includes a programmable chip. For example, in some embodiments, the Smart NIC may include at least one of a programmable logic controller (PLC), a single-chip microcomputer, a field programmable gate array (FPGA), a digital signal processor (DSP), a single-chip microcomputer, and an advanced RISC machine (ARM). By programming the programmable chip in the Smart NIC, rate limiting operations originally performed by the gateway device can be offloaded to the Smart NIC.

[0056]

[0060] The Smart NIC is connected to a gateway device, receives messages forwarded by the gateway device, and forwards the messages to a target device in the physical network. In this embodiment, the message carries data to be identified. This data can be located in the message header or footer, or in other agreed-upon fields. The Smart NIC parses this data according to the information exchange format agreed upon with the gateway device to obtain the target speed limit identifier corresponding to the message.

[0057]

[0061] In some optional embodiments, the data to be identified is located in the message header. This message header uses an information exchange format agreed upon by the gateway device and the SmartNIC to store metadata information required for communication between the gateway device and the SmartNIC. This metadata information includes a target speed limit identifier. The format and field descriptions of the metadata information are shown in FIG3 and are not further described here. The SmartNIC can parse the metadata information according to the information exchange format to obtain the target speed limit identifier. In addition to the target speed limit identifier, the SmartNIC can also parse the metadata information to obtain information such as the number of speed limit identifiers, the message length, and the version number.

[0058]

[0062] The target rate limit identifier is determined by the gateway device by querying preset service rate limit information and added to the message. For details, please refer to the description of the preceding embodiment. Based on the rate limit identifier, the smart network card can perform rate limiting operations on the message during message forwarding. The smart network card pre-stores a correspondence between at least one rate limit identifier and a rate limit parameter. This correspondence can be issued by the gateway device or obtained by the smart network card from a designated service in the network. For example, in some optional embodiments, before obtaining the target rate limit parameter corresponding to the target rate limit identifier from the correspondence between the at least one rate limit identifier and the target rate limit parameter, the smart network card can receive the correspondence between the at least one rate limit identifier and the target rate limit parameter from the gateway device. The correspondence between the at least one rate limit identifier and the rate limit parameter can be obtained by the gateway device from externally provided rate limit configuration data. For details, please refer to the description of the preceding embodiment. In this embodiment, the target rate limit parameter may include a committed burst size and a committed information rate.

[0063] The smart network card may obtain, from the correspondence between the at least one speed limit identifier and the target speed limit parameter, a speed limit parameter corresponding to the target speed limit identifier as the target speed limit parameter. After obtaining the target speed limit parameter, the smart network card may perform a speed limit control operation on the message according to the target speed limit parameter.

[0059]

[0064] In some optional embodiments, when forwarding packets according to the target rate limit parameters, the SmartNIC uses a fixed window to control the forwarding rate of the corresponding packets. In this embodiment, the SmartNIC may set a fixed time window and a maximum data volume to be sent within the time window. This maximum data volume is determined based on the length of the time window and the committed information rate. When a packet arrives, if the amount of data sent within the time window at the time of the packet's arrival is equal to or greater than the maximum data volume, the SmartNIC may add the packet to a waiting queue and wait for the next time window. Within each time window, packets with a data volume less than or equal to the maximum data volume corresponding to the time window may be removed from the waiting queue and forwarded.

[0060]

[0065] In other optional embodiments, when forwarding packets according to the target rate limit parameters, the Smart NIC may employ a token bucket algorithm to control the forwarding rate corresponding to the packet. The Smart NIC may determine a token bucket whose capacity corresponds to the committed burst size (CBS) in the target rate limit parameters. The Smart NIC may add tokens to the token bucket based on the committed information rate (CIR) corresponding to the target rate limit identifier. When a packet is sent, the token bucket is decremented by a number of tokens corresponding to the packet's data volume. In this embodiment, one token may correspond to one byte of data. That is, the Smart NIC consumes one token from the token bucket for each byte of data forwarded. Based on this, when a packet arrives, the Smart NIC may determine whether the number of remaining tokens in the token bucket is greater than or equal to the packet length. If the number of remaining tokens in the token bucket is greater than or equal to the packet length, the Smart NIC may send the packet. If the number of remaining tokens in the token bucket is less than the length of the message, the smart network card may cache the message until the number of remaining tokens in the token bucket is greater than or equal to the length of the message and then send the message.

[0061]

[0066] The following description uses an FPGA-based Smart NIC as an example. An FPGA-based Smart NIC may include a hardware rate limiting module as shown in Figure 5. The hardware rate limiting module includes a token generator, a token bucket, and a message controller. The token generator can be implemented based on a timer or counter in the FPGA. The token generator generates tokens at a fixed frequency based on an input clock signal and places the tokens into a token bucket. The fixed frequency corresponds to the committed information rate (CIR) in the rate limiting parameters. For example, if the token generator is implemented as a counter, a token is generated when the counter reaches a specific value corresponding to the CIR. After the generated token is added to the token bucket, the counter is reset and continues counting until the counter reaches the specific value, generating the next token. In the Smart NIC, the token bucket can be implemented based on a data table in the static random access memory (SRAM) in the FPGA. The token bucket corresponding to any rate limit identifier stores tokens generated for that rate limit identifier based on the data table. The total number of tokens corresponding to that rate limit identifier is limited based on the CIR associated with the rate limit identifier to prevent the upper limit from being exceeded. The message controller can be implemented using programmable logic units within an FPGA. It primarily detects the length of incoming messages and controls the transmission of message packets based on the number of tokens. When a packet is ready to be sent, the message controller checks whether there are sufficient tokens in the token bucket. If sufficient tokens are present, the packet is forwarded and the corresponding number of tokens is decremented from the token bucket. If insufficient tokens are present, the packet is blocked or discarded until more tokens are generated.

[0062]

[0067] In this implementation, the Smart NIC can determine the target rate limit parameter corresponding to the target rate limit identifier carried in the message and perform message flow control based on the target rate limit parameter. This effectively reduces the load on the gateway device. Furthermore, the Smart NIC does not need to query service rate limit information. When the service rate limit information is implemented as a service rate limit table, the Smart NIC does not need to be compatible with service rate limit tables in different formats. This reduces the development cost of the Smart NIC and lowers the compatibility requirements for service rate limit information in different formats, making the Smart NIC more versatile.

[0063]

[0068] The above-mentioned embodiments of the present disclosure will be further illustrated below with reference to FIG6 . FIG6 is a schematic diagram of a gateway processing system provided by an exemplary embodiment of the present disclosure. As shown in FIG6 , the gateway processing system includes a gateway device and an FPGA network card. As shown in FIG6 , the FPGA network card can perform packet receiving and distribution operations, namely, receiving externally transmitted messages and forwarding them to the gateway device. The gateway device can query service rate limit information to obtain the rate limit ID corresponding to the message and write the rate limit ID into the message. The driver component in the gateway device can then forward the message to the FPGA network card. As shown in FIG6 , the functionality of the software rate limit module in the gateway device is offloaded to the hardware rate limit module in the FPGA network card. Furthermore, the FPGA network card can obtain the rate limit ID from the message and perform hardware rate limit operations. As shown in FIG6 , the gateway device further includes a speed limit configuration module, which is used to obtain speed limit configuration data, update the service speed limit information in the gateway device according to the speed limit configuration data, and send the correspondence between the speed limit identifier and the speed limit parameter in the speed limit configuration data to the hardware speed limit module in the FPGA network card.

[0064]

[0069] Based on the gateway processing system shown in Figure 6, the rate limiting operation in the gateway device is offloaded to the smart network card. As a result, the gateway device does not need to perform rate limiting operations on received messages, which reduces the resource usage of the gateway device. As a result, the gateway device can use more resources to perform other functions, improving the overall performance of the gateway device.

[0065]

[0070] It should be noted that the execution entity of each step of the method provided in the above embodiment may be the same device, or the method may be executed by different devices. For example, the execution entity of steps 401 to 403 may be device A; for another example, the execution entity of steps 401 and 402 may be device A, and the execution entity of step 403 may be device B; and so on.

[0066]

[0071] In addition, some processes described in the above embodiments and accompanying drawings include multiple operations that appear in a specific order. However, it should be understood that these operations may be executed in a different order than the order in which they appear herein or in parallel. Operation sequence numbers, such as 401 and 402, are merely used to distinguish between different operations and do not represent any specific execution order. Furthermore, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that terms such as "first" and "second" are used herein to distinguish between different messages, devices, modules, and the like, and do not represent a sequential order or limit "first" and "second" to different types.

[0067]

[0072] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0068]

[0073] FIG7 illustrates a schematic diagram of the structure of a gateway device provided in an exemplary embodiment of the present disclosure. This gateway device is applicable to the message rate limiting method provided in the aforementioned embodiment. As shown in FIG7 , the gateway device includes a memory 701, a processor 702, and a communication component 703.

[0069]

[0074] The memory 701 is used to store computer programs and can be configured to store various other data to support operations on the gateway device. Examples of such data include instructions for any application program or method operating on the gateway device.

[0070]

[0075] The processor 702 is coupled to the memory 701 and is configured to execute a computer program in the memory 701 to: control the communication component 703 to receive a message to be forwarded; query preset service rate limit information based on the message to obtain a target rate limit identifier corresponding to the message; and control the communication component 703 to provide the message and the target rate limit identifier to the smart network card according to an information exchange format agreed upon with the smart network card, so that the smart network card performs rate limit control on the message based on the target rate limit identifier.

[0071]

[0076] Optionally, when providing the message and the target speed limit identifier to the smart network card according to the information exchange format agreed upon with the smart network card, the processor 702 is specifically configured to: generate metadata information according to the target speed limit identifier and attributes of the message and in accordance with the information exchange format agreed upon between the gateway device and the smart network card; add the metadata information to a header of the message, and send the message with the added metadata to the smart network card.

[0072]

[0077] Optionally, the processor 702 is further configured to: obtain externally provided speed limit configuration data; update the preset service speed limit information according to the speed limit rule in the speed limit configuration data; and / or send a correspondence between at least one speed limit identifier and a speed limit parameter in the speed limit configuration data to the smart network card; wherein the speed limit parameters corresponding to any speed limit identifier include: a committed burst size and a committed information rate.

[0073]

[0078] Optionally, before adding the target speed limit identifier to the message, the processor 702 is further configured to: calculate the resource occupancy rate of the gateway device; if the resource occupancy rate of the gateway device is greater than a set threshold, determine that the smart network card performs a speed limit control operation on the message, and provide the message and the target speed limit identifier to the smart network card.

[0074]

[0079] Optionally, the processor 702 is further configured to: if the resource occupancy rate of the gateway device is less than or equal to the set threshold, obtain a target speed limit parameter corresponding to the target speed limit identifier from the service speed limit information; and control the forwarding rate of the message according to the target speed limit parameter.

[0075]

[0080] Furthermore, as shown in FIG7 , the gateway device further includes other components such as a power supply component 704. FIG7 schematically illustrates only some components, which does not mean that the gateway device only includes the components shown in FIG7 .

[0076]

[0081] The memory 701 may be implemented by any type of volatile or non-volatile memory device or a combination thereof, such as static random-access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.

[0077]

[0082] The communication component 703 is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as Wi-Fi (wireless network communication technology), 2G (such as Global System for Mobile Communications (GSM), etc.), 3G (such as Wideband Code Division Multiple Access (WCDMA), 4G

[0078] (such as Long Term Evolution (LTE), etc.), 4G+ (such as upgraded Long Term Evolution (LTE-Advanced, LTE-A), etc.) or 5G (fifth generation mobile communication technology), or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component can be implemented based on near field communication (NFC) technology, radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra wide band (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0079]

[0083] The power supply component 704 is configured to provide power to various components of the device where the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device where the power supply component is located.

[0080]

[0084] In this embodiment, the rate limiting operation in the gateway device is offloaded to the smart network card. Therefore, when the gateway device receives a message, it does not need to perform the rate limiting operation on the message. This reduces the resource usage of the gateway device, allowing the gateway device to use more resources to perform other functions, thereby improving the overall performance of the gateway device.

[0081]

[0085] Accordingly, an embodiment of the present disclosure further provides a computer-readable storage medium storing a computer program, which, when executed, can implement the steps that can be performed by the gateway device in the above method embodiment.

[0082]

[0086] Accordingly, an embodiment of the present disclosure further provides a computer program product, including: a computer program / instruction, which, when executed by a processor, can implement the steps that can be executed by the gateway device in the above embodiment.

[0083]

[0087] FIG8 illustrates a schematic structural diagram of a smart network card provided by an exemplary embodiment of the present disclosure. As shown in FIG8 , the smart network card includes the following modules.

[0084]

[0088] The communication module 801 is configured to receive a message sent by a gateway device, the message carrying data to be identified; parse the data to be identified according to an information exchange format agreed upon with the gateway device, and obtain a target speed limit identifier corresponding to the message.

[0085]

[0089] The hardware speed limit module 802 is configured to obtain a target speed limit parameter corresponding to the target speed limit identifier from a correspondence between at least one speed limit identifier and a target speed limit parameter, and forward the message according to the target speed limit parameter.

[0086]

[0090] Optionally, before the hardware speed limit module 802 obtains the target speed limit parameter corresponding to the target speed limit identifier from the correspondence between the at least one speed limit identifier and the target speed limit parameter, the communication module 801 is further configured to: receive the correspondence between the at least one speed limit identifier and the target speed limit parameter sent by the gateway, where the target speed limit parameter includes: a committed burst size and a committed information rate.

[0087]

[0091] Optionally, the hardware rate limiting module 802 includes: a token generator 803, a token bucket 804 and a message controller 805.

[0088]

[0092] The token generator 803 may include a counter or a timer. The token bucket 804 may include a memory, such as a table in a static random access memory. The message controller 805 may include a programmable logic unit and execution logic running therein.

[0089]

[0093] Optionally, when the hardware rate limiting module 802 forwards the message according to the target rate limiting parameter, the above components are respectively configured to perform the following operations:

[0090]

[0094] Token bucket 804 is used to provide token storage space. The capacity of token bucket 804 corresponds to the committed burst size in the target rate limit parameter. Token generator 803 is used to add tokens to token bucket 804 based on the committed information rate in the target rate limit identifier. Message controller 805 is used to determine whether the number of remaining tokens in token bucket 804 is greater than or equal to the message length. If so, the message is sent. If not, the message is buffered until the number of remaining tokens in token bucket 804 is greater than or equal to the message length, at which point the message is sent. When the message is sent, token bucket 804 is decremented by an amount corresponding to the message data size.

[0091]

[0095] In this embodiment, the Smart NIC can determine the target rate limit parameter corresponding to the target rate limit identifier based on the target rate limit identifier carried in the message, and perform message flow control based on the target rate limit parameter. This effectively reduces the load on the gateway device. Furthermore, the Smart NIC does not need to query service rate limit information. When the service rate limit information is implemented as a service rate limit table, the Smart NIC does not need to be compatible with service rate limit tables in different formats. This reduces the development cost of the Smart NIC and lowers the compatibility requirements for service rate limit information in different formats, making the Smart NIC more versatile.

[0092]

[0096] Accordingly, an embodiment of the present disclosure further provides a computer-readable storage medium storing a computer program. When the computer program is executed, the steps that can be performed by the smart network card in the above method embodiment can be implemented.

[0093]

[0097] Accordingly, an embodiment of the present disclosure further provides a computer program product, including: a computer program / instruction, which, when executed by a processor, can implement the steps that can be performed by the smart network card in the above embodiment.

[0094]

[0098] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM (Compact Disc Read-Only Memory), optical storage, etc.) containing computer-usable program code.

[0095]

[0099] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process flow and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, 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 produce a machine, such that execution of the instructions by the processor of the computer or other programmable data processing device produces means for implementing the functions specified in one or more processes in the flowcharts and / or one or more blocks in the block diagrams.

[0096]

[0100] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0097]

[0101] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operating 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 steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0098]

[0102] In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), input / output interfaces, network interfaces, and memory.

[0099]

[0103] Memory may include non-permanent storage in a computer-readable medium in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0100]

[0104] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can be implemented using any method or technology to store information. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, Parallel Random Access Machine (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read-Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technologies, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.

[0101]

[0105] It should also be noted that the terms "comprise," "include," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, product, or apparatus comprising a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, product, or apparatus. In the absence of further limitations, the phrase "comprising a..." does not preclude the presence of additional identical elements in the process, method, product, or apparatus comprising the elements.

[0102]

[0106] The foregoing description is merely an example of the present disclosure and is not intended to limit the present disclosure. Persons skilled in the art will readily appreciate that various modifications and variations are possible with the present disclosure. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present disclosure are intended to be encompassed by the claims of the present disclosure.

Claims

Claims 1. A message rate limiting method, applicable to a gateway device, comprising: receiving a message to be forwarded; querying preset service rate limit information based on the message to obtain a target rate limit identifier corresponding to the message; and providing the message and the target rate limit identifier to the smart network card according to an information exchange format agreed upon with the smart network card, so that the smart network card performs rate limit control on the message based on the target rate limit identifier.

2. The method according to claim 1, wherein: Providing the message and the target speed limit identifier to the smart network card according to an information exchange format agreed upon with the smart network card includes: generating metadata information according to the target speed limit identifier and attributes of the message in accordance with the information exchange format; adding the metadata information to a header of the message, and sending the message with the added metadata information to the smart network card.

3. The method according to claim 1, further comprising: Obtain externally provided rate limit configuration data; updating the preset service speed limit information according to the speed limit rules in the speed limit configuration data; And / or, sending a correspondence between at least one speed limit identifier and a speed limit parameter in the speed limit configuration data to the smart network card; wherein the speed limit parameters corresponding to any speed limit identifier include: a committed burst size and a committed information rate.

4. The method according to any one of claims 1 to 3, wherein: Before adding the target speed limit identifier to the message, the method further includes: calculating the resource occupancy rate of the gateway device; if the resource occupancy rate of the gateway device is greater than a set threshold, determining that the smart network card performs a speed limit control operation on the message, and providing the message and the target speed limit identifier to the smart network card.

5. The method according to claim 4, further comprising: If the resource occupancy rate of the gateway device is less than or equal to the set threshold, obtaining a target speed limit parameter corresponding to the target speed limit identifier from the service speed limit information; and controlling the forwarding rate of the message according to the target speed limit parameter.

6. A message rate limiting method, applicable to a smart network card, comprising: receiving a message sent by a gateway device, wherein the message carries data to be identified; Parsing the data to be identified according to the information exchange format agreed upon with the gateway device to obtain a target speed limit identifier corresponding to the message; Obtaining a target speed limit parameter corresponding to the target speed limit identifier from a correspondence between at least one speed limit identifier and a target speed limit parameter; and forwarding the message according to the target speed limit parameter.

7. The method according to claim 6, wherein: Before obtaining the target speed limit parameter corresponding to the target speed limit identifier from the correspondence between the at least one speed limit identifier and the target speed limit parameter, the method further includes: receiving the correspondence between the at least one speed limit identifier and the target speed limit parameter sent by the gateway, where the target speed limit parameter includes a committed burst size and a committed information rate.

8. The method according to claim 7, wherein: Forwarding the message according to the target rate limit parameter includes: determining a token bucket, where the capacity of the token bucket corresponds to the committed burst size in the target rate limit parameter; placing tokens into the token bucket according to the committed information rate in the target rate limit identifier; and determining whether the number of remaining tokens in the token bucket is greater than or equal to the length of the message; If yes, the message is sent; if no, the message is cached until the number of remaining tokens in the token bucket is greater than or equal to the length of the message, and then the message is sent; When the message is sent, the token bucket is reduced by a number of tokens corresponding to the data volume of the message.

9. A gateway device, comprising: A memory and a processor; wherein the memory is used to store one or more computer instructions; and the processor is used to execute the one or more computer instructions to: execute the steps in the method according to any one of claims 1 to 5.

10. Smart network cards, including: a communication module, configured to receive a message sent by a gateway device, the message carrying a target speed limit identifier; The hardware speed limit module is configured to obtain a target speed limit parameter corresponding to the target speed limit identifier from a correspondence between at least one speed limit identifier and a target speed limit parameter, and forward the message according to the target speed limit parameter.

11. A computer-readable storage medium storing a computer program, wherein: When the computer program is executed by a processor, the message rate limiting method according to any one of claims 1 to 8 can be implemented.

12. A computer program product comprising: Computer program / instruction, wherein, when the computer program / instruction is executed by a processor, it can implement the message rate limiting method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Virtual machine flow rate limiting method and device, electronic equipment and storage medium

    CN114465956A

  • Control method and device and computing equipment

    CN115190077A

  • Flow rate limiting method based on priority, and DPU message forwarding method and device

    CN115766592A