A storm flow control method, device, electronic equipment, and medium for a switch.
By dynamically adjusting the storm bandwidth threshold in the switch, the problem of the inability to control storms according to changes in network conditions in existing technologies is solved, realizing intelligent control of various types of traffic and improving network reliability and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INSPUR SUZHOU INTELLIGENT TECH CO LTD
- Filing Date
- 2023-05-26
- Publication Date
- 2026-06-30
AI Technical Summary
Existing storm control methods for switches cannot dynamically adjust according to network conditions, resulting in an inability to meet the ever-changing traffic demands of data center networks and impacting network performance and stability.
By acquiring the remaining bandwidth of the port in each control cycle, the storm bandwidth thresholds for different types of traffic, such as multicast, broadcast, and unicast, are dynamically adjusted, and the storm control configuration is automatically updated using the remaining bandwidth, thus achieving intelligent control of various types of traffic.
It improves the reliability and stability of the switch network, ensures the stability and controllability of different types of traffic during transmission, and enhances network performance and service quality.
Smart Images

Figure CN116800676B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of switch technology, specifically relating to a storm flow control method, device, electronic equipment, and medium for a switch. Background Technology
[0002] With the development of multi-service networks, the amount of data carried by these networks is increasing exponentially. Furthermore, the services within these networks consume a significant amount of network bandwidth, making bandwidth a bottleneck for internet development. To ensure that bandwidth meets service demands as much as possible, storm control is necessary. Traditional storm control on switches involves pre-configuring maximum bandwidth for broadcast, multicast, and unicast traffic on the switch interfaces and comparing the current traffic rate with pre-configured thresholds. When the packet traffic rate reaches the upper limit threshold, the excess packets are dropped until the traffic rate falls below the threshold, at which point normal operation resumes.
[0003] For the same port, different storm types can only be configured with control policies individually. Since changing the configuration must be done manually and it is not easy to adjust the settings according to changes in the current network conditions, this technology cannot meet the ever-changing data center network traffic demands of today. Therefore, meeting the ever-changing data center network traffic demands is an urgent problem to be solved. Summary of the Invention
[0004] In view of the above problems, embodiments of this application provide a storm flow control method, apparatus, electronic device and medium for a switch, so as to overcome the above problems or at least partially solve the above problems.
[0005] In a first aspect, this application provides a storm flow control method for a switch, the method comprising:
[0006] In each control cycle, obtain the remaining bandwidth of the port;
[0007] Based on the remaining bandwidth, the storm bandwidth thresholds corresponding to various types of traffic in the current control cycle are adjusted; wherein, the larger the remaining bandwidth, the larger the storm bandwidth threshold is adjusted.
[0008] Based on the first storm bandwidth threshold corresponding to the various types of traffic in the previous control cycle of the current control cycle, and the second storm bandwidth threshold adjusted in the current control cycle, the various types of storm traffic are controlled respectively.
[0009] The various types include at least one of multicast, broadcast and unicast.
[0010] Optionally, obtaining the remaining bandwidth of the port in each control cycle includes:
[0011] Obtain the traffic passing through the port;
[0012] Based on the traffic, determine the bandwidth usage of the port;
[0013] Based on the bandwidth usage, the remaining bandwidth is obtained.
[0014] Optionally, adjusting the storm bandwidth thresholds corresponding to various types of traffic in the current control cycle based on the remaining bandwidth includes:
[0015] Determine the increment of the remaining bandwidth relative to a preset remaining bandwidth; wherein the preset remaining bandwidth is used to ensure the passage of various types of normal traffic;
[0016] If the increment is greater than zero, the increment is allocated to the storm bandwidth threshold;
[0017] If the increment is less than or equal to zero, the storm bandwidth threshold is reduced by the increment.
[0018] Optionally, after allocating the increment to the storm bandwidth threshold when the increment is greater than zero, the method further includes:
[0019] Based on the real-time traffic of the various traffic types in the current period, determine the total storm bandwidth occupied by the various traffic types on the port;
[0020] When the total storm bandwidth is less than or equal to the total storm bandwidth threshold, the target type corresponding to the traffic exceeding the storm bandwidth threshold is determined among the various types of traffic; wherein, the total storm bandwidth threshold is used to characterize the sum of the storm bandwidth thresholds after incremental allocation corresponding to the various types of traffic respectively;
[0021] Reduce the storm bandwidth threshold for traffic types other than the target type.
[0022] Optionally, before reducing the storm bandwidth threshold by the increment if the increment is less than or equal to zero, the method further includes:
[0023] Determine whether the storm bandwidth threshold is less than the minimum storm bandwidth; wherein, the minimum storm bandwidth is used to prevent network interruption;
[0024] When the remaining bandwidth is less than the preset remaining bandwidth, the storm bandwidth threshold is reduced by the increment, including:
[0025] If the storm bandwidth threshold is greater than the minimum storm bandwidth, the storm bandwidth threshold is reduced by the increment.
[0026] Optionally, the control of the various types of storm traffic based on the first storm bandwidth threshold corresponding to each type of traffic in the previous control cycle and the second storm bandwidth threshold adjusted for the current control cycle includes:
[0027] Based on the first storm bandwidth threshold and the second storm bandwidth threshold, determine the target storm bandwidth threshold corresponding to the current control cycle;
[0028] Storm traffic flowing into the port that exceeds the target storm bandwidth threshold is suppressed until the bandwidth of the storm traffic is less than the target storm bandwidth threshold.
[0029] Optionally, determining the target storm bandwidth threshold corresponding to the current control cycle based on the first storm bandwidth threshold and the second storm bandwidth threshold includes:
[0030] Determine the threshold difference between the first storm bandwidth threshold and the second storm bandwidth threshold;
[0031] If the threshold difference is less than or equal to the preset threshold difference, the first storm bandwidth threshold is determined as the target storm bandwidth threshold; wherein, the preset threshold difference is used to characterize the fault tolerance rate between the first bandwidth threshold and the second bandwidth threshold;
[0032] If the threshold difference is greater than the preset threshold difference, the second storm bandwidth threshold is determined as the target storm bandwidth threshold.
[0033] Optionally, suppressing storm traffic flowing into the port and exceeding the target storm bandwidth threshold includes:
[0034] Based on the target storm bandwidth threshold, update the storm suppression level corresponding to the port; wherein, different storm bandwidth thresholds correspond to different storm suppression levels;
[0035] Based on the storm suppression level, the storm flow entering the port is suppressed.
[0036] A second aspect of this application provides a storm flow control device for a switch, the device comprising:
[0037] The acquisition module is used to acquire the remaining bandwidth of the port in each control cycle;
[0038] The adjustment module is used to adjust the storm bandwidth thresholds corresponding to various types of traffic in the current control cycle based on the remaining bandwidth; wherein, the larger the remaining bandwidth, the larger the storm bandwidth threshold is adjusted.
[0039] The control module is used to control the various types of storm traffic based on the first storm bandwidth threshold corresponding to the various types of traffic in the previous control cycle and the second storm bandwidth threshold adjusted in the current control cycle.
[0040] The various types include at least one of multicast, broadcast and unicast.
[0041] Optionally, the acquisition module includes:
[0042] Acquisition Submodule 1 is used to acquire traffic passing through the port;
[0043] Based on the traffic, determine the bandwidth usage of the port;
[0044] Based on the bandwidth usage, the remaining bandwidth is obtained.
[0045] Optionally, the adjustment module includes:
[0046] The first submodule is used to determine the increment of the remaining bandwidth relative to the preset remaining bandwidth; wherein the preset remaining bandwidth is used to ensure the passage of various types of normal traffic.
[0047] Adjustment submodule one is used to allocate the increment to the storm bandwidth threshold when the increment is greater than zero;
[0048] Adjust to module two, used to reduce the storm bandwidth threshold by the increment if the increment is less than or equal to zero.
[0049] Optionally, the second adjustment submodule further includes:
[0050] Submodule 2 is used to determine the total storm bandwidth occupied by the various types of traffic on the port based on the real-time traffic of the various types of traffic in the current period;
[0051] Submodule 3 is used to determine the target type of traffic exceeding the storm bandwidth threshold among the various types of traffic when the total storm bandwidth is less than or equal to the total storm bandwidth threshold; wherein, the total storm bandwidth threshold is used to characterize the sum of the storm bandwidth thresholds after incremental allocation corresponding to the various types of traffic respectively;
[0052] The reduction module is used to reduce the storm bandwidth threshold corresponding to other types of traffic besides the target type.
[0053] Optionally, before reducing the storm bandwidth threshold by the increment if the increment is less than or equal to zero, the adjustment module further includes:
[0054] Adjustment submodule four is used to determine whether the storm bandwidth threshold is less than the minimum storm bandwidth; wherein, the minimum storm bandwidth is used to prevent network interruption;
[0055] When the remaining bandwidth is less than the preset remaining bandwidth, the storm bandwidth threshold is reduced by the increment, including:
[0056] If the storm bandwidth threshold is greater than the minimum storm bandwidth, the storm bandwidth threshold is reduced by the increment.
[0057] Optionally, the control module includes:
[0058] The fourth submodule is used to determine the target storm bandwidth threshold corresponding to the current control cycle based on the first storm bandwidth threshold and the second storm bandwidth threshold.
[0059] A suppression module is used to suppress storm traffic flowing into the port that exceeds the target storm bandwidth threshold until the bandwidth of the storm traffic is less than the target storm bandwidth threshold.
[0060] Optionally, the determining submodule four includes:
[0061] Submodule 5 is used to determine the threshold difference between the first storm bandwidth threshold and the second storm bandwidth threshold.
[0062] If the threshold difference is less than or equal to the preset threshold difference, the first storm bandwidth threshold is determined as the target storm bandwidth threshold; wherein, the preset threshold difference is used to characterize the fault tolerance rate between the first bandwidth threshold and the second bandwidth threshold;
[0063] If the threshold difference is greater than the preset threshold difference, the second storm bandwidth threshold is determined as the target storm bandwidth threshold.
[0064] Optionally, the compression module includes:
[0065] The update module is used to update the storm suppression level of the port based on the target storm bandwidth threshold; wherein different storm bandwidth thresholds correspond to different storm suppression levels;
[0066] Based on the storm suppression level, the storm flow entering the port is suppressed.
[0067] In a third aspect of the present invention, an electronic device is provided, the electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the storm flow control method of the switch as described in the first aspect of the present invention.
[0068] In a fourth aspect of the present invention, a storage medium is provided, wherein when the program is executed by a processor, it implements the storm flow control method of the switch as described in the first aspect of the present invention.
[0069] The storm traffic control method for a switch provided by this invention first obtains the remaining bandwidth of the port in each control cycle. Then, based on the remaining bandwidth, the storm bandwidth thresholds corresponding to various types of traffic in the current control cycle are adjusted. The adjustment follows the rule that the larger the remaining bandwidth, the larger the storm bandwidth threshold is adjusted. The storm control configuration can be automatically updated according to the status of port service traffic, and storm control can be performed reasonably. Finally, based on the first storm bandwidth thresholds corresponding to various types of traffic in the previous control cycle and the second storm bandwidth thresholds adjusted in the current control cycle, the various types of storm traffic are controlled respectively. The various types include at least one of multicast, broadcast and unicast, thereby realizing the control of the switch traffic.
[0070] The method provided by this invention can not only automatically adjust the storm bandwidth threshold by utilizing bandwidth availability and service traffic status to achieve more reasonable storm control and improve the reliability and stability of the switch network, but also control different types of traffic (multicast, broadcast, and unicast) separately to ensure the stability and controllability of different types of traffic during transmission, thereby improving network performance and service quality. Attached Figure Description
[0071] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0072] Figure 1 This is a flowchart illustrating the steps of a storm flow control method for a switch provided in an embodiment of this application;
[0073] Figure 2This is a flowchart of an automated storm control process for a switch provided in an embodiment of this application;
[0074] Figure 3 This is a flowchart illustrating the generation of a storm control configuration provided in an embodiment of this application;
[0075] Figure 4 This is a schematic diagram of a storm flow control device for a switch provided in an embodiment of this application;
[0076] Figure 5 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0077] Exemplary embodiments of this application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of this application and to fully convey the scope of this application to those skilled in the art.
[0078] Storm control typically refers to BUM storms, which include broadcast, unknown unicast, unknown multicast, and multicast. The essence of storm control is to manage BUM type packet traffic to prevent it from consuming excessive network bandwidth, thereby ensuring the network performance of the switch.
[0079] Current storm control methods in switches are unidirectional, requiring manual configuration of storm control policies before being sent to the switching chip. This process lacks a feedback mechanism, preventing the formation of a closed-loop control system. This results in overly rigid storm control, failing to adapt to the current traffic demands of the switch. However, BUM (Block Memory Usage) type packets are not useless traffic; they may contain useful information. If, when the switch port has ample network bandwidth, the previously manually set thresholds are still applied to restrict BUM type packets, preventing normal packet forwarding, this can negatively impact network performance and packet forwarding quality.
[0080] Therefore, this application provides a method, apparatus, and electronic device for controlling storms in a switch to solve the above-mentioned problems.
[0081] Example 1
[0082] Reference Figure 1 , Figure 1This is a flowchart illustrating the steps of a storm flow control method for a switch according to an embodiment of this application. The steps of the storm flow control method include:
[0083] Step S101: In each control cycle, obtain the remaining bandwidth of the port.
[0084] In this embodiment, a port refers to a physical or logical interface on a switch used to access network devices (such as computers, servers, routers, firewalls, etc.). Switches typically have multiple ports, each with a unique identifier (such as a port number) to identify its location within the switch. Through ports, the switch can identify and manage data traffic between devices, enabling network communication and traffic control. First, the port's service traffic information is periodically collected according to a control cycle, the duration of which can be set manually, to obtain the port's remaining bandwidth.
[0085] For example, this application uses the case where the bandwidth of a port is a fixed value. Assuming the port bandwidth is 1000 megabits per second and the traffic flowing through the port is 600 megabits per second, then the remaining bandwidth is 400 megabits per second.
[0086] Step S102: Based on the remaining bandwidth, adjust the storm bandwidth thresholds corresponding to various types of traffic in the current control cycle; wherein, the larger the remaining bandwidth, the larger the storm bandwidth threshold is adjusted.
[0087] In this embodiment, the switch ports will set threshold bandwidth according to different types of traffic, including normal traffic threshold and storm traffic threshold. Initially, the storm traffic threshold is a fixed value, but the storm traffic in the traffic is a variable value. Therefore, when forwarding storm traffic, the storm traffic threshold corresponding to each type of storm traffic will be adjusted according to the remaining bandwidth. The adjustment rule is to choose to raise or lower the storm bandwidth threshold based on the amount of remaining bandwidth.
[0088] For example, assuming a port bandwidth of 1000 Mbps, the threshold for normal broadcast traffic is 20 Mbps. Traffic less than or equal to 20 Mbps is considered normal traffic, while traffic exceeding 20 Mbps is considered storm traffic. If the storm traffic threshold is 30 Mbps, it means the port can allow broadcast storm traffic between 20 Mbps and 30 Mbps to pass through. However, storm traffic is uncontrollable and may exceed 30 Mbps. If there is ample bandwidth remaining on the port, the broadcast storm traffic threshold can be increased. While ensuring normal traffic can pass, the broadcast storm traffic threshold can be increased to 50 Mbps. Furthermore, if multiple types of storm traffic thresholds exist on the port, they can be proportionally allocated to different types of storm traffic based on the remaining port bandwidth, thus adjusting the storm bandwidth threshold.
[0089] Step S103: Based on the first storm bandwidth threshold corresponding to the various types of traffic in the previous control period of the current control period, and the second storm bandwidth threshold adjusted in the current control period, control the various types of storm traffic respectively; wherein, the various types include at least one of multicast, broadcast and unicast.
[0090] In this embodiment, unicast refers to a one-to-one communication mode, where each data packet is sent to only one specific target address; broadcast refers to a one-to-many communication mode, where each data packet is sent to all hosts in the same broadcast domain; multicast is between unicast and broadcast, sending data to a group of specific target addresses at once. This group is called a multicast group, and each member in the group can receive the data packet. Since multicast, broadcast, and unicast have different data packet transmission methods, they have different impacts on the network. Therefore, it is necessary to control different types of traffic separately.
[0091] After obtaining the adjusted storm bandwidth threshold, the corresponding configuration information is automatically generated and sent to the switching chip. The switching chip then controls the traffic flowing into the port. Therefore, before sending the information, the storm bandwidth threshold of the previous period is obtained. Specifically, the storm bandwidth threshold of the previous period can be obtained by using a timestamp, which is the first storm bandwidth threshold. The first storm bandwidth threshold corresponding to each type of traffic in the previous period is then determined to be the same as the adjusted storm bandwidth threshold corresponding to each type of traffic, which is the second storm bandwidth threshold. This determines whether the configuration information corresponding to the adjusted second storm bandwidth threshold needs to be sent to the switching chip to control the storm traffic.
[0092] In one embodiment, obtaining the remaining bandwidth of a port in each control cycle includes: obtaining the traffic passing through the port; determining the bandwidth usage of the port based on the traffic; and obtaining the remaining bandwidth based on the bandwidth usage.
[0093] In this embodiment, the port bandwidth is a fixed amount in each control cycle. The traffic flowing through the port is acquired periodically. The traffic includes normal traffic and storm traffic. The port bandwidth usage is determined based on the traffic flow rate. In this application, the flow rate of the traffic flowing through the port can be directly obtained through the transmission protocol. Therefore, the port bandwidth utilization rate, i.e., the port bandwidth usage, can be known. Based on the port usage, the remaining bandwidth of the current port can be obtained.
[0094] For example, this application uses the case where the bandwidth of a port is a fixed value. Assuming the port bandwidth is 1000 megabits per second and the various types of traffic flowing through the port are 600 megabits per second, then the remaining bandwidth is 400 megabits per second.
[0095] In one embodiment, adjusting the storm bandwidth thresholds corresponding to various types of traffic in the current control cycle based on the remaining bandwidth includes: determining the increment of the remaining bandwidth relative to a preset remaining bandwidth; wherein the preset remaining bandwidth is used to ensure the passage of various types of normal traffic; when the increment is greater than zero, allocating the increment to the storm bandwidth threshold; when the increment is less than or equal to zero, reducing the storm bandwidth threshold by the increment.
[0096] In this embodiment, in order to ensure the passage of various types of normal traffic, there is a preset bandwidth remaining amount for protection. Therefore, after obtaining the port bandwidth remaining amount, the port bandwidth remaining amount is subtracted from the preset bandwidth remaining amount to obtain an increment of the port bandwidth remaining amount compared to the preset bandwidth remaining amount. This increment can be a positive increment, a negative increment, or a zero increment. Therefore, based on the type of increment, it is further determined how to adjust the storm bandwidth threshold.
[0097] When the increment is positive (i.e., the increment is greater than zero), the increment is allocated to the storm bandwidth thresholds corresponding to the various types of traffic, thereby increasing the storm bandwidth thresholds. The specific allocation method is not limited; it can be allocated according to the proportion of different types of traffic on the port, or it can be allocated evenly according to the quantity of different types, or it can be allocated only to increase the storm bandwidth threshold. A reasonable allocation method can be adopted according to the actual application scenario.
[0098] When the increment is negative or zero, i.e., the increment is less than or equal to zero, the storm bandwidth is reduced according to the increment value. In the case of negative increment, the reduction can be based on the proportion of different types of traffic on the port, or the reduction can be based on the average quantity of different types. This application does not limit the reduction method, as long as the remaining bandwidth after reduction is greater than or equal to the preset remaining bandwidth. The appropriate reduction method can be selected to reduce the storm bandwidth threshold according to the actual application scenario.
[0099] When the increment is zero, the storm bandwidth threshold is not reduced, which can also be understood as reducing the storm bandwidth threshold by zero.
[0100] In one embodiment, after allocating the increment to the storm bandwidth threshold when the increment is greater than zero, the method further includes: determining the total storm bandwidth occupied by the various types of traffic on the port based on the real-time traffic of the various types of traffic in the current period; when the total storm bandwidth is less than or equal to the total storm bandwidth threshold, determining the target type corresponding to the traffic exceeding the storm bandwidth threshold among the various types of traffic; wherein the total storm bandwidth threshold is used to characterize the sum of the storm bandwidth thresholds after the incremental allocation corresponding to the various types of traffic respectively; reducing the storm bandwidth thresholds corresponding to other types of traffic besides the target type.
[0101] In this embodiment, after the storm bandwidth threshold is increased, the total threshold of storm bandwidth for various types after adjusting the storm bandwidth can be known. Furthermore, based on the real-time traffic of various types of traffic in the current period, which includes various types of storm traffic, the total storm bandwidth occupied by the various types of traffic can be determined. When the total storm bandwidth is less than or equal to the total storm bandwidth threshold, the target type corresponding to the traffic exceeding the storm bandwidth threshold is determined among the various types of traffic. The total storm bandwidth threshold is used to characterize the sum of the incrementally allocated storm bandwidth thresholds corresponding to various types of traffic, reducing the storm bandwidth thresholds corresponding to other types of traffic besides the target type.
[0102] For example, the storm bandwidth thresholds for three types of traffic A, B, and C flowing through the port before adjustment are 20, 30, and 40 respectively, and the storm bandwidth thresholds after adjustment are 40, 50, and 60 respectively. Therefore, the total storm bandwidth threshold after adjustment is 150. Assuming that after adjustment, the real-time bandwidth occupied by the three types of storm traffic A, B, and C flowing through the port is 50, 40, and 50 respectively, the total storm bandwidth is 140, which is less than the total storm bandwidth threshold after adjustment. Further, it is determined that among the various traffic types, the traffic exceeding the storm bandwidth threshold is A. To ensure that A can pass, the storm bandwidth thresholds of B or C will be reduced, or both B and C's storm bandwidth thresholds will be reduced simultaneously. This application does not limit the reduction of other types of storm bandwidth thresholds; reductions will be made according to actual needs.
[0103] In one embodiment, before reducing the storm bandwidth threshold by the increment when the increment is less than or equal to zero, the method further includes: determining whether the storm bandwidth threshold is less than a minimum storm bandwidth; wherein the minimum storm bandwidth is used to prevent network interruption; reducing the storm bandwidth threshold by the increment when the remaining bandwidth is less than the preset remaining bandwidth includes: reducing the storm bandwidth threshold by the increment when the storm bandwidth threshold is greater than the minimum storm bandwidth.
[0104] In this embodiment, when the storm bandwidth threshold is reduced when the increment is less than or equal to zero, it is determined whether the storm bandwidth threshold is less than the minimum storm bandwidth. The minimum storm bandwidth is used to prevent network interruption and ensure normal communication of switch ports. When the remaining bandwidth is less than the preset remaining bandwidth, the storm bandwidth threshold is reduced incrementally, including: when the storm bandwidth threshold is greater than the minimum storm bandwidth, the storm bandwidth threshold is reduced incrementally; when the storm bandwidth threshold is equal to the minimum storm bandwidth, the storm bandwidth threshold is not reduced, which means the storm bandwidth is reduced to the minimum storm bandwidth.
[0105] In one embodiment, the control of the various types of storm traffic based on the first storm bandwidth threshold corresponding to the various types of traffic in the previous control cycle and the second storm bandwidth threshold adjusted for the current control cycle includes: determining a target storm bandwidth threshold corresponding to the current control cycle based on the first storm bandwidth threshold and the second storm bandwidth threshold; and suppressing storm traffic flowing into the port that exceeds the target storm bandwidth threshold until the bandwidth of the storm traffic is less than the target storm bandwidth threshold.
[0106] In this embodiment, it is necessary to determine the target storm bandwidth threshold corresponding to the current control cycle. The target storm bandwidth threshold is the configuration information used down to the switching chip. The suppression of storm traffic is based on the target storm traffic. Therefore, storm traffic flowing into the port and exceeding the target storm bandwidth threshold is suppressed until the bandwidth of the storm traffic is less than the target storm bandwidth threshold before the storm traffic is allowed to pass.
[0107] In one embodiment, determining the target storm bandwidth threshold corresponding to the current control cycle based on the first storm bandwidth threshold and the second storm bandwidth threshold includes: determining the threshold difference between the first storm bandwidth threshold and the second storm bandwidth threshold; if the threshold difference is less than or equal to a preset threshold difference, determining the first storm bandwidth threshold as the target storm bandwidth threshold; wherein the preset threshold difference is used to characterize the fault tolerance rate between the first bandwidth threshold and the second bandwidth threshold; if the threshold difference is greater than the preset threshold difference, determining the second storm bandwidth threshold as the target storm bandwidth threshold.
[0108] In this embodiment, determining the target storm bandwidth threshold is to determine whether the switch chip configuration needs to be updated again in the current cycle. To avoid repeated downloads and updates that reduce the transmission efficiency of the switch ports, it is necessary to determine the threshold difference between the first storm bandwidth threshold of the previous cycle and the second storm threshold of the current control cycle. The threshold difference refers to the difference between the storm bandwidth thresholds of various types of traffic in the second storm bandwidth and the storm bandwidth thresholds of various types of traffic in the first storm bandwidth.
[0109] If the threshold difference is less than or equal to the preset threshold difference, the first storm bandwidth threshold will be determined as the target storm bandwidth threshold; if the threshold difference is greater than the threshold difference, the second storm bandwidth threshold will be determined as the target storm bandwidth threshold.
[0110] In one embodiment, suppressing storm traffic flowing into the port that exceeds the target storm bandwidth threshold includes: updating the storm suppression level corresponding to the port based on the target storm bandwidth threshold; wherein different storm bandwidth thresholds correspond to different storm suppression levels; and suppressing the storm traffic flowing into the port based on the storm suppression level.
[0111] In this embodiment, the storm suppression level corresponding to the port needs to be updated according to the target storm bandwidth threshold. Different storm bandwidth thresholds correspond to different storm suppression levels. According to the storm suppression level, storm traffic exceeding the target storm bandwidth threshold in the traffic flowing into the port is suppressed until the inbound traffic drops below a predetermined threshold.
[0112] For example, refer to Figure 2 , Figure 2 This is a flowchart of an automated storm control process for a switch provided in an embodiment of this application, illustrating the implementation of automated storm control in a switch:
[0113] Step S201: Periodically collect service traffic information for the port. The traffic information includes BUM storm traffic information (bandwidth percentage and whether the threshold has been reached), port bandwidth utilization, and timestamps.
[0114] Step S202: Based on the collected port information, according to the proportion of different types of storm traffic and port bandwidth utilization, obtain the remaining bandwidth of the port, calculate the limit threshold for different storm types, and generate the corresponding storm control configuration, i.e., the second storm bandwidth threshold.
[0115] Step S203: Determine whether the control strategy has been updated. Check whether the threshold difference between the current second storm bandwidth threshold and the first storm bandwidth threshold of the previous control cycle is less than or equal to the preset threshold difference. If yes, proceed to step S204; otherwise, proceed to step S206.
[0116] Step S204: Update the storm control configuration, i.e. the target storm bandwidth threshold, and send the configuration to the switching chip.
[0117] Step S205: The switching chip completes storm control according to the issued configuration.
[0118] Step S206: Determine whether to turn off storm control. If yes, end the process; otherwise, proceed to step S201.
[0119] To achieve automated storm control, the method provided in this application is applied to the SONiC system. It completes storm traffic control of the switch under the SONiC system by setting up a port storm information acquisition module, a control policy automatic generation module, a control configuration distribution module, and a storm control execution module.
[0120] Port Storm Information Collection Module: SONiC's original Everflow function periodically collects BUM storm traffic information (bandwidth percentage and whether the threshold has been reached), port bandwidth utilization, and timestamps, and incorporates port tags. This information is then written to STATE_DB (status database).
[0121] Automatic Control Policy Generation Module: This module is placed in the SWSS (Switch StateService) container of the SONiC system. When the port storm information acquisition module writes relevant information into the State_DB (state database), the State_DB (state database) will determine the remaining bandwidth of the port based on the information. Based on the remaining bandwidth, the automatic control policy generation module will be triggered to run, and according to the control policy generation rules, it will calculate the storm bandwidth threshold for different types of traffic, generate storm control configuration, and write the configuration into the CONFIG_DB (configuration database).
[0122] Reference Figure 3 , Figure 3 This is a flowchart illustrating a storm control configuration generation process provided in this application embodiment, which describes a storm control configuration that the control strategy generation module can generate:
[0123] Initially, in each control cycle, the remaining bandwidth of the port is obtained. After obtaining the remaining bandwidth, proceed to step S301.
[0124] Step S301: Determine if there is any remaining bandwidth on the current port, and if the remaining bandwidth is greater than the preset remaining bandwidth. If yes, proceed to step S302; otherwise, proceed to step S303.
[0125] Step S302: Determine the increment of the remaining bandwidth relative to the preset remaining bandwidth, allocate the increment according to the storm bandwidth threshold ratio of different types of traffic, increase the bandwidth that the BUM storm can occupy, and proceed to step S305 after the increase is completed.
[0126] Step S303: Determine whether the bandwidth occupied by the storm traffic of the current different types of traffic is less than the specified minimum storm bandwidth. If not, proceed to step S304; if yes, proceed to step S305.
[0127] Step S304: Reduce the storm bandwidth threshold of different types of traffic proportionally so that the remaining bandwidth of the port is greater than or equal to the preset remaining bandwidth. After the reduction is completed, proceed to step S305.
[0128] Step S305: Generate storm control configuration, i.e. target storm bandwidth threshold. Calculate the speed threshold for different types of storm traffic based on the adjusted storm bandwidth threshold, and send the control configuration to the distribution module.
[0129] Control configuration distribution module: This module is placed in the SWSS container of the SONiC system. It is triggered when the storm control configuration is written to CONFIG_DB (configuration database). Note that this module will be triggered regardless of whether there is already a storm control configuration in CONFIG_DB.
[0130] The control configuration distribution module first compares the configuration information in CONFIG_DB (the second storm bandwidth threshold in the current control cycle) with the storm control configuration in APPL_DB (the application database) for the previous control cycle (the first storm bandwidth threshold). It then determines the threshold difference between the first and second storm bandwidth thresholds. If the threshold difference is less than or equal to the preset threshold difference, the configuration distribution is abandoned. If they are different, the configuration in CONFIG_DB is updated in APPL_DB, and the storm control configuration information is distributed to the switching chip connected to the device by SAI (Switch Abstraction Interface).
[0131] Storm control execution module: The switching chip performs storm control based on the received storm control configuration information, updates the storm suppression level corresponding to the port, and suppresses the storm traffic flowing into the port according to the storm suppression level.
[0132] Specifically, the switching chip continuously monitors the inbound traffic of the port corresponding to the storm control configuration information, and compares the current type of traffic with the updated storm suppression level (specifically, the corresponding predetermined threshold value). Storm traffic exceeding the target storm bandwidth threshold in the traffic flowing into the port is suppressed until the inbound traffic drops below the predetermined threshold value.
[0133] Example 2
[0134] The embodiments of this application refer to... Figure 4 , Figure 4 A schematic diagram of a storm flow control device for a switch is provided, the device comprising: an acquisition module 401, an adjustment module 402, and a control module 403.
[0135] The acquisition module 401 is used to acquire the remaining bandwidth of the port in each control cycle;
[0136] The adjustment module 402 is used to adjust the storm bandwidth thresholds corresponding to various types of traffic in the current control cycle based on the remaining bandwidth; wherein, the larger the remaining bandwidth, the larger the storm bandwidth threshold is adjusted.
[0137] Control module 403 is used to control the various types of storm traffic based on the first storm bandwidth threshold corresponding to the various types of traffic in the previous control cycle and the second storm bandwidth threshold adjusted in the current control cycle.
[0138] The various types include at least one of multicast, broadcast and unicast.
[0139] In one embodiment, the acquisition module 401 includes: an acquisition submodule 1, configured to acquire traffic passing through the port; determine the bandwidth usage of the port based on the traffic; and acquire the remaining bandwidth based on the bandwidth usage.
[0140] In one embodiment, the adjustment module 402 includes: a determining submodule 1, used to determine the increment of the remaining bandwidth relative to a preset remaining bandwidth; wherein the preset remaining bandwidth is used to ensure the passage of various types of normal traffic; the adjusting submodule 1, used to allocate the increment to the storm bandwidth threshold when the increment is greater than zero; and an adjusting submodule 2, used to reduce the storm bandwidth threshold by the increment when the increment is less than or equal to zero.
[0141] In one embodiment, the adjustment submodule two further includes: a determining submodule two, used to determine the total storm bandwidth occupied by the various types of traffic on the port based on the real-time traffic of the various types of traffic in the current period; a determining submodule three, used to determine the target type corresponding to the traffic exceeding the storm bandwidth threshold among the various types of traffic when the total storm bandwidth is less than or equal to the total storm bandwidth threshold; wherein, the total storm bandwidth threshold is used to characterize the sum of the storm bandwidth thresholds after incremental allocation corresponding to the various types of traffic respectively; and a reduction module, used to reduce the storm bandwidth thresholds corresponding to other types of traffic besides the target type.
[0142] In one embodiment, before reducing the storm bandwidth threshold by the increment when the increment is less than or equal to zero, the adjustment module 402 further includes: an adjustment submodule four, used to determine whether the storm bandwidth threshold is less than the minimum storm bandwidth; wherein, the minimum storm bandwidth is used to prevent network interruption; reducing the storm bandwidth threshold by the increment when the remaining bandwidth is less than the preset remaining bandwidth includes: reducing the storm bandwidth threshold by the increment when the storm bandwidth threshold is greater than the minimum storm bandwidth.
[0143] In one embodiment, the control module 403 includes: a determining submodule four, used to determine a target storm bandwidth threshold corresponding to the current control cycle based on the first storm bandwidth threshold and the second storm bandwidth threshold; and a suppression module, used to suppress storm traffic flowing into the port and exceeding the target storm bandwidth threshold until the bandwidth of the storm traffic is less than the target storm bandwidth threshold.
[0144] In one embodiment, the determining submodule four includes: a determining submodule five, configured to determine a threshold difference between the first storm bandwidth threshold and the second storm bandwidth threshold; if the threshold difference is less than or equal to a preset threshold difference, to determine the first storm bandwidth threshold as the target storm bandwidth threshold; wherein the preset threshold difference is used to characterize the fault tolerance rate between the first bandwidth threshold and the second bandwidth threshold; if the threshold difference is greater than the preset threshold difference, to determine the second storm bandwidth threshold as the target storm bandwidth threshold.
[0145] In one embodiment, the suppression module includes: an update module, configured to update the storm suppression level currently corresponding to the port based on the target storm bandwidth threshold; wherein different storm bandwidth thresholds correspond to different storm suppression levels; and to suppress the storm traffic flowing into the port based on the storm suppression level.
[0146] The device provided by this invention, when applied to storm control of switches, can not only automatically adjust the storm bandwidth threshold by utilizing bandwidth availability and service traffic status to achieve more reasonable storm control and improve the reliability and stability of the switch network, but also control different types of traffic (multicast, broadcast, and unicast) separately to ensure the stability and controllability of network traffic, thereby improving network performance and service quality.
[0147] Example 3
[0148] This invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the storm flow control method of the switch as described in this invention.
[0149] In this embodiment, refer to Figure 5 , Figure 5 This is a schematic diagram of an electronic device provided in an embodiment of the present invention; as shown. Figure 5As shown, the electronic device 100 includes a memory 110 and a processor 120. The memory 110 and the processor 120 are connected via a bus for communication. The memory 110 stores a computer program that can run on the processor 120 to implement the storm flow control method of the switch described in this application embodiment.
[0150] Example 4
[0151] This invention provides a storage medium that, when executed by a processor, implements the storm flow control method for a switch as described in this invention.
[0152] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0153] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods and apparatus according to embodiments of the present invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0154] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0155] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0156] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.
[0157] 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 terminal device 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 terminal device. 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 terminal device that includes said element.
[0158] The present invention provides a detailed description of a storm flow control method, device, electronic device, and medium for a switch. 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, those skilled in the art will recognize that 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 method for storm traffic control of a switch, the method comprising: The method includes: In each control cycle, obtain the remaining bandwidth of the port; Based on the remaining bandwidth, the storm bandwidth thresholds corresponding to various types of traffic in the current control cycle are adjusted; wherein, the larger the remaining bandwidth, the larger the storm bandwidth threshold is adjusted. Based on the first storm bandwidth threshold corresponding to the various types of traffic in the previous control cycle of the current control cycle, and the second storm bandwidth threshold adjusted in the current control cycle, the various types of storm traffic are controlled respectively. The various types include at least one of multicast, broadcast and unicast; The first storm bandwidth threshold corresponding to each type of traffic in the previous control cycle, based on the current control cycle, and the second storm bandwidth threshold adjusted for the current control cycle, respectively control the various types of storm traffic, including: Based on the first storm bandwidth threshold and the second storm bandwidth threshold, determine the target storm bandwidth threshold corresponding to the current control cycle; Suppress storm traffic flowing into the port that exceeds the target storm bandwidth threshold until the bandwidth of the storm traffic is less than the target storm bandwidth threshold; The step of determining the target storm bandwidth threshold corresponding to the current control cycle based on the first storm bandwidth threshold and the second storm bandwidth threshold includes: Determine the threshold difference between the first storm bandwidth threshold and the second storm bandwidth threshold; If the threshold difference is less than or equal to the preset threshold difference, the first storm bandwidth threshold is determined as the target storm bandwidth threshold; wherein, the preset threshold difference is used to characterize the fault tolerance rate between the first storm bandwidth threshold and the second storm bandwidth threshold; If the threshold difference is greater than the preset threshold difference, the second storm bandwidth threshold is determined as the target storm bandwidth threshold.
2. The method according to claim 1, characterized in that, The process of obtaining the remaining bandwidth of the port in each control cycle includes: Obtain the traffic passing through the port; Based on the traffic, determine the bandwidth usage of the port; Based on the bandwidth usage, the remaining bandwidth is obtained.
3. The method according to claim 1, characterized in that, The adjustment of storm bandwidth thresholds for various types of traffic in the current control cycle based on the remaining bandwidth includes: Determine the increment of the remaining bandwidth relative to a preset remaining bandwidth; wherein the preset remaining bandwidth is used to ensure the passage of various types of normal traffic; If the increment is greater than zero, the increment is allocated to the storm bandwidth threshold; If the increment is less than or equal to zero, the storm bandwidth threshold is reduced by the increment.
4. The method according to claim 3, characterized in that, After allocating the increment to the storm bandwidth threshold when the increment is greater than zero, the method further includes: Based on the real-time traffic of the various traffic types in the current period, determine the total storm bandwidth occupied by the various traffic types on the port; When the total storm bandwidth is less than or equal to the total storm bandwidth threshold, the target type corresponding to the traffic exceeding the storm bandwidth threshold is determined among the various types of traffic; wherein, the total storm bandwidth threshold is used to characterize the sum of the storm bandwidth thresholds after incremental allocation corresponding to the various types of traffic respectively; Reduce the storm bandwidth threshold for traffic types other than the target type.
5. The method according to claim 3, characterized in that, Before reducing the storm bandwidth threshold by the increment when the increment is less than or equal to zero, the method further includes: Determine whether the storm bandwidth threshold is less than the minimum storm bandwidth; wherein, the minimum storm bandwidth is used to prevent network interruption; When the remaining bandwidth is less than the preset remaining bandwidth, the storm bandwidth threshold is reduced by the increment, including: If the storm bandwidth threshold is greater than the minimum storm bandwidth, the storm bandwidth threshold is reduced by the increment.
6. The method according to claim 1, characterized in that, The suppression of storm traffic flowing into the port and exceeding the target storm bandwidth threshold includes: Based on the target storm bandwidth threshold, update the storm suppression level corresponding to the port; wherein, different storm bandwidth thresholds correspond to different storm suppression levels; Based on the storm suppression level, the storm flow entering the port is suppressed.
7. A storm flow control device for a switch, characterized in that, The device includes: The acquisition module is used to acquire the remaining bandwidth of the port in each control cycle; The adjustment module is used to adjust the storm bandwidth thresholds corresponding to various types of traffic in the current control cycle based on the remaining bandwidth; wherein, the larger the remaining bandwidth, the larger the storm bandwidth threshold is adjusted. The control module is used to control the various types of storm traffic based on the first storm bandwidth threshold corresponding to the various types of traffic in the previous control cycle and the second storm bandwidth threshold adjusted in the current control cycle. The various types include at least one of multicast, broadcast and unicast; The control module includes: The fourth submodule is used to determine the target storm bandwidth threshold corresponding to the current control cycle based on the first storm bandwidth threshold and the second storm bandwidth threshold. A suppression module is used to suppress storm traffic flowing into the port that exceeds the target storm bandwidth threshold until the bandwidth of the storm traffic is less than the target storm bandwidth threshold. The fourth determining submodule includes: Submodule 5 is used to determine the threshold difference between the first storm bandwidth threshold and the second storm bandwidth threshold. If the threshold difference is less than or equal to the preset threshold difference, the first storm bandwidth threshold is determined as the target storm bandwidth threshold; wherein, the preset threshold difference is used to characterize the fault tolerance rate between the first storm bandwidth threshold and the second storm bandwidth threshold; If the threshold difference is greater than the preset threshold difference, the second storm bandwidth threshold is determined as the target storm bandwidth threshold.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the storm flow control method of the switch as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the storm flow control method for the switch as described in any one of claims 1-6.
Citation Information
Patent Citations
Storm control implementation method, device and equipment and readable storage medium
CN113259452A
Network storm processing method, system and device and computer storage medium
CN113938414A