Yeslab安德CCIE技术文档QoS之WRED
标签:
ccieccnpredhatrhcayeslab杂谈 |
一、理论支持
Random Early Detection(RED)早期检测随即丢弃二、拓扑描述
如图所示,已经配置了串行链路的直连地址以及IGP协议三、实验步骤
1、基于接口的WRED(加权早期随即丢弃)
R2(config)#int s1/0R2(config-if)#random-detect---默认情况下这里的权重为基于IP优先级
验证
R2#sh queueing random-detect---需要注意的是,这里的验证命令是查看队列(虽然我们不是在查看队列)
Current random-detect configuration:
Serial1/0---s1/0接口已经启用了WRED
让我们来解读上面的验证情况:
R2(config)#int s1/0
R2(config-if)#fair-queue
Must remove RED configuration first.---默认情况仅仅支持FIFO的队列(FIFO队列深度为40个报文)
可以人为的修改每一个IP优先级的最小和最大丢弃阀值,以及丢弃可能性(分母):
R2#sh queueing interface s1/0
Interface Serial1/0 queueing strategy: random early detection (WRED)
在IOS中可以有不同的丢弃Profile,默认基于IP优先级,也可以基于DSCP:
R2(config-if)#random-detect dscp-based
R2#sh queueing interface s1/0
Interface Serial1/0 queueing strategy: random early detection (WRED)
default
下面我们修改某一个DSCP的丢弃可能性和阀值
R2(config-if)#random-detect dscp af43 37 40 11---对DSCP43的流量,最小丢弃阀值为37,最大丢弃阀值为40,丢弃可能性为十一分之一
R2#sh queueing interface s1/0
Interface Serial1/0 queueing strategy: random early detection (WRED)
New average = (Old_average * (1 – 2–n)) + (Current_Q_depth * 2–n)
拿9来举例:
New average = (Old_average * .998) + (Current_Q_depth * .002)
换句话说,只参考了现有队列深度的非常小的一部分,而参考现有的平均队列深度更多。该值9为默认也可以修改:
R2(config-if)#random-detect exponential-weighting-constant 5
R2#sh queueing interface s1/0
Interface Serial1/0 queueing strategy: random early detection (WRED)
2、CB-WRED基于类的WRED
R2(config)#ip access-list extended UDP
R2(config-ext-nacl)#permit ip any any precedence 5
R2(config-ext-nacl)#permit udp any any eq ntp!
R2(config)#class-map match-any UDP
R2(config-cmap)#match access-group name UDP!
R2(config)#policy-map WRED
R2(config-pmap)#class UDP
R2(config-pmap-c)#bandwidth percent 10---不能和LLQ合用,可以和CBWFQ合用,而且RED不能单独使用
R2(config-pmap-c)#random-detect
interface Serial1/0
service-policy output WRED---应用到出接口
R2#sh policy-map
也可以根据某一个IP优先级设置丢弃阀值
R2(config-pmap-c)#random-detect precedence 5 1 2 1---这个设置的非常小
在R3去做测试:
R3#ping
Protocol [ip]:
Target IP address: 12.1.1.1
Repeat count [5]: 20
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface:
Type of service [0]: 160---等于IP优先级5,请自行计算
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 13, 100-byte ICMP Echos to 12.1.1.1, timeout is 2 seconds:!!!!!!!!!!!!!
Success rate is 100 percent (13/13), round-trip min/avg/max = 8/22/60 ms
R2#sh policy-map int
如上验证已经有匹配
试验完成
欢迎大家继续关注Ender的文档以及更多视频

加载中…