Example for Configuring Congestion Management and Congestion Avoidance
Networking Requirements
As shown in Figure 4-13, voice, video, and data services on the LAN side of the enterprise are connected to Eth2/0/0 and Eth2/0/1 of RouterA through SwitchA and SwitchB, and are sent to the WAN-side network through GE3/0/0 of RouterA.
Packets are marked with different DSCP priorities by SwitchA and SwitchB, and the priorities of voice, video, and data services are ef, af43, and af32 and af31. RouterA sends packets to queues based on DSCP priorities. The rates of Eth2/0/0 and Eth2/0/1 on RouterA are greater than those of GE3/0/0, congestion may occur on GE3/0/0 in the outbound direction. It is required that voice packets be sent first. Ensure that video and data packets with smaller priority obtain less bandwidth and have less drop probability.
Configuration Roadmap
- Create VLANs and VLANIF interfaces on RouterA and configure interfaces so that enterprise users can access the WAN-side network through RouterA.
- On the Router, configure an interface to trust DSCP priorities so that packets with different priorities enter different queues.
- Create a drop profile, and set WRED parameters based on DSCP priorities so that packets with smaller priorities have greater drop probability.
- Create a queue profile in which PQ scheduling is used for voice packets and WFQ scheduling is used for video and data packets so that voice packets are sent preferentially and video and data packets are scheduled based on priorities.
- Bind the drop profile to the queue profile, and apply the queue profile to the interface on RouterA connected to the WAN to implement congestion avoidance and congestion management.
Procedure
- Create VLANs and configure interfaces.
# Create VLAN 20 and VLAN 30 on RouterA.
<Huawei> system-view [Huawei] sysname RouterA [RouterA] vlan batch 20 30
# Configure Eth2/0/0 and Eth2/0/1 to trust DSCP priorities, configure them as trunk interfaces, and add Eth2/0/0 to VLAN 20 and Eth2/0/1 to VLAN 30.
[RouterA] interface ethernet 2/0/0 [RouterA-Ethernet2/0/0] trust dscp [RouterA-Ethernet2/0/0] port link-type trunk [RouterA-Ethernet2/0/0] port trunk allow-pass vlan 20 [RouterA-Ethernet2/0/0] quit [RouterA] interface ethernet 2/0/1 [RouterA-Ethernet2/0/1] trust dscp [RouterA-Ethernet2/0/1] port link-type trunk [RouterA-Ethernet2/0/1] port trunk allow-pass vlan 30 [RouterA-Ethernet2/0/1] quit
Configure the interface of SwitchA connected to RouterA as a trunk interface and add it to VLAN 20.
Configure the interface of SwitchB connected to RouterA as a trunk interface and add it to VLAN 30.
# Create VLANIF 20 and VLANIF 30, assign IP address 192.168.2.1/24 to VLANIF 20, and assign IP address 192.168.3.1/24 to VLANIF 30.
[RouterA] interface vlanif 20 [RouterA-Vlanif20] ip address 192.168.2.1 24 [RouterA-Vlanif20] quit [RouterA] interface vlanif 30 [RouterA-Vlanif30] ip address 192.168.3.1 24 [RouterA-Vlanif30] quit
# Assign IP address 192.168.4.1/24 to GE3/0/0.
[RouterA] interface gigabitethernet 3/0/0 [RouterA-GigabitEthernet3/0/0] ip address 192.168.4.1 24 [RouterA-GigabitEthernet3/0/0] quit
Configure RouterB to ensure that there is a reachable route between RouterB and RouterA. The configuration details are not mentioned here.
- Create drop profiles.
# Create drop profiles data and video on RouterA.
[RouterA] drop-profile data [RouterA-drop-profile-data] wred dscp [RouterA-drop-profile-data] dscp 28 low-limit 50 high-limit 70 discard-percentage 30 [RouterA-drop-profile-data] dscp 26 low-limit 40 high-limit 60 discard-percentage 40 [RouterA-drop-profile-data] quit [RouterA] drop-profile video [RouterA-drop-profile-video] wred dscp [RouterA-drop-profile-video] dscp 38 low-limit 60 high-limit 80 discard-percentage 20 [RouterA-drop-profile-video] quit
- Create a queue profile.
# Create a queue profile queue-profile1 on RouterA and set the scheduling mode for each queue.
[RouterA] qos queue-profile queue-profile1 [RouterA-qos-queue-profile-queue-profile1] schedule pq 5 wfq 3 to 4
You can run the display qos map-table command to check the mapping between DSCP priorities and local priorities on RouterA.
Packets enter queues based on local priorities mapping DSCP priorities.
- Apply the queue profile.
# Bind the drop profile to the queue profile.
[RouterA-qos-queue-profile-queue-profile1] queue 4 drop-profile video [RouterA-qos-queue-profile-queue-profile1] queue 3 drop-profile data [RouterA-qos-queue-profile-queue-profile1] quit
# Apply the queue profile to GE3/0/0 of RouterA.
[RouterA] interface gigabitethernet 3/0/0 [RouterA-GigabitEthernet3/0/0] qos queue-profile queue-profile1
- Verify the configuration.
# View the interface configuration on RouterA.
[RouterA-GigabitEthernet3/0/0] display this # interface GigabitEthernet3/0/0 ip address 192.168.4.1 255.255.255.0 qos queue-profile queue-profile1 # return
# View the drop profile configuration.
[RouterA-GigabitEthernet3/0/0] quit [RouterA] display qos queue-profile queue-profile1 Queue-profile: queue-profile1 Queue Schedule Weight Length(Bytes/Packets) GTS(CIR/CBS) ----------------------------------------------------------------- 3 WFQ 10 -/- -/- 4 WFQ 10 -/- -/- 5 PQ - -/- -/-
# View the drop profile bound to the queue profile.
[RouterA] qos queue-profile queue-profile1 [RouterA-qos-queue-profile-queue-profile1] display this # qos queue-profile queue-profile1 queue 3 drop-profile data queue 4 drop-profile video schedule wfq 3 to 4 pq 5 # return
# View the configuration of drop profiles.
[RouterA-qos-queue-profile-queue-profile1] quit
[RouterA] display drop-profile video Drop-profile[2]: video DSCP Low-limit High-limit Discard-percentage ----------------------------------------------------------------- 0(default) 30 100 10 1 30 100 10 2 30 100 10 3 30 100 10 4 30 100 10 5 30 100 10 6 30 100 10 7 30 100 10 8(cs1) 30 100 10 9 30 100 10 10(af11) 30 100 10 11 30 100 10 12(af12) 30 100 10 13 30 100 10 14(af13) 30 100 10 15 30 100 10 16(cs2) 30 100 10 17 30 100 10 18(af21) 30 100 10 19 30 100 10 20(af22) 30 100 10 21 30 100 10 22(af23) 30 100 10 23 30 100 10 24(cs3) 30 100 10 25 30 100 10 26(af31) 30 100 10 27 30 100 10 28(af32) 30 100 10 29 30 100 10 30(af33) 30 100 10 31 30 100 10 32(cs4) 30 100 10 33 30 100 10 34(af41) 30 100 10 35 30 100 10 36(af42) 30 100 10 37 30 100 10 38(af43) 60 80 20 39 30 100 10 40(cs5) 30 100 10 41 30 100 10 42 30 100 10 43 30 100 10 44 30 100 10 45 30 100 10 46(ef) 30 100 10 47 30 100 10 48(cs6) 30 100 10 49 30 100 10 50 30 100 10 51 30 100 10 52 30 100 10 53 30 100 10 54 30 100 10 55 30 100 10 56(cs7) 30 100 10 57 30 100 10 58 30 100 10 59 30 100 10 60 30 100 10 61 30 100 10 62 30 100 10 63 30 100 10 -----------------------------------------------------------------
[RouterA] display drop-profile data Drop-profile[1]: data DSCP Low-limit High-limit Discard-percentage ----------------------------------------------------------------- 0(default) 30 100 10 1 30 100 10 2 30 100 10 3 30 100 10 4 30 100 10 5 30 100 10 6 30 100 10 7 30 100 10 8(cs1) 30 100 10 9 30 100 10 10(af11) 30 100 10 11 30 100 10 12(af12) 30 100 10 13 30 100 10 14(af13) 30 100 10 15 30 100 10 16(cs2) 30 100 10 17 30 100 10 18(af21) 30 100 10 19 30 100 10 20(af22) 30 100 10 21 30 100 10 22(af23) 30 100 10 23 30 100 10 24(cs3) 30 100 10 25 30 100 10 26(af31) 40 60 40 27 30 100 10 28(af32) 50 70 30 29 30 100 10 30(af33) 30 100 10 31 30 100 10 32(cs4) 30 100 10 33 30 100 10 34(af41) 30 100 10 35 30 100 10 36(af42) 30 100 10 37 30 100 10 38(af43) 60 80 20 39 30 100 10 40(cs5) 30 100 10 41 30 100 10 42 30 100 10 43 30 100 10 44 30 100 10 45 30 100 10 46(ef) 30 100 10 47 30 100 10 48(cs6) 30 100 10 49 30 100 10 50 30 100 10 51 30 100 10 52 30 100 10 53 30 100 10 54 30 100 10 55 30 100 10 56(cs7) 30 100 10 57 30 100 10 58 30 100 10 59 30 100 10 60 30 100 10 61 30 100 10 62 30 100 10 63 30 100 10 -----------------------------------------------------------------
Configuration Files
- RouterA configuration file
# sysname RouterA # vlan batch 20 30 # drop-profile data wred dscp dscp af31 low-limit 40 high-limit 60 discard-percentage 40 dscp af32 low-limit 50 high-limit 70 discard-percentage 30 # drop-profile video wred dscp dscp af43 low-limit 60 high-limit 80 discard-percentage 20 # qos queue-profile queue-profile1 queue 3 drop-profile data queue 4 drop-profile video schedule wfq 3 to 4 pq 5 # interface Vlanif20 ip address 192.168.2.1 255.255.255.0 # interface Vlanif30 ip address 192.168.3.1 255.255.255.0 # interface Ethernet2/0/0 port link-type trunk port trunk allow-pass vlan 20 trust dscp # interface Ethernet2/0/1 port link-type trunk port trunk allow-pass vlan 30 trust dscp # interface GigabitEthernet3/0/0 ip address 192.168.4.1 255.255.255.0 qos queue-profile queue-profile1 # return