session 1 CBWFQ and LLQ
CBWFQ,class basic wiegth fair queue 基于类的加权公平队列,是一种基于类的WFQ,与WFQ不同的是CBWFQ是基于类的,分配队列的时候不需要像WFQ一样用flow的5元素组来hash出队列号,而是通过类来直接分配流量队列序号(class-map定义的)。主要针对于没有语音和视频的应用程序业务数据网络。
LLQ,low Latency Queue 低延迟队列,是一种带有优先级转发的CBWFQ,在基于类的WFQ基础上增加了优先转发的队列技术。主要针对于有语音和视频流量的网络。
这两种队列技术是目前园区网内广泛流行的队列技术,是目前网络质量的最好的解决方案。
session 2 CBWFQ的基本配置
使用CBWFQ来配置,将http、ftp的业务流量分配一定带宽,剩余流量使用WFQ机制来保障网络的服务质量。
R1(config)#class-map match-all ftp
R1(config-cmap)#match protocol ftp
R1(config-cmap)#exit
R1(config)#class-map match-all
http
R1(config-cmap)#match protocol http
R1(config-cmap)#exit
R1(config)#policy-map
CBWFQ
R1(config-pmap)#class
ftp
R1(config-pmap-c)#bandwidth 3000 (bit) 给ftp类流量分配3M的带宽
R1(config-pmap-c)#exit
R1(config-pmap)#class
http
R1(config-pmap-c)#bandwidth 2000 (bit) 给http类流量分配2M的带宽
R1(config-pmap-c)#exit
R1(config-pmap)#class class-default
R1(config-pmap-c)#fair-queue 除calss定义的ftp和http流量,剩余的所有流量使用WFQ机制
R1(config-pmap-c)#exit
R1(config)#interface f0/0
R1(config-if)#service-policy output
CBWFQ 在接口的出战方向调用QOS策略
R1(config-if)#end
检查CBWFQ的配置命令:
R1#show policy-map 查看policy-map的配置信息
Policy Map ftp
Class ftp
Bandwidth 3000 (kbps) Max Threshold 64 (packets) 带宽3M,最大队列深度64个包,超出的丢弃
Class http
Bandwidth 2000 (kbps) Max Threshold 64 (packets) 带宽2M,最大队列深度64个包,超出的丢弃
Class class-default
Flow based Fair Queueing class-default默认流量使用默认的WFQ队列机制
Bandwidth 0 (kbps) Max Threshold 64 (packets) WFQ最大队列深度64个包,超出的丢弃
R1#show policy-map interface 查看policy-map在接口的详细信息
FastEthernet0/0
Service-policy output: ft
Class-map: ftp (match-all)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: protocol ftp
Queueing
Output Queue: Conversation 265
Bandwidth 3000 (kbps)Max Threshold 64 (packets)
(pkts matched/bytes matched) 0/0
(depth/total drops/no-buffer drops) 0/0/0
Class-map: http (match-all)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: protocol http
Queueing
Output Queue: Conversation 265
Bandwidth 3000 (kbps)Max Threshold 64 (packets)
(pkts matched/bytes matched) 0/0
(depth/total drops/no-buffer drops) 0/0/0
Class-map: class-default (match-any)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: any
Queueing
Flow Based Fair Queueing
Maximum Number of Hashed Queues 256
(total queued/total drops/no-buffer drops) 0/0/0
补充:
R(config)#interface s0/0
R(config-if)#ip nbar protocol-discovery 在接口打开NBAR功能
R(config)#max-reserved-bandwidth 100
调整QOS可以使用的最大带宽为100%,一般建议用默认的75%可用带宽,因为25%的是留给路由协议等流量使用的。
session 3 LLQ的基本配置
R1(config)#class-map match-all voice
R1(config-cmap)#match protocol vdolive
R1(config-cmap)#exit
R1(config)#class-map match-all ftp
R1(config-cmap)#match protocol ftp
R1(config-cmap)#exit
R1(config)#class-map match-all
http
R1(config-cmap)#match protocol http
R1(config-cmap)#exit
R1(config)#policy-map
LLQ
R1(config-pmap)#class
voice
R1(config-pmap-c)#priority 1000 (bit) 给语音类流量分配1M的带宽,并且优先转发。区别于CBWFQ
R1(config-pmap-c)#exit
R1(config-pmap)#class
ftp
R1(config-pmap-c)#bandwidth 3000 (bit) 给ftp类流量分配3M的带宽
R1(config-pmap-c)#exit
R1(config-pmap)#class
http
R1(config-pmap-c)#bandwidth 2000 (bit) 给http类流量分配2M的带宽
R1(config-pmap-c)#exit
R1(config-pmap)#class class-default
R1(config-pmap-c)#fair-queue 除calss定义流量,剩余的所有流量使用默认的WFQ机制
R1(config-pmap-c)#exit
R1(config)#interface f0/0
R1(config-if)#service-policy output
LLQ
R1(config-if)#end
R1#show policy-map
Policy Map LLQ
Class ftp
Bandwidth 3000 (kbps) Max Threshold 64 (packets)
Class voice
Strict Priority 体现了LLQ机制的强制优先转发策略
Bandwidth 1000 (kbps) Burst 25000 (Bytes)
Class http
Bandwidth 2000 (kbps) Max Threshold 64 (packets)
Class class-default
Flow based Fair Queueing 其余流量使用默认的WFQ
Bandwidth 0 (kbps) Max Threshold 64 (packets)
R1#show policy-map interface f0/0
FastEthernet0/0
Service-policy output: LLQ
Class-map: ftp (match-all)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: protocol ftp
Queueing
Output Queue: Conversation 265
Bandwidth 3000 (kbps)Max Threshold 64 (packets)
(pkts matched/bytes matched) 0/0
(depth/total drops/no-buffer drops) 0/0/0
Class-map: voice (match-all)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: protocol vdolive
Queueing
Strict Priority
Output Queue: Conversation 264
Bandwidth 1000 (kbps) Burst 25000 (Bytes)
(pkts matched/bytes matched) 0/0
(total drops/bytes drops) 0/0
Class-map: http (match-all)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: protocol http
Queueing
Output Queue: Conversation 266
Bandwidth 2000 (kbps)Max Threshold 64 (packets)
(pkts matched/bytes matched) 0/0
(depth/total drops/no-buffer drops) 0/0/0
Class-map: class-default (match-any)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: any
Queueing
Flow Based Fair Queueing
Maximum Number of Hashed Queues 256
(total queued/total drops/no-buffer drops) 0/0/0