QOS关于队列的相关配置(PQ+CQ+WFQ+CBWFQ+LLQ) 所有试验共用的试验拓扑:
PQ:优先级队列(priority queue)
在优先级队列PQ中,有高,中,普通,低优先级4个队列。数据包根据事先定义放在不同的队列中,路由器按照高,中,普通,低顺序服务,只有高优先级的队列为空后,才为其他队列服务,依次类推。
直接手敲的 制作匆忙。
priority-list 1 protocol ip high tcp telnet //将telnet流量放在高优先级队列里
priority-list 1 protocol ip high list 101 //将acc-list 101定义的流量放在高优先级里 priority-list 1 protocal ip medium gt 1000 //将数据包大小大于1000字节的流量放在中等优先级队列里
priority-list 1 interface Ethernet 1/0 normal //将从Ethernet口收到的流量放在普通的优先级队列里
priority-list 1 default low //。。。。。
priority-list 1 queue-limit 20 30 40 50 //分别定义高、中、普通、低优先级队列长度,如果超出这些长度的数据包将被丢弃!
Int s 0/0
Prority-group 1
Show int s 0/0、show queueing priority就能检测了。
CQ:自定义队列(custom queue)
与PQ不同,在CQ中有16个队列数据包根据事先定义的放在不同的队列中,路由器将为第一队列服务一定数量的数据包、字节后就为第二个队列服务,我们定义的是深度——即为每个队列服务的那“一定数量的数据包、字节”然后转而为下一队列服务。注意:CQ中队列0 比较特殊,只有0为空了才为其他队列服务。
一下是show run的内容
access-list 101 permit ip host 10.1.1.0 any queue-list 1 protocol ip 1 tcp telnet queue-list 1 protocol ip 2 list 101 queue-list 1 protocol ip 3 gt 1000 queue-list 1 interface Ethernet1/0 4 queue-list 1 default 5
queue-list 1 queue 1 limit 40 //定义深度队列一的深度为40
queue-list 1 queue 2 limit 35 queue-list 1 queue 3 limit 30 queue-list 1 queue 4 limit 25 !
interface Serial0/0
ip address 192.168.12.1 255.255.255.0 ip ospf 1 area 0
serial restart-delay 0
custom-queue-list 1 //接口上应用
show int s 0/0
Show queueing custom
WFQ:(weigth fair queue)加权公平队列
WFQ是低速链路(低于2.048Mbps)上的默认设置,它将数据包区分为
不同的流。配置相当简单一条命令解决问题啊~~
int s 0/0
fair-queue 512 1024 10 //512为丢弃阈值,1024为动态会话数 10为RSVP预留队列
CBWFQ(class-based weight fair queue)基于类的加权公平队列
简单来说就是根据数据包的协议类型、ACL、IP优先级或者输入接口等条件实现定义好流量的类型,为不同的类型配置最大带宽和占用接口带宽的百分比。能与NBAR,WRED一起使用!
!
class-map match-any MYMAP1 //定义类 match protocol http match protocol ftp
class-map match-all MYMAP2 match protocol telnet ! !
policy-map MYPOLICY //定义策略 class MYMAP1 bandwidth 60 class MYMAP2 bandwidth 10
!
interface Serial0/0
ip address 192.168.12.1 255.255.255.0 ip ospf 1 area 0
serial restart-delay 0
service-policy output MYPOLICY //接口应用
LLQ(low latency queue)低延时队列
该实验需要在CBWFQ的基础上完成
即允许用户自定义数据类别,并优先让这些类别的数据传输。
R1(config)#class-map match-any MYMAP3 R1(config-cmap)#match ip precedence critical R1(config-cmap)#exit
R1(config)#policy-map MYPOLICY R1(config-pmap)#class MYMAP3 R1(config-pmap-c)#priority 15
R1#show policy-map Policy Map MYPOLICY Class MYMAP1
Bandwidth 60 (kbps) Max Threshold 64 (packets) Class MYMAP2
Bandwidth 10 (kbps) Max Threshold 64 (packets) Class MYMAP3 Strict Priority
Bandwidth 15 (kbps) Burst 375 (Bytes)
R1#show policy-map int s 0/0 Serial0/0
Service-policy output: MYPOLICY
Class-map: MYMAP1 (match-any) 0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps Match: protocol http 0 packets, 0 bytes 5 minute rate 0 bps Match: protocol ftp 0 packets, 0 bytes 5 minute rate 0 bps Queueing
Output Queue: Conversation 265
Bandwidth 60 (kbps)Max Threshold 64 (packets) (pkts matched/bytes matched) 0/0
(depth/total drops/no-buffer drops) 0/0/0
Class-map: MYMAP2 (match-all) 0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps Match: protocol telnet
Queueing
Output Queue: Conversation 266
Bandwidth 10 (kbps)Max Threshold 64 (packets) (pkts matched/bytes matched) 0/0
(depth/total drops/no-buffer drops) 0/0/0
Class-map: MYMAP3 (match-any) 0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps Match: ip precedence 5 0 packets, 0 bytes 5 minute rate 0 bps Queueing
Strict Priority //严格优先级 Output Queue: Conversation 264
Bandwidth 15 (kbps) Burst 375 (Bytes) (pkts matched/bytes matched) 0/0 (total drops/bytes drops) 0/0
Class-map: class-default (match-any) 128 packets, 9462 bytes
5 minute offered rate 0 bps, drop rate 0 bps Match: any