拥塞管理之---CQ
版权声明:原创作品,谢绝转载!否则将追究法律责任。 |
![]() 源为R1,目标为R3,在R2上配置CQ,每个CQ允许包的最大数量为2500。
CQ1为NTP包,数量为1100,分配带宽为20% CQ2为TELNET包,数量为300,分配带宽为60% CQ3为TFTP包,数量为800,分配带宽为20% R1
conf t int f 0/0 ip ad 10.1.1.1 255.255.255.0 no shut router rip ver 2 no au net 10.0.0.0 end R2
conf t int f 0/0 ip ad 10.1.1.2 255.255.255.0 no shut int s2/0 ip ad 10.1.2.2 255.255.255.0 encap f no arp f no frame inver frame map ip 10.1.2.3 203 b no shut exit queue-list 1 queue 1 limit 2500 /*每个CQ允许包的最大数量为2500。 queue-list 1 queue 2 limit 2500 queue-list 1 queue 3 limit 2500 queue-list 1 queue 1 byte-count 1100 /*指明每个队列转发的平均的字节数量,ntp包为1100,telnet包为2400,tftp包为800 queue-list 1 queue 2 byte-count 2400 queue-list 1 queue 3 byte-count 800 queue-list 1 protocol ip 1 udp ntp /*建立基于ntp协议的队列 queue-list 1 protocol ip 2 tcp telnet /*建立基于telnet协议的队列 queue-list 1 protocol ip 3 udp tftp /*建立基于tftp协议的队列 int s 2/0 custom-queue-list 1 /*把CQ应用到接口 exit router rip ver 2 no au net 10.0.0.0 end R3
conf t int s2/0 ip ad 10.1.2.3 255.255.255.0 encap f no arp f no frame inver frame map ip 10.1.2.2 302 b no shut router rip ver 2 no au net 10.0.0.0 end 校验 R2#sh int s2/0 Serial2/0 is up, line protocol is up 。。。。。。。。。。。。。。。。。。。。。。。。。。。。 Queueing strategy: custom-list 1 Output queues: (queue #: size/max/drops) 0: 0/20/0 1: 0/2500/0 2: 0/2500/0 3: 0/2500/0 4: 0/20/0 5: 0/20/0 6: 0/20/0 7: 0/20/0 8: 0/20/0 9: 0/20/0 10: 0/20/0 11: 0/20/0 12: 0/20/0 13: 0/20/0 14: 0/20/0 15: 0/20/0 16: 0/20/0 。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。 R2#sh queueing custom
Current custom queue configuration: List Queue Args
1 1 protocol ip udp port ntp 1 2 protocol ip tcp port telnet 1 3 protocol ip udp port tftp 1 1 byte-count 1100 limit 2500 1 2 byte-count 2400 limit 2500 1 3 byte-count 800 limit 2500 附:解决CQ中包的数量占用带宽的问题
当CQ在接口启用时,系统会维持17个队列的信息,其中队列0是系统队列,用户只可以配置队列1到16,router从特定队列中发送数据包,直到发送的字节数超过队列的长度,.一旦超过额定的字节数,通常这个数据包会被完整的传出,因此,如果用户定义的字节数量为100字节的话,但是用户协议的数据包的长度为1024字节,那么这个队列降发送1024字节,而不是100字节。这样将会导致别的队列会等相当长的时间。下面我们来解决这个问题
1,对于每个队列,根据包的字节数来划分你想要的带宽的的百分比来分配到这个队列。比如A为NTP包,数量为1100,分配带宽为20%B为TELNET包,数量为300,分配带宽为60%C为TFTP包,数量为800,分配带宽为20%
算出带宽和数据包的比值
A: 20/1100=0.018
B: 60/300=0.2
C: 20/800=0.025
2,A, B, C同时与A的值相比,得
A: 1
B: 11.1
C: 1.4
3,将小数点后面的数进位,得
A: 1
B: 12
C: 2
也就是当队列1发送1个包以后,队列2发送12个包,然后队列3发送2个包。然后再队列1发送……如此循环下去。
4,将上面的结果与包的大小相乘,得
A: 1*1100=1100
B: 12*300=3600
C: 2*800=1600
这些字节的数量是在CQ的byte-count 中配置的
5,确定带宽的分配
1100+3600+1600=6300
这样
A分配的带宽:1100/6300=0.18
B分配的带宽:3600/6300=0.57
C分配的带宽:1600/6300=0.25
即,带宽的分配比率为18/57/25,这就和要求的20/60/20比较接近了,因此不会发生队列过长而影响其他队列传输的现象。 本文出自 “穿过地狱去看海” 博客,谢绝转载! 本文出自 51CTO.COM技术博客 |




cj231210
博客统计信息
热门文章
最新评论
友情链接

