Professional Documents
Culture Documents
01-07 Congestion Avoidance and Congestion Management Configuration
01-07 Congestion Avoidance and Congestion Management Configuration
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.
● 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.
NOTE
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 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
Relevant Information
Technology Forum
● 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.
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.
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.
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.
Queue 7
Packet flow
......
Queue 1
Interface
Classification
Queue 0
Queu 4 2 5 3 6 4 2 1
e
Weig
ht
Queu - - - - Queu - - -
e in e3
the
sixth
round
of
sched
uling
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.
(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
Queue 1 weight 1
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.
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.
PQ scheduling
Packet flow
Queue 6
Packet flow
Queue 5
DRR scheduling
Queue 4
Interface
Classification Queue 3
Queue 2
Queue 1
Queue 0
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.
Traffic direction
Data flow
Data server
Video flow
Video server
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.
Traffic direction
Voice flow
WAN
Data flow
Video flow
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.
S2700EI V100R006(C00&C01&C03&C05)
S2710SI V100R006(C03&C05)
S3700EI V100R006(C00&C01&C03&C05)
S5710-C-LI V200R001C00
S5730SI V200R011C10
S5730S-EI V200R011C10
NOTE
To know details about software mappings, see Hardware Query Tool.
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
NOTE
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.
----End
Pre-configuration Tasks
Configure congestion avoidance based on a WRED drop profile on the device
when packets are discarded due to congestion.
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.
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
NOTE
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.
NOTE
----End
Context
On the device, you can apply a WRED drop profile to an interface, the system, or a
queue on an interface.
Procedure
● Applying a WRED drop profile to the system
a. Run system-view
NOTE
----End
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
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.
----End
Pre-configuration Tasks
Before configuring congestion management, map the priority of packets to a PHB.
Context
Configure congestion management on the device when the network intermittently
becomes congested.
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 scheduling mode of queues on the interface is set to PQ, WRR, or WDRR.
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.
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
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.
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.
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.
----End
NOTICE
Procedure
● Run the reset qos queue statistics interface interface-type interface-number
command to clear queue-based traffic statistics on the interface.
----End
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
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.
Voice CS7 0
Video EF 20
Data AF2 10
Network
Router
GE0/0/3
GE0/0/1 GE0/0/2
Switch
PC TV
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.
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.
#
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
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.
Video Yellow 60 80 20
Data Red 40 60 40
Voice EF 0
Data AF1 50
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
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.
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
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
# 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
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