A message rate limiting method, a rate limiting parameter optimization method, a device, an apparatus, and a medium
By acquiring a set of rate limiting parameters adapted to network devices, identifying operating scenarios based on protocol message rates, and dynamically adjusting rate limiting parameters, the problem of fixed rate limiting parameters being unable to adapt to different scenarios is solved, achieving efficient resource utilization and stable operation of network devices.
Patent Information
- Application Number
- CN202611445030.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-17
- Publication Date
- 2026-11-27
AI Technical Summary
When faced with protocol packet traffic of different performance levels and operating scenarios, the fixed rate limiting parameters of existing network devices cannot adapt, resulting in uneven CPU utilization, which may lead to equipment failure or waste of resources.
By acquiring a set of rate limiting parameters adapted to network devices, the current operating scenario is identified based on the rate of protocol packets, and the rate limiting parameters are dynamically adjusted to adapt to different scenarios, including normal and abnormal operating scenarios, and dynamically adjusted in combination with CPU utilization and packet loss rate.
It improves the adaptability of rate limiting policies to the actual operating scenarios of network devices, reduces the impact of abnormal protocol messages on the control plane, protects CPU resources, and avoids device failures and resource waste.
Smart Images

Figure CN123185149A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network communication technology, and in particular to a message rate limiting method, a rate limiting parameter optimization method, an apparatus, a device, and a medium. Background Technology
[0002] Currently, mainstream network devices (such as routers) are mainly divided into two categories based on the deployment method of their control and forwarding functions: centralized architecture and distributed architecture. A centralized architecture contains only one main control board, whose CPU integrates both control and forwarding cores. A distributed architecture contains one main control board and multiple line cards; the control plane is handled by a dedicated control CPU on the main control board, while the forwarding plane is implemented locally on each line card. Regardless of the architecture, packets must be identified and classified by the forwarding plane before being sent to the control plane for processing, and a unified rate-limiting point exists along this transmission path. When a device suffers a protocol-based attack targeting the control plane or experiences an abnormal surge in protocol packets, a large number of packets are sent to the control plane, causing a spike in CPU utilization and leading to serious failures such as routing oscillations, frequent interruptions in neighbor relationships, and management disconnection.
[0003] Currently, to address the aforementioned issues, a common approach is to set fixed rate thresholds for different types of packets at the control plane ingress for rate limiting protection. However, this static rate limiting scheme has inherent drawbacks: on the one hand, the same rate limiting parameter cannot adapt to routers with different performance levels; high-performance devices experience low CPU utilization leading to idle resources, while low-performance devices suffer severe overload or even failure; on the other hand, network devices may face different packet traffic conditions during operation, and fixed rate limiting parameters are difficult to adapt to the rate limiting requirements of network devices in different operating scenarios.
[0004] In summary, determining the appropriate rate limiting parameters for current network devices, and ensuring that these parameters can adapt to the rate limiting requirements of network devices in different operating scenarios, is a problem that needs to be solved. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide a packet rate limiting method, a rate limiting parameter optimization method, an apparatus, a device, and a medium, capable of determining rate limiting parameters adapted to the current network equipment, so that the rate limiting parameters can adapt to the rate limiting requirements of the network equipment under different operating scenarios. The specific solution is as follows: In a first aspect, this application discloses a message rate limiting method applied to network devices, comprising: Obtain a set of speed limit parameters that are suitable for itself; wherein, the set of speed limit parameters includes speed limit parameters corresponding to different operating scenarios; The message rate of the protocol messages entering the control plane is obtained, the current operating scenario is determined from the different operating scenarios based on the message rate, and the target speed limit parameter corresponding to the current operating scenario is determined from the speed limit parameter set. The protocol messages entering the control plane are rate-limited based on the target rate-limiting parameters.
[0006] Optionally, the operating scenario includes a normal operating scenario and at least one abnormal operating scenario, wherein the speed limit parameter corresponding to the normal operating scenario is lower than the speed limit parameter corresponding to the abnormal operating scenario, and the speed limit parameter includes speed limit values corresponding to different protocol types respectively; Determining the current operating scenario from the different operating scenarios based on the message rate includes: The message rate of protocol messages of different protocol types is compared with the rate limit value corresponding to the corresponding protocol type in the at least one abnormal operation scenario. If the message rate of each protocol message does not reach the rate limit value corresponding to the corresponding protocol type in any abnormal operation scenario, then the current operation scenario is determined to be the normal operation scenario. If the message rate of at least one protocol type reaches the rate limit value corresponding to the corresponding protocol type in the at least one abnormal operation scenario, then the current operation scenario is determined from the at least one abnormal operation scenario based on the matching relationship between the message rate of different protocol types and the rate limit value corresponding to each of the abnormal operation scenarios.
[0007] Optionally, the at least one abnormal operation scenario includes a single-protocol abnormal operation scenario and a multi-protocol abnormal operation scenario; The step of determining the current operating scenario from the at least one abnormal operating scenario based on the matching relationship between the message rate of different protocol types and the rate limit value corresponding to each of the abnormal operating scenarios includes: If the message rates of at least two protocol types reach the rate limit value of the corresponding protocol type in the same multi-protocol abnormal operation scenario, then the current operation scenario is determined to be the multi-protocol abnormal operation scenario. If only one protocol type's message rate reaches the rate limit value of the corresponding single-protocol abnormal operation scenario, then the current operation scenario is determined to be the single-protocol abnormal operation scenario.
[0008] Optionally, the message rate limiting method further includes: When the current operating scenario is an abnormal operating scenario, obtain the message rate of the abnormal protocol message corresponding to the abnormal operating scenario; When the message rate of the abnormal protocol message is continuously lower than the rate limit value corresponding to the abnormal operation scenario, the current operation scenario is switched from the abnormal operation scenario to the normal operation scenario, so as to limit the rate of the protocol messages entering the control plane based on the rate limit parameter corresponding to the normal operation scenario.
[0009] Optionally, after limiting the rate of protocol messages entering the control plane based on the target rate limiting parameter, the method further includes: The system acquires first operational feedback information during the speed limiting process and dynamically adjusts the target speed limiting parameters based on the first operational feedback information, so as to limit the speed of protocol messages entering the control plane based on the adjusted speed limiting parameters.
[0010] Optionally, the first operational feedback information includes the CPU utilization of the network device and the packet loss rate of the protocol messages; The step of dynamically adjusting the target speed limit parameter based on the first operational feedback information includes: When the current operating scenario is the normal operating scenario, a target protocol type that meets the preset dynamic adjustment conditions is determined; wherein, the preset dynamic adjustment conditions include: the packet rate of the protocol message of the target protocol type is continuously higher than the current rate limit value corresponding to the normal operating scenario and continuously lower than the rate limit value in the abnormal operating scenario, the CPU utilization is lower than the preset CPU utilization threshold, and the packet loss rate of the protocol message of the target protocol type is lower than the first preset packet loss rate threshold. The speed limit value corresponding to the target protocol type is increased by a preset step size.
[0011] Optionally, the message rate limiting method further includes: Determine the rate difference between the message rate of the protocol message of the target protocol type and the current rate limit value; The preset step size is determined based on the rate difference and the preset adjustment coefficient.
[0012] Optionally, after increasing the rate limit value corresponding to the target protocol type by a preset step size, the method further includes: Obtain the CPU utilization and packet loss rate of protocol packets of the target protocol type when rate limiting is performed based on the improved rate limiting value; If the CPU utilization exceeds the preset CPU utilization threshold, or the packet loss rate of the protocol message of the target protocol type exceeds the second preset packet loss rate threshold, then the fallback rate limit value is determined based on the average of the rate limit value before the increase and the rate limit value after the increase. Adjust the speed limit value corresponding to the target protocol type to the fallback speed limit value.
[0013] Optionally, the message rate limiting method further includes: If the CPU utilization rate remains higher than the preset abnormal CPU threshold for a preset duration, the currently used rate limiting parameter will be switched to a guaranteed rate limiting parameter that is compatible with itself, and the protocol messages entering the control plane will be rate limited based on the guaranteed rate limiting parameter.
[0014] Secondly, this application discloses a rate limiting parameter optimization method applied to a control terminal, used to obtain a rate limiting parameter set adapted to the network device in the aforementioned disclosed message rate limiting method, the rate limiting parameter optimization method comprising: Obtain packet characteristic data of the network environment in which the network device is to be deployed; Traffic generation rules are constructed based on the packet feature data to generate basic test packet flows for reproducing the network environment; For each of the different operating scenarios, a corresponding scenario test message stream is generated based on the basic test message stream. Configure the network device using preset initial candidate rate limiting parameters, and control the tester to input the scenario test packet stream into the network device to obtain the second operational feedback information when the network device processes the scenario test packet stream; Based on the initial candidate rate limiting parameters and the corresponding second operational feedback information, an iterative search is performed using Bayesian optimization within the target search space to obtain rate limiting parameters corresponding to different operational scenarios, thereby forming a rate limiting parameter set adapted to the network device.
[0015] Optionally, the different operating scenarios include normal operation scenarios, single-protocol abnormal operation scenarios, and multi-protocol abnormal operation scenarios; For each of the different operating scenarios, generating a corresponding scenario test message stream based on the basic test message stream includes: For the aforementioned normal operation scenario, the basic test message stream is determined as the scenario test message stream; For the single-protocol abnormal operation scenario, a protocol message of an abnormal protocol type is superimposed on the basic test message stream to control the tester to generate the corresponding scenario test message stream; For the aforementioned multi-protocol abnormal operation scenario, protocol messages of at least two abnormal protocol types are superimposed on the basic test message stream to control the tester to generate the corresponding scenario test message stream.
[0016] Optionally, obtaining the packet characteristic data of the network environment to which the network device is to be deployed includes: Obtain packet sample data of the network environment to be deployed on the network device; Extract at least one of the following message feature data from the message sample data: message timestamp offset, source MAC address, destination MAC address, source IP address, destination IP address, port number, protocol type, protocol field information, message length, burstiness identifier, and protocol interaction timing characteristics.
[0017] Optionally, before configuring the network device using preset initial candidate rate limiting parameters, the method further includes: Gradually increase the packet rate of the test packets input to the network device, and obtain the CPU utilization rate of the network device accordingly; When the CPU utilization reaches a preset CPU utilization threshold, the packet processing rate of the network device for protocol messages entering the control plane is obtained, and the packet processing rate is determined as the upper limit of the processing rate. Based on the processing rate upper limit, the range of rate limit values corresponding to different protocol types is determined to construct the target search space.
[0018] Optionally, the iterative search using Bayesian optimization within the target search space further includes: If the sum of the candidate rate limit values corresponding to different protocol types in the target candidate rate limit parameters is greater than the processing rate upper limit, then a penalty is imposed on the target candidate rate limit parameter to reduce the probability of the target candidate rate limit parameter being selected in subsequent iterative search processes.
[0019] Optionally, based on the initial candidate speed limit parameters and the corresponding second operational feedback information, the iterative search within the target search space using Bayesian optimization to obtain speed limit parameters corresponding to the different operational scenarios includes: Multiple sets of initial candidate speed limit parameters and corresponding second running feedback information are stored in the training dataset, and a proxy model is constructed based on the training dataset. Based on the proxy model and the preset acquisition function, new candidate speed limit parameters are generated in the target search space; Configure the network device using the new candidate rate limiting parameters, and input the scenario test packet stream corresponding to the running scenario into the network device to obtain the second running feedback information corresponding to the new candidate rate limiting parameters, and update the training dataset. The proxy model is updated using the updated training dataset, and then the process jumps back to the step of generating new candidate speed limit parameters in the target search space based on the proxy model and the preset acquisition function, until the preset iteration termination condition is met, and the speed limit parameters for the corresponding running scenario are determined based on the iteration search results.
[0020] Optionally, the second operational feedback information includes the CPU utilization of the network device and the packet loss rate of protocol messages of different protocol types; Before constructing the proxy model based on the training dataset, the process also includes: Based on the initial candidate rate limiting parameters, the CPU utilization of the network device, and the packet loss rate of protocol packets of different protocol types, the loss value is calculated using a preset loss function. The initial candidate rate limiting parameters and their corresponding loss values are associated and stored in the training dataset.
[0021] Optionally, the preset iteration termination condition includes: During the iterative search process of a preset number of consecutive iterations, the rate of change between the optimal loss values obtained from two adjacent iterations is less than a preset rate of change threshold; wherein, the optimal loss value corresponding to any iteration is the minimum value among the loss values corresponding to each candidate speed limit parameter tested up to that iteration.
[0022] Optionally, the speed limit parameter optimization method further includes: Obtain abnormal message data reported by the network device during deployment and operation; wherein, the abnormal message data is message data collected during the period when the CPU utilization of the network device is continuously higher than a preset abnormal CPU threshold; Extract abnormal message feature data from the abnormal message data; Based on the abnormal message feature data, a basic test message flow for reproducing the abnormal network environment is reconstructed, and the rate limiting parameters are optimized based on the reconstructed basic test message flow to obtain the rate limiting parameters corresponding to the abnormal network environment. The rate limiting parameters corresponding to the abnormal network environment are sent to the network device to update the rate limiting parameter set of the network device.
[0023] Thirdly, this application discloses a message rate limiting device applied to network equipment, comprising: The parameter acquisition module is used to acquire a set of speed limit parameters that are compatible with itself; wherein, the set of speed limit parameters includes speed limit parameters corresponding to different operating scenarios. The scenario determination module is used to obtain the message rate of the protocol messages entering the control plane, determine the current operating scenario from the different operating scenarios based on the message rate, and determine the target speed limit parameter corresponding to the current operating scenario from the speed limit parameter set. A rate limiting module is used to limit the rate of protocol messages entering the control plane based on the target rate limiting parameters.
[0024] Fourthly, this application discloses an electronic device, comprising: Memory, used to store computer programs; A processor is used to execute the computer program to implement the aforementioned disclosed message rate limiting method or rate limiting parameter optimization method.
[0025] Fifthly, this application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned message rate limiting method or rate limiting parameter optimization method.
[0026] As can be seen, in this application, the network device obtains a set of rate limiting parameters adapted to itself; wherein, the set of rate limiting parameters includes rate limiting parameters corresponding to different operating scenarios; obtains the packet rate of protocol packets entering the control plane, determines the current operating scenario from the different operating scenarios based on the packet rate, and determines the target rate limiting parameter corresponding to the current operating scenario from the set of rate limiting parameters; and limits the rate of protocol packets entering the control plane based on the target rate limiting parameter.
[0027] Beneficial Effects: The network device in this application first acquires a set of rate-limiting parameters adapted to itself. This set includes rate-limiting parameters corresponding to different operating scenarios, enabling the device to pre-load multiple rate-limiting schemes adapted to its own performance and deployment environment. Furthermore, during device operation, the current operating scenario is determined based on the packet rate of protocol packets entering the control plane, and a target rate-limiting parameter corresponding to the current operating scenario is selected from the rate-limiting parameter set to rate-limit the protocol packets entering the control plane. Thus, the current operating scenario of the network device can be identified based on the packet rate of protocol packets entering the control plane, and appropriate rate-limiting parameters can be adaptively selected for different operating scenarios. This avoids the problem of fixed rate-limiting parameters being difficult to adapt to different operating scenarios, thereby improving the adaptability between the packet rate-limiting strategy and the actual operating scenario of the network device, and reducing the impact of abnormal protocol packets on control plane processing resources. Attached Figure Description
[0028] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0029] Figure 1 This is a flowchart of a message rate limiting method disclosed in this application; Figure 2 This is a comparative diagram of speed limit parameters in one scenario disclosed in this application; Figure 3 This is a flowchart of a speed limit parameter optimization method disclosed in this application; Figure 4 This is a schematic diagram of an offline parameter optimization environment disclosed in this application; Figure 5This application discloses a general test flowchart; Figure 6 This is a schematic diagram of a message rate limiting device disclosed in this application; Figure 7 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0030] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0031] See Figure 1 As shown in the figure, this application discloses a message rate limiting method applied to a network device. The method includes: Step S11: Obtain a set of speed limit parameters that are compatible with itself; wherein, the set of speed limit parameters includes speed limit parameters corresponding to different operating scenarios.
[0032] In this embodiment, a network device refers to a network device with a control plane and a forwarding plane, and a rate-limiting implementation point set at the entrance of the control plane. This device can be a router with a centralized architecture, a router with a distributed architecture, or a switch, firewall, or other device with similar control plane protection requirements; this embodiment does not specifically limit this. The rate-limiting implementation point refers to the physical or logical location where rate-limiting actions are performed on packets entering the control plane. For example, in a centralized architecture, the rate-limiting implementation point is the inter-core queue between the forwarding core and the control core within the main control board's CPU; in a distributed architecture, the rate-limiting implementation point is the queue where the line processing unit (LPU) sends packets to the main control unit (MPU). Regardless of the architecture, the rate-limiting implementation point is located on the transmission path between the forwarding plane and the control plane, and is used to perform rate limiting on various protocol packets at the entrance of the control plane. The rate-limiting implementation point supports setting rate-limiting values according to protocol type; that is, different rate-limiting thresholds can be configured for packets of different protocol types at the rate-limiting implementation point.
[0033] Because network devices of different performance levels have varying processing capabilities for protocol messages entering the control plane, and the traffic characteristics of the same deployment environment also differ at different times, this embodiment allows network devices to acquire at least one set of compatible rate-limiting parameters. This set includes rate-limiting parameters corresponding to different operating scenarios. In other words, for the same network device, its rate-limiting parameter set does not contain only one fixed set of parameters, but rather multiple sets of parameters corresponding to various operating scenarios. This allows the network device to load the appropriate rate-limiting parameters based on its operating scenario during operation, thereby adapting to its processing performance and the operating scenario. The rate-limiting parameter set adapted to the network device can be pre-generated offline and deployed to the network device, or it can be generated by the control terminal and then distributed online to the network device, or it can be obtained online through a network management system or cloud server. This embodiment does not limit this approach.
[0034] It should be noted that the rate limiting parameter set adapted to the network device can be obtained offline based on the network device's own CPU performance, cache configuration, and the actual traffic characteristics of the network environment to be deployed. Furthermore, the acquisition process of the rate limiting parameter set can be as follows: the network device reads a pre-set rate limiting parameter set from a local file during startup; the network device can obtain the rate limiting parameter set from a control terminal through a management channel; or the network device can receive a rate limiting parameter set issued by a network management system or cloud server. Alternatively, the network device can receive incremental updates to the existing rate limiting parameter set during operation. This embodiment does not limit the specific implementation of these methods.
[0035] In specific implementations, since network devices of the same model may be deployed in various network environments with significant differences, such as enterprise office environments and data center environments, and the traffic characteristics of different network environments vary considerably, a set of rate-limiting parameters containing multiple operating scenarios can be generated for each typical network environment. When deploying a network device, the network environment in which the device is located needs to be specified in order to load the corresponding rate-limiting parameter set. That is, this embodiment actually needs to obtain a rate-limiting parameter set adapted to the network device under the current network environment. Specifically, administrators can manually select the required rate-limiting parameter set via command line or network management interface based on the actual network environment in which the device is deployed. Besides manually specifying scenarios, the network device can also have a built-in lightweight scenario matching model. This model, after offline training, is exported as a scenario matching rule set and embedded in the device firmware. During operation, the network device only needs to use real-time packet reception characteristics, such as protocol entropy, traffic burstiness, and the proportion of key protocols, to find the most suitable network environment parameters according to this matching rule. It then directly reads the corresponding rate-limiting parameter set from a local file. This parameter set contains rate-limiting parameters corresponding to different operating scenarios within that network environment, and then distributes the rate-limiting parameters corresponding to the default operating scenario to the rate-limiting implementation points. In this way, even if the administrator does not specify the network environment, the network device can automatically load a rate-limiting parameter set adapted to its actual deployment environment, reducing deployment difficulty.
[0036] Step S12: Obtain the message rate of the protocol messages entering the control plane, determine the current operating scenario from the different operating scenarios based on the message rate, and determine the target speed limit parameter corresponding to the current operating scenario from the speed limit parameter set.
[0037] In this embodiment, during operation, the network device can collect the packet rate of each protocol packet entering the control plane in real time according to a fixed sampling period, for example, collecting the packet rate of each protocol packet at a default sampling period of T=5s. The packet rate of the protocol packets can be measured in packets per second (pps). Based on the currently collected packet rate, the network device determines its current operating scenario from different operating scenarios corresponding to its rate limiting parameter set, and then determines the target rate limiting parameter corresponding to the current operating scenario from the rate limiting parameter set, so that rate limiting can be performed subsequently based on the target rate limiting parameter.
[0038] The operating scenarios include normal operating scenarios and at least one abnormal operating scenario. The rate limiting parameter corresponding to the normal operating scenario is lower than the rate limiting parameter corresponding to the abnormal operating scenario. The rate limiting parameters include rate limiting values corresponding to different protocol types. It should be noted that the normal operating scenario here refers to a scenario where the network device has not suffered protocol-related attacks and the packet rates of each protocol are at normal service levels; this can also be called the default operating scenario or the factory default scenario. The abnormal operating scenario refers to a scenario where there is an abnormal surge in packets from one or more protocols, typically caused by a protocol-related attack on the device. Furthermore, a set of rate limiting parameters includes rate limiting values corresponding to each protocol type of interest in that scenario. For example, for protocols entering the same upload queue such as ARP (Address Resolution Protocol), DHCP (Dynamic Host Configuration Protocol), RADIUS (Remote Authentication Dial In User Service), and ND (Neighbor Discovery).
[0039] Understandably, in normal operating scenarios, the network mainly consists of service traffic, and the packet rates of various protocol messages entering the control plane are relatively low. Therefore, the rate limiting parameters for normal operating scenarios are configured with relatively low values to minimize the sum of the rate limiting values of each protocol while ensuring zero packet loss of service messages, thereby reserving processing resources for the CPU. In contrast, the rate limiting parameters for abnormal operating scenarios are determined with the optimization goal of ensuring the normal processing of non-abnormal protocols under the constraint of allowing a certain amount of packet loss. Their rate limiting values are relatively high, thus serving as a criterion for determining whether an abnormal scenario has occurred. Figure 2 A comparative diagram of scenario speed limit parameters is disclosed, showing that the speed limit parameters of the same protocol type in abnormal operation scenarios are significantly higher than those in normal operation scenarios.
[0040] The step of determining the current operating scenario from the different operating scenarios based on the message rate includes: comparing the message rate of protocol messages of different protocol types with the rate limit value corresponding to the corresponding protocol type in the at least one abnormal operating scenario; if the message rate of each protocol message does not reach the rate limit value corresponding to the corresponding protocol type in any abnormal operating scenario, then the current operating scenario is determined to be the normal operating scenario; if the message rate of at least one protocol type reaches the rate limit value corresponding to the corresponding protocol type in the at least one abnormal operating scenario, then the current operating scenario is determined from the at least one abnormal operating scenario based on the matching relationship between the message rate of different protocol types and the rate limit value corresponding to each of the abnormal operating scenarios.
[0041] In other words, this embodiment does not determine whether an anomaly has occurred through additional attack detection algorithms, but rather uses the rate-limiting parameters of each acquired abnormal operating scenario as the scenario determination threshold. Specifically, in each sampling period, the network device compares the currently collected packet rates of each protocol type with the preset rate-limiting parameter sets of multiple abnormal operating scenarios. If the packet rates of all protocol types do not reach the rate-limiting value corresponding to the corresponding protocol type in any abnormal operating scenario, it indicates that there is no abnormal traffic in the current network, and the network remains in the normal operating scenario. As mentioned above, the normal operating scenario is the initial default operating scenario. If the packet rate of one or more protocols reaches the rate-limiting value corresponding to the corresponding protocol type in an abnormal operating scenario, it indicates that abnormal traffic has occurred in the current network. In this case, the matching degree of each abnormal operating scenario is comprehensively judged, and the current operating scenario is determined from at least one abnormal operating scenario.
[0042] Furthermore, the at least one abnormal operating scenario includes a single-protocol abnormal operating scenario and a multi-protocol abnormal operating scenario. Specifically, a single-protocol abnormal operating scenario is a scenario where only a single protocol type of protocol messages experiences an abnormal surge, such as an abnormal surge in only ARP messages; a multi-protocol abnormal operating scenario is a scenario where at least two protocol types of protocol messages simultaneously experience an abnormal surge, such as an abnormal surge in both ARP messages and DHCP messages.
[0043] The step of determining the current operating scenario from the at least one abnormal operating scenario based on the matching relationship between the message rate of different protocol types and the rate limit value corresponding to each of the abnormal operating scenarios includes: if the message rates of at least two protocol types reach the rate limit value of the corresponding protocol type in the same multi-protocol abnormal operating scenario, then the current operating scenario is determined to be the multi-protocol abnormal operating scenario; if the message rate of only one protocol type reaches the rate limit value of the corresponding single-protocol abnormal operating scenario, then the current operating scenario is determined to be the single-protocol abnormal operating scenario.
[0044] In other words, when multiple candidate abnormal operating scenarios exist, it is necessary to comprehensively judge the matching degree of each abnormal operating scenario and select the abnormal operating scenario with the highest matching degree as the current operating scenario. Specifically, taking the abnormal operating scenarios including ARP single-protocol abnormal operating scenario, DHCP single-protocol abnormal operating scenario, and ARP+DHCP multi-protocol abnormal operating scenario as an example, the network device can first compare the currently collected packet rate of each protocol type with the rate limit value of the corresponding protocol type in the multi-protocol abnormal operating scenario (i.e., ARP+DHCP multi-protocol abnormal operating scenario). If the ARP packet rate and the DHCP packet rate both exceed the corresponding rate limit value in the multi-protocol abnormal operating scenario, then the multi-protocol abnormal operating scenario is switched to the current operating scenario; otherwise, the case of individual protocol types is judged one by one. If only the ARP packet rate exceeds the rate limit value corresponding to the ARP single-protocol abnormal operating scenario, then the ARP single-protocol abnormal operating scenario is switched to the current operating scenario. In this way, when a hybrid attack occurs, the system can prioritize matching multi-protocol abnormal operation scenarios that are consistent with the actual attack pattern, rather than matching only one single-protocol abnormal operation scenario. This avoids the problem of rate limiting parameters not matching actual traffic due to insufficient scenario matching granularity, thereby improving the accuracy of scenario identification.
[0045] The method of this application further includes: when the current operating scenario is an abnormal operating scenario, obtaining the message rate of the abnormal protocol message corresponding to the abnormal operating scenario; when the message rate of the abnormal protocol message is continuously lower than the rate limit value corresponding to the abnormal operating scenario, switching the current operating scenario from the abnormal operating scenario to the normal operating scenario, so as to rate limit the protocol messages entering the control plane based on the rate limit parameter corresponding to the normal operating scenario.
[0046] Understandably, the rate limiting parameters corresponding to abnormal operating scenarios are relatively lenient, aiming to maintain basic device availability during an attack. If the network remains in an abnormal operating scenario for an extended period after the attack ceases, the control plane will be continuously exposed to high packet access rates, which is detrimental to CPU resource protection. Therefore, this embodiment sets up a scenario fallback mechanism. When a network device is currently in an abnormal operating scenario, and the packet rate of the abnormal protocol defined in that scenario has consistently fallen below the corresponding rate limit value, it indicates that the abnormal traffic that triggered the abnormal operating scenario has subsided. At this point, the network device automatically falls back to the normal operating scenario and applies rate limiting based on the rate limiting parameters corresponding to the normal operating scenario, thereby restoring the normal configuration of CPU processing resources. Furthermore, "consistently" here can be understood as being below the corresponding rate limit threshold for a consecutive preset number of sampling periods. For example, if the ARP packet rate is below the ARP rate limit value in an ARP attack scenario for three consecutive sampling periods (i.e., 15 seconds), then the network falls back from the ARP attack scenario to the default scenario. By setting a criterion for duration, it is possible to avoid frequent switching between normal and abnormal operation scenarios due to instantaneous traffic fluctuations.
[0047] Step S13: Limit the rate of protocol messages entering the control plane based on the target rate limiting parameters.
[0048] In this embodiment, the network device sends the determined target rate-limiting parameters to the aforementioned unified rate-limiting implementation point. This implementation point then limits the rate of protocol packets sent to the control plane according to the rate-limiting values corresponding to each protocol type in the target rate-limiting parameters, discarding protocol packets exceeding the corresponding rate-limiting values. The specific rate-limiting implementation can employ conventional QoS (Quality of Service) rate-limiting mechanisms such as token buckets; this embodiment does not limit this approach. Since each protocol type corresponds to an independent rate-limiting value, when multiple protocol types share the same uplink queue, rate-limiting abnormally surging protocol packets can prevent interference with the uplink of normal protocol packets, achieving fine-grained isolation and protection at the protocol level.
[0049] Furthermore, based on the adaptive selection of rate limiting parameters according to the current operating scenario, in order to further adapt the rate limiting parameters adopted by the network device to changes in the actual operating state of the network device, this application embodiment can also dynamically adjust the currently adopted rate limiting parameters according to the operating feedback information of the network device during the rate limiting process. Therefore, after rate limiting the protocol packets entering the control plane based on the target rate limiting parameters, the method of this application further includes: obtaining first operating feedback information during the rate limiting process, and dynamically adjusting the target rate limiting parameters according to the first operating feedback information, so as to rate limit the protocol packets entering the control plane based on the adjusted rate limiting parameters.
[0050] It is understandable that during the process of limiting the network speed based on the target speed limit parameters, the network device will continuously collect the first operation feedback information that represents its actual operating status, and dynamically adjust the target speed limit parameters currently used according to the first operation feedback information. This allows for fine-tuning of the speed limit parameters within the scene based on the scene-level parameter switching, thus fully leveraging the processing performance potential of the CPU.
[0051] In a specific implementation, the first operational feedback information includes the CPU utilization of the network device and the packet loss rate of the protocol packets; the step of dynamically adjusting the target rate limiting parameter based on the first operational feedback information includes: when the current operational scenario is the normal operation scenario, determining a target protocol type that meets preset dynamic adjustment conditions; wherein, the preset dynamic adjustment conditions include: the packet rate of the protocol packets of the target protocol type is continuously higher than the current rate limiting value corresponding to the normal operation scenario and continuously lower than the rate limiting value in the abnormal operation scenario, the CPU utilization is lower than a preset CPU utilization threshold, and the packet loss rate of the protocol packets of the target protocol type is lower than a first preset packet loss rate threshold; increasing the rate limiting value corresponding to the target protocol type by a preset step size.
[0052] In other words, when the current operating scenario is a normal operating scenario, the network device initiates a gradual rate-limiting relaxation mechanism. A protocol type is identified as the target protocol type when it simultaneously meets the following four conditions: First, the current packet rate of this protocol type is consistently higher than the corresponding current rate limit value in a normal operating scenario, indicating that legitimate service packets are being dropped due to rate limiting, thus requiring a relaxation of the rate limit value; Second, the current packet rate of this protocol type is lower than the corresponding rate limit value in an abnormal operating scenario, indicating that the traffic growth of this protocol is still within the normal business fluctuation range, rather than an abnormal surge caused by an attack, thus justifying a relaxation of the rate limit value; Third, the CPU utilization rate is lower than a preset CPU utilization threshold (e.g., 85%), indicating that the control plane still has surplus processing capacity, providing a safety margin for relaxing the rate limit value; Fourth, the packet loss rate of this protocol type is lower than a first preset packet loss rate threshold (e.g., 2%), indicating that the current packet loss is still within a controllable range, and relaxing the rate limit value is a gradual optimization rather than an emergency measure. Here, "consistently higher than" or "consistently lower than" can be understood as being higher than or lower than the corresponding rate limit value for at least one sampling period (e.g., default value T=5s), thereby avoiding unnecessary adjustments triggered by sudden bursts of traffic. Dynamic rate adjustment can be triggered as long as any protocol type meets the above conditions.
[0053] It should be noted that within the same sampling period, there may be multiple protocol types that simultaneously meet the preset dynamic adjustment conditions. In this case, the rate limit value corresponding to each target protocol type can be increased one by one according to the preset step size. The adjustment order is not limited. After the adjusted rate limit value of each target protocol type is determined, it can be sent to the application in sequence.
[0054] Furthermore, the message rate limiting method further includes: determining the rate difference between the message rate of the protocol message of the target protocol type and the current rate limiting value; and determining the preset step size based on the rate difference and a preset adjustment coefficient.
[0055] In other words, the preset step size in this embodiment is not a fixed value, but is dynamically determined based on the rate difference between the current actual packet rate of the target protocol type and the current rate limit value, so that the increase in the rate limit value matches the amount of legitimate packets dropped due to rate limiting. In one specific implementation, the product of the above-mentioned rate difference and a preset adjustment coefficient (e.g., 20%) can be determined as the preset step size, and the sum of the current rate limit value and the preset step size can be used as the adjusted rate limit value. The adjustment formula is as follows: ; Among them, L new This indicates the adjusted speed limit value, L. old R represents the current speed limit value before adjustment. actual The actual packet rate of the protocol message representing the target protocol type is 20%, which is a preset adjustment coefficient. It is understood that the value of the preset adjustment coefficient can be adjusted according to actual needs, and this application does not limit it. Through this method, the network device can gradually relax the rate limit value, provided that CPU resources allow and packet loss is not caused, enabling the device to handle higher legitimate traffic.
[0056] Furthermore, it should be noted that after increasing the rate limit value corresponding to the target protocol type according to a preset step size, the method further includes: obtaining the CPU utilization and the packet loss rate of the protocol packets of the target protocol type when rate limiting is performed based on the increased rate limit value; if the CPU utilization exceeds the preset CPU utilization threshold, or the packet loss rate of the protocol packets of the target protocol type exceeds the second preset packet loss rate threshold, then a fallback rate limit value is determined based on the average of the rate limit value before the increase and the rate limit value after the increase; and the rate limit value corresponding to the target protocol type is adjusted to the fallback rate limit value.
[0057] In other words, after increasing the rate limit value corresponding to the target protocol type by a preset step size, the network device further obtains the CPU utilization and the packet loss rate of protocol packets of the target protocol type when rate limiting is performed based on the increased rate limit value, in order to perform a reverse evaluation of the effect of this rate limit increase. If the CPU utilization exceeds the preset CPU utilization threshold after increasing the rate limit value, or the packet loss rate of protocol packets of the target protocol type exceeds the second preset packet loss rate threshold (e.g., 5%), it indicates that this rate limit increase has exceeded the device's carrying capacity. At this time, a reverse adjustment is immediately performed, and the rate limit value corresponding to the target protocol type is rolled back to the safety boundary. The rollback is not a direct rollback to the rate limit value before the increase, but rather the midpoint (i.e., the average value) of the rate limit value before and after the increase is taken as the rollback rate limit value. The reverse adjustment formula is as follows: ; Among them, L rollback Indicates the reverted speed limit value, L new L represents the increased speed limit value. old This represents the rate limit value before the increase. The advantage of using median backoff instead of full backoff is that full backoff would cause the system to lose all the gains obtained in this exploration and may trigger the same positive adjustment again in subsequent cycles, thus forming oscillations; while median backoff is essentially equivalent to performing a binary approximation near the safe boundary, which cancels the part of the increment that exceeds the limit and retains the part of the increment within the safe range, so that the rate limit value can converge to near the maximum legal rate that the device can actually withstand with fewer iterations, thereby giving full play to the performance potential of the CPU.
[0058] In other words, through the dynamic rate adjustment mechanism that combines gradual relaxation with out-of-bounds median backoff, the network device can fully utilize the processing performance potential of the CPU while ensuring that CPU utilization and packet loss rate are within safe ranges. This achieves reverse adjustment of the packet loss rate, i.e., automatically reducing the rate limit when CPU utilization or packet loss rate is too high. Furthermore, the first preset packet loss rate threshold and the second preset packet loss rate threshold can be the same or different; this application does not impose any limitation on this.
[0059] In addition, the method of this application also includes: if the CPU utilization rate is continuously higher than the preset abnormal CPU threshold for a preset duration, the currently used rate limiting parameter is switched to a guaranteed rate limiting parameter that is compatible with itself, and the protocol messages entering the control plane are rate limited based on the guaranteed rate limiting parameter.
[0060] In other words, to address persistent performance anomalies when local dynamic adjustment fails, this embodiment includes an abnormal traffic fallback mechanism. During operation, the network device continuously monitors its CPU utilization. If the CPU utilization remains above a preset abnormal CPU threshold for a preset duration (e.g., consistently above 95% for 30 seconds), it is considered a performance anomaly. This indicates that the currently applied rate limiting parameters are incompatible with the actual traffic. The fallback mechanism is immediately triggered, switching the currently used rate limiting parameters to a guaranteed rate limiting parameter compatible with the network device. Based on this guaranteed rate limiting parameter, protocol packets entering the control plane are rate-limited, thereby ensuring the basic functionality of the device remains available.
[0061] It should be noted that the guaranteed rate limit parameter is a conservative configuration based on historical experience values, and the guaranteed rate limit parameter varies from device to device. In one specific implementation, the guaranteed rate limit parameter can be obtained as follows: During actual business testing, when a certain protocol type is found to experience high CPU usage, the rate limit value for that protocol type is manually reduced via command line configuration and fixed as the initial parameter. After multiple rounds of testing, a set of empirical values can be obtained as the guaranteed rate limit parameter. Because the guaranteed rate limit parameter is generally conservative, it can quickly reduce the total number of packets sent to the control plane to a level that the device can withstand under extreme operating conditions, thereby ensuring the availability of basic forwarding functions and management channels.
[0062] As can be seen, the network device in this application first obtains a set of rate-limiting parameters adapted to itself. This set of rate-limiting parameters includes rate-limiting parameters corresponding to different operating scenarios, enabling the device to pre-load multiple rate-limiting schemes adapted to its own performance and deployment environment. Furthermore, during device operation, the current operating scenario is determined based on the packet rate of protocol packets entering the control plane, and a target rate-limiting parameter corresponding to the current operating scenario is selected from the rate-limiting parameter set for packet rate limiting. Thus, the current operating scenario of the network device can be identified based on the packet rate of protocol packets entering the control plane, and appropriate rate-limiting parameters can be adaptively selected for different operating scenarios. This avoids the problem of fixed rate-limiting parameters being difficult to adapt to different operating scenarios, thereby improving the adaptability between the packet rate-limiting strategy and the actual operating scenario of the network device, and reducing the impact of abnormal protocol packets on control plane processing resources.
[0063] Furthermore, embodiments of this application can also obtain first operational feedback information of the network device during the rate limiting process, and dynamically adjust the target rate limiting parameters based on the first operational feedback information, so that the rate limiting parameters can further adapt to changes in the actual operating state of the network device, reduce the dropping of normal protocol packets due to unreasonable rate limiting parameter settings, and improve the adaptability and reliability of network device control plane packet rate limiting.
[0064] See Figure 3 As shown in the illustration, this application also discloses a rate-limiting parameter optimization method applied to a control terminal to obtain a rate-limiting parameter set adapted to the network device in the aforementioned disclosed packet rate-limiting method. It should be noted that, considering the differences in processing capabilities of network devices with different performance levels for protocol packets entering the control plane, and the differences in traffic characteristics faced by the same network device in different deployment environments, this embodiment performs the following rate-limiting parameter optimization process for each independent deployment environment and each device, thereby ensuring that the generated rate-limiting parameter set is highly matched with the device capabilities and deployment environment.
[0065] Furthermore, before proceeding with the parameter optimization process, the offline parameter optimization environment of this embodiment will be described first. See [link to documentation]. Figure 4 As shown, the offline parameter optimization environment in this embodiment includes a control terminal, a traffic feature analysis terminal, a device under test, and a tester. The control terminal and the traffic feature analysis terminal can both be general-purpose personal computers (PCs), and they can also be integrated into the same physical device; the device under test is the network device from which the rate-limiting parameter set is to be generated.
[0066] The traffic feature analysis terminal extracts features from packet sample data captured from the field. These extracted features are then used to reproduce the field network environment locally using a tester. Furthermore, for different typical network environments, such as enterprise office environments and data center environments, different raw packet sample data needs to be captured separately to ensure that the generated rate-limiting parameters match the actual traffic characteristics of that environment. The tester injects corresponding traffic into the device under test (DUT) based on the packet features analyzed by the traffic feature analysis terminal, i.e., generating and injecting test packet streams. During the processing of the test packet streams, the DUT monitors its queue's packet loss rate and CPU utilization, and periodically uploads the monitoring information to the control terminal. The control terminal receives the information reported by the DUT and performs Bayesian optimization accordingly, then sends the optimized rate-limiting parameters back to the DUT.
[0067] Specifically, the speed limit parameter optimization method includes the following steps: Step S21: Obtain packet characteristic data of the network environment to be deployed by the network device.
[0068] In a specific implementation, obtaining the packet feature data of the network environment to be deployed by the network device includes: obtaining packet sample data of the network environment to be deployed by the network device; and extracting at least one of the following packet feature data from the packet sample data: packet timestamp offset, source MAC address, destination MAC address, source IP address, destination IP address, port number, protocol type, protocol field information, packet length, burstiness identifier, and protocol interaction timing characteristics.
[0069] In this embodiment, the packet sample data can be a packet capture file obtained from the network environment where the network device is to be deployed. Traffic feature analysis terminals can use open-source protocol parsing libraries, such as dpkt or scapy, to perform deep parsing of packet capture files, thereby extracting the following packet feature data: packet timestamp offset, with an accuracy down to the microsecond (μs) level; source MAC address, destination MAC address, source IP address, destination IP address, and port number; protocol type and key protocol field information, for example, for the DHCP protocol, it is necessary to distinguish whether the packet is a discover packet or an offer packet, and what its specific internal field information is; packet length and burst identifier. The burst identifier refers to the indication information used to characterize whether the packet traffic exhibits burst characteristics in time. For example, it can be used to count the number of packets arriving within a preset time window. If the number of packets in the current time window exceeds a preset burst threshold, then the time window is marked as a burst window. The burst identifier can include at least one of the following information: burst start timestamp, burst duration, peak packet rate within the burst window, average packet rate within the burst window, etc.; protocol interaction timing characteristics, such as the interval distribution between request-response pairs, state transition dependencies, and other timing constraints. By extracting the aforementioned message feature data, the traffic characteristics of the network environment to be deployed can be characterized more completely, providing a basis for subsequent reproduction of the network environment.
[0070] Step S22: Construct traffic generation rules based on the packet feature data to generate basic test packet flows for reproducing the network environment.
[0071] In this embodiment, the control terminal organizes and summarizes a set of traffic generation rules based on a series of message feature data obtained from the aforementioned parsing. The test instrument reads these traffic generation rules to construct and replay the corresponding traffic, thereby generating a basic test message stream for reproducing the network environment to be deployed. It is understood that the traffic generation rules constructed based on the aforementioned message feature data can preserve the protocol semantics and timing characteristics of the original traffic, ensuring that the message stream generated by the test instrument can trigger the complete control plane processing flow of the device under test, including protocol state machine transitions and resource allocation, thereby realistically reproducing the CPU load and associated packet loss phenomena of the device under test. It should be noted that the traffic generation rules here can also be called a replayable traffic model; the two have the same meaning, and this application does not limit its name.
[0072] Step S23: For each of the different operating scenarios, generate a corresponding scenario test message stream based on the basic test message stream.
[0073] First, it should be noted that the parameter optimization process in this embodiment needs to be executed separately for each independently deployed environment. This involves: constructing traffic generation rules based on the on-site packet capture files of that environment; defining its own normal operation and abnormal operation scenarios, such as normal and attack scenarios for an enterprise network environment, and normal and attack scenarios for a data center environment; running Bayesian optimization for each scenario to generate scenario-specific parameter sets and embedding them into the device. Furthermore, considering the differences in hardware performance between different device models, corresponding scenarios must be defined for different device platforms to ensure a high degree of matching between the optimized parameter sets and the device capabilities.
[0074] Specifically, the different operating scenarios include normal operation scenarios, single-protocol abnormal operation scenarios, and multi-protocol abnormal operation scenarios. For each of these different operating scenarios, generating a corresponding scenario test message stream based on the basic test message stream includes: for the normal operation scenario, determining the basic test message stream as the scenario test message stream; for the single-protocol abnormal operation scenario, superimposing a protocol message of an abnormal protocol type onto the basic test message stream to control the tester to generate the corresponding scenario test message stream; for the multi-protocol abnormal operation scenario, superimposing at least two protocol messages of abnormal protocol types onto the basic test message stream to control the tester to generate the corresponding scenario test message stream.
[0075] In other words, for normal operation scenarios, only the basic test packet flow corresponding to the service traffic model of that network environment needs to be injected. The optimization goal is to achieve zero packet loss for protocol packets of all protocol types, and to minimize the sum of the rate limit values for each protocol type while ensuring zero packet loss, so as to reserve CPU processing resource space and support dynamic relaxation of rate limits during subsequent operation. For single-protocol abnormal operation scenarios, attack traffic of a single abnormal protocol type is superimposed on the basic test packet flow, such as superimposing 5000pps of ARP flood traffic. The constraint is that the packet loss rate of protocol packets of non-attack protocol types is less than 2% and the CPU utilization is less than 85%. For multi-protocol abnormal operation scenarios, attack traffic of multiple abnormal protocol types is superimposed on the basic test packet flow, such as simultaneously superimposing ARP flood traffic and DHCP flood traffic. The constraint is the same as that for single-protocol abnormal operation scenarios. It is understandable that, due to the significant differences in traffic characteristics between different scenarios, for the same network device, it is necessary to generate corresponding rate limit parameters for its different operation scenarios, thus forming the aforementioned rate limit parameter set that includes rate limit parameters corresponding to different operation scenarios.
[0076] Step S24: Configure the network device using preset initial candidate rate limiting parameters, and control the tester to input the scenario test packet stream into the network device to obtain the second operation feedback information when the network device processes the scenario test packet stream.
[0077] In this embodiment, the control terminal sends preset initial candidate rate limiting parameters to the network device to configure the network device; then the control terminal controls the tester to input the scenario test message stream of the corresponding operating scenario to the network device; during the processing of the scenario test message stream, the network device collects second operating feedback information and reports it to the control terminal, thereby providing an evaluation basis for subsequent Bayesian optimization.
[0078] Furthermore, before configuring the network device using preset initial candidate rate limiting parameters, the method further includes: gradually increasing the packet rate of the test packets input to the network device and obtaining the CPU utilization of the network device; when the CPU utilization reaches a preset CPU utilization threshold, obtaining the packet processing rate of the network device for protocol packets entering the control plane, and determining the packet processing rate as the upper limit of the processing rate; and determining the range of rate limiting values corresponding to different protocol types based on the upper limit of the processing rate to construct a target search space.
[0079] In other words, before performing Bayesian optimization, the target search space for Bayesian optimization needs to be constructed first. This embodiment uses the maximum packet processing rate U of the software queue when the CPU utilization equals a preset CPU utilization threshold (e.g., 85%) as a global constraint. This upper limit of processing rate U is dynamically calibrated through load testing. The specific load testing method is as follows: the control terminal controls the tester to gradually increase the packet rate of test packets injected into the normal operating scenario. When the CPU utilization reaches 85%, the packet processing rate of the queue is recorded, thus obtaining the upper limit of processing rate U, in pps. For each protocol type entering the queue, such as ARP, DHCP, RADIUS, and ND protocols, the corresponding rate limiting value pi ranges from [0, U], thereby constructing the target search space. It can be understood that when performing parameter optimization, users only need to specify the CPU upper limit (default 85%) and the list of protocols that need rate limiting; all other parameters can be automatically calibrated, making it a low-barrier-to-use solution. Meanwhile, since the processing speed limit is obtained through actual testing on the device under test, the search space will automatically expand and contract with the device's capabilities for hardware platforms with different CPU frequencies and cache configurations, fundamentally solving the problem of lack of device adaptability of the speed limit parameters.
[0080] Step S25: Based on the initial candidate rate limiting parameters and the corresponding second operation feedback information, perform iterative search using Bayesian optimization within the target search space to obtain rate limiting parameters corresponding to different operation scenarios, so as to form a rate limiting parameter set adapted to the network device.
[0081] In this embodiment, the control terminal performs an iterative search within the target search space using Bayesian optimization based on the initial candidate speed limit parameters and the corresponding second operation feedback information, thereby obtaining speed limit parameters corresponding to different operation scenarios.
[0082] The iterative search process using Bayesian optimization within the target search space further includes: if the sum of candidate rate limiting values corresponding to different protocol types in the target candidate rate limiting parameters is greater than the processing rate upper limit, then a penalty is imposed on the target candidate rate limiting parameters to reduce the probability of the target candidate rate limiting parameters being selected in subsequent iterative search processes.
[0083] In other words, this embodiment applies a validity constraint to the candidate rate limiting parameters: if the sum of the candidate rate limiting values corresponding to different protocol types in a certain target candidate rate limiting parameter is greater than the upper limit of the processing rate U, i.e., ∑p i If the value is >U, then the candidate speed limit parameter belongs to the infeasible region. In this case, a penalty is applied to the candidate speed limit parameter, for example, by returning a very large penalty value (such as 10) in its corresponding loss function. 6 This allows Bayesian optimization to automatically avoid the infeasible region during subsequent iterative search processes, reducing the probability that the target candidate rate limiting parameter is selected.
[0084] In a specific implementation, the step of iteratively searching within the target search space using Bayesian optimization based on the initial candidate rate-limiting parameters and the corresponding second operational feedback information to obtain rate-limiting parameters corresponding to different operational scenarios includes: storing multiple sets of initial candidate rate-limiting parameters and corresponding second operational feedback information into a training dataset, and constructing a proxy model based on the training dataset; generating new candidate rate-limiting parameters within the target search space based on the proxy model and a preset acquisition function; configuring the network device using the new candidate rate-limiting parameters, and inputting a scenario test packet stream corresponding to the operational scenario into the network device to obtain the second operational feedback information corresponding to the new candidate rate-limiting parameters, and updating the training dataset; updating the proxy model using the updated training dataset, and then jumping back to the step of generating new candidate rate-limiting parameters within the target search space based on the proxy model and the preset acquisition function, until a preset iteration termination condition is met, and then determining the rate-limiting parameters corresponding to the operational scenario based on the iterative search results.
[0085] First, it should be noted that all Bayesian optimization stages in this embodiment reuse the same general testing process. See [link to relevant documentation] Figure 5 As shown, the general testing process includes the following steps: the control terminal sends the rate-limiting parameters to the device under test; the protocol tester injects traffic from the packet capture file corresponding to the scenario; the test lasts for a specified duration, such as 60 seconds; the device under test reports the average CPU utilization and the packet loss rate of each protocol type; the control terminal calculates the loss value based on the scenario-specific loss function. The above general testing process is applicable to each parameter evaluation during the initialization modeling phase and the iterative optimization phase.
[0086] During the initial modeling phase, based on the number of protocols k, a hierarchical sampling strategy is used to generate an initial candidate rate-limiting parameter set, for example, generating 6 to 10 sets of initial candidate rate-limiting parameters to ensure that the rate-limiting values for each protocol type uniformly cover the key area within the range [0, U]. For example, Latin Hypercube Sampling (LHS) can be used to generate the initial candidate rate-limiting parameter set: the rate-limiting space in each dimension is divided into M equal parts, a point is randomly selected within each part, and then M sets of parameter combinations are randomly paired to generate the rate-limiting values for each protocol type to be sent to the network device. The above general testing process is executed for each set of initial candidate rate-limiting parameters, and the resulting M sets of parameters and loss values are stored in the training dataset to build the initial proxy model.
[0087] The training dataset is used to store test results. Each record contains a set of rate-limiting parameters (e.g., ARP = 1000pps, DHCP = 2000pps) and their corresponding performance metrics (e.g., CPU utilization = 62%, ARP packet loss rate = 2%). The surrogate model is a parameter-to-performance mapping model initially fitted based on the training dataset. It is used to predict the performance of untested candidate rate-limiting parameters, thereby guiding the selection of high-potential candidate rate-limiting parameters. It should be noted that this application does not limit the specific implementation of the surrogate model; for example, it can be implemented using Gaussian processes or other forms of models such as random forests. The only requirement is that it can predict the loss value of new candidate rate-limiting parameters based on existing test data.
[0088] During the iterative optimization phase, the agent model is updated based on the current training dataset, and a new set of high-potential candidate rate-limiting parameters is generated using a preset acquisition function. The preset acquisition function is used to evaluate and rank the candidate rate-limiting parameters based on their potential. Candidate rate-limiting parameters with higher potential values have greater optimization value in terms of expected improvement and are more suitable as test parameters for the next round of distribution to network devices. This application does not limit the specific mathematical form of the acquisition function; in practical engineering, the Expected Improvement (EI) function is typically used as the acquisition function. For ease of understanding, the potential evaluation logic of the EI function can be simplified as follows: Improved expected value = (current best value - predicted mean) × improvement probability + prediction uncertainty × improvement magnitude coefficient; The expected improvement value is the potential value of the candidate rate-limiting parameter evaluated by the EI function; the current optimal value is the minimum loss value calculated using the loss function among all the candidate rate-limiting parameters that have been tested; the improvement probability and the improvement magnitude coefficient are the cumulative distribution function and probability density function of the standard normal distribution, respectively, both of which are well-known tools in mathematics; the prediction mean and prediction uncertainty (i.e., standard deviation) are the values output by the surrogate model. The method for obtaining the next set of high-potential candidate rate-limiting parameters involves substituting a series of candidate rate-limiting parameters into the EI acquisition function for calculation. The larger the expected improvement value calculated for a candidate rate-limiting parameter, the greater its potential value, and the more suitable it is for distribution to network devices for testing. It should be noted that, unlike the loss function, the contents of the acquisition function are all general mathematical formulas. Apart from the current optimal value and the candidate rate-limiting parameters that need to be substituted into the calculation, the formula itself does not specifically introduce content strongly correlated with network devices.
[0089] This embodiment performs the same general testing process as the initialization modeling phase for each new set of candidate rate-limiting parameters. That is, the traffic generation rules remain unchanged under the same operating scenario. The new data is added to the training dataset, and the proxy model is updated using the updated training dataset. Then, the process jumps back to the step of generating new candidate rate-limiting parameters based on the proxy model and a preset acquisition function. This process is iterated until a preset iteration termination condition is met. Finally, the rate-limiting parameters for the corresponding operating scenario are determined based on the iteration search results. It should be noted that different operating scenarios need to execute this parameter optimization process independently. For example, the above process is executed once for a normal operating scenario, and then again for each abnormal operating scenario, thus obtaining rate-limiting parameters corresponding to different operating scenarios.
[0090] Furthermore, the second operational feedback information includes the CPU utilization of the network device and the packet loss rate of protocol messages of different protocol types. Before constructing the proxy model based on the training dataset, the method further includes: calculating the loss value based on the initial candidate rate limiting parameters, the CPU utilization of the network device, and the packet loss rate of protocol messages of different protocol types, and using a preset loss function; and storing the initial candidate rate limiting parameters and the corresponding loss value in the training dataset.
[0091] In this embodiment, the control terminal calculates the loss value corresponding to each set of candidate speed limit parameters based on a scene-specific loss function, and stores the candidate speed limit parameters and their corresponding loss values in the training dataset, thereby enabling the agent model to learn the mapping relationship between candidate speed limit parameters and loss values. For example, this embodiment uses the following loss function structure: ; Where L represents the loss value; CPU% represents the CPU utilization of the network device under the current candidate rate limiting parameters; PLoss_max represents the maximum packet loss rate of protocol packets of each protocol type; Rlimit represents the average rate limit value of each protocol type under the current candidate rate limiting parameters; λ represents the penalty coefficient, that is, when the CPU utilization is greater than 85%, a very large penalty value is introduced through the max(0, CPU%-85) term; ω1, ω2, and ω3 are all preference weight parameters, used to indicate the importance of each indicator in the loss function calculation. This embodiment uses the following configuration values: ω1=0.4, ω2=0.6, ω3=0.3. This loss function design enables the proxy model to automatically avoid high-risk parameter areas when the CPU utilization is close to the threshold, while prioritizing the optimization of packet loss indicators, and requiring the rate limit value to be as small as possible while ensuring CPU utilization and packet loss rate, thereby reserving a safety margin for dynamic rate adaptive adjustment in the execution scenario during device operation. It is understood that the values of the above preference weight parameters and penalty coefficients can be adjusted according to actual needs, and this application does not limit them.
[0092] Furthermore, the preset iteration termination condition includes: during the continuous preset number of iterations, the rate of change between the optimal loss values obtained from two adjacent iterations is less than a preset rate of change threshold; wherein, the optimal loss value corresponding to any iteration is the minimum value among the loss values corresponding to each candidate rate limiting parameter tested up to that iteration.
[0093] In other words, this embodiment uses the relative improvement rate of the optimal loss value as the convergence criterion. For example, when the relative improvement rate of the optimal loss value is less than a preset rate of change threshold in N=5 consecutive iterations, convergence is determined, and the optimal speed limit parameter set for that operating scenario is output. The preset rate of change threshold, denoted as ε, can be expressed as: <ε; in, This represents the globally optimal loss value up to the t-th iteration search, which is the smallest loss among all tested candidate rate limiting parameters; This represents the globally optimal loss value up to the (t-1)th iteration. When the relative improvement rate is less than the preset rate of change threshold for N=5 consecutive iterations, the iterative search is considered to have converged. At this point, the rate limiting parameters for the corresponding operating scenario can be determined based on the iterative search results. Since this embodiment collects packets and performs Bayesian optimization in different network environments (e.g., enterprise network or data center environments), it obtains rate limiting parameter sets for different operating scenarios.
[0094] Furthermore, after the network device is deployed and operational, if the network device experiences a persistent CPU utilization rate higher than a preset abnormal CPU threshold, the network device can collect abnormal packet data during this period and report the abnormal packet data to the control terminal. Specifically, the method in this embodiment further includes: acquiring abnormal packet data reported by the network device during deployment and operation; wherein, the abnormal packet data is packet data collected during the period when the CPU utilization rate of the network device is persistently higher than the preset abnormal CPU threshold; extracting abnormal packet feature data from the abnormal packet data; reconstructing a basic test packet flow for reproducing the abnormal network environment based on the abnormal packet feature data, and optimizing the rate limiting parameters based on the reconstructed basic test packet flow to obtain rate limiting parameters corresponding to the abnormal network environment; and sending the rate limiting parameters corresponding to the abnormal network environment to the network device to update the rate limiting parameter set of the network device.
[0095] In other words, when a network device experiences persistent CPU anomalies during actual deployment and operation, the packets during the anomaly period can be collected and reported. The specific extraction of abnormal packet features and subsequent optimization of rate limiting parameters are performed by the control terminal. After obtaining the abnormal packet data reported by the network device, the control terminal extracts abnormal packet feature data and reconstructs a basic test packet stream to reproduce the abnormal network environment based on this feature data. Then, following the aforementioned rate limiting parameter optimization process, the control tester inputs a scenario test packet stream generated based on this basic test packet stream into the network device and performs Bayesian optimization using the operational information fed back by the network device, thereby obtaining the rate limiting parameters corresponding to the abnormal network environment. After optimization, the control terminal sends the rate limiting parameters corresponding to the abnormal network environment to the network device to update the network device's rate limiting parameter set, thus achieving online self-evolution and capability self-adaptation of the rate limiting strategy and improving the device's adaptability to new network environments. It should be noted that abnormal packet data can be collected by capturing packets from the forwarding plane. This involves uploading the captured packet files as abnormal packet characteristic data, along with the current CPU utilization of the device, the operating scenario, and the corresponding rate limiting configuration. This allows the control terminal to reproduce the abnormal condition and define new scenarios accordingly. In this way, when network devices encounter new abnormal traffic not covered during the training phase, they can obtain targeted rate limiting parameters through a single offline re-optimization, significantly improving the device's adaptability to new environments.
[0096] As can be seen, this embodiment reproduces the network environment based on packet characteristic data of the network environment to be deployed, through an offline parameter optimization process. It generates corresponding scenario test packet flows for different operating scenarios, and then iteratively searches within a target search space constrained by the processing rate limit, using Bayesian optimization with CPU utilization and protocol packet loss rate as joint optimization objectives. This yields a rate-limiting parameter set highly matched to the processing performance of the network device and the deployment environment, solving the problem of lack of device adaptability in rate-limiting parameters. Furthermore, when abnormal network environments not covered in the initial optimization phase occur after the network device is deployed and running, the control terminal can re-execute rate-limiting parameter optimization based on the abnormal packet data reported by the network device, obtaining rate-limiting parameters corresponding to the abnormal network environment and sending them to the network device to update the network device's rate-limiting parameter set, further improving the adaptability and reliability of packet rate limiting. In addition, the parameter optimization process provided in this embodiment can automatically output optimal rate-limiting parameters adapted to the characteristics of hardware platforms with different CPU frequencies and cache configurations. Therefore, it can be used for automated factory calibration of new devices, replacing the traditional extensive setting relying on experience and reducing deployment risks in the current network.
[0097] See Figure 6As shown in the figure, this application discloses a message rate limiting device applied to a network device, the device comprising: The parameter acquisition module 11 is used to acquire a set of speed limit parameters that are compatible with itself; wherein, the set of speed limit parameters includes speed limit parameters corresponding to different operating scenarios. The scenario determination module 12 is used to obtain the message rate of the protocol message entering the control plane, determine the current operating scenario from the different operating scenarios according to the message rate, and determine the target speed limit parameter corresponding to the current operating scenario from the speed limit parameter set. The speed limiting module 13 is used to limit the speed of protocol messages entering the control plane based on the target speed limiting parameters.
[0098] As can be seen, the network device in this application first obtains a set of rate-limiting parameters adapted to itself. This set of rate-limiting parameters includes rate-limiting parameters corresponding to different operating scenarios, enabling the device to pre-load multiple rate-limiting schemes adapted to its own performance and deployment environment. Furthermore, during device operation, the current operating scenario is determined based on the packet rate of protocol packets entering the control plane, and a target rate-limiting parameter corresponding to the current operating scenario is selected from the rate-limiting parameter set for packet rate limiting. Thus, the current operating scenario of the network device can be identified based on the packet rate of protocol packets entering the control plane, and appropriate rate-limiting parameters can be adaptively selected for different operating scenarios. This avoids the problem of fixed rate-limiting parameters being difficult to adapt to different operating scenarios, thereby improving the adaptability between the packet rate-limiting strategy and the actual operating scenario of the network device, and reducing the impact of abnormal protocol packets on control plane processing resources.
[0099] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Specifically, it may include at least one processor 21, at least one memory 22, and a communication module 23; these components are electrically connected directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The memory 22 stores a computer program 221, which is loaded and executed by the processor 21 to implement the relevant steps in the message rate limiting method or rate limiting parameter optimization method disclosed in any of the foregoing embodiments. In one specific embodiment, the electronic device 20 can be the aforementioned network device, and the processor 21 loads and executes the computer program stored in the memory 22 to implement the relevant steps in the message rate limiting method disclosed in any of the foregoing embodiments. In another specific embodiment, the electronic device 20 can be the aforementioned control terminal, and the processor 21 loads and executes the computer program 221 stored in the memory 22 to implement the relevant steps in the rate limiting parameter optimization method disclosed in any of the foregoing embodiments.
[0100] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0101] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk, or optical disk, etc. The resources stored on it include operating systems, computer programs, and data, and the storage method can be temporary storage or permanent storage.
[0102] Furthermore, embodiments of this application also disclose a computer-readable storage medium storing a computer program. When the computer program is loaded and executed by a processor, it implements the message rate limiting method or rate limiting parameter optimization method disclosed in any of the foregoing embodiments.
[0103] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0104] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0105] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, compact disc read-only memory (CD-ROM), or any other form of storage medium known in the art.
[0106] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0107] The above provides a detailed description of the message rate limiting method, rate limiting parameter optimization method, apparatus, device, and medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A message rate limiting method, characterized in that, Applied to network devices, including: Obtain a set of speed limit parameters that are suitable for itself; wherein, the set of speed limit parameters includes speed limit parameters corresponding to different operating scenarios; The message rate of the protocol messages entering the control plane is obtained, the current operating scenario is determined from the different operating scenarios based on the message rate, and the target speed limit parameter corresponding to the current operating scenario is determined from the speed limit parameter set. The protocol messages entering the control plane are rate-limited based on the target rate-limiting parameters.
2. The message rate limiting method according to claim 1, characterized in that, The operating scenarios include normal operating scenarios and at least one abnormal operating scenario. The speed limit parameter corresponding to the normal operating scenario is lower than the speed limit parameter corresponding to the abnormal operating scenario. The speed limit parameter includes speed limit values corresponding to different protocol types. Determining the current operating scenario from the different operating scenarios based on the message rate includes: The message rate of protocol messages of different protocol types is compared with the rate limit value corresponding to the corresponding protocol type in the at least one abnormal operation scenario. If the message rate of each protocol message does not reach the rate limit value corresponding to the corresponding protocol type in any abnormal operation scenario, then the current operation scenario is determined to be the normal operation scenario. If the message rate of at least one protocol type reaches the rate limit value corresponding to the corresponding protocol type in the at least one abnormal operation scenario, then the current operation scenario is determined from the at least one abnormal operation scenario based on the matching relationship between the message rate of different protocol types and the rate limit value corresponding to each of the abnormal operation scenarios.
3. The message rate limiting method according to claim 2, characterized in that, The at least one abnormal operation scenario includes a single-protocol abnormal operation scenario and a multi-protocol abnormal operation scenario. The step of determining the current operating scenario from the at least one abnormal operating scenario based on the matching relationship between the message rate of different protocol types and the rate limit value corresponding to each of the abnormal operating scenarios includes: If the message rates of at least two protocol types reach the rate limit value of the corresponding protocol type in the same multi-protocol abnormal operation scenario, then the current operation scenario is determined to be the multi-protocol abnormal operation scenario. If only one protocol type's message rate reaches the rate limit value of the corresponding single-protocol abnormal operation scenario, then the current operation scenario is determined to be the single-protocol abnormal operation scenario.
4. The message rate limiting method according to claim 2, characterized in that, The method further includes: When the current operating scenario is an abnormal operating scenario, obtain the message rate of the abnormal protocol message corresponding to the abnormal operating scenario; When the message rate of the abnormal protocol message is continuously lower than the rate limit value corresponding to the abnormal operation scenario, the current operation scenario is switched from the abnormal operation scenario to the normal operation scenario, so as to limit the rate of the protocol messages entering the control plane based on the rate limit parameter corresponding to the normal operation scenario.
5. The message rate limiting method according to any one of claims 2 to 4, characterized in that, After limiting the rate of protocol messages entering the control plane based on the target rate limiting parameter, the method further includes: The system acquires first operational feedback information during the speed limiting process and dynamically adjusts the target speed limiting parameters based on the first operational feedback information, so as to limit the speed of protocol messages entering the control plane based on the adjusted speed limiting parameters.
6. The message rate limiting method according to claim 5, characterized in that, The first operational feedback information includes the CPU utilization of the network device and the packet loss rate of the protocol messages; The step of dynamically adjusting the target speed limit parameter based on the first operational feedback information includes: When the current operating scenario is the normal operating scenario, a target protocol type that meets the preset dynamic adjustment conditions is determined; wherein, the preset dynamic adjustment conditions include: the packet rate of the protocol message of the target protocol type is continuously higher than the current rate limit value corresponding to the normal operating scenario and continuously lower than the rate limit value in the abnormal operating scenario, the CPU utilization is lower than the preset CPU utilization threshold, and the packet loss rate of the protocol message of the target protocol type is lower than the first preset packet loss rate threshold. The speed limit value corresponding to the target protocol type is increased by a preset step size.
7. The message rate limiting method according to claim 6, characterized in that, The method further includes: Determine the rate difference between the message rate of the protocol message of the target protocol type and the current rate limit value; The preset step size is determined based on the rate difference and the preset adjustment coefficient.
8. The message rate limiting method according to claim 6, characterized in that, After increasing the rate limit value corresponding to the target protocol type by a preset step size, the method further includes: Obtain the CPU utilization and packet loss rate of protocol packets of the target protocol type when rate limiting is performed based on the improved rate limiting value; If the CPU utilization exceeds the preset CPU utilization threshold, or the packet loss rate of the protocol message of the target protocol type exceeds the second preset packet loss rate threshold, then the fallback rate limit value is determined based on the average of the rate limit value before the increase and the rate limit value after the increase. Adjust the speed limit value corresponding to the target protocol type to the fallback speed limit value.
9. The message rate limiting method according to claim 6, characterized in that, The method further includes: If the CPU utilization rate remains higher than the preset abnormal CPU threshold for a preset duration, the currently used rate limiting parameter will be switched to a guaranteed rate limiting parameter that is compatible with itself, and the protocol messages entering the control plane will be rate limited based on the guaranteed rate limiting parameter.
10. A method for optimizing speed limit parameters, characterized in that, Applied to a control terminal, for obtaining a set of rate limiting parameters adapted to a network device in the message rate limiting method according to any one of claims 1 to 9, wherein the rate limiting parameter optimization method includes: Obtain packet characteristic data of the network environment in which the network device is to be deployed; Traffic generation rules are constructed based on the packet feature data to generate basic test packet flows for reproducing the network environment; For each of the different operating scenarios, a corresponding scenario test message stream is generated based on the basic test message stream. Configure the network device using preset initial candidate rate limiting parameters, and control the tester to input the scenario test packet stream into the network device to obtain the second operational feedback information when the network device processes the scenario test packet stream; Based on the initial candidate rate limiting parameters and the corresponding second operational feedback information, an iterative search is performed using Bayesian optimization within the target search space to obtain rate limiting parameters corresponding to different operational scenarios, thereby forming a rate limiting parameter set adapted to the network device.
11. The speed limit parameter optimization method according to claim 10, characterized in that, The different operating scenarios include normal operation scenarios, single-protocol abnormal operation scenarios, and multi-protocol abnormal operation scenarios; For each of the different operating scenarios, generating a corresponding scenario test message stream based on the basic test message stream includes: For the aforementioned normal operation scenario, the basic test message stream is determined as the scenario test message stream; For the single-protocol abnormal operation scenario, a protocol message of an abnormal protocol type is superimposed on the basic test message stream to control the tester to generate the corresponding scenario test message stream; For the aforementioned multi-protocol abnormal operation scenario, protocol messages of at least two abnormal protocol types are superimposed on the basic test message stream to control the tester to generate the corresponding scenario test message stream.
12. The speed limit parameter optimization method according to claim 10, characterized in that, The step of obtaining packet characteristic data of the network environment to be deployed by the network device includes: Obtain packet sample data of the network environment to be deployed on the network device; Extract at least one of the following message feature data from the message sample data: message timestamp offset, source MAC address, destination MAC address, source IP address, destination IP address, port number, protocol type, protocol field information, message length, burstiness identifier, and protocol interaction timing characteristics.
13. The speed limit parameter optimization method according to claim 10, characterized in that, Before configuring the network device using preset initial candidate rate limiting parameters, the method further includes: Gradually increase the packet rate of the test packets input to the network device, and obtain the CPU utilization rate of the network device accordingly; When the CPU utilization reaches a preset CPU utilization threshold, the packet processing rate of the network device for protocol messages entering the control plane is obtained, and the packet processing rate is determined as the upper limit of the processing rate. Based on the processing rate upper limit, the range of rate limit values corresponding to different protocol types is determined to construct the target search space.
14. The speed limit parameter optimization method according to claim 13, characterized in that, The iterative search process using Bayesian optimization within the target search space also includes: If the sum of the candidate rate limit values corresponding to different protocol types in the target candidate rate limit parameters is greater than the processing rate upper limit, then a penalty is imposed on the target candidate rate limit parameter to reduce the probability of the target candidate rate limit parameter being selected in subsequent iterative search processes.
15. The speed limit parameter optimization method according to any one of claims 10 to 14, characterized in that, Based on the initial candidate speed limit parameters and the corresponding second operational feedback information, an iterative search is performed within the target search space using Bayesian optimization to obtain speed limit parameters corresponding to different operational scenarios, including: Multiple sets of initial candidate speed limit parameters and corresponding second running feedback information are stored in the training dataset, and a proxy model is constructed based on the training dataset. Based on the proxy model and the preset acquisition function, new candidate speed limit parameters are generated in the target search space; Configure the network device using the new candidate rate limiting parameters, and input the scenario test packet stream corresponding to the running scenario into the network device to obtain the second running feedback information corresponding to the new candidate rate limiting parameters, and update the training dataset. The proxy model is updated using the updated training dataset, and then the process jumps back to the step of generating new candidate speed limit parameters in the target search space based on the proxy model and the preset acquisition function, until the preset iteration termination condition is met, and the speed limit parameters for the corresponding running scenario are determined based on the iteration search results.
16. The speed limit parameter optimization method according to claim 15, characterized in that, The second operational feedback information includes the CPU utilization of the network device and the packet loss rate of protocol messages of different protocol types; Before constructing the proxy model based on the training dataset, the process also includes: Based on the initial candidate rate limiting parameters, the CPU utilization of the network device, and the packet loss rate of protocol packets of different protocol types, the loss value is calculated using a preset loss function. The initial candidate rate limiting parameters and their corresponding loss values are associated and stored in the training dataset.
17. The speed limit parameter optimization method according to claim 16, characterized in that, The preset iteration termination conditions include: During the iterative search process of a preset number of consecutive iterations, the rate of change between the optimal loss values obtained from two adjacent iterations is less than a preset rate of change threshold; wherein, the optimal loss value corresponding to any iteration is the minimum value among the loss values corresponding to each candidate speed limit parameter tested up to that iteration.
18. The speed limit parameter optimization method according to claim 15, characterized in that, Also includes: Obtain abnormal message data reported by the network device during deployment and operation; wherein, the abnormal message data is message data collected during the period when the CPU utilization of the network device is continuously higher than a preset abnormal CPU threshold; Extract abnormal message feature data from the abnormal message data; Based on the abnormal message feature data, a basic test message flow for reproducing the abnormal network environment is reconstructed, and the rate limiting parameters are optimized based on the reconstructed basic test message flow to obtain the rate limiting parameters corresponding to the abnormal network environment. The rate limiting parameters corresponding to the abnormal network environment are sent to the network device to update the rate limiting parameter set of the network device.
19. A message rate limiting device, characterized in that, Applied to network devices, including: The parameter acquisition module is used to acquire a set of speed limit parameters that are compatible with itself; wherein, the set of speed limit parameters includes speed limit parameters corresponding to different operating scenarios. The scenario determination module is used to obtain the message rate of the protocol messages entering the control plane, determine the current operating scenario from the different operating scenarios based on the message rate, and determine the target speed limit parameter corresponding to the current operating scenario from the speed limit parameter set. A rate limiting module is used to limit the rate of protocol messages entering the control plane based on the target rate limiting parameters.
20. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor is configured to execute the computer program to implement the message rate limiting method as described in any one of claims 1 to 9, or to implement the rate limiting parameter optimization method as described in any one of claims 10 to 18.
21. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein, when the computer programs are executed by a processor, they implement the message rate limiting method as described in any one of claims 1 to 9, or the rate limiting parameter optimization method as described in any one of claims 10 to 18.
