Congestion management implements queuing and scheduling when sending packet flows. The device provides the following congestion management technologies: Priority Queuing (PQ), Weighted Deficit Round Robin (WDRR), Weighted Round Robin (WRR), PQ+WDRR, and PQ+WRR. The device has eight queues on each interface in the outbound direction, which are identified by index numbers 0 to 7. Based on the mappings between local priorities and queues, the device sends the classified packets to queues, and then schedules the packets using queue scheduling mechanisms.
Congestion avoidance is a flow control mechanism. A system configured with congestion avoidance monitors network resource usage such as queues and memory buffers. When congestion occurs or aggravates, the system discards packets. Congestion avoidance uses tail drop and random drop policies to discard packets. Random drop policies include the Simple Random Early Detection (SRED) and Weighted Random Early Detection (WRED).
This example uses WRR scheduling to implement congestion management. In WRR scheduling, the device performs scheduling in a polling manner according to the weight of each queue. The number of times packets are scheduled in each queue is directly proportional to the weight of this queue. A higher weight indicates more times packets are scheduled. SRED is configured to implement congestion avoidance. The device discards excess traffic according to the maximum drop probability.
For applicable product models and versions, see Applicable Product Models and Versions.
For details about software mappings, visit Hardware Query Tool and search for the desired product model.
In Figure 1, the Switch is connected to the router through GE0/0/3. The 802.1p priorities of voice, video, and data services are 7, 5, and 2, respectively, and these services can reach residential users through the router and Switch. To reduce the impact of network congestion and ensure bandwidth for high-priority and delay-sensitive services, set parameters according to the following table.
Service Type |
Color |
Lower Drop Threshold |
Maximum Drop Probability |
---|---|---|---|
Voice |
Yellow |
1000 |
0.78125% |
Red |
500 |
6.25% |
|
Video |
Yellow |
1000 |
0.78125% |
Red |
500 |
6.25% |
|
Data |
Yellow |
1000 |
0.78125% |
Red |
500 |
6.25% |
Service Type |
CoS Value |
WRR Weight |
---|---|---|
Voice |
CS7 |
0 |
Video |
EF |
20 |
Data |
AF2 |
10 |
Configure a VLAN for each interface so that devices can communicate with each other at the link layer.
Configure an interface to trust 802.1p priorities of packets.
Set scheduling parameters of queues.
Set SRED drop thresholds and maximum drop probability of queues.
<HUAWEI> system-view [HUAWEI] sysname Switch [Switch] vlan batch 10 20 30 [Switch] interface gigabitethernet 0/0/1 [Switch-GigabitEthernet0/0/1] port link-type trunk [Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 20 30 [Switch-GigabitEthernet0/0/1] quit [Switch] interface gigabitethernet 0/0/2 [Switch-GigabitEthernet0/0/2] port link-type trunk [Switch-GigabitEthernet0/0/2] port trunk allow-pass vlan 10 20 30 [Switch-GigabitEthernet0/0/2] quit [Switch] interface gigabitethernet 0/0/3 [Switch-GigabitEthernet0/0/3] port link-type trunk [Switch-GigabitEthernet0/0/3] port trunk allow-pass vlan 10 20 30 [Switch-GigabitEthernet0/0/3] quit
[Switch] interface gigabitethernet 0/0/3 [Switch-GigabitEthernet0/0/3] trust 8021p //Configure the interface to trust 802.1p priorities. That is, packets enter different queues according to the default mapping between 802.1p priorities and local priorities. [Switch-GigabitEthernet0/0/3] quit
# Set SRED drop thresholds and maximum drop probability of queues.
[Switch] qos sred queue 2 red 500 discard-probability 1 yellow 1000 discard-probability 4 //Set the drop threshold and maximum drop probability for red and yellow packets in queue 2. That is, when there are more than 500 red packets, the device discards extra red packets according to the ratio of 6.25%. When there are more than 1000 yellow packets, the device discards extra yellow packets according to the ratio of 0.78125%. [Switch] qos sred queue 5 red 500 discard-probability 1 yellow 1000 discard-probability 4 [Switch] qos sred queue 7 red 500 discard-probability 1 yellow 1000 discard-probability 4
# Set the scheduling mode of each queue on GE0/0/1 and GE0/0/2 on the Switch. By default, WRR is used.
[Switch] interface gigabitethernet 0/0/1 [Switch-GigabitEthernet0/0/1] qos queue 7 wrr weight 0 //Set the WRR weight of queue 7 to 0 and use PQ scheduling. [Switch-GigabitEthernet0/0/1] qos queue 5 wrr weight 20 //Set the WRR weight of queue 5 to 20. [Switch-GigabitEthernet0/0/1] qos queue 2 wrr weight 10 //Set the WRR weight of queue 2 to 10. The device schedules packets in queue 5 and queue 2 according to the ratio of 2:1. [Switch-GigabitEthernet0/0/1] quit [Switch] interface gigabitethernet 0/0/2 [Switch-GigabitEthernet0/0/2] qos queue 7 wrr weight 0 [Switch-GigabitEthernet0/0/2] qos queue 5 wrr weight 20 [Switch-GigabitEthernet0/0/2] qos queue 2 wrr weight 10 [Switch-GigabitEthernet0/0/2] quit
# Check the global SRED configuration of the interface queue in the outbound direction.
[Switch] display qos sred
Current sred configuration:
qos sred queue-index 2 red 500 discard-probability 1 yellow 1000 discard-probability 4
qos sred queue-index 5 red 500 discard-probability 1 yellow 1000 discard-probability 4
qos sred queue-index 7 red 500 discard-probability 1 yellow 1000 discard-probability 4
Switch configuration file
# sysname Switch # vlan batch 10 20 30 # qos sred queue 2 red 500 discard-probability 1 yellow 1000 discard-probability 4 qos sred queue 5 red 500 discard-probability 1 yellow 1000 discard-probability 4 qos sred queue 7 red 500 discard-probability 1 yellow 1000 discard-probability 4 # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 10 20 30 qos queue 2 wrr weight 10 qos queue 5 wrr weight 20 qos queue 7 wrr weight 0 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 10 20 30 qos queue 2 wrr weight 10 qos queue 5 wrr weight 20 qos queue 7 wrr weight 0 # interface GigabitEthernet0/0/3 port link-type trunk port trunk allow-pass vlan 10 20 30 trust 8021p # return