Example for Configuring Congestion Avoidance and Congestion Management
Networking Requirements
Users can obtain the voice, video, and data service information from a server using a switch. When a large volume of data is sent from the server to hosts, congestion may occur on the switch because the rate on the inbound interface is greater than the rate on the outbound interface.
The voice, video, and data services are in descending order of priority. Users want to have differentiated services provided so that high-priority services are first processed. Users also want to prevent congestion on the outbound interfaces. The following table lists parameters to be configured.
Service Type |
Color |
Lower Drop Threshold (%) |
Upper Drop Threshold (%) |
Drop Probability |
CoS |
Scheduling |
Weight |
---|---|---|---|---|---|---|---|
Voice |
Green |
80 |
100 |
10 |
EF |
PQ |
- |
Video |
Yellow |
60 |
80 |
20 |
AF3 |
WFQ |
100 |
Data |
Red |
40 |
60 |
40 |
AF1 |
WFQ |
50 |
Configuration Roadmap
Map 802.1p priorities of voice, data, and video service packets to PHBs and colors to classify packets.
Configure a WRED drop profile that contains drop parameters of packets of different colors, including the upper drop threshold, lower drop threshold, and drop probability. In this way, congestion is relived and resolved.
Set scheduling parameters such as the scheduling mode and weight of each CoS to implement differentiated scheduling for queues of different priorities.
Procedure
- Configure VLANs for each interface so that devices can communicate with each other at the link layer.
# Configure 10GE1/0/1, 10GE1/0/2, and 10GE1/0/3 on Switch as trunk interfaces. Add 10GE1/0/1 to VLAN 100, 10GE1/0/2 to VLAN 200, and 10GE1/0/3 to VLAN 100 and VLAN 200.
<HUAWEI> system-view [~HUAWEI] sysname Switch [*HUAWEI] commit [~Switch] vlan batch 100 200 [*Switch] interface 10ge 1/0/1 [*Switch-10GE1/0/1] port link-type trunk [*Switch-10GE1/0/1] port trunk allow-pass vlan 100 [*Switch-10GE1/0/1] quit [*Switch] interface 10ge 1/0/2 [*Switch-10GE1/0/2] port link-type trunk [*Switch-10GE1/0/2] port trunk allow-pass vlan 200 [*Switch-10GE1/0/2] quit [*Switch] interface 10ge 1/0/3 [*Switch-10GE1/0/3] port link-type trunk [*Switch-10GE1/0/3] port trunk allow-pass vlan 100 200 [*Switch-10GE1/0/3] quit [*Switch] commit
- Configure priority mappings.
# Create DiffServ domain ds1. In the DiffServ domain, map 802.1p priorities 6, 5, 2 to PHBs EF, AF3, and AF1 and to colors 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 DiffServ domain ds1 to VLAN 100 and 200 of the Switch.
[*Switch] vlan 100 [*Switch-vlan100] trust upstream ds1 [*Switch-vlan100] quit [*Switch] vlan 200 [*Switch-vlan200] trust upstream ds1 [*Switch-vlan200] quit [*Switch] commit
- Configure congestion avoidance.
# Create WRED drop profile wred1 on the Switch and set scheduling parameters in WRED drop profile wred1.
[~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 WRED drop profile wred1 to queues of 10GE1/0/3 on the Switch. For details about mappings between CoS values (internal priorities) and queues, see "Default Settings for Priority Mapping".
[*Switch] interface 10ge 1/0/3 [*Switch-10GE1/0/3] qos queue 5 wred wred1 [*Switch-10GE1/0/3] qos queue 3 wred wred1 [*Switch-10GE1/0/3] qos queue 1 wred wred1 [*Switch-10GE1/0/3] quit [*Switch] commit
- Configure congestion management.
# Set scheduling parameters of each queue on the outbound interface 10GE1/0/3 of the Switch.
[~Switch] interface 10ge 1/0/3 [~Switch-10GE1/0/3] qos pq 5 to 7 wfq 0 to 4 [*Switch-10GE1/0/3] qos queue 3 wfq weight 100 [*Switch-10GE1/0/3] qos queue 1 wfq weight 50 [*Switch-10GE1/0/3] quit [*Switch] commit [~Switch] quit
- Verify the configurations.
# Check the configuration of DiffServ domain ds1.
<Switch> display diffserv domain 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 8021p-outbound be yellow map 0 8021p-outbound be red map 0 ...
# Check the configuration of WRED drop profile wred1.
<Switch> display drop-profile wred1 Drop-profile[1]: wred1 Color Low-limit High-limit Discard-percentage ----------------------------------------------------------------- Green 80 100 10 Yellow 60 80 20 Red 40 60 40 -----------------------------------------------------------------
# Check the configuration of 10GE1/0/3.
<Switch> display qos configuration interface 10ge 1/0/3 interface 10ge1/0/3 -------------------------------------------------------------------------- trust flag : outer 8021p diffserv domain : default dei enable : disable port priority : 0 phb marking 8021p : enable phb marking dscp : disable port wred : - port lr : outbound, cir = -, cbs = - port car name : - -------------------------------------------------------------------------- queue shaping schedule wred cir pir cbs pbs -------------------------------------------------------------------------- 0 - - wfq - - - weight = 1 1 - - wfq wred1 - - weight = 50 2 - - wfq - - - weight = 1 3 - - wfq wred1 - - weight = 100 4 - - wfq - - - weight = 1 5 - - pq wred1 - - 6 - - pq - - - 7 - - pq - - - --------------------------------------------------------------------------
Configuration Files
Switch configuration file
# sysname Switch # 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 # vlan batch 100 200 # diffserv domain ds1 8021p-inbound 2 phb af1 red 8021p-inbound 5 phb af3 yellow 8021p-inbound 6 phb ef green # vlan 100 trust upstream ds1 # vlan 200 trust upstream ds1 # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 100 # interface 10GE1/0/2 port link-type trunk port trunk allow-pass vlan 200 # interface 10GE1/0/3 port link-type trunk port trunk allow-pass vlan 100 200 qos queue 1 wred wred1 qos queue 3 wred wred1 qos queue 5 wred wred1 qos wfq 0 to 4 qos queue 1 wfq weight 50 qos queue 3 wfq weight 100 # return