You are on page 1of 39

S1720, S2700, S5700, and S6720 Series Ethernet

Switches 7 Congestion Avoidance and Congestion


Configuration Guide - QoS Management Configuration

7 Congestion Avoidance and Congestion


Management Configuration

About This Chapter

This chapter describes how to configure congestion avoidance and congestion


management.

7.1 Overview of Congestion Avoidance and Congestion Management


7.2 Understanding Congestion Avoidance and Congestion Management
7.3 Application Scenarios for Congestion Avoidance and Congestion Management
7.4 Licensing Requirements and Limitations for Congestion Avoidance and
Congestion Management
7.5 Configuring Congestion Avoidance (Tail Drop Profile Mode)
7.6 Configuring Congestion Avoidance (WRED Drop Profile Mode)
7.7 Configuring Congestion Management (Schedule Template Mode)
7.8 Configuring Congestion Management (Interface Mode)
7.9 Configuring Congestion Management on a Stack Interface (Schedule Template
Mode)
7.10 Maintaining Congestion Avoidance and Congestion Management
7.11 Configuration Examples for Congestion Avoidance and Congestion
Management

7.1 Overview of Congestion Avoidance and Congestion


Management
Congestion avoidance prevents a network from being overloaded using a packet
discarding policy. Congestion management ensures that high-priority services are
preferentially processed based on the specified packet scheduling sequence.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 167


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

On a traditional network, quality of service (QoS) is affected by network


congestion. Congestion means the low data forwarding rate and delay resulting
from insufficient network resources. Congestion results in delay of packet
transmission, low throughput rate, and high resource consumption. Congestion
frequently occurs in a complex networking environment where packet
transmission and provision of various services are both required.

Congestion avoidance and congestion management are two flow control


mechanisms for resolving congestion on a network.

Congestion Avoidance
Congestion avoidance is a flow control mechanism. A system configured with
congestion avoidance monitors network resources such as queues and memory
buffers. When congestion occurs or aggravates, the system discards packets.

The device supports the following congestion avoidance features:

● Tail drop
Tail drop is the traditional congestion avoidance mechanism that processes all
packets equally without classifying the packets into different types. When
congestion occurs, packets at the end of a queue are discarded until the
congestion problem is solved.
Tail drop causes global Transmission Control Protocol (TCP) synchronization.
In tail drop mechanism, all newly arrived packets are dropped when
congestion occurs, causing all TCP sessions to simultaneously enter the slow
start state and the packet transmission to slow down. Then all TCP sessions
restart their transmission at roughly the same time and then congestion
occurs again, causing another burst of packet drops, and all TCP sessions
enters the slow start state again. The behavior cycles constantly, severely
reducing the network resource usage.
By default, an interface uses tail drop.
● WRED
Weighted Random Early Detection (WRED) randomly discards packets based
on drop parameters. WRED defines different drop policies for packets of
different services. WRED discards packets based on packet priorities, so the
drop probability of packets with higher priorities is low. In addition, WRED
randomly discards packets so that rates of TCP connections are reduced at
different times. This prevents global TCP synchronization.
WRED defines upper and lower threshold for the length of each queue. The
packet drop policy is as follows:
– When the length of a queue is shorter than the lower threshold, no
packet is discarded.
– When the length of a queue exceeds the upper threshold, all received
packets are discarded.
– When the length of a queue ranges from the lower threshold to the
upper threshold, incoming packets are discarded randomly. Random Early
Detection (RED) generates a random number for each incoming packet
and compares it with the drop probability of the current queue. If the
random number is smaller than the drop probability, the packet is
discarded. A longer queue indicates a higher drop probability.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 168


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

NOTE

WRED is only supported by the S6720EI, S6720S-EI, S5720HI, and S5720EI.

Congestion Management
When a network is congested intermittently and delay-sensitive services require
higher bandwidth than other services, congestion management adjusts the
scheduling order of packets.
The device supports the following congestion management features:
● PQ scheduling
Priority queuing (PQ) schedules packets in descending order of priority.
Packets in queues with a low priority can be scheduled only after all packets
in queues with a high priority have been scheduled.
By using PQ scheduling, the device puts packets of delay-sensitive services
into queues with higher priorities and packets of other services into queues
with lower priorities so that packets of delay-sensitive services are
preferentially scheduled.
The disadvantage of PQ is that the packets in lower-priority queues are not
processed until all the higher-priority queues are empty. As a result, a
congested higher-priority queue causes all lower-priority queues to starve out.
● WRR scheduling
Weighted Round Robin (WRR) ensures that packets in all the queues are
scheduled in turn.
For example, eight queues are configured on an interface. Each queue is
configured with a weight, namely, w7, w6, w5, w4, w3, w2, w1, and w0. The
weight value represents the percentage of obtaining resources. This example
assumes that the weights of queues on a 100M interface are 50, 50, 30, 30,
10, 10, 10, and 10, which correspond to w7, w6, w5, w4, w3, w2, w1, and w0
respectively. The queue with the lowest priority can obtain at least 5 Mbit/s
bandwidth. This ensures that packets in all the queues can be scheduled.
In addition, WRR can dynamically change the time of scheduling packets in
queues. For example, if a queue is empty, WRR ignores this queue and starts
to schedule the next queue. This ensures efficient use of bandwidth.
WRR scheduling has two disadvantages:
– WRR schedules packets based on the number of packets, whereas users
concern the bandwidth. When the average packet length in each queue is
the same or known, users can obtain the required bandwidth by setting
WRR weight values. When the average packet length in each queue is
variable, users cannot obtain the required bandwidth by setting WRR
weight values.
– Delay-sensitive services, such as voice services, cannot be scheduled in a
timely manner.
NOTE

The S5720HI does not support WRR.


● WDRR scheduling
Weighted Deficit Round Robin (WDRR) implementation is similar to WRR
implementation.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 169


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

The difference between WDRR and WRR is as follows: WRR schedules packets
based on the number of packets, whereas WDRR schedules packets based on
the packet length. If the packet length is too long, WDRR allows the negative
weight value so that long packets can be scheduled. In the next round, the
queue with the negative weight value is not scheduled until its weight value
becomes positive.
WDRR offsets the disadvantages of PQ scheduling and WRR scheduling. That
is, in PQ scheduling, packets in queues with lower priorities cannot be
scheduled for a long time if congestion occurs, in WRR scheduling, bandwidth
is allocated improperly when the packet length of each queue is different or
variable.
WDRR cannot schedule delay-sensitive services such as voice services in a
timely manner.
When the all the queues participating in WDRR scheduling have the same
weights, the result of WDRR scheduling is the same as that of DRR
scheduling.
● WFQ scheduling
Fair Queue (FQ) ensures that network resources are allocated evenly to
optimize the delay and jitter of all flows. Weighted FQ (WFQ) schedules
packets based on priorities, and schedules more packets with higher priorities
than packets with lower priorities.
WFQ can automatically classify flows based on the session information,
including the protocol type, source and destination TCP or UDP port numbers,
source and destination IP addresses, and precedence field in the ToS field. In
addition, WFQ provides a large number of queues and evenly puts flows into
queues to smooth out the delay. When flows leave queues, WFQ allocates the
bandwidth on the outbound interface for each flow based on the precedence
of each flow. Flows with the lowest priorities obtain the least bandwidth.
● PQ+WRR/PQ+WDRR/PQ+WFQ scheduling
PQ, WRR, WDRR, and WFQ have their own advantages and disadvantages. If
only PQ scheduling is used, packets in the queues with a low priority may not
obtain bandwidth for a long time. If only WRR, WDRR, or WFQ scheduling is
used, delay-sensitive services, such as voice services, cannot be scheduled in a
timely manner. PQ+WRR, PQ+WDRR, or PQ+WFQ scheduling integrates the
advantages of PQ scheduling and WRR, WDRR, or WFQ scheduling and can
avoid their disadvantages.
By using PQ+WRR, PQ+WDRR, or PQ+WFQ scheduling, the device puts
important packets such as protocol packets and packets of delay-sensitive
services to the queue using PQ scheduling, and allocates bandwidth to the
queue. Then, the device can put other packets into the queues using WRR,
WDRR, or WFQ scheduling based on the packet priority. Packets in queues
using WRR, WDRR, or WFQ scheduling can be scheduled based on weight
values in turn.
NOTE

The S5720HI does not support PQ+WRR.

Relevant Information
Technology Forum

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 170


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

QoS Issues - Issue 5 QoS Implementation - Queue Scheduling Modes and


Packet Loss Policies

7.2 Understanding Congestion Avoidance and


Congestion Management
7.2.1 Congestion Avoidance
Congestion avoidance is a mechanism used to control service flows. Congestion
avoidance allows the device to monitor network resource usage, such as queues
and memory buffers. The system uses tail drop or WRED to discard packets when
congestion occurs or worsens.
The switch supports the following congestion avoidance features:
● Tail drop
When the queue length reaches its maximum value, the packets that were
added last (at the tail of the queue) are discarded. This packet drop policy
may cause global TCP synchronization. As a result, TCP connections cannot be
set up.
Below, three colors represent three TCP connections. When packets from
multiple TCP connections are discarded, these TCP connections enter the
congestion avoidance and slow start state. Traffic reduces, and then reaches a
peak. Traffic volume varies greatly.

Figure 7-1 Tail drop of multiple TCP connections

● WRED
Random Early Detection (RED) is used to avoid global TCP synchronization. Its
mechanism randomly discards packets. This ensures the transmission speed of
multiple TCP connections is not reduced simultaneously. Global TCP
synchronization is prevented and the TCP and network traffic rates are
stabilized.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 171


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Figure 7-2 RED of multiple TCP connections

The switch provides Weighted Random Early Detection (WRED) based on RED
technology.
WRED discards packets in queues based on DSCP priorities or IP priorities. The
upper drop threshold, lower drop threshold, and drop probability can be set
for each priority. When the total size of packets in a queue reaches the lower
drop threshold, the switch discards packets. As the total size of packets in the
queue increases, the packet loss ratio increases accordingly. The maximum
drop probability cannot exceed the configured packet loss ratio. All packets
are discarded when the total size of packets in the queue reaches the upper
drop threshold. WRED discards packets in queues based on the drop
probability, thereby preventing congestion to a certain degree.

7.2.2 Congestion Management


As an increasing number of network services emerge and people demand higher
network quality, bandwidth use also increases, which in turn causes congestion.
This leads to delay and/or signal loss. Congestion management implements
queuing and scheduling when sending packet flows to combat delay or signal loss.
Congestion management is required when a network is congested intermittently
and delay-sensitive services require higher QoS than delay-insensitive services. If
congestion persists on the network after congestion management is configured,
increase the bandwidth.
Based on queuing and scheduling policies, the switch supports Priority Queuing
(PQ), Weighted Deficit Round Robin (WDRR), Weighted Round Robin (WRR),
Weighted Fair Queuing (WFQ), PQ+WDRR, PQ+WRR, and PQ+WFQ for congestion
management. Each scheduling algorithm schedules specific types of traffic, and
affects bandwidth allocation, delay, and jitter.
The switch has eight queues on each interface in the outbound direction. The
queues are identified by index numbers ranging from 0 to 7. The device sends
classified packets to queues based on mappings between local priorities and
queues. The packets are then scheduled using queue scheduling mechanisms:
● PQ scheduling
Designed for core services, PQ scheduling is applied to queues in descending
order of priority. Low-priority queues are processed only after all high-priority
queues are empty. Core services are assigned a high priority and are processed

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 172


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

first. Non-core services are processed only at times when core services do not
require bandwidth. Core services are placed into high-priority queues, and
non-core services (such as email services) are placed into low-priority queues.
PQ scheduling is valid for short-delay services.
In Figure 7-3, data flow X is mapped to the queue with the highest priority
on each node.
When packets from data flow X reach a node, the data flow packets are
processed first. Packets are processed according to priority. Queues are
processed in descending order of priority:
– Queue 7 packets are processed first.
– Queue 6 packets are sent at the link rate when they need to be sent and
queue 7 is empty.
– Queue 5 packets are sent at the link rate when queue 6 and queue 7 are
empty, and so on.
However, the PQ scheduling mechanism may result in package starvation in
low-priority queues. For example, if data flows mapped to queue 7 arrive at a
100% link rate in a given period, the scheduler does not process flows in
queues 0 to 6.
To prevent package starvation, upstream devices need to accurately define
service characteristics of data flows preventing service flows mapped to queue
7 from exceeding a certain percentage of link capacity. This prevents queue 7
from becoming full and allows the scheduler to process packets from low-
priority queues.

Figure 7-3 PQ scheduling

Queue 7 High priority

Packet flow

Queue 6 Packet flow

......
Queue 1
Interface

Queue 0

Low priority

● WRR scheduling
WRR scheduling is an extension of Round Robin (RR) scheduling. Packets in
each queue are scheduled in a polling manner based on the queue weight. RR
scheduling equals WRR scheduling with the weight being 1.
Figure 7-4 shows WRR scheduling.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 173


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Figure 7-4 WRR scheduling

Queue 7
Packet flow

Queue 6 Packet flow

......
Queue 1
Interface
Classification

Queue 0

In WRR scheduling, the device schedules packets in queues in a polling


manner round by round based on the queue weight. After one round of
scheduling, the weights of all queues are decreased by 1. The queue whose
weight is decreased to 0 cannot be scheduled. When the weights of all the
queues are decreased to 0, the next round of scheduling starts. For example,
the weights of eight queues on an interface are set to 4, 2, 5, 3, 6, 4, 2, and 1.
Table 7-1 lists the WRR scheduling results.

Table 7-1 WRR scheduling results


Queu Queu Queu Queu Queu Queu Queu Queu Queu
e e7 e6 e5 e4 e3 e2 e1 e0
Index

Queu 4 2 5 3 6 4 2 1
e
Weig
ht

Queu Queu Queu Queu Queu Queu Queu Queu Queu


e in e7 e6 e5 e4 e3 e2 e1 e0
the
first
round
of
sched
uling

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 174


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Queu Queu Queu Queu Queu Queu Queu Queu Queu


e e7 e6 e5 e4 e3 e2 e1 e0
Index

Queu Queu Queu Queu Queu Queu Queu Queu -


e in e7 e6 e5 e4 e3 e2 e1
the
secon
d
round
of
sched
uling

Queu Queu - Queu Queu Queu Queu - -


e in e7 e5 e4 e3 e2
the
third
round
of
sched
uling

Queu Queu - Queu - Queu Queu - -


e in e7 e5 e3 e2
the
fourth
round
of
sched
uling

Queu - - Queu - Queu - - -


e in e5 e3
the
fifth
round
of
sched
uling

Queu - - - - Queu - - -
e in e3
the
sixth
round
of
sched
uling

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 175


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Queu Queu Queu Queu Queu Queu Queu Queu Queu


e e7 e6 e5 e4 e3 e2 e1 e0
Index

Queu Queu Queu Queu Queu Queu Queu Queu Queu


e in e7 e6 e5 e4 e3 e2 e1 e0
the
seven
th
round
of
sched
uling

Queu Queu Queu Queu Queu Queu Queu Queu -


e in e7 e6 e5 e4 e3 e2 e1
the
eighth
round
of
sched
uling

Queu Queu - Queu Queu Queu Queu - -


e in e7 e5 e4 e3 e2
the
ninth
round
of
sched
uling

Queu Queu - Queu - Queu Queu - -


e in e7 e5 e3 e2
the
tenth
round
of
sched
uling

Queu - - Queu - Queu - - -


e in e5 e3
the
eleve
nth
round
of
sched
uling

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 176


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Queu Queu Queu Queu Queu Queu Queu Queu Queu


e e7 e6 e5 e4 e3 e2 e1 e0
Index

Queu - - - - Queu - - -
e in e3
the
twelft
h
round
of
sched
uling

The statistics show that the number of times packets are scheduled in each
queue corresponds to the queue weight. A higher queue weight indicates a
greater number of times packets in the queue are scheduled. The unit for
WRR scheduling is packet; therefore, there is no fixed bandwidth for each
queue. If packets are scheduled fairly, large-sized packets obtain more
bandwidth than small-sized packets.
WRR scheduling offsets the disadvantage of PQ scheduling in which packets
in queues with lower priories may be not processed for a long period of time
if congestion occurs. In addition, WRR can dynamically change the time of
scheduling packets in queues. For example, if a queue is empty, WRR
scheduling ignores this queue and starts to schedule the next queue. This
ensures bandwidth usage. WRR scheduling, however, cannot schedule short-
delay services in time.
● WDRR scheduling
WDRR is also based on RR. WDRR solves the WRR problem. In WRR
scheduling, a large-sized packet obtains less bandwidth than a small-sized
packet. WDRR schedules packets considering the packet length, ensuring that
packets are scheduled equally.
Deficit indicates the bandwidth deficit of each queue. The initial value is 0.
The system allocates bandwidth to each queue based on the weight and
calculates the deficit. If the deficit of a queue is greater than 0, the queue
participates in scheduling. The device sends a packet and calculates the deficit
based on the length of the sent packet. If the deficit of a queue is smaller
than 0, the queue does not participate in scheduling. The current deficit is
used as the basis for the next round of scheduling.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 177


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Figure 7-5 Queue weights


(Q7,20%)
400 600 900

(Q6,15%)
500 300 400

(Q5,10%)
800 400 600

(Q4,5%)
800 800 400

(Q3,20%)
500 400 800

(Q2,15%)
700 700 700

(Q1,10%)
700 800 600

(Q0,5%)
700 800 600

In Figure 7-5, the weights of Q7, Q6, Q5, Q4, Q3, Q2, Q1, and Q0 are set to
40, 30, 20, 10, 40, 30, 20, and 10 respectively. During scheduling, Q7, Q6, Q5,
Q4, Q3, Q2, Q1, and Q0 obtain 20%, 15%, 10%, 5%, 20%, 15%, 10%, and 5%
of the bandwidth respectively. Q7 and Q6 are used as examples to describe
WDRR scheduling. Assume that Q7 obtains 400 bytes/s bandwidth and Q6
obtains 300 bytes/s bandwidth.
– First round of scheduling
Deficit[7][1] = 0 + 400 = 400
Deficit[6][1] = 0 + 300 = 300
A packet of 900 bytes in Q7 and a packet of 400 bytes in Q6 are sent.
Then, the values are as follows:
Deficit[7][1] = 400 - 900 = -500
Deficit[6][1] = 300 - 400 = -100
– Second round of scheduling
Deficit [7][2] = -500 + 400 = -100
Deficit [6][2] = -100 + 300 = 200
A packet in Q7 is not scheduled because the deficit of Q7 is negative. A
packet of 300 bytes in Q6 is sent. Then, the value is as follows:
Deficit [6][2] = 200 - 300 = -100

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 178


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

– Third round of scheduling


Deficit[7][3] = -100 + 400 = 300
Deficit[6][3] = -100 + 300 = 200
A packet of 600 bytes in Q7 and a packet of 500 bytes in Q6 are sent.
Then, the values are as follows:
Deficit[7][3] = 300 - 600 = -300
Deficit[6][3] = 200 - 500 = -300
Such a process is repeated and finally Q7 and Q6 respectively obtain 20%
and 15% of the bandwidth. This illustrates that you can obtain the
required bandwidth by setting the weights.
In WDRR scheduling, short-delay services still cannot be scheduled in time.
● WFQ scheduling
Fair Queuing (FQ) scheduling equally allocates network resources to minimize
delay and jitter of all flows. Packet allocation is as follows:
– Packets in different queues are scheduled fairly, and the flow delays have
slight differences
– Packets with different sizes are scheduled fairly. If many large and small
packets in different queues need to be sent, small packets are scheduled
first, reducing total packet jitter of each flow.
Weighted Fair Queuing (WFQ) uses priorities to schedule packets. Higher
priority packets are scheduled more than lower priority packets.
Prior to entering queues, WFQ classifies packets based on:
– Session information
Flows are classified according to session information, including the
protocol type, source and destination TCP or UDP port number, source
and destination IP address, and precedence field in the ToS field.
To resolve delays, WFQ provides a large number of queues and evenly
distributes flows into queues.
When a flow leaves a queue, WFQ allocates the bandwidth on the
outbound interface based on the precedence of the flow. A low
precedence value receives little bandwidth while high precedence value
receives more bandwidth.
– Priority
Priority mapping technique marks local priorities for traffic.
Each interface is allocated four or eight queues. Packets enter queues
based on the queue number.
By default, queue weight is the same and interface bandwidth is evenly
shared by queue traffic. Queue weight is customizable so that high-
priority and low-priority packets are allocated bandwidth by weight
percentage.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 179


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Figure 7-6 WFQ scheduling

Queue 1 weight 1
Packet flow

Queue 2 weight 2 Packet flow

Scheduling
......
Queue N-1 weight N-1
Interface
Classification
Queue N weight N

● PQ+WRR scheduling
PQ+WRR scheduling integrates the advantages and offsets the disadvantages
of both PQ scheduling and WRR scheduling. Packets from queues with lower
priorities can obtain the bandwidth by WRR scheduling and short-delay
services can be scheduled first by PQ scheduling.
On the device, you can set WRR parameters for queues. The eight queues on
each interface are classified into two groups. One group includes queue 7,
queue 6, and Queue 5, and is scheduled in PQ mode; the other group includes
queue 4, queue 3, queue 2, queue 1, and queue 0, and is scheduled in WRR
mode. Only LAN-side interfaces on the device support PQ+WRR scheduling.
Figure 7-7 shows PQ+WRR scheduling.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 180


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Figure 7-7 PQ+WRR scheduling


Queue 7

PQ scheduling
Packet flow
Queue 6
Packet flow
Queue 5

Queue 4

WRR scheduling
Interface
Classification Queue 3

Queue 2

Queue 1

Queue 0

During scheduling, the device first schedules traffic in queue 7, queue 6, and
queue 5 in PQ mode. The device schedules traffic in other queues in WRR
mode only after the traffic in queue 7, queue 6, and queue 5 are scheduled.
Queue 4, queue 3, queue 2, queue 1, and queue 0 have their own weights.
Important protocol packets or short-delay service packets must be placed in
queues using PQ scheduling so that they can be scheduled first. Other packets
are placed in queues using WRR scheduling.
● PQ+WDRR scheduling
PQ+WDRR scheduling integrates the advantages and offsets the
disadvantages of both PQ scheduling and WDRR scheduling. If only PQ
scheduling is used, packets in queues with lower priorities cannot obtain
bandwidth for a long period of time. If only WDRR scheduling is used, short-
delay services such as voice services cannot be scheduled first. PQ+WDRR
scheduling has advantages of both PQ and WDRR scheduling and offsets their
disadvantages.
Eight queues on the device interface are classified into two groups. You can
specify PQ scheduling for certain groups and WDRR scheduling for other
groups.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 181


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Figure 7-8 PQ+WDRR scheduling


Queue 7

PQ scheduling
Packet flow
Queue 6
Packet flow
Queue 5

DRR scheduling
Queue 4
Interface
Classification Queue 3

Queue 2

Queue 1

Queue 0

In Figure 7-8, the device first schedules traffic in queues 7, 6, and 5 in PQ


mode. After traffic scheduling in queues 7, 6, and 5 is complete, the device
schedules traffic in queues 4, 3, 2, 1, and 0 in WDRR mode. Queues 4, 3, 2, 1,
and 0 have their own weight.
Important protocol packets or short-delay service packets must be placed in
queues using PQ scheduling so that they can be scheduled first. Other packets
are placed in queues using WDRR scheduling.
● PQ+WFQ scheduling
PQ+WFQ scheduling integrates the advantages and offsets the disadvantages
of both PQ scheduling and WFQ scheduling.
If PQ scheduling is used on its own, packets in low-priority queues cannot
obtain bandwidth for an extended period of time. If WFQ scheduling is used
on its own, delay-sensitive services, such as voice services, cannot be
scheduled in a timely manner.
Eight queues on the device interface are classified into two groups. You can
specify PQ scheduling for certain groups and WFQ scheduling for other
groups.
Configuring PQ+WFQ scheduling solves the above problems.
In Figure 7-9, there are eight queues on the device interface. They are
classified into two groups, allowing for PQ scheduling for certain groups and
WFQ scheduling for other groups.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 182


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Figure 7-9 PQ+WFQ scheduling


Queue 7

PQ scheduling
Packet flow
Queue 6
Packet flow
Queue 5

WFQ scheduling
Queue 4
Interface
Classification Queue 3

Queue 2

Queue 1

Queue 0

The device first schedules traffic from queues 7, 6, and 5 in PQ mode. After
traffic scheduling is complete, traffic from queues 4, 3, 2, 1, and 0 is
scheduled in WFQ mode. Queues 4, 3, 2, 1, and 0 each have their own
weights.
PQ scheduling is used to schedule important protocol packets or short-delay
service packets in queues first. WFQ scheduling is used to place other packets
in queues.

7.3 Application Scenarios for Congestion Avoidance


and Congestion Management
Congestion Management
Congestion management is often deployed in QoS applications to schedule
different services based on priorities.
On an enterprise network, when multiple services compete for the same resources
(such as the bandwidth and buffer), traffic congestion may occur. High-priority
services may not be processed in a timely manner.
Figure 7-10 shows a network implementing congestion management. Packets are
sent to different cues according to the result of priority mapping. To implement
differentiated services, different scheduling modes are set in the outbound
direction.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 183


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Figure 7-10 Network implementing congestion management

Traffic direction

Voice flow Voice server

Data flow

Data server

Video flow

Video server

Congestion management in the outbound direction

Congestion Avoidance
When congestion occurs or worsens, congestion avoidance discards low-priority
packets to relieve network overload and ensure forwarding of high-priority
packets.
In Figure 7-11, different LAN users may obtain data from the same server. Data
exchanged between the server and users goes through the wide area network
(WAN).
WAN bandwidth is lower than LAN bandwidth, so congestion may occur between
the WAN and LAN.
Congestion avoidance is configured on an edge device to discard low-priority
packets, such as data packets. It reduces network overload and ensures forwarding
of high-priority services.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 184


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Figure 7-11 Network implementing congestion avoidance

Traffic direction

Voice flow

WAN
Data flow

Video flow

Congestion management in the outbound direction

7.4 Licensing Requirements and Limitations for


Congestion Avoidance and Congestion Management
Involved Network Elements
Other network elements are not required.

Licensing Requirements
Configuration commands of congestion management and congestion avoidance
are available only after the S1720GW, S1720GWR, and S1720X have the license
(WEB management to full management Electronic RTU License) loaded and
activated and the switches are restarted. Configuration commands of congestion
management and congestion avoidance on other models are not under license
control.
For details about how to apply for a license, see S Series Switch License Use
Guide.

Version Requirements
Table 7-2 describes the products and versions supporting congestion management
and congestion avoidance.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 185


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Table 7-2 Products and versions supporting congestion management and


congestion avoidance
Product Product Software Version
Model

S1700 S1720GFR V200R006C10, V200R009C00, V200R010C00,


V200R011C00, V200R011C10

S1720GW, V200R010C00, V200R011C00, V200R011C10


S1720GWR

S1720GW- V200R010C00, V200R011C00, V200R011C10


E,
S1720GWR
-E

S1720X, V200R011C00, V200R011C10


S1720X-E

Other Models that cannot be configured using commands.


S1700 For details about features and versions, see S1700
models Documentation Bookshelf.

S2700 S2700SI Congestion management: not supported


Congestion avoidance:
V100R006(C00&C01&C03&C05)

S2700EI V100R006(C00&C01&C03&C05)

S2710SI V100R006(C03&C05)

S2720EI V200R006C10, V200R009C00, V200R010C00,


V200R011C10

S2750EI V200R003C00, V200R005C00SPC300, V200R006C00,


V200R007C00, V200R008C00, V200R009C00,
V200R010C00, V200R011C00, V200R011C10

S3700 S3700SI V100R006(C00&C01&C03&C05)

S3700EI V100R006(C00&C01&C03&C05)

S3700HI V100R006C01, V200R001C00

S5700 S5700LI V200R001C00, V200R002C00,


V200R003(C00&C02&C10), V200R005C00SPC300,
V200R006C00, V200R007C00, V200R008C00,
V200R009C00, V200R010C00, V200R011C00,
V200R011C10

S5700S-LI V200R001C00, V200R002C00, V200R003C00,


V200R005C00SPC300, V200R006C00, V200R007C00,
V200R008C00, V200R009C00, V200R010C00,
V200R011C00, V200R011C10

S5710-C-LI V200R001C00

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 186


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Product Product Software Version


Model

S5710-X-LI V200R008C00, V200R009C00, V200R010C00,


V200R011C00, V200R011C10

S5700SI V100R006C00, V200R001C00, V200R002C00,


V200R003C00, V200R005C00

S5700EI V100R006(C00&C01), V200R001(C00&C01),


V200R002C00, V200R003C00,
V200R005(C00&C01&C02&C03)

S5710EI V200R001C00, V200R002C00, V200R003C00,


V200R005(C00&C02)

S5720EI V200R007C00, V200R008C00, V200R009C00,


V200R010C00, V200R011C00, V200R011C10

S5720LI, V200R010C00, V200R011C00, V200R011C10


S5720S-LI

S5720SI, V200R008C00, V200R009C00, V200R010C00,


S5720S-SI V200R011C00, V200R011C10

S5730SI V200R011C10

S5730S-EI V200R011C10

S5700HI V100R006C01, V200R001(C00&C01), V200R002C00,


V200R003C00, V200R005(C00SPC500&C01&C02)

S5710HI V200R003C00, V200R005(C00&C02&C03)

S5720HI V200R006C00, V200R007(C00&C10), V200R008C00,


V200R009C00, V200R010C00, V200R011C00,
V200R011C10

S6700 S6700EI V100R006C00, V200R001(C00&C01), V200R002C00,


V200R003C00, V200R005(C00&C01&C02)

S6720LI, V200R011C00, V200R011C10


S6720S-LI

S6720SI, V200R011C00, V200R011C10


S6720S-SI

S6720EI V200R008C00, V200R009C00, V200R010C00,


V200R011C00, V200R011C10

S6720S-EI V200R009C00, V200R010C00, V200R011C00,


V200R011C10

NOTE
To know details about software mappings, see Hardware Query Tool.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 187


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Feature Limitations
Product Models Supporting Tail Drop Profiles and Specifications
● S1720GFR in V200R006C10: 7
● S1720GFR in V200R009C00 and later versions: 6
● S2720EI: 6
● S2750EI: 6
● S5700SI: 7
● S5700-10P-LI: 6
● Other S5700LI models except the S5700-10P-LI in earlier versions than
V200R009C00: 7
● Other S5700LI models except the S5700-10P-LI in V200R009C00 and later
versions: 6
● S5700S-LI in earlier versions than V200R009C00: 7
● S5700S-LI in V200R009C00 and later versions: 6
● S5710-C-LI: 7
● S5710-X-LI in V200R008C00: 7
● S5710-X-LI in V200R009C00 and later versions: 6
● S1720GW, S1720GWR, S1720X, S1720GW-E, S1720GWR-E, and S1720X-E: 6
● S5720LI, S5720S-LI, S5720SI, and S5720S-SI: 6
● S5730SI and S5730S-EI: 6
● S6720LI, S6720S-LI, S6720SI, and S6720S-SI: 6
Product Models Supporting WRED Drop Profiles and Specifications
● S3700HI, S5700HI, S5710EI, S5710HI, S5720EI, S6700EI, S6720EI, S6720S-EI:
64
● S5720HI: 16

7.5 Configuring Congestion Avoidance (Tail Drop


Profile Mode)
Context
The switch uses tail drop to prevent congestion. When the length of a queue
reaches the maximum value, all the packets last added to the queue (at the tail of
the queue) are discarded. You can set the maximum number of bytes or packets
to be cached in a queue to prevent traffic loss.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 188


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

NOTE

Only the S1720GFR, S1720GW, S1720GWR, S1720X, S1720GW-E, S1720GWR-E, S1720X-E,


S2720EI, S2750EI, S5700LI, S5700S-LI, S5710-X-LI, S5720LI, S5720S-LI, S5720SI, S5720S-SI,
S5730SI, S5730S-EI, S6720LI, S6720S-LI, S6720SI, and S6720S-SI support congestion
avoidance using a tail drop profile.
Before setting the maximum number of bytes or packets to be cached in a queue, run the
shutdown command to shut down the interface. After the maximum number of bytes or
packets to be cached in a queue is set, run the undo shutdown command to enable the
interface. These operations may cause network interruption in a short period of time.

Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run qos tail-drop-profile profile-name
A tail drop profile is created and the tail drop profile view is displayed.
Step 3 Run the following commands as required.
Set the maximum number of bytes or packets to be cached in a queue.
● On the S2750EI and S5700-10P-LI, run qos queue queue-index green max-
buffer cell-number non-green max-buffer cell-number
The maximum number of bytes to be cached in a queue is set.
● On other modules except the S2750EI and S5700-10P-LI, run qos queue
queue-index max-buffer cell-number [ green max-buffer cell-number ]
The maximum number of bytes to be cached in a queue is set.
● On other modules except the S2750EI and S5700-10P-LI, run qos queue
queue-index green max-buffer cell-number
The maximum number of bytes to be cached in a queue is set.
● On the S2750EI and S5700-10P-LI, run qos queue queue-index green max-
length packet-number non-green max-length packet-number
The maximum number of packets to be cached in a queue is set.
● On other modules except the S2750EI and S5700-10P-LI, run qos queue
queue-index max-length packet-number [ green max-length packet-
number ]
The maximum number of packets to be cached in a queue is set.
● On other modules except the S2750EI and S5700-10P-LI, run qos queue
queue-index green max-length packet-number
The maximum number of packets to be cached in a queue is set.
If the maximum number of bytes or packets is reached, the device considers that
congestion occurs and will discard subsequent packets.
Step 4 Run quit
Return to the system view.
Step 5 Run interface interface-type interface-number
The interface view is displayed.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 189


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Step 6 Run shutdown

The interface is shut down.

Step 7 Run qos tail-drop-profile profile-name

The tail drop profile is applied to the interface.

Step 8 Run undo shutdown

The interface is restarted.

----End

Verifying the Configuration


● Run the display qos configuration interface interface-type interface-number
command to check all the QoS configurations on the interface.
● Run the display qos queue statistics interface interface-type interface-
number [ queue queue-index ] command to check the queue-based traffic
statistics on the interface.

7.6 Configuring Congestion Avoidance (WRED Drop


Profile Mode)

Pre-configuration Tasks
Configure congestion avoidance based on a WRED drop profile on the device
when packets are discarded due to congestion.

Packets of different services are processed in different manners (differentiated by


CoS values or colors), ensuring bandwidth for important services and preventing
packets from important services from being discarded.

Before configuring congestion avoidance, map the priority of packets to a per-hop


behavior (PHB) and color.

7.6.1 (Optional) Configuring CFI as the Internal Drop Priority

Context
The Canonical Format Indicator (CFI) in the VLAN tag, also called Drop Eligible
Indicator (DEI), identifies the drop priority of packets in certain situations. When
the rate of packets on certain devices exceeds the committed information rate
(CIR) value, the value of the DEI field is set to 1. In this case, the drop priority of
the packets is high. When congestion occurs, the devices first discard the packets
whose DEI field is 1.

If packets whose rate exceeds the CIR need to be discarded, configure CFI as the
internal drop priority.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 190


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Procedure
Step 1 Run system-view
Enter the system view.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run dei enable
CFI is configured as the internal drop priority.
By default, CFI is not configured as the internal drop priority.

----End

7.6.2 Configuring a WRED Drop Profile


Context
A WRED drop profile defines the upper drop threshold, lower drop threshold, and
drop probability for different colored packets. WRED randomly discards packets
based on drop parameters to prevent global TCP synchronization, and defines
different drop policies based on packet colors. WRED discards packets based on
packet priorities. Packets with higher priorities have a low probability of being
discarded. For more information about packet colors, see 4.6 Configuring Priority
Mapping.

NOTE

Congestion avoidance applies only to unicast traffic.


Only the S5720EI, S5720HI, S6720EI, and S6720S-EI support congestion avoidance using a
WRED profile.

Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run drop-profile drop-profile-name
A WRED drop profile is created and the drop profile view is displayed.
By default, the WRED drop profile default exists. The default WRED drop profile
exists, which can be modified but not deleted.
Step 3 Run color { green | non-tcp | red | yellow } low-limit low-limit-percentage high-
limit high-limit-percentage discard-percentage discard-percentage
WRED parameters are set. low-limit specifies the lower threshold, high-limit
specifies the upper threshold, and discard-percentage specifies the maximum
drop probability.
By default, low-limit, high-limit, and discard-percentage of a WRED drop profile
are all set to 100.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 191


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Step 4 (Optional) Run queue-depth queue-depth-value

The length of the port queue is set.

NOTE

Only the S5720HI supports this command.

----End

7.6.3 Applying the WRED Drop Profile

Context
On the device, you can apply a WRED drop profile to an interface, the system, or a
queue on an interface.

If a WRED drop profile is applied to the system and an interface simultaneously,


the WRED drop profile applied to the interface takes effect. After a WRED drop
profile is applied to the system, it takes effect on all the interfaces.If you apply a
WRED drop profile to an interface and a queue on an interface simultaneously,
the system first matches the packets with the profile applied to the queue, and
then the profile applied to the interface. Then the device performs congestion
avoidance on the packets that match the WRED drop profile.

Procedure
● Applying a WRED drop profile to the system
a. Run system-view

The system view is displayed.


b. Run qos queue queue-index wred drop-profile-name

A WRED drop profile is applied to the system.


● Apply a WRED drop profile to a queue on an interface.
a. Run system-view

The system view is displayed.


b. Run interface interface-type interface-number

The interface view is displayed.


c. Run qos queue queue-index wred drop-profile-name

A WRED drop profile is applied to a queue on the interface.

NOTE

The parameter drop-profile-name specifies the name of a WRED drop profile.


The value must be the same as that configured in 7.6.2 Configuring a WRED
Drop Profile.

----End

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 192


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

7.6.4 Verifying the Congestion Avoidance Configuration


Procedure
● Run the display drop-profile [ all | name drop-profile-name ] command to
check the WRED drop profile configuration.
● Run the display qos configuration interface interface-type interface-number
command to check all the QoS configurations on a specified interface.
----End

7.7 Configuring Congestion Management (Schedule


Template Mode)
Pre-configuration Tasks
Before configuring congestion management, map the priority of packets to a PHB.

Context
There are eight queues on each interface. Different queues can use different
scheduling modes. The device schedules the queues using PQ scheduling first. If
multiple queues using PQ scheduling exist, the device schedules the queues in
descending order of priority. A larger queue index indicates higher priority of a
queue. After all the PQ scheduling is completed, the device schedules the queues
using WRR or WDRR scheduling.

NOTE

Only the S1720GFR, S1720GW, S1720GWR, S1720X, S1720GW-E, S1720GWR-E, S1720X-E,


S2720EI, S2750EI, S5700LI, S5700S-LI, S5710-X-LI, S5720LI, S5720S-LI, S5720SI, S5720S-SI,
S5730SI, S5730S-EI, S6720LI, S6720S-LI, S6720SI, and S6720S-SI support congestion
management using a schedule template.

Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run qos schedule-profile profile-name
A global schedule template is created and the schedule template view is displayed.
Step 3 Run qos { pq | wrr | drr }
The scheduling mode of a port queue is set to PQ, WRR, or WDRR.
By default, WRR scheduling is used.
Step 4 Configure WRR or WDRR weights for port queues.
● If the scheduling mode is WRR, run the qos queue queue-index wrr weight
weight command to set the WRR weight for a port queue.
By default, the weight in WRR mode is 1.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 193


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

NOTE

Perform this step only when the scheduling mode of a port queue is set to PQ+WRR or
WRR.
When WRR scheduling is applied and the weight of a queue is set to 0, the queue
applies PQ scheduling and other queues apply WRR scheduling. When configuring the
PQ+WRR scheduling mode, ensure that the queues with weight 0 (queue using PQ
scheduling) are consecutively configured, without being interrupted by the
configuration of the queues using WRR scheduling.
● If the scheduling mode is WDRR, run the qos queue queue-index drr weight
weight command to set the WDRR weight for a port queue.
By default, the weight in WDRR mode is 1.
NOTE

Perform this step only when the scheduling mode of a port queue is set to WDRR or
PQ+WDRR.
When WDRR scheduling is applied and the weight of a queue is set to 0, the queue
applies PQ scheduling and other queues apply WDRR scheduling. When configuring
the PQ+WDRR scheduling mode, ensure that the queues with weight 0 (queue using
PQ scheduling) are consecutively configured, without being interrupted by the
configuration of the queues using WDRR scheduling.

Step 5 Run quit

Return to the system view.

Step 6 Run interface interface-type interface-number

The interface view is displayed.

Step 7 Run qos schedule-profile profile-name

The scheduling template is applied.

----End

Verifying the Configuration


● Run the display qos configuration interface [ interface-type interface-
number ] command to check all the QoS configurations on a specified
interface.
● Run the display qos queue statistics interface interface-type interface-
number [ queue queue-index ] command to check the queue-based traffic
statistics on the interface.

7.8 Configuring Congestion Management (Interface


Mode)

Pre-configuration Tasks
Before configuring congestion management, map the priority of packets to a PHB.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 194


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Context
Configure congestion management on the device when the network intermittently
becomes congested.

Once congestion management is configured, the sequence at which packets are


forwarded is determined according to the defined scheduling policy. High-priority
services are scheduled preferentially.

There are eight queues on each interface. Different queues can use different
scheduling modes. The device schedules the queues using PQ scheduling first. If
multiple queues using PQ scheduling exist, the device schedules the queues in
descending order of priority. A larger queue index indicates higher priority of a
queue. After all the PQ scheduling is completed, the device schedules the queues
using WRR or WDRR scheduling.

NOTE

Only the S5720EI, S5720HI, S6720EI, and S6720S-EI support congestion management in
interface mode.

Procedure
Step 1 Run system-view

The system view is displayed.

Step 2 Run interface interface-type interface-number

The interface view is displayed.

Step 3 Run qos { pq | wrr | drr }

The scheduling mode of queues on the interface is set to PQ, WRR, or WDRR.

By default, the scheduling mode of queues on an interface of the S5720HI is


WDRR, and the scheduling mode of queues on an interface of other models is
WRR.

Step 4 Configure the weight.


● In WRR scheduling, run qos queue queue-index wrr weight weight
The weight for WRR scheduling is set.
By default, the weight for WRR scheduling is 1.
NOTE

This step is required only when the scheduling mode is WRR or PQ+WRR.
When WRR scheduling is applied and the weight of a queue is set to 0, PQ scheduling
is used. That is, the queue uses PQ+WRR.
The S5720HI does not support WRR or PQ+WRR.
● In WDRR scheduling, run qos queue queue-index drr weight weight
The weight for WDRR scheduling is set.
By default, the weight for WDRR scheduling is 1.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 195


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

NOTE

This step is required only when the scheduling mode is WDRR or PQ+WDRR.
When WDRR scheduling is applied and the weight of a queue is set to 0, PQ
scheduling is used. That is, the queue uses PQ+WDRR.
On the S5720EI, if the queue scheduling mode is changed or the weight is changed
during queue scheduling, packet loss occurs within 250 ms.
On the S6720EI and S6720S-EI, if the queue scheduling mode is changed or the weight
is changed during queue scheduling, packet loss occurs within 20 ms.

----End

Verifying the Configuration


● Run the display qos configuration interface [ interface-type interface-
number ] command to check all the QoS configurations on the interface.
● Run the display qos queue statistics interface interface-type interface-
number [ queue queue-index ] command to view queue-based traffic
statistics on the interface.

7.9 Configuring Congestion Management on a Stack


Interface (Schedule Template Mode)

Pre-configuration Tasks
Configure congestion management on a stack interface when the network
intermittently becomes congested. Once congestion management is configured,
the sequence at which packets are forwarded is determined according to the
defined scheduling policy. High-priority services are scheduled preferentially.

Before configuring congestion management on a stack interface, complete the


following tasks:
● Perform the stack configuration.
● Configure priority mapping on inbound interface of packets.

Context
After the stack is configured, stack protocol packets and packets between chassis
are exchanged on the stack interface. If a large number of packets are exchanged,
congestion may occur on the stack interface. As a result, core services such as
video services and voice services cannot be processed in a timely manner. You can
set the scheduling mode on the stack interface so that services with the same
priority are processed in the same manner and services with different priorities are
processed based on weights.

NOTE

Only the S2720EI, S2750EI, S5700LI, S5700S-LI, S5710-X-LI, S5720LI, S5720S-LI, S5720SI,
S5720S-SI, S5730SI, S5730S-EI, S6720LI, S6720S-LI, S6720SI, and S6720S-SI support
congestion management on a stack interface using a schedule template.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 196


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run qos schedule-profile profile-name
A global schedule template is created and the schedule template view is displayed.
Step 3 Run qos { pq | wrr | drr }
The scheduling mode of a port queue is set to PQ, WRR, or WDRR.
By default, WRR scheduling is used.
Step 4 Configure WRR or WDRR weights for port queues.
● If the scheduling mode is WRR, run the qos queue queue-index wrr weight
weight command to set the WRR weight for a port queue.
By default, the weight in WRR mode is 1.
NOTE

Perform this step only when the scheduling mode of a port queue is set to PQ+WRR or
WRR.
When WRR scheduling is applied and the weight of a queue is set to 0, the queue
applies PQ scheduling and other queues apply WRR scheduling. When configuring the
PQ+WRR scheduling mode, ensure that the queues with weight 0 (queue using PQ
scheduling) are consecutively configured, without being interrupted by the
configuration of the queues using WRR scheduling.
● If the scheduling mode is WDRR, run the qos queue queue-index drr weight
weight command to set the WDRR weight for a port queue.
By default, the weight in WDRR mode is 1.
NOTE

Perform this step only when the scheduling mode of a port queue is set to WDRR or
PQ+WDRR.
When WDRR scheduling is applied and the weight of a queue is set to 0, the queue
applies PQ scheduling and other queues apply WDRR scheduling. When configuring
the PQ+WDRR scheduling mode, ensure that the queues with weight 0 (queue using
PQ scheduling) are consecutively configured, without being interrupted by the
configuration of the queues using WDRR scheduling.

Step 5 Run quit


Return to the system view.
Step 6 Run stack-port qos schedule-profile profile-name
The scheduling profile is applied.

----End

Verifying the Configuration


● Run the display qos configuration interface [ interface-type interface-
number ] command to check all the QoS configurations on a specified
interface.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 197


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

● Run the display qos queue statistics interface interface-type interface-


number [ queue queue-index ] command to check the queue-based traffic
statistics on the interface.

7.10 Maintaining Congestion Avoidance and


Congestion Management

7.10.1 Displaying Queue-based Traffic Statistics


Procedure
● Run the display qos queue statistics interface interface-type interface-
number [ queue queue-index ] command to view queue-based traffic
statistics on the interface.
----End

7.10.2 Clearing Queue-based Traffic Statistics


Context
Before re-collecting queue-based traffic statistics on an interface, run the
following command in the user view to clear the existing statistics.

NOTICE

The cleared queue-based traffic statistics cannot be restored. Exercise caution


when you run the command.

Procedure
● Run the reset qos queue statistics interface interface-type interface-number
command to clear queue-based traffic statistics on the interface.
----End

7.11 Configuration Examples for Congestion Avoidance


and Congestion Management
7.11.1 Example for Configuring Congestion Management

Networking Requirements
As shown in Figure 7-12, The Switch is connected to the router through GE 0/0/3.
The 802.1p priorities of voice, video, and data services from the Internet are 7, 5,
and 2, and these services can reach users through the router and Switch. To reduce

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 198


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

the impact of network congestion and ensure bandwidth for high-priority and
low-delay services, you need to set the related parameters according to the
following table.

Table 7-3 Congestion management parameters

Service Type CoS WRR

Voice CS7 0

Video EF 20

Data AF2 10

Figure 7-12 Networking diagram for configuring congestion management

Network

Router
GE0/0/3

GE0/0/1 GE0/0/2
Switch
PC TV

802.1p=2 LSW LSW 802.1p=5

802.1p=5 802.1p=7 802.1p=2 802.1p=7

TV Phone PC Phone

Configuration Roadmap
The configuration roadmap is as follows:
1. Configure the VLAN for each interface so that devices can communicate with
each other at the link layer.
2. Configure interfaces to trust 802.1p priorities of packets.
3. Configure the scheduling template and apply the scheduling template to the
interface.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 199


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Procedure
Step 1 Configure the VLAN for each interface so that devices can communicate with each
other at the link layer.
<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

Step 2 Configure the inbound interface of service packets to trust packet priorities.
NOTE

For the priority mapping configuration of the S5720EI, S5720HI, S6720EI, and S6720S-EI,
refer to Configuring Priority Mapping. For the priority mapping configuration of the
S1720GFR, S1720GW, S1720GWR, S1720X, S1720GW-E, S1720GWR-E, S1720X-E, S2720EI,
S2750EI, S5700LI, S5700S-LI, S5710-X-LI, S5720LI, S5720S-LI, S5720SI, S5720S-SI, S5730SI,
S5730S-EI, S6720LI, S6720S-LI, S6720SI, and S6720S-SI, refer to Configuring Priority
Mapping.
The configuration in this step is applicable to the S1720GFR, S1720GW, S1720GWR,
S1720X, S1720GW-E, S1720GWR-E, S1720X-E, S2720EI, S2750EI, S5700LI, S5700S-LI, S5710-
X-LI, S5720LI, S5720S-LI, S5720SI, S5720S-SI, S5730SI, S5730S-EI, S6720LI, S6720S-LI,
S6720SI, and S6720S-SI.

# Configure gigabitethernet0/0/3 to trust 802.1p priorities of packets.


[Switch] interface gigabitethernet 0/0/3
[Switch-GigabitEthernet0/0/3] trust 8021p
[Switch-GigabitEthernet0/0/3] quit

Step 3 Configure congestion management.


# Create a scheduling template and set queue scheduling parameters.
[Switch] qos schedule-profile p1
[Switch-qos-schedule-profile-p1] qos wrr
[Switch-qos-schedule-profile-p1] qos queue 7 wrr weight 0
[Switch-qos-schedule-profile-p1] qos queue 5 wrr weight 20
[Switch-qos-schedule-profile-p1] qos queue 2 wrr weight 10
[Switch-qos-schedule-profile-p1] quit

# Apply the scheduling template to GE 0/0/1 and GE 0/0/2 of the Switch.


[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] qos schedule-profile p1
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] qos schedule-profile p1
[Switch-GigabitEthernet0/0/2] quit

Step 4 Verify the configuration.


# View the scheduling template and queue scheduling parameters.
[Switch] qos schedule-profile p1
[Switch-qos-schedule-profile-p1] display this

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 200


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

#
qos schedule-profile p1
qos queue 2 wrr weight 10
qos queue 5 wrr weight 20
qos queue 7 wrr weight 0
#
return

----End

Configuration Files
● Switch configuration file
#
sysname Switch
#
vlan batch 10 20 30
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20 30
qos schedule-profile p1
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20 30
qos schedule-profile p1
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 10 20 30
trust 8021p
#
qos schedule-profile p1
qos queue 2 wrr weight 10
qos queue 5 wrr weight 20
qos queue 7 wrr weight 0
#
return

7.11.2 Example for Configuring Congestion Avoidance and


Congestion Management

Networking Requirements
The Switch is connected to the router through GE0/0/3; the 802.1p priorities of
voice, video, and data services on the Internet are 6, 5, and 2 respectively, and
these services can reach users through the router and Switch, as shown in Figure
7-13. The rate of inbound interface GE0/0/3 on the Switch is greater than the
rates of outbound interfaces GE0/0/1 and GE0/0/2; therefore, congestion may
occur on these two outbound interfaces.
To reduce the impact of network congestion and ensure bandwidth for high-
priority and delay-sensitive services, set parameters based on Table 7-4 and Table
7-5.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 201


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Table 7-4 Congestion avoidance parameters


Service Type Color Lower Upper Drop Percent
Threshold Threshold
(%) (%)

Voice Green 80 100 10

Video Yellow 60 80 20

Data Red 40 60 40

Table 7-5 Congestion management parameters


Service Type CoS WDRR

Voice EF 0

Video AF3 100

Data AF1 50

Figure 7-13 Networking diagram for configuring congestion avoidance and


congestion management

Network

Router
GE0/0/3

GE0/0/1 GE0/0/2
PC Switch TV
802.1p=5
802.1p=2
Individual Individual
user 1 user n

802.1p=5 802.1p=6 802.1p=2 802.1p=6

TV Phone PC Phone

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 202


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Configuration Roadmap
The configuration roadmap is as follows:
1. Configure the VLAN for each interface so that devices can communicate with
each other.
2. Create and configure a DiffServ domain on the Switch, map packets of 802.1p
priorities to PHBs and colors of packets, and bind the DiffServ domain to an
inbound interface on the Switch.
3. Create a WRED drop profile on the Switch and apply the WRED drop profile
on an outbound interface.
4. Set scheduling parameters of queues of different CoS on outbound interfaces
of the Switch.

Procedure
Step 1 Configure the VLAN for each interface so that devices can communicate with each
other.
<HUAWEI> system-view
[HUAWEI] sysname Switch
[Switch] vlan batch 2 5 6
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] port link-type trunk
[Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 5 6
[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 2 5 6
[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 2 5 6
[Switch-GigabitEthernet0/0/3] quit

Step 2 Configure priority mapping based on simple traffic classification.


NOTE

For the priority mapping configuration of the S5720EI, S5720HI, S6720EI, and S6720S-EI,
refer to Configuring Priority Mapping. For the priority mapping configuration of the
S1720GFR, S1720GW, S1720GWR, S1720X, S1720GW-E, S1720GWR-E, S1720X-E, S2720EI,
S2750EI, S5700LI, S5700S-LI, S5710-X-LI, S5720LI, S5720S-LI, S5720SI, S5720S-SI, S5730SI,
S5730S-EI, S6720LI, S6720S-LI, S6720SI, and S6720S-SI, refer to Configuring Priority
Mapping.
The configuration in this step is applicable to the S5720EI, S5720HI, S6720EI, and S6720S-
EI.

# Create DiffServ domain ds1, map packets of 802.1p priorities being 6, 5, and 2
to PHBs EF, AF3, and AF1, and color packets as green, yellow, and red.
[Switch] diffserv domain ds1
[Switch-dsdomain-ds1] 8021p-inbound 6 phb ef green
[Switch-dsdomain-ds1] 8021p-inbound 5 phb af3 yellow
[Switch-dsdomain-ds1] 8021p-inbound 2 phb af1 red
[Switch-dsdomain-ds1] quit

# Bind incoming interface GE0/0/3 on the Switch to DiffServ domain ds1.


[Switch] interface gigabitethernet 0/0/3
[Switch-GigabitEthernet0/0/3] trust upstream ds1
[Switch-GigabitEthernet0/0/3] trust 8021p inner
[Switch-GigabitEthernet0/0/3] quit

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 203


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Step 3 Configure congestion avoidance.


# Create drop profile wred1 on the Switch and set parameters of packets of three
colors.
[Switch] drop-profile wred1
[Switch-drop-wred1] color green low-limit 80 high-limit 100 discard-percentage 10
[Switch-drop-wred1] color yellow low-limit 60 high-limit 80 discard-percentage 20
[Switch-drop-wred1] color red low-limit 40 high-limit 60 discard-percentage 40
[Switch-drop-wred1] quit

# Apply drop profile wred1 on outbound interfaces GE0/0/1 and GE0/0/2 of the
Switch.
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] qos wred wred1
[Switch-GigabitEthernet0/0/1] qos queue 5 wred wred1
[Switch-GigabitEthernet0/0/1] qos queue 3 wred wred1
[Switch-GigabitEthernet0/0/1] qos queue 1 wred wred1
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] qos wred wred1
[Switch-GigabitEthernet0/0/2] qos queue 5 wred wred1
[Switch-GigabitEthernet0/0/2] qos queue 3 wred wred1
[Switch-GigabitEthernet0/0/2] qos queue 1 wred wred1
[Switch-GigabitEthernet0/0/2] quit

Step 4 Configure congestion management.


# Set scheduling parameters of queues of different CoS on outgoing interfaces
GE0/0/1 and GE0/0/2 of the Switch.
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] qos drr
[Switch-GigabitEthernet0/0/1] qos queue 5 drr weight 0
[Switch-GigabitEthernet0/0/1] qos queue 3 drr weight 100
[Switch-GigabitEthernet0/0/1] qos queue 1 drr weight 50
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] qos drr
[Switch-GigabitEthernet0/0/2] qos queue 5 drr weight 0
[Switch-GigabitEthernet0/0/2] qos queue 3 drr weight 100
[Switch-GigabitEthernet0/0/2] qos queue 1 drr weight 50
[Switch-GigabitEthernet0/0/2] quit

Step 5 Verify the configuration.


# Check the configuration of DiffServ domain ds1.
[Switch] display diffserv domain name ds1
diffserv domain name:ds1
8021p-inbound 0 phb be green
8021p-inbound 1 phb af1 green
8021p-inbound 2 phb af1 red
8021p-inbound 3 phb af3 green
8021p-inbound 4 phb af4 green
8021p-inbound 5 phb af3 yellow
8021p-inbound 6 phb ef green
8021p-inbound 7 phb cs7 green
8021p-outbound be green map 0
......

# Check the configuration of drop profile wred1.


[Switch] display drop-profile name wred1
Drop-profile[1]: wred1
Queue depth : default
Color Low-limit High-limit Discard-percentage
---------------------------------

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 204


S1720, S2700, S5700, and S6720 Series Ethernet
Switches 7 Congestion Avoidance and Congestion
Configuration Guide - QoS Management Configuration

Green 80 100 10
Yellow 60 80 20
Red 40 60 40
Non-tcp 100 100 100
-----------------------------------------------------------------

NOTE

Only the display information of the S5720HI contains the Queue depth field.
The display information of the S5720HI does not contain the Non-tcp field.

----End

Configuration Files
● Switch configuration file
#
sysname Switch
#
vlan batch 2 5 to 6
#
diffserv domain ds1
8021p-inbound 2 phb af1 red
8021p-inbound 5 phb af3 yellow
8021p-inbound 6 phb ef green
#
drop-profile wred1
color green low-limit 80 high-limit 100 discard-percentage 10
color yellow low-limit 60 high-limit 80 discard-percentage 20
color red low-limit 40 high-limit 60 discard-percentage 40
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 5 to 6
qos drr
qos queue 1 drr weight 50
qos queue 3 drr weight 100
qos queue 5 drr weight 0
qos wred wred1
qos queue 1 wred wred1
qos queue 3 wred wred1
qos queue 5 wred wred1
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 5 to 6
qos drr
qos queue 1 drr weight 50
qos queue 3 drr weight 100
qos queue 5 drr weight 0
qos wred wred1
qos queue 1 wred wred1
qos queue 3 wred wred1
qos queue 5 wred wred1
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 5 to 6
trust upstream ds1
trust 8021p inner
#
return

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 205

You might also like