2009年(48)
分类: 系统运维
2009-09-18 10:13:52
拥塞避免(Congestion Avoidance)是通过监视网络资源(如队列或内存缓冲区)的使用情况,在拥塞有加剧的趋势时,主动丢弃报文,通过调整网络的流量来解除网络过载的一种流量控制机制。
与端到端的流控相比,拥塞避免的流控有更广泛的意义。它影响到路由器中更多的业务流的负载。当然,路由器在丢弃报文时,并不排斥与源端的流控动作比如TCP流控的配合,更好地调整网络的流量到一个合理的负载状态。
为了避免TCP全局同步这种情况,队列可以采用WRED丢弃策略。由于WRED随机地丢弃报文,将避免使多个TCP连接同时降低发送速度,从而避免了TCP的全局同步现象,提高了线路带宽的利用率。
在部署拥塞避免时,采用如下的配置思路:
1. 使能路由协议,实现互通
2. 先在设备入接口处标记不同流的业务优先级
3. 配置WRED对象,设置报文丢弃的高低门限百分比和丢弃概率
4. 在设备的出接口为不同业务等级的类队列配置调度策略,并在调度策略中应用配置好的WRED对象
WRED丢弃策略通常与WFQ队列配合使用。
Server、Telephone、PC1和PC2通过路由器RouterA向网络发送数据,其中Server发送关键业务数据,Telephone发送语音数据,PC1和PC2发送非关键业务数据。由于RouterA入接口GE1/0/0的速率大于出接口POS2/0/0的速率,在POS2/0/0接口处可能发生拥塞,并且可能出现拥塞加剧现象。
要求在网络拥塞时保证Server和Telephone发送的业务数据得到优先发送。但由于PC1和PC2是VIP用户,他们的数据在发送的过程中也需要一定的带宽保证,可以有少量延迟,但不希望延迟过大。在拥塞加剧的时候需要根据优先权来丢弃报文。
需要在RouterA上配置WFQ和WRED配合调度和丢弃。
步骤 1 配置ACL规则列表,分别匹配来源于Server、Telephone、PC1和PC2的报文
[RouterA] acl number 2001
[RouterA-acl-basic-2001] rule permit source 10.1.1.3 0.0.0.0
[RouterA-acl-basic-2001] quit
[RouterA] acl number 2002
[RouterA-acl-basic-2002] rule permit source 10.1.1.2 0.0.0.0
[RouterA-acl-basic-2002] quit
[RouterA] acl number 2003
[RouterA-acl-basic-2001] rule permit source 10.1.1.4 0.0.0.0
[RouterA-acl-basic-2001] quit
[RouterA] acl number 2004
[RouterA-acl-basic-2002] rule permit source 10.1.1.5 0.0.0.0
[RouterA-acl-basic-2002] return
步骤 2 在RouterA的GE1/0/0接口上配置复杂流分类,标记各个流的业务优先级
[RouterA] traffic classifier aa
[RouterA-classifier-aa] if-match acl 2001
[RouterA-classifier-aa] quit
[RouterA] traffic classifier bb
[RouterA-classifier-bb] if-match acl 2002
[RouterA-classifier-bb] quit
[RouterA] traffic classifier cc
[RouterA-classifier-cc] if-match acl 2003
[RouterA-classifier-cc] quit
[RouterA] traffic classifier dd
[RouterA-classifier-dd] if-match acl 2004
[RouterA-classifier-dd] quit
[RouterA] traffic behavior aa
[RouterA-behavior-aa] remark ip-precedence 5
[RouterA-behavior-aa] quit
[RouterA] traffic behavior bb
[RouterA-behavior-bb] remark ip-precedence 4
[RouterA-behavior-bb] quit
[RouterA] traffic behavior cc
[RouterA-behavior-cc] remark ip-precedence 3
[RouterA-behavior-cc] quit
[RouterA] traffic behavior dd
[RouterA-behavior-dd] remark ip-precedence 2
[RouterA-behavior-dd] quit
[RouterA] traffic policy ee
[RouterA-trafficpolicy-ee] classifier aa behavior aa
[RouterA-trafficpolicy-ee] classifier bb behavior bb
[RouterA-trafficpolicy-ee] classifier cc behavior cc
[RouterA-trafficpolicy-ee] classifier dd behavior dd
[RouterA-trafficpolicy-ee] quit
[RouterA] interface gigabiethernet1/0/0
[RouterA-gigabitEthernet1/0/0] undo shutdown
[RouterA-gigabitEthernet1/0/0] traffic-policy ee inbound
[RouterA-gigabitEthernet1/0/0] return
步骤 3 在RouterA上配置WRED对象
[RouterA] port-wred pw
[RouterA-port-wred-pw] color green low-limit 70 high-limit 100 discard-percentage 100
[RouterA-port-wred-pw] color yellow low-limit 60 high-limit 90 discard-percentage 100
[RouterA-port-wred-pw] color red low-limit 50 high-limit 80 discard-percentage 100
[RouterA-port-wred-pw] return
完成上述配置后,执行命令display port-wred configuration verbose,可以查看类队列WRED对象的配置参数。
port-wred-name : pw
color low-limit high-limit discard-percent
green 70 100 100
yellow 60 90 100
red 50 80 100
[reference relationship]
NULL
步骤 4 在RouterA的POS2/0/0接口上配置类队列并应用配置好的WRED对象pw
[RouterA] interface pos2/0/0
[RouterA-POS2/0/0] undo shutdown
[RouterA-POS2/0/0] port-queue ef pq port-wred pw outbound
[RouterA-POS2/0/0] port-queue af4 wfq weight 15 shaping 100 port-wred pw outbound
[RouterA-POS2/0/0] port-queue af3 wfq weight 10 shaping 50 port-wred pw outbound
[RouterA-POS2/0/0] port-queue af2 wfq weight 10 shaping 50 port-wred pw outbound
[RouterA-POS2/0/0] return
完成上述配置后,执行命令display port-queue configuration interface,可以显示类队列的详细配置信息。