This section provides an example of how to configure congestion avoidance. A device on which congestion avoidance is configured checks the use of network resources and starts to discard packets when it determines that congestion is intensifying.
As shown in Figure 1, Server sends mission-critical data, Telephone sends voice data, and PC1 and PC2 send non-mission-critical data to the network through Device A. On Device A, the rate of the inbound interface Interfaces 1 is greater than that of the outbound interface Interfaces 2. Therefore, congestion may occur on Interfaces 2 and may be intensifying.
In the case of network congestion, the service data from the server and the telephone must be preferentially sent. In addition, the telephone requires 5 Mbit/s bandwidth, and the server requires 4 Mbit/s bandwidth. As PC1 and PC2 are VIP users, bandwidth must be assured for the data that PC1 and PC2 send. The delay must be as low as possible. If congestion intensifies on the network, packets are dropped according to priority.
In this scenario, WRED need to be configured on Device A to work with WFQ for scheduling and discarding.
Interfaces 1 through 2 in this example are GE 0/1/0, GE 0/1/8.
The configuration roadmap is as follows:
Configure a WRED profile and set the lower drop threshold, upper drop threshold, and drop probability for packets.
On the outbound interface GE 0/1/8 of Device A, configure a different scheduling policy for class queues of each service level and apply a configured WRED object to the scheduling policy.
To complete the configuration, you need the following data:
WRED profile name, lower and upper drop thresholds, drop probability, and packet color in each queue
Interfaces and class queues to which WRED drop policies are applied
<HUAWEI> system-view <~HUAWEI> sysname DeviceA <*HUAWEI> commit [~DeviceA] acl number 2001 [*DeviceA-acl4-basic-2001] rule permit source 10.1.1.3 0.0.0.0 [*DeviceA-acl4-basic-2001] commit [~DeviceA-acl4-basic-2001] quit [~DeviceA] acl number 2002 [*DeviceA-acl4-basic-2002] rule permit source 10.1.1.2 0.0.0.0 [*DeviceA-acl4-basic-2002] commit [~DeviceA-acl4-basic-2002] quit [~DeviceA] acl number 2003 [*DeviceA-acl4-basic-2003] rule permit source 10.1.1.4 0.0.0.0 [*DeviceA-acl4-basic-2003] commit [~DeviceA-acl4-basic-2003] quit [~DeviceA] acl number 2004 [*DeviceA-acl4-basic-2004] rule permit source 10.1.1.5 0.0.0.0 [*DeviceA-acl4-basic-2004] commit [~DeviceA-acl4-basic-2004] return
<*DeviceA> system-view [~DeviceA] traffic classifier aa [*DeviceA-classifier-aa] if-match acl 2001 [*DeviceA-classifier-aa] commit [~DeviceA-classifier-aa] quit [~DeviceA] traffic classifier bb [*DeviceA-classifier-bb] if-match acl 2002 [*DeviceA-classifier-bb] commit [~DeviceA-classifier-bb] quit [~DeviceA] traffic classifier cc [*DeviceA-classifier-cc] if-match acl 2003 [*DeviceA-classifier-cc] commit [~DeviceA-classifier-cc] quit [~DeviceA] traffic classifier dd [*DeviceA-classifier-dd] if-match acl 2004 [*DeviceA-classifier-dd] commit [~DeviceA-classifier-dd] quit [~DeviceA] traffic behavior aa [*DeviceA-behavior-aa] remark ip-precedence 5 [*DeviceA-behavior-aa] car cir 5000 [*DeviceA-behavior-aa] commit [~DeviceA-behavior-aa] quit [~DeviceA] traffic behavior bb [*DeviceA-behavior-bb] remark ip-precedence 4 [*DeviceA-behavior-bb] car cir 4000 [*DeviceA-behavior-bb] commit [~DeviceA-behavior-bb] quit [~DeviceA] traffic behavior cc [*DeviceA-behavior-cc] remark ip-precedence 3 [*DeviceA-behavior-cc] commit [~DeviceA-behavior-cc] quit [~DeviceA] traffic behavior dd [*DeviceA-behavior-dd] remark ip-precedence 2 [*DeviceA-behavior-dd] commit [~DeviceA-behavior-dd] quit [~DeviceA] traffic policy ee [*DeviceA-trafficpolicy-ee] classifier aa behavior aa [*DeviceA-trafficpolicy-ee] classifier bb behavior bb [*DeviceA-trafficpolicy-ee] classifier cc behavior cc [*DeviceA-trafficpolicy-ee] classifier dd behavior dd [*DeviceA-trafficpolicy-ee] commit [~DeviceA-trafficpolicy-ee] quit [~DeviceA] interface gigabiethernet0/1/0 [~DeviceA-GigabitEthernet0/1/0] undo shutdown [*DeviceA-GigabitEthernet0/1/0] traffic-policy ee inbound [*DeviceA-GigabitEthernet0/1/0] commit [~DeviceA-GigabitEthernet0/1/0] return
For details about the mapping between the IP precedence and service class, see Default Mapping Between IP Precedence/MPLS EXP/802.1p and Service Class in the HUAWEI NetEngine 8000 F Series Feature Description - QoS Priority Mapping.
<DeviceA> system-view [~DeviceA] port-wred pw [*DeviceA-port-wred-pw] color green low-limit 70 high-limit 100 discard-percentage 100 [*DeviceA-port-wred-pw] color yellow low-limit 60 high-limit 90 discard-percentage 100 [*DeviceA-port-wred-pw] color red low-limit 50 high-limit 80 discard-percentage 100 [*DeviceA-port-wred-pw] commit [~DeviceA-port-wred-pw] quit
After you complete the preceding configuration, run the display port-wred configuration verbose command to check the WRED profile parameters.
<DeviceA> display port-wred configuration verbose
Port wred name : pw
---------------------------------------------------
Color Low-limit High-limit Discard-percent
---------------------------------------------------
green 70 100 100
yellow 60 90 100
red 50 80 100
Reference relationships : NULL
[~DeviceA] interface gigabitethernet0/1/8 [~DeviceA-GigabitEthernet0/1/8] undo shutdown [*DeviceA-GigabitEthernet0/1/8] port-queue ef pq port-wred pw outbound [*DeviceA-GigabitEthernet0/1/8] port-queue af4 wfq weight 15 shaping 100 port-wred pw outbound [*DeviceA-GigabitEthernet0/1/8] port-queue af3 wfq weight 10 shaping 50 port-wred pw outbound [*DeviceA-GigabitEthernet0/1/8] port-queue af2 wfq weight 10 shaping 50 port-wred pw outbound [*DeviceA-GigabitEthernet0/1/8] commit [~DeviceA-GigabitEthernet0/1/8] return
After you complete the preceding configuration, run the display port-queue configuration interface command to view detailed configurations of the class queues.
<DeviceA> display port-queue configuration interface gigabitethernet 0/1/8 outbound GigabitEthernet0/1/8 outbound current port-queue configuration: be : arithmetic: wfq weight: 10 tm weight: 3 fact weight: 10.00 shaping(kbps): NA port-wred: NA green (low-high limit) (kbytes) 12800 - 12800 yellow(low-high limit) (kbytes) 12800 - 12800 red (low-high limit) (kbytes) 12800 - 12800 current queue-length (kbytes) 12800 cir:123 cir-percentage:NA cir-arithmetic:pq cir-weight:NA pir:123 pir-percentage:NA pir-arithmetic:lpq pir-weight:NA af1: arithmetic: wfq weight: 10 tm weight: 3 fact weight: 10.00 shaping(kbps): NA port-wred: NA green (low-high limit) (kbytes) 12800 - 12800 yellow(low-high limit) (kbytes) 12800 - 12800 red (low-high limit) (kbytes) 12800 - 12800 current queue-length (kbytes) 12800 cir:NA cir-percentage:10 cir-arithmetic:pq cir-weight:NA pir:NA pir-percentage:20 pir-arithmetic:wfq pir-weight:15 af2: arithmetic: wfq weight: 10 tm weight: 3 fact weight: 10.00 shaping(kbps): NA port-wred: NA green (low-high limit) (kbytes) 12800 - 12800 yellow(low-high limit) (kbytes) 12800 - 12800 red (low-high limit) (kbytes) 12800 - 12800 current queue-length (kbytes) 12800 cir:NA cir-percentage:NA cir-arithmetic:NA cir-weight:NA pir:NA pir-percentage:NA pir-arithmetic:NA pir-weight:NA af3: arithmetic: wfq weight: 15 tm weight: 2 fact weight: 15.00 shaping(kbps): NA port-wred: NA green (low-high limit) (kbytes) 12800 - 12800 yellow(low-high limit) (kbytes) 12800 - 12800 red (low-high limit) (kbytes) 12800 - 12800 current queue-length (kbytes) 12800 cir:NA cir-percentage:NA cir-arithmetic:NA cir-weight:NA pir:NA pir-percentage:NA pir-arithmetic:NA pir-weight:NA af4: arithmetic: wfq weight: 15 tm weight: 2 fact weight: 15.00 shaping(kbps): NA port-wred: NA green (low-high limit) (kbytes) 12800 - 12800 yellow(low-high limit) (kbytes) 12800 - 12800 red (low-high limit) (kbytes) 12800 - 12800 current queue-length (kbytes) 12800 cir:NA cir-percentage:NA cir-arithmetic:NA cir-weight:NA pir:NA pir-percentage:NA pir-arithmetic:NA pir-weight:NA ef : arithmetic: pq weight: NA tm weight: 0 fact weight: 0.00 shaping(kbps): NA port-wred: NA green (low-high limit) (kbytes) 1280 - 1280 yellow(low-high limit) (kbytes) 1280 - 1280 red (low-high limit) (kbytes) 1280 - 1280 current queue-length (kbytes) 1280 cir:NA cir-percentage:NA cir-arithmetic:NA cir-weight:NA pir:NA pir-percentage:NA pir-arithmetic:NA pir-weight:NA cs6: arithmetic: pq weight: NA tm weight: 0 fact weight: 0.00 shaping(kbps): NA port-wred: NA green (low-high limit) (kbytes) 1280 - 1280 yellow(low-high limit) (kbytes) 1280 - 1280 red (low-high limit) (kbytes) 1280 - 1280 current queue-length (kbytes) 1280 cir:NA cir-percentage:NA cir-arithmetic:NA cir-weight:NA pir:NA pir-percentage:NA pir-arithmetic:NA pir-weight:NA cs7: arithmetic: pq weight: NA tm weight: 0 fact weight: 0.00 shaping(kbps): NA port-wred: NA green (low-high limit) (kbytes) 1280 - 1280 yellow(low-high limit) (kbytes) 1280 - 1280 red (low-high limit) (kbytes) 1280 - 1280 current queue-length (kbytes) 1280 cir:NA cir-percentage:NA cir-arithmetic:NA cir-weight:NA pir:NA pir-percentage:NA pir-arithmetic:NA pir-weight:NA
When the network has traffic, run the display port-queue statistics [ slot slot-id | interface { interface-type interface-number | interface-name } ] [ cos-value ] outbound command on Device A. The command output shows that the traffic volumes of varying service levels increase rapidly. With the rapid increase in traffic volumes, the volume of discarded traffic also increases rapidly according to the configured WRED drop parameters.
Configuration file of Device A
# sysname DeviceA # acl number 2001 rule permit source 10.1.1.3 0 # acl number 2002 rule permit source 10.1.1.2 0 # acl number 2003 rule permit source 10.1.1.4 0 # acl number 2004 rule permit source 10.1.1.5 0 # traffic classifier aa operator or if-match acl 2001 traffic classifier bb operator or if-match acl 2002 traffic classifier cc operator or if-match acl 2003 traffic classifier dd operator or if-match acl 2004 # traffic behavior aa car cir 5000 traffic behavior bb car cir 4000 remark ip-precedence 4 traffic behavior cc remark ip-precedence 3 traffic behavior dd remark ip-precedence 2 # traffic policy ee classifier aa behavior aa classifier bb behavior bb classifier cc behavior cc classifier dd behavior dd # port-wred pw color green low-limit 70 high-limit 100 discard-percentage 100 color yellow low-limit 60 high-limit 90 discard-percentage 100 color red low-limit 50 high-limit 80 discard-percentage 100 # interface GigabitEthernet0/1/0 undo shutdown ip address 10.1.1.1 255.255.255.0 traffic-policy ee inbound # interface GigabitEthernet0/1/8 undo shutdown ip address 10.10.1.1 255.255.255.0 port-queue af2 wfq weight 10 shaping 50 port-wred pw outbound port-queue af3 wfq weight 10 shaping 50 port-wred pw outbound port-queue af4 wfq weight 15 shaping 100 port-wred pw outbound port-queue ef pq port-wred pw outbound # ospf 1 area 0.0.0.0 network 10.1.1.0 0.0.0.255 network 10.10.1.0 0.0.0.255 # return