Flow test method and apparatus

By setting background and observation streams in the switch queue, using TD and RED strategies to control the queue length, and calculating the drop probability point by point, the ambiguity of the existing RED verification method is resolved, and accurate verification and design validation of the RED mechanism are achieved.

CN116260745BActive Publication Date: 2026-11-24SUZHOU CENTEC COMM CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111502636.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-09
Publication Date
2026-11-24
Estimated Expiration
2041-12-09

AI Technical Summary

Technical Problem

Existing RED verification methods can only observe the probability trend under different queue lengths, and cannot obtain specific approximate values ​​of the discard probability, thus failing to fully verify the design and implementation of the RED mechanism.

Method used

By setting two traffic streams to the same queue, one of which uses the RED mechanism as the observation stream and the other uses the TD strategy as the background stream, the queue length is controlled, and the drop probability is calculated point by point until the queue length reaches the maximum random drop threshold, thus accurately calculating the drop probability.

Benefits of technology

It achieves accurate verification of the RED mechanism, obtains specific approximate values ​​of the drop probability, overcomes the problem of ambiguous probability trends in traditional methods, and ensures the accuracy of RED design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116260745B_ABST
    Figure CN116260745B_ABST
Patent Text Reader

Abstract

This invention discloses a traffic testing method and apparatus. The traffic testing method includes: pre-setting background traffic and observation traffic to be enqueued and dequeued from the same queue on the same port; the background traffic adopts a TD (Discretionary Timeout) strategy, and the observation traffic adopts a RED (Redirected Traffic Response) strategy; configuring the drop threshold of the background traffic to be equal to the minimum randomly droptable threshold of the observation traffic, and increasing the drop threshold point by point; calculating the packet drop probability point by point by comparing the number of packets sent and received by the observation traffic, until the drop threshold increases to be equal to the maximum randomly droptable threshold of the observation traffic. This apparatus and method solve the problem that existing RED verification methods can only observe a probability trend under different queue lengths, and cannot obtain a specific approximate drop probability value, thus failing to fully verify the design and implementation of the RED mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to network communication technology, and in particular to a traffic testing method and apparatus. Background Technology

[0002] The essence of switch buffer management is to perform manageable and predictable packet dropping operations on excessively congested traffic. Generally speaking, the simplest dropping strategy is the Tail Drop (TD) strategy—that is, when the queue of a flow reaches a certain level, subsequent packets are dropped to avoid excessive consumption of the switch's packet buffer.

[0003] However, tail-dropping can trigger a TCP global synchronization phenomenon: when the queue drops packets from multiple TCP connections simultaneously, multiple TCP connections will simultaneously enter congestion avoidance and slow start states to reduce and adjust traffic, and then at some point, traffic peaks will occur simultaneously. This cycle repeats, causing network traffic to fluctuate wildly, resulting in continuous network oscillations.

[0004] Therefore, Random Early Detection (RED) was introduced to address the global synchronization problem in TCP. RED works as a drop strategy: when numerous TCP flows reach the RED's random drop threshold, some packets are randomly dropped. At this point, while a TCP connection's packets are being dropped and transmission begins to slow down, other TCP connections still maintain a high transmission rate. Thus, at any given time, there are always TCP connections transmitting at a faster speed, ultimately improving the utilization of line bandwidth (throughput).

[0005] With the deployment of data centers, the ports of switching devices are becoming increasingly larger due to technological advancements, resulting in more and more TCP traffic being forwarded on a single node. Meanwhile, RED technology has evolved beyond being used as a drop strategy; it can also be used as a marking strategy. For example, explicit congestion notification uses the RED mechanism to mark incoming and outgoing TCP packets, improving the effective transmission rate (Goodput) of TCP traffic through pre-feedback of TCP traffic.

[0006] As RED technology becomes more widely used, the RED mechanism is becoming increasingly important for the validity verification of switches. The basic mechanism of RED is as follows:

[0007] In a queue, if a type of traffic becomes congested, its corresponding queue length will increase. When the queue length reaches Thrd_min, random early detection begins, and packets are arbitrated. (For simplicity, if the arbitration result is positive, the packet is dropped; if the result is negative, no action is taken. However, positive packets may also be marked with an ECN (Enhanced Communication Name).) The drop probability (positive rate) obtained through arbitration varies depending on the current queue length. That is, the longer the queue, the higher the drop probability. When the queue length is infinitely close to but not equal to Thrd_max, the packet drop probability has a maximum value, P_red; and when the queue length reaches or exceeds Thrd_max, all packets are dropped 100%. This mechanism is called RED (Reduce of Randomization).

[0008] Furthermore, if multiple types of traffic are queued together, each type of traffic will calculate its own drop probability based on its attributes, the queue length at its current queuing time, and its own configuration, and then execute the drop operation. This mechanism reflects that multiple types of traffic have different drop strategy weights in a queue, hence it is called (weighted) random early detection (WRED).

[0009] The existing testing protocols for RED are as follows:

[0010] Step 1: Close the queue exit, including but not limited to configuration, traffic shaping, and setting the shaping rate to 0;

[0011] Step 2: Packet messages with increasing numbers until the queue depth (queue length) reaches or exceeds the length corresponding to the maximum drop probability;

[0012] a. If the length (maxThrd) corresponding to the maximum discard probability is reached and then no longer increases, it means that the RED design is implemented correctly;

[0013] b. If the queue length continues to increase after reaching the length corresponding to the maximum discard probability, it indicates that the RED mechanism is implemented incorrectly.

[0014] Step 3: Stop sending incoming traffic;

[0015] Step 4: Open the queue exit and observe the message numbers remaining in the queue. The checkpoints are as follows:

[0016] a. When the sequence number is less than minThrd, check if the numbering is discontinuous—whether message dropping occurs. If no dropping occurs, the RED design implementation is correct; otherwise, there is an error.

[0017] b. If the sequence number becomes discontinuous starting from a value greater than minThrd, it is considered that random discarding has occurred. The larger the sequence number, the more discontinuous the cases and the larger the jump value of the sequence number. This indicates that RED exhibits a phenomenon where the probability of discarding increases with the depth of the queue, proving that the design and implementation are correct.

[0018] Specific examples of the effects are as follows:

[0019] minThrd=10, maxThrd=30, P_max=0.5

[0020] Then one of the more satisfactory sequences should be:

[0021] 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 18, 20, 24, 28, 30, 31, 35, 41, 45, 57, 68, 83, 102, 152, 212.

[0022] The drawback of existing technology is that, as can be seen, random discarding is a random event. One or more tests can confirm that the processing before minThrd is correct, and the processing after maxThrd is correct. However, for the random discarding probability between minThrd and maxThrd, only a vague trend can be observed; the specific approximate value of the discarding probability at each point under different queue depths cannot be seen from the sequence itself. Summary of the Invention

[0023] The technical problem to be solved by the embodiments of the present invention is how to solve the problem that the existing RED verification method can only observe a probability trend under different queue lengths and cannot obtain a specific approximate value of the discard probability, thus failing to fully verify the design and implementation of the RED mechanism.

[0024] To address the aforementioned technical problems, this invention provides a traffic testing method, which includes: pre-setting background traffic and observation traffic to be enqueued and dequeued from the same queue on the same port; the background traffic adopts a TD strategy, and the observation traffic adopts a RED strategy; configuring the drop threshold of the background traffic to be equal to the minimum randomly droptable threshold of the observation traffic, and increasing the drop threshold point by point; calculating the packet drop probability point by point by comparing the number of packets sent and received in the observation traffic, until the drop threshold increases to be equal to the maximum randomly droptable threshold of the observation traffic.

[0025] In the above-described traffic testing method, before configuring the background flow traffic drop threshold to be equal to the minimum randomly droptable threshold of the observed flow traffic, the method further includes: configuring the background flow traffic drop threshold to be equal to 0, and gradually increasing the drop threshold; determining whether the observed flow has dropped packets by statistically analyzing the number of packets sent and received within a preset time period; if so, determining that the RED design is faulty; if not, determining that the RED design is correct.

[0026] The above-described traffic testing method, after the step of increasing the drop threshold to be equal to the maximum randomly droptable threshold of the observed traffic, further includes: increasing the drop threshold point by point; detecting whether the queue length can continue to increase; if not, determining that the RED design is flawed; if so, determining that the RED design is correct.

[0027] In the above-described traffic testing method, the background traffic is discarded with a lower priority than the observed traffic.

[0028] In the above-described traffic testing method, the bandwidth of the background flow is equal to the port bandwidth of the sending port.

[0029] To address the aforementioned technical problems, this invention also provides a traffic testing device, comprising: a setting unit for pre-setting background traffic and observation traffic to enqueue and dequeue from the same queue on the same port; wherein the background traffic employs a TD strategy and the observation traffic employs a RED strategy; and a processing unit for configuring a drop threshold for the background traffic to be equal to the minimum randomly droptable threshold for the observation traffic, and increasing the drop threshold point by point; and calculating the packet drop probability point by point by comparing the number of packets sent and received in the observation traffic, until the drop threshold increases to be equal to the maximum randomly droptable threshold for the observation traffic.

[0030] In the aforementioned traffic testing device, before configuring the background flow traffic drop threshold to be equal to the minimum randomly droptable threshold of the observed flow traffic, the processing unit is further configured to: configure the background flow traffic drop threshold to be equal to 0, and increase the drop threshold point by point; determine point by point whether the observed flow has dropped packets by statistically analyzing the number of transmissions and receptions of the observed flow within a preset time period; if so, determine that the RED design is faulty; if not, determine that the RED design is faultless.

[0031] In the aforementioned flow testing device, after the drop threshold increases to be equal to the maximum randomly droptable threshold of the observed flow flow, the processing unit is further configured to: increase the drop threshold point by point; detect whether the queue length can continue to increase; if not, determine that the RED design is faulty; if so, determine that the RED design is correct.

[0032] In the aforementioned flow testing device, the background flow has a lower priority for discarding than the observed flow.

[0033] In the aforementioned traffic testing device, the bandwidth of the background flow is equal to the port bandwidth of the sending port.

[0034] This invention addresses the problems in existing technologies by setting up two traffic streams to be sent to the same queue. One stream is discarded as an observation stream using the RED mechanism, while the other stream is controlled as a background stream using the TD strategy. This stabilizes the queue length at a certain value, allowing observation of the RED mechanism's traffic discarding behavior when the queue length is at this value. The invention then calculates an approximate discard probability value, thus overcoming the problem that traditional RED verification methods can only observe the fuzzy probability trend under different queue lengths and cannot obtain a specific approximate discard probability value. Attached Figure Description

[0035] Figure 1 This is a schematic diagram of the test scenario for the traffic testing method in this embodiment;

[0036] Figure 2 This is a schematic diagram illustrating the process of maxThrd0 increasing to minThrd1 in the flow rate testing method of this embodiment;

[0037] Figure 3 This is a schematic diagram of the first process in the flow test method of this embodiment, in which maxThrd0 increases from minThrd1 to maxThrd1;

[0038] Figure 4 This is a schematic diagram of the second process in the flow test method of this embodiment, in which maxThrd0 increases from minThrd1 to maxThrd1. Detailed Implementation

[0039] In existing technologies, random dropping in RED is a random event. One or more tests can confirm that the processing before minThrd is correct, and the processing after maxThrd is correct. However, for the random dropping probability between minThrd and maxThrd, only a vague trend can be observed; it's impossible to discern a specific approximate dropping probability for each point at different queue depths from the sequence itself.

[0040] This invention addresses the problems in existing technologies by sending two traffic streams to the same queue. One stream is discarded as an observation stream using the RED mechanism, while the other stream is controlled as a background stream using the TD strategy. This stabilizes the queue length at a certain value, allowing observation of the RED mechanism's discard behavior when the queue length is at this value. The invention then calculates an approximate discard probability, overcoming the problem that traditional RED verification methods can only observe the fuzzy probability trend under different queue lengths but cannot obtain a specific approximate discard probability.

[0041] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0042] Example 1

[0043] A traffic testing method according to an embodiment of the present invention can be applied to network application scenarios such as Ethernet data switching, integrated circuit design, testing and verification, and data packet processing. Specifically, the traffic testing method includes:

[0044] Step S101: Preset background stream traffic and observation stream traffic to be enqueued and dequeued from the same queue on the same sending port;

[0045] like Figure 1 As shown, ports 1 and 2 of the switch are used to receive preset background flow traffic and observation flow traffic, and forward them to port 3 for output. Both background flow and observation flow enter and exit the same queue on port 3. Background flow traffic is forwarded from port 1 to port 3, and the bandwidth of the background flow is equal to the port bandwidth of port 3. Essentially, the background flow rate only needs to be equal to the dequeue rate in port 3. Observation flow traffic can be forwarded from port 2 to port 3 at a relatively lower rate than the background flow traffic to suit practical application scenarios.

[0046] In this embodiment, the background flow and the observation flow are configured with different drop priorities. Specifically, the drop priority of the background flow is lower than that of the observation flow. For example, if the background flow has a drop priority of 0 and the observation flow has a drop priority of 1, the background flow with a drop priority of 0 is configured with a drop policy of TD (i.e., WTD), and the corresponding drop threshold is maxThrd0; the observation flow with a drop priority of 1 is configured with a drop policy of RED (i.e., WRED), and the corresponding drop thresholds are the minimum drop threshold minThrd1 and the maximum drop threshold maxThrd1, which are configured to 100 and 500 respectively in this embodiment. By configuring the background flow and the observation flow with different drop priorities, this embodiment ensures that they have different drop decision thresholds. Therefore, as long as the background flow is dropped, congestion will not continue when there is only the flow being tested in the actual queue. At this point, a fixed point can be anchored to observe the drop status of the tested traffic.

[0047] In this embodiment, switch ports 1, 2, and 3 are configured as equal-rate ports. However, those skilled in the art will understand that configuring the ports as equal-rate ports is merely an example of this embodiment, used for illustrative purposes.

[0048] Step S102: Configure the background flow traffic drop threshold to be equal to 0, and increase the drop threshold point by point;

[0049] Initially, the `maxThrd0` parameter of the background stream is configured to 0, and both the background and observation streams are sent as required. Since `maxThrd0` is 0, all background traffic is discarded. Observation traffic, because the queue length has not yet reached `maxThrd1`, can be enqueued. Furthermore, because the observation traffic rate is less than the queue sending rate, the observation stream traffic in the queue can be sent immediately, and the queue length will remain between 0 and 1, preventing backlog. The number of messages sent and received by the observation stream within a preset time is counted. If they are equal, it indicates that the queue length corresponding to `maxThrd0` being 0 means that no packets were dropped in the observation stream, meeting the design requirements.

[0050] like Figure 2 As shown, the value of the background flow maxThrd0 is then gradually increased.

[0051] Step S103: By statistically analyzing the number of messages sent and received in the observation stream within a preset time period, determine whether the observation stream has experienced message dropping point by point;

[0052] As maxThrd0 is gradually increased, the background traffic will be queued in the queue until the queue length equals maxThrd0, at which point the background traffic will be discarded again.

[0053] At this point, the queue will contain both observation stream packets and background stream packets. Since the queue length does not exceed maxThrd1, all observation stream packets can be enqueued, and the queue length is still less than minThrd1. If the RED mechanism is designed correctly, all packets can be sent. During the increment process, for each increment of maxThrd0, the statistics of the observation stream under the observation configuration are checked to see if any packets are dropped. If so, the RED design is considered faulty; otherwise, the RED design is considered correct.

[0054] Continue to increase the value of maxThrd0 until it equals minThrd1.

[0055] Step S104: When the discard threshold maxThrd0 of the background stream is equal to the minimum randomly discardable threshold minThrd1 of the observation stream, continue to increase the discard threshold maxThrd0 point by point.

[0056] like Figures 3-4 The diagram shows a process of continuously increasing the discard threshold maxThrd0 point by point.

[0057] Step S105: Compare the number of messages sent and received in the observed stream, and calculate the message drop probability point by point;

[0058] When maxThrd0 equals (minThrd1+1), the observation stream discards packets according to the discard probability corresponding to point (minThrd1+1), similar to step S103. During a preset observation period (used to wait for the queue to stabilize), by comparing the number of packets sent and received by the observation stream, the statistically significant packet discard probability when the queue length stabilizes at that point can be obtained. Because this embodiment introduces a background stream, the queue length can be stabilized at a definite value, thus allowing for a more precise determination of the specific packet discard probability.

[0059] By gradually increasing the background flow drop threshold maxThrd0, we can observe and calculate the statistical probability of packet drop when maxThrd0 increases from minThrd1 to maxThrd1 under a stable queue length.

[0060] Step S106: Increase the discard threshold maxThrd0 point by point;

[0061] Once the background stream's drop threshold maxThrd0 increases to equal the observation stream's maximum drop threshold maxThrd1, the drop threshold maxThrd0 continues to increase point by point.

[0062] Step S107: Check if the queue length can continue to increase.

[0063] The effectiveness of 100% discarding above maxThrd1 can be verified using traditional methods. If the queue length corresponding to the maximum discard probability of 100% is reached, theoretically, the queue length should no longer increase since all packets in the observation stream should be discarded. In this case, the RED design is correct. Conversely, if the queue length continues to increase, the RED mechanism is flawed.

[0064] Example 2

[0065] To address the problems in the prior art, this embodiment also discloses a flow rate testing device, specifically comprising:

[0066] The setting unit is used to preset that background flow traffic and observation flow traffic are enqueued and dequeued from the same queue on the same port; the background flow traffic adopts the TD strategy, and the observation flow adopts the RED strategy;

[0067] The processing unit is configured to set the drop threshold of the background flow traffic to be equal to the minimum randomly droptable threshold of the observed flow traffic, and to increase the drop threshold point by point; by comparing the number of packets sent and received in the observed flow, the packet drop probability is calculated point by point until the drop threshold increases to be equal to the maximum randomly droptable threshold of the observed flow traffic.

[0068] In a specific implementation, before the background flow traffic drop threshold is configured to equal the minimum randomly droptable threshold of the observed flow traffic, the processing unit is further configured to: configure the background flow traffic drop threshold to be equal to 0, and increase the drop threshold point by point; determine point by point whether the observed flow has dropped packets by statistically analyzing the number of transmissions and receptions of the observed flow within a preset time period; if so, determine that the RED design is faulty; if not, determine that the RED design is correct.

[0069] In a specific implementation, after the discard threshold increases to be equal to the maximum randomly discardable threshold of the observed flow, the processing unit is further configured to: increase the discard threshold point by point; detect whether the queue length can continue to increase; if not, determine that the RED design is incorrect; if so, determine that the RED design is correct.

[0070] In practice, the background stream traffic is discarded at a lower priority than the observation stream traffic.

[0071] In a specific implementation, the bandwidth of the background stream is equal to the port bandwidth of the sending port.

[0072] Those skilled in the art will understand that the flow testing device of this embodiment and the flow testing method of Embodiment 1 are based on the same inventive concept. Therefore, the relevant content of this embodiment can be referred to the corresponding content above, and will not be repeated here.

[0073] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include ROM, RAM, disk, or optical disk, etc.

[0074] While the present invention has been disclosed above, it is not limited thereto. Any person skilled in the art can make various modifications and alterations without departing from the spirit and scope of the invention; therefore, the scope of protection of the present invention should be determined by the scope defined in the claims.

Claims

1. A flow testing method characterized by, include: Background stream traffic and observation stream traffic are pre-queued and dequeued from the same queue on the same port; The background flow traffic adopts the TD strategy, and the observation flow adopts the RED strategy; Configure the background stream traffic drop threshold to be equal to the minimum randomly droptable threshold of the observed stream traffic, and increase the drop threshold point by point; By comparing the number of messages sent and received in the observed stream, the probability of message dropping is calculated point by point until the dropping threshold increases to be equal to the maximum randomly droptable threshold of the observed stream traffic. Before configuring the background flow traffic drop threshold to be equal to the minimum randomly droptable threshold of the observed flow traffic, the method further includes: configuring the background flow traffic drop threshold to be equal to 0, and gradually increasing the drop threshold; determining whether the observed flow has packet drop by statistically analyzing the number of transmissions and receptions of the observed flow within a preset time period; if so, determining that the RED design is faulty; if not, determining that the RED design is correct; and / or After the drop threshold increases to be equal to the maximum randomly droptable threshold of the observed stream flow, the method further includes: increasing the drop threshold point by point; detecting whether the queue length can continue to increase; if not, determining that the RED design is flawed; if so, determining that the RED design is correct.

2. The flow test method of claim 1, wherein, The background stream traffic is dropped at a lower priority than the observation stream traffic.

3. The flow rate testing method as described in claim 1, characterized in that, The bandwidth of the background stream is equal to the port bandwidth of the sending port.

4. A flow rate testing device, characterized in that, include: The setting unit is used to preset the background stream traffic and the observation stream traffic to be enqueued and dequeued from the same queue on the same port; The background flow traffic adopts the TD strategy, and the observation flow adopts the RED strategy; The processing unit is configured to set the discard threshold of the background stream traffic to be equal to the minimum randomly discardable threshold of the observed stream traffic, and to increase the discard threshold point by point. By comparing the number of messages sent and received in the observed stream, the probability of message dropping is calculated point by point until the dropping threshold increases to be equal to the maximum randomly droptable threshold of the observed stream traffic. Before configuring the background flow traffic drop threshold to be equal to the minimum randomly droptable threshold of the observed flow traffic, the processing unit is further configured to: configure the background flow traffic drop threshold to be equal to 0, and increase the drop threshold point by point; determine whether the observed flow has dropped packets point by point by statistically analyzing the number of sent and received packets of the observed flow within a preset time; if so, determine that the RED design is flawed. If not, then the RED design is deemed correct; and / or After the drop threshold increases to be equal to the maximum randomly droptable threshold of the observed stream flow, the processing unit is further configured to: increase the drop threshold point by point; detect whether the queue length can continue to increase; if not, determine that the RED design is incorrect; if so, determine that the RED design is correct.

5. The flow rate testing device as described in claim 4, characterized in that, The background stream traffic is dropped at a lower priority than the observation stream traffic.

6. The flow rate testing device as described in claim 4, characterized in that, The bandwidth of the background stream is equal to the port bandwidth of the sending port.

Citation Information

Patent Citations

  • Method and system for testing active queue management parameters of communication equipment

    CN102185732A