配置拥塞管理及拥塞避免示例
以特性的典型场景为例,介绍如何配置拥塞管理及拥塞避免。
组网需求
如图4-6所示,Server、Telephone、PC1和PC2通过DeviceA向网络发送数据,其中Server发送关键业务数据,Telephone发送语音数据,PC1和PC2发送非关键业务数据。由于DeviceA入接口GE0/1/0的速率大于出接口GE0/2/0的速率,在GE0/2/0接口处可能发生拥塞,并且可能出现拥塞加剧现象。
要求在网络拥塞时保证Server和Telephone发送的业务数据得到优先发送,且Telephone可以保证5Mbit/s的带宽,Server可以保证4Mbit/s的带宽。但由于PC1和PC2是VIP用户,其数据在发送的过程中也需要一定的带宽保证,可以有少量延迟,但不希望延迟过大。在拥塞加剧的时候需要根据优先权来丢弃报文。
需要在DeviceA配置WFQ和WRED配合调度和丢弃。
本例中interface1,interface2分别代表GE0/1/0,GE0/2/0。
配置思路
采用如下的思路配置拥塞避免。
- 在DeviceA入接口GE0/1/0处标记不同流的业务优先级。
配置WRED模板,设置报文丢弃的高低门限百分比和丢弃概率。
在DeviceA的出接口GE0/2/0为不同业务等级的类队列配置调度策略,并在调度策略中应用配置好的WRED对象。
数据准备
完成此举例配置,需准备以下数据:
- ACL列表号、流分类名称、流行为名称、重新标记的业务优先级、流量策略名称
WRED模板名称、高低门限百分比、丢弃概率、队列中报文颜色
WRED丢弃策略应用的接口和类队列参数
操作步骤
- 配置ACL规则列表,分别匹配来源于Server、Telephone、PC1和PC2的报文
<Huawei> system-view
[~Huawei]sysname DeviceA
[~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的GE0/1/0接口上配置复杂流分类,标记各个流的业务优先级
<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
IP Precedence与服务等级之间的映射关系如《HUAWEI NE20E-S 特性描述-QoS优先级映射》中的IP Precedence/MPLS EXP/802.1p到服务等级的缺省映射表所示。
服务等级的优先级高低取决于具体的队列调度算法配置:- 如果8种类型的队列都配置为PQ调度,则CS7>CS6>EF>AF4>AF3>AF2>AF1>BE;
- 如果BE配置为PQ调度(一般不会这么配置),其余7种类型的队列配置为WFQ调度,则BE的优先级比其余7个都高;
- 如果8种类型的队列都配置成WFQ调度,则相互之间无优先级高低之分。
- 在DeviceA上配置WRED模板
<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
完成上述配置后,执行命令display port-wred configuration verbose,可以查看WRED模板的配置参数。
<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 Queue Depth : 8000 Reference relationships : NULL
- 在DeviceA的GE0/2/0接口上配置类队列并应用配置好的WRED对象pw
[~DeviceA] interface gigabitethernet0/2/0
[~DeviceA-GigabitEthernet0/2/0] undo shutdown
[*DeviceA-GigabitEthernet0/2/0] port-queue ef pq port-wred pw outbound
[*DeviceA-GigabitEthernet0/2/0] port-queue af4 wfq weight 15 shaping 100 port-wred pw outbound
[*DeviceA-GigabitEthernet0/2/0] port-queue af3 wfq weight 10 shaping 50 port-wred pw outbound
[*DeviceA-GigabitEthernet0/2/0] port-queue af2 wfq weight 10 shaping 50 port-wred pw outbound
[*DeviceA-GigabitEthernet0/2/0] commit
[~DeviceA-GigabitEthernet0/2/0] return
完成上述配置后,执行命令display port-queue configuration interface,可以显示端口队列的详细配置信息。
<DeviceA> display port-queue configuration interface gigabitethernet 0/2/0 outbound
GigabitEthernet0/2/0 be current configuration: Arithmetic: wfq weight: 10 tm weight: 3 fact weight: 10 shaping(mbps): NA port-wred name: NA af1 current configuration: Arithmetic: wfq weight: 10 tm weight: 3 fact weight: 10 shaping(mbps): NA port-wred name: NA af2 current configuration: Arithmetic: wfq weight: 10 tm weight: 3 fact weight: 10 shaping(mbps): 50 port-wred name: pw af3 current configuration: Arithmetic: wfq weight: 10 tm weight: 3 fact weight: 10 shaping(mbps): 50 port-wred name: pw af4 current configuration: Arithmetic: wfq weight: 15 tm weight: 3 fact weight: 10 shaping(mbps): 100 port-wred name: pw ef current configuration: Arithmetic: pq weight: NA tm weight: NA fact weight: NA shaping(mbps): NA port-wred name: pw cs6 current configuration: Arithmetic: pq weight: NA tm weight: NA fact weight: NA shaping(mbps): NA port-wred name: NA cs7 current configuration: Arithmetic: pq weight: NA tm weight: NA fact weight: NA shaping(mbps): NA port-wred name: NA
- 检查配置结果
当网络中有流量通过时,在DeviceA上执行命令display port-queue statistics [ slot slot-id | interface { interface-type interface-number | interface-name } ] [ cos-value ] outbound,可以看到各种业务等级的流量迅速增长。当网络中流量迅速增加时,可以看到丢弃的流量开始迅速增加,不同的业务流量丢弃的数量符合WRED配置的丢弃参数。
配置文件
DeviceA的配置文件
#
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 cc operator or
if-match acl 2003
traffic classifier dd operator or
if-match acl 2004
traffic classifier aa operator or
if-match acl 2001
traffic classifier bb operator or
if-match acl 2002
#
traffic behavior cc
remark ip-precedence 3
traffic behavior dd
remark ip-precedence 2
traffic behavior aa
car cir 5000
remark ip-precedence 5
traffic behavior bb
car cir 4000
remark ip-precedence 4
#
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/2/0
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