Method for improving traffic supervision algorithm to output bandwidth according to input traffic proportion

By introducing configurable threshold registers and packet triggering methods into the traffic policing algorithm, the problem of a certain flow monopolizing the output bandwidth is solved, ensuring that different flows output bandwidth according to the proportion of input traffic, thereby improving the fairness and stability of network resource allocation.

CN121509341APending Publication Date: 2026-02-10NANJING YITAI MICROELECTRONICS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511365093.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-23
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

In existing traffic policing algorithms, there is a problem where one flow occupies all the output bandwidth, while another flow cannot output.

Method used

By setting a configurable threshold register, it is determined whether the token addition meets the accumulation condition, ensuring that the bandwidth is output according to the input traffic ratio after the tokens accumulate to a sufficient amount. Tokens are added to buckets C and E in a packet-triggered manner, and when the tokens have not accumulated to the configured threshold, all packets are colored red and discarded without updating the relevant parameters.

Benefits of technology

This makes the output bandwidth ratio of different flows more consistent with the input traffic ratio, improving the fairness and stability of network resource allocation and avoiding the situation where a certain flow monopolizes the output bandwidth.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121509341A_ABST
    Figure CN121509341A_ABST
Patent Text Reader

Abstract

The invention provides a method for improving a traffic supervision algorithm to output bandwidth according to an input traffic proportion. Comprising the following steps: S1, at a moment Tcur, a data packet with a packet length Lcur is valid, and a preceding-stage flow classification module maps the data packet to stream; s2, reading the updated C bucket residual token of the previous packet, the E bucket residual token, the arrival time of the previous packet and a speed limit template index (profile index) by using stream; and S3, obtaining speed limit parameters through a profile index, wherein the speed limit parameters comprise CIR (committed information rate), CBS (committed burst size) and EIR (excess information rate). According to the method for outputting the bandwidth according to the input flow proportion by improving the flow supervision algorithm, the configurable threshold register is arranged, whether token adding meets the accumulation condition or not is judged, it is ensured that the bandwidth can be output according to the input flow proportion after the tokens are accumulated to the sufficient amount, the situation that a certain flow occupies the output bandwidth exclusively is avoided, and the bandwidth output efficiency is improved. And the output bandwidth proportions of different flows better conform to the input flow proportion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network traffic control technology, and in particular to an improved traffic policing algorithm to achieve output bandwidth proportional to input traffic. Background Technology

[0002] Traffic policing refers to monitoring incoming traffic to ensure that it does not abuse network resources. By monitoring the specifications of traffic entering the network, it limits it to an acceptable range. If the packet traffic of a connection is too high, the packet is dropped or its priority is reset (for example, limiting HTTP packets to not occupy more than 50% of network bandwidth) to protect network resources and the interests of operators.

[0003] To achieve traffic control, a mechanism is needed to measure the traffic passing through a device. The token bucket is currently the most commonly used traffic measurement method to assess whether the traffic rate exceeds a specified value. Popular token bucket algorithms include RFC2697, RFC2698, RFC4115, and MEF10.1. For an example using MEF10.1, please refer to the appendix. Figure 2 .

[0004] With attachment Figure 4 Taking the example traffic model, data flow 1 packets have long intervals between them, while data flow 2 always arrives immediately after data flow 1 packets, with very short intervals between them. According to the traffic policing process described above, adding C-bucket tokens is triggered by a packet, and the formula for adding C-bucket tokens is as follows: At time T1, the value is 0, because T1-T0 is long enough that the added tokens are just enough for the length of flow 1 packets, so it is marked as green and passed. Thus, the remaining C-bucket tokens written back are approximately 0. At time T2, the value is approximately 0, because T2-T1 is very short, and the number of added tokens is insufficient for the length of flow 2 packets, so it is marked as red and discarded. This cycle continues, and the final result is that the output bandwidth is entirely occupied by flow 1 packets, while flow 2 is completely discarded because it never receives a token.

[0005] Therefore, it is necessary to provide an improved traffic regulation algorithm to solve the above-mentioned technical problems by outputting bandwidth proportional to the input traffic. Summary of the Invention

[0006] This invention provides an improved traffic policing algorithm to achieve output bandwidth proportional to input traffic, solving the problem in existing traffic policing algorithms where one flow occupies the entire output bandwidth while another flow cannot be output.

[0007] To address the aforementioned technical problems, the present invention provides an improved traffic regulation algorithm for implementing a method of outputting bandwidth proportional to input traffic, comprising the following steps:

[0008] S1, at time T cur Package length L cur If the data packet is valid, the preceding flow classification module maps it to a streamid;

[0009] S2. Use streamid to read the remaining tokens in bucket C and bucket E, the arrival time of the previous packet, and the rate limiting template index profile_index;

[0010] S3. Obtain the rate limiting parameters through the profile_index, including CIR (Committed Information Rate), CBS (Committed Burst Size), EIR (Excess Information Rate), EBS (Excess Burst Size), CF (Color Perception Factor), and CM (Color Mode).

[0011] S4. Add tokens to buckets C and E using a packet-triggered method;

[0012] S5. Set two threshold registers, B c th and B e th, determine whether the cumulative condition is met;

[0013] S6. After obtaining the add token according to step S5, compare it with the packet length and output the packet color.

[0014] Preferably, the formula for adding tokens to bucket C and bucket E is as follows:

[0015]

[0016] Preferably, in step S5, determining whether the accumulation condition is met includes the following steps:

[0017] S51, if (B) is satisfied cadd ≥B c th)||(B eadd ≥B e At this point, adding a token once has accumulated enough tokens for N packets from Stream 1 and N-1 packets from Stream 2. It is expected that subsequent packets from N Stream 1 and N-1 packets from Stream 2, where N is large enough, will allow Stream 1 and Stream 2 to be output in proportion to their input. At this point, T will be... cur And the updated B c (T cur ) and B e (T cur Save as T pre B c (T pre ) and B e (T pre (For the next packet to read;)

[0018] S52. Otherwise, if the added tokens do not exceed the threshold, it means that not enough tokens have been accumulated. In this case, B... cadd and B eadd Setting it to 0 means that only the remaining tokens in buckets C and E are used for comparing packet length. If the remaining leaky bucket tokens are insufficient to cover the packet length consumption, then all packets before the tokens accumulate to the configured threshold are colored red and discarded. Furthermore, T will not be updated until the configured threshold is reached. pre As time goes on, the accumulated T cur -T pre The larger the value, the more likely it is to exceed the configured threshold.

[0019] Preferably, in step S6, the output packet color includes the following steps: S61,

[0020] if(((CM==color_blind)||(input_color==Green))&&(L cur ≤B c (T cur So update B c (T cur ):B c (T cur ) = B c (T cur )-L cur And B c (T cur Save as B c (T pre ), T cur Whether to update to T depends on whether the token added in step S5 C exceeds the configured threshold. pre ;

[0021] S62,

[0022] Otherwise, if (((CM==color_blind)||(input_color !=RED))&&(L cur ≤B e (T cur So update B e (T cur ):B e (T cur ) = B e (T cur )-L cur And B e (T cur Save as B e (T pre ), T curWhether to update to T depends on whether the token added by E in step 5 exceeds the configured threshold. pre ;

[0023] S63. Otherwise, the package is colored red and discarded. In this case:

[0024] B c (T cur It will not be updated to B. c (T pre ),

[0025] B e (T cur It will not be updated to B. e (T pre ), .

[0026] T cur It will not be updated to T pre

[0027] Preferably, the threshold of the threshold register is configurable, and by adjusting the threshold size, the accuracy and response speed of the output bandwidth proportional to the input flow can be changed.

[0028] Preferably, in step S4, when adding tokens using the packet-triggered method, the token addition for buckets C and E is calculated based on the packet arrival time interval.

[0029] Preferably, the color mode CM includes a color-blind mode and a color-sensitive mode. In the color-sensitive mode, the input color will participate in the judgment of the package color.

[0030] Preferably, in step S6, when a packet is colored green or yellow, the remaining amount of tokens and the arrival time of the previous packet are updated according to whether the tokens added to bucket C or bucket E exceed the threshold.

[0031] Preferably, when the number of tokens has not accumulated to the configured threshold, all packets are colored red and discarded without updating the relevant parameters, so as to ensure that enough tokens are accumulated subsequently to achieve output proportional to the input traffic.

[0032] Preferably, in the token addition formula of the E-bucket, CF is a color perception factor used to adjust the amount of tokens added to the E-bucket.

[0033] Compared with related technologies, the improved traffic regulation algorithm provided by this invention to achieve output bandwidth proportional to input traffic has the following beneficial effects:

[0034] This invention provides an improved traffic policing algorithm to achieve output bandwidth proportional to input traffic. By setting a configurable threshold register, it determines whether token addition meets the accumulation condition, ensuring that after enough tokens are accumulated, bandwidth can be output proportional to input traffic, avoiding a single flow monopolizing the output bandwidth, and making the output bandwidth ratio of different flows more consistent with the input traffic ratio. Attached Figure Description

[0035] Figure 1 A flowchart of a preferred embodiment of the improved traffic regulation algorithm provided by the present invention to achieve a method of outputting bandwidth according to the proportion of input traffic;

[0036] Figure 2 Flowchart of the MEF traffic policing solution;

[0037] Figure 3 Example speed limit scenario diagram;

[0038] Figure 4 This is a sample traffic model diagram. Detailed Implementation

[0039] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0040] Please refer to the following: Figure 1 and Figure 4 ,in, Figure 1 A flowchart of a preferred embodiment of the improved traffic regulation algorithm provided by the present invention to achieve a method of outputting bandwidth according to the proportion of input traffic; Figure 4 This is a sample traffic model diagram.

[0041] A method for improving traffic policing algorithms to output bandwidth proportional to input traffic includes the following steps:

[0042] S1, at time T cur Package length L cur If the data packet is valid, the preceding flow classification module maps it to a streamid;

[0043] S2. Use streamid to read the remaining tokens in bucket C and bucket E, the arrival time of the previous packet, and the rate limiting template index profile_index;

[0044] S3. Obtain the rate limiting parameters through the profile_index, including CIR (Committed Information Rate), CBS (Committed Burst Size), EIR (Excess Information Rate), EBS (Excess Burst Size), CF (Color Perception Factor), and CM (Color Mode).

[0045] S4. Add tokens to buckets C and E using a packet-triggered method;

[0046] S5. Set two threshold registers, B c th and B e th, determine whether the cumulative condition is met;

[0047] S6. After obtaining the add token according to step S5, compare it with the packet length and output the packet color.

[0048] The formula for adding tokens to buckets C and E is as follows:

[0049]

[0050] In step S5, determining whether the accumulation condition is met includes the following steps:

[0051] S51, if (B) is satisfied cadd ≥B c th)||(B eadd ≥B e At this point, adding a token once has accumulated enough tokens for N packets from Stream 1 and N-1 packets from Stream 2. It is expected that subsequent packets from N Stream 1 and N-1 packets from Stream 2, where N is large enough, will allow Stream 1 and Stream 2 to be output in proportion to their input. At this point, T will be... cur And the updated B c (T cur ) and B e (T cur Save as T pre B c (T pre ) and B e (T pre (For the next packet to read;)

[0052] S52. Otherwise, if the added tokens do not exceed the threshold, it means that not enough tokens have been accumulated. In this case, B... cadd and B eadd Setting it to 0 means that only the remaining tokens in buckets C and E are used for comparing packet length. If the remaining leaky bucket tokens are insufficient to cover the packet length consumption, then all packets before the tokens accumulate to the configured threshold are colored red and discarded. Furthermore, T will not be updated until the configured threshold is reached. pre As time goes on, the accumulated T cur -T pre The larger the value, the more likely it is to exceed the configured threshold.

[0053] In step S6, the output packet color includes the following steps: S61,

[0054] if(((CM==color_blind)||(input_color==Green))&&(L cur ≤B c (T cur So update B c (T cur ):B c (T cur ) = B c (T cur )-L cur And B c (T cur Save as B c (T pre ), T cur Whether to update to T depends on whether the token added in step S5 C exceeds the configured threshold. pre ;

[0055] S62,

[0056] Otherwise, if (((CM==color_blind)||(input_color !=RED))&&(L cur ≤B e (T cur So update B e (T cur ):B e (T cur ) = B e (T cur )-L cur And B e (T cur Save as B e (T pre ), T cur Whether to update to T depends on whether the token added by E in step 5 exceeds the configured threshold. pre ;

[0057] S63. Otherwise, the package is colored red and discarded. In this case:

[0058] B c (T cur It will not be updated to B. c (T pre ),

[0059] B e (T cur It will not be updated to B. e (T pre ), .

[0060] T cur It will not be updated to Tpre

[0061] The threshold of the threshold register is configurable. By adjusting the threshold size, the accuracy and response speed of the output bandwidth proportional to the input flow can be changed.

[0062] The threshold of the threshold register can be flexibly configured according to the actual network scenario and needs. For example, in scenarios with extremely high requirements for bandwidth allocation accuracy, such as traffic management in data centers, the threshold can be set relatively high. In this way, more tokens need to be accumulated before the operation of proportionally outputting bandwidth is triggered, thereby making the bandwidth allocation ratio between different flows more accurately match the ratio of input traffic. In scenarios with higher requirements for response speed, such as real-time audio and video transmission, the threshold can be set lower, so that tokens can accumulate to the trigger threshold more quickly, thereby allowing bandwidth allocation to respond more rapidly to changes in traffic.

[0063] When the threshold increases, it means that more tokens need to be accumulated before bandwidth is output proportionally. This allows for a more thorough statistical analysis and balancing of the input traffic from different flows during the token accumulation process, thereby improving the accuracy of bandwidth allocation. However, it also slows down the system's response to traffic changes because it takes longer to accumulate enough tokens. Conversely, when the threshold decreases, tokens can accumulate to the trigger threshold more quickly, and the system's response to traffic changes will be faster. However, because the number of accumulated tokens is smaller, the statistical analysis and balancing of traffic may not be sufficient, which will reduce the accuracy of bandwidth allocation.

[0064] In step S4, when adding tokens using the packet-triggered method, the token addition for buckets C and E is calculated based on the packet arrival time interval.

[0065] The color mode CM includes a colorblind mode and a color-sensitive mode. In the color-sensitive mode, the input color will be used to determine the color of the package.

[0066] In step S6, when a packet is colored green or yellow, the remaining amount of tokens and the arrival time of the previous packet are updated according to whether the tokens added to bucket C or bucket E exceed the threshold.

[0067] When a packet is colored green or yellow, the system updates the remaining tokens and the arrival time of the previous packet based on whether the tokens added to bucket C or bucket E exceed the threshold. Specifically, if the packet is colored green or yellow based on the number of tokens in bucket C, and the number of tokens added to bucket C exceeds the threshold, then the remaining tokens in bucket C will be updated to the current remaining tokens minus the packet length, and the arrival time of the previous packet will be updated to the current time. Similarly, if the packet is colored green or yellow based on the number of tokens in bucket E, and the number of tokens added to bucket E exceeds the threshold, then the remaining tokens in bucket E and the arrival time of the previous packet will be updated accordingly.

[0068] This update mechanism ensures that the system accurately records the remaining tokens in each bucket and the arrival time of data packets, providing an accurate basis for subsequent token additions and packet color determination. By updating these parameters in a timely manner, the system can better adapt to changes in traffic and ensure the accuracy and stability of bandwidth allocation.

[0069] The method states that if tokens have not accumulated to the configured threshold, all packets are colored red and discarded without updating relevant parameters, in order to ensure that enough tokens are accumulated subsequently to achieve output proportional to the input traffic.

[0070] When tokens have not accumulated to the configured threshold, all packets will be colored red and discarded, and related parameters such as the remaining tokens in buckets C and E, and the arrival time of the previous packet will not be updated.

[0071] The principle behind ensuring sufficient token accumulation is as follows: If data packets are processed and related parameters are updated before the tokens have accumulated to the threshold, the token accumulation process may be interrupted, preventing the accumulation of enough tokens to achieve proportional output bandwidth. By coloring all packets red and discarding them without updating parameters, the system can maintain the current token accumulation state. Over time, subsequent data packets will trigger token addition operations, causing tokens to gradually accumulate. When the accumulated token count exceeds the configured threshold, the system will have enough tokens to meet the proportional output bandwidth requirements of different streams, thereby ensuring the stable operation of the algorithm and the accuracy of bandwidth allocation.

[0072] In the E-bucket token addition formula, CF is the color perception factor, used to adjust the amount of tokens added to the E-bucket.

[0073] This avoids the situation in existing technologies where flow 2 is always discarded because it cannot obtain a token, allowing each flow to obtain the corresponding output bandwidth according to the proportion of input traffic, thus improving the fairness of network resource allocation.

[0074] The threshold register has a configurable threshold. By adjusting the threshold size, the accuracy and response speed of the output bandwidth proportional to the input traffic can be changed to adapt to different network scenarios and needs.

[0075] When tokens have not accumulated to the configured threshold, all packets are colored red and discarded without updating relevant parameters. This ensures that enough tokens are accumulated subsequently, thereby stably achieving output proportional to the input traffic and guaranteeing the stability and reliability of the algorithm.

[0076] The improved traffic regulation algorithm provided by this invention, which outputs bandwidth according to the proportion of input traffic, works as follows:

[0077] By introducing a configurable C-bucket / E-bucket token and adding an update threshold, the problem of one stream occupying all the output bandwidth while another stream has no output can be solved. The implementation scheme of this invention is attached. Figure 1 As shown: The number of tokens B added to bucket C is calculated by reading the rate-limiting parameters through profile_index. cadd Afterwards, instead of immediately comparing the remaining tokens in bucket C plus the tokens added to bucket C with the input packet length, it first checks whether the number of tokens added to bucket C exceeds a pre-set threshold. If it does not exceed the threshold, then the number of tokens added to bucket C for this calculation is 0, and only the remaining tokens in bucket C are compared with the input packet length; T is not updated. cur .

[0078] As shown in the appendix Figure 4 Taking the example traffic model as an example, according to the improved traffic policing process, at time T1, B c (T0) is 0 because

[0079] T1-T0 is long enough, add token B c (T1) is just enough to consume one packet of long-lasting power, but B c (T1) is less than the configured threshold B c th, only compare the remaining tokens in bucket C with the length of the input packet, B c (T0)-L1<0, so the packet is colored red and discarded. At this time, neither T0 nor the remaining tokens in bucket C will be updated. At time T2, the same process is repeated: the packet is colored red and discarded, and neither T0 nor the remaining tokens in bucket C will be updated; this continues until T... n At this moment, the number of tokens added to bucket C is... The time interval is long enough that the number of tokens added at one time exceeds the configured threshold B. c The added tokens are enough to subtract N packets from stream 1 and N-1 packets from stream 2. Therefore, the output bandwidth ratio of stream 1 and stream 2 will be as follows: With proportional output, it's clear that the larger N is, the closer the output bandwidth is to a 1:1 proportional output.

[0080] Compared with related technologies, the improved traffic regulation algorithm provided by this invention to achieve output bandwidth proportional to input traffic has the following beneficial effects:

[0081] By setting a configurable threshold register, it is determined whether the token addition meets the accumulation condition, ensuring that the output bandwidth can be proportional to the input traffic after the tokens have accumulated to a sufficient amount, avoiding a certain flow from monopolizing the output bandwidth, and making the output bandwidth ratio of different flows more consistent with the input traffic ratio.

[0082] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for improving a traffic regulation algorithm to achieve output bandwidth proportional to input traffic, characterized in that, Includes the following steps: S1, at time T cur Package length L cur If the data packet is valid, the preceding flow classification module maps it to a streamid; S2. Use streamid to read the remaining tokens in bucket C and bucket E, the arrival time of the previous packet, and the rate limiting template index profile_index; S3. Obtain the rate limiting parameters through the profile_index, including CIR (Committed Information Rate), CBS (Committed Burst Size), EIR (Excess Information Rate), EBS (Excess Burst Size), CF (Color Perception Factor), and CM (Color Mode). S4. Add tokens to buckets C and E using a packet-triggered method; S5. Set two threshold registers, B c th and B e th, determine whether the cumulative condition is met; S6. After obtaining the add token according to step S5, compare it with the packet length and output the packet color.

2. The method for implementing output bandwidth proportional to input traffic using the improved traffic regulation algorithm according to claim 1, characterized in that, The formula for adding tokens to buckets C and E is as follows:

3. The method for implementing output bandwidth proportional to input traffic using the improved traffic regulation algorithm according to claim 1, characterized in that, In step S5, determining whether the accumulation condition is met includes the following steps: S51, if (B) is satisfied cadd ≥B c th)||(B eadd ≥B e At this point, adding a token once has accumulated enough tokens for N packets from Stream 1 and N-1 packets from Stream 2. It is expected that subsequent packets from N Stream 1 and N-1 packets from Stream 2, where N is large enough, will allow Stream 1 and Stream 2 to be output in proportion to their input. At this point, T will be... cur And the updated B c (T cur ) and B e (T cur Save as T pre B c (T pre ) and B e (T pre (For the next packet to read;) S52. Otherwise, if the added tokens do not exceed the threshold, it means that not enough tokens have been accumulated. In this case, B... cadd and B eadd Setting it to 0 means that only the remaining tokens in buckets C and E are used for comparing packet length. If the remaining leaky bucket tokens are insufficient to cover the packet length consumption, then all packets before the tokens accumulate to the configured threshold are colored red and discarded. Furthermore, T will not be updated until the configured threshold is reached. pre As time goes on, the accumulated T cur -T pre The larger the value, the more likely it is to exceed the configured threshold.

4. The method for improving the traffic regulation algorithm according to claim 1 to achieve output bandwidth proportional to input traffic, characterized in that, In step S6, the output packet color includes the following steps: S61, if(((CM==color_blind)||(input_color==Green))&&(L cur ≤B c (T cur So update B c (T cur ):B c (T cur ) = B c (T cur )-L cur And B c (T cur Save as B c (T pre ), T cur Whether to update to T depends on whether the token added in step S5 C exceeds the configured threshold. pre ; S62、 Otherwise, if (((CM==color_blind)||(input_color !=RED))&&(L cur ≤B e (T cur So update B e (T cur ):B e (T cur ) = B e (T cur )-L cur And B e (T cur Save as B e (T pre ), T cur Whether to update to T depends on whether the token added by E in step 5 exceeds the configured threshold. pre ; S63. Otherwise, the package is colored red and discarded. In this case:

5. The method for implementing output bandwidth proportional to input traffic using the improved traffic regulation algorithm according to claim 1, characterized in that, The threshold of the threshold register is configurable. By adjusting the threshold size, the accuracy and response speed of the output bandwidth proportional to the input flow can be changed.

6. The method for implementing output bandwidth proportional to input traffic using the improved traffic regulation algorithm according to claim 1, characterized in that, In step S4, when adding tokens using the packet-triggered method, the token addition for buckets C and E is calculated based on the packet arrival time interval.

7. The method for implementing an improved traffic regulation algorithm according to claim 1 to output bandwidth proportional to input traffic, characterized in that, The color mode CM includes a colorblind mode and a color-sensitive mode. In the color-sensitive mode, the input color will be used to determine the color of the package.

8. The method for implementing an improved traffic regulation algorithm according to claim 1 to output bandwidth proportional to input traffic, characterized in that, In step S6, when a packet is colored green or yellow, the remaining amount of tokens and the arrival time of the previous packet are updated according to whether the tokens added to bucket C or bucket E exceed the threshold.

9. The method for implementing an improved traffic regulation algorithm according to claim 1 to output bandwidth proportional to input traffic, characterized in that, The method states that if tokens have not accumulated to the configured threshold, all packets are colored red and discarded without updating relevant parameters, in order to ensure that enough tokens are accumulated subsequently to achieve output proportional to the input traffic.

10. The method for implementing output bandwidth proportional to input traffic using the improved traffic regulation algorithm according to claim 1, characterized in that, In the E-bucket token addition formula, CF is the color perception factor, used to adjust the amount of tokens added to the E-bucket.