中文
交流机
园区网交流机
数据中心与云盘算交流机
行业精选交流系列
意图网络指挥官
所有手艺解决计划
无线
放装型无线接入点
墙面型无线接入点
智分无线接入点
室外无线接入点
场景化无线
行业精选无线系列
无线治理与应用
清静
下一代防火墙
清静网关
检测治理清静
所有手艺解决计划
运营商
政府
互联网
制造业
高教/职教
医疗卫生
交通
公共清静
首页 >效劳与支持 >常见问题 >Qos是什么,怎样设置?
QoS(Quality of Service,效劳质量)能够知足用户对差别应用差别效劳质量的要求。凭证用户的要求分派和调理资源,对差别的报文提供差别的效劳质量。
在古板的IP网络中,装备对所有的报文都接纳等同看待方法,凭证报文抵达的时间先后,先入先出的排队战略(FIFO)处置惩罚,尽最大的起劲(Best-Effort)将报文传送到目的地。当网络带宽充裕的时间,所有的报文都获得了较好的处置惩罚;而当网络爆发拥塞的时间,所有的报文都有可能被扬弃。
QoS针对某种类别的报文,可以为它付与某个级别的传输优先级,标识它的相对主要性,并使用装备所提供的种种优先级转发战略、拥塞阻止等机制为这些报文提供特殊的传输效劳。对实时性强且主要的报文优先处置惩罚;关于实时性不强的普转达文,提供较低的处置惩罚优先级,网络拥塞时甚至扬弃。
QoS增添了网络性能的可预知性,并能够有用地分派网络带宽,越发合理地使用网络资源。
某学校为了知足正常的教学营业需要,要求知足以下四点需求:
l 限制学校会见Internet的流量为100Mbps,扬弃凌驾限制的报文。
l 限制宿舍楼的出口流量为50Mbps,扬弃凌驾限制的报文。
l 限制实验楼发出DSCP优先级为7的报文的速率为20Mbps,将速率凌驾20M的此类报文扬弃。
l 限制教学楼的出口流量为30Mbps,扬弃凌驾限制的报文。
说明
某学校通过Device A的G0/24上联Internet,Device A的G0/1、G0/2和G0/3划分下联的教学楼(192.168.194.2~253/24)、实验楼(192.168.195.2~253/24)和宿舍楼(192.168.196.2~253/24)。
图1-6 接口限速和优先级重标记应用场景
(1) 关于出口会见Internet,在Device A接口G0/24上设置接口的出口流量限制,带脱期制为每秒102400KBits,突发流量限制为每秒256Kbytes。
(2) 关于宿舍楼,在Device A接口G0/3上设置接口的入口流量限制,带脱期制为每秒51200KBits,突发流量限制为每秒256Kbytes。
(3) 关于教学楼,在Device A接口G0/1上设置接口的入口流量限制,带脱期制为每秒30720KBits,突发流量限制为每秒256Kbytes。
(4) 关于实验楼,建设类cmap_dscp7匹配DSCP优先级7,建设战略pmap_shiyan,关联cmap_dscp7,绑定盛行为,将速率凌驾20M的报文的DSCP值改为16;将pmap_shiyan应用在接口G0/2上,并设置接口信托DSCP。
(1) 设置接口IP地点(略)。
(2) 设置接口限速。
# 关于出口会见Internet,在接口G0/24上设置接口的出口流量限制。
DeviceA> enable
DeviceA# configure terminal
DeviceA(config)# interface gigabitethernet 0/24
DeviceA(config-if-GigabitEthernet 0/24# rate-limit output 102400 256
DeviceA(config-if-GigabitEthernet 0/24)# exit
# 关于宿舍楼,在接口G0/3上设置接口的入口流量限制。
DeviceA(config)# interface gigabitethernet 0/3
DeviceA(config-if-GigabitEthernet 0/3# rate-limit input 51200 256
DeviceA(config-if-GigabitEthernet 0/3)# exit
# 关于教学楼,在接口G0/1上设置接口的入口流量限制。
DeviceA(config)# interface gigabitethernet 0/1
DeviceA(config-if-GigabitEthernet 0/1# rate-limit input 30720 256
DeviceA(config-if-GigabitEthernet 0/1)# exit
(3) 设置流分类。
# 关于实验楼,设置类,盛行为和战略。
DeviceA(config)# class-map cmap_dscp7
DeviceA(config-cmap)# match ip dscp 7
DeviceA(config-cmap)# exit
DeviceA(config)# policy-map pmap_shiyan
DeviceA(config-pmap)# class cmap_dscp7
DeviceA(config-pmap-c)# police 20480 128 exceed-action drop
DeviceA(config-pmap-c)# exit
DeviceA(config-pmap)# exit
# 将战略应用到接口,并设置接口信托DSCP。
DeviceA(config)# interface gigabitethernet 0/2
DeviceA(config-if-GigabitEthernet 0/2# service-policy input pmap_shiyan
DeviceA(config-if-GigabitEthernet 0/2)# mls qos trust dscp
DeviceA(config-if-GigabitEthernet 0/2)# exit
# 检查接口限速设置是否乐成。
DeviceA# show mls qos rate-limit
Interface: GigabitEthernet 0/1
rate limit input Kbps = 30720 burst = 256
Interface: GigabitEthernet 0/3
rate limit input Kbps = 51200 burst = 256
Interface: GigabitEthernet 0/24
rate limit output Kbps = 102400 burst = 256
# 检查类是否建设乐成。
DeviceA# show class-map cmap_dscp7
Class Map cmap_dscp7
Match ip dscp 7
# 检查战略是否建设乐成。
DeviceA# show policy-map pmap_shiyan
Policy Map pmap_shiyan
Class cmap_dscp7
police 20480 128 exceed-action dscp 16
# 检查战略是否乐成应用在接口上。
DeviceA# show mls qos interface gigabitethernet 0/2
Interface: GigabitEthernet 0/2
Ratelimit input:
Ratelimit output:
Attached input policy-map: pmap_shiyan
Attached output policy-map:
Default trust: dscp
Default cos: 0
Device A的设置文件
hostname DeviceA
!
class-map cmap_dscp7
match ip dscp 7
!
policy-map pmap_shiyan
class cmap_dscp7
police 20480 128 exceed-action drop
!
interface GigabitEthernet 0/1
ip add 192.168.194.1 255.255.255.0
rate-limit input 30720 256
!
interface GigabitEthernet 0/2
ip add 192.168.195.1 255.255.255.0
service-policy input pmap_shiyan
mls qos trust dscp
!
interface GigabitEthernet 0/3
ip add 192.168.196.1 255.255.255.0
rate-limit input 51200 256
!
interface GigabitEthernet 0/24
rate-limit output 102400 256
!
设置优先级重标记和行列调理,实现下述需求:
l 当研发部和市场部会见效劳器时,效劳器报文的优先级为:邮件效劳器>文件效劳器>人为盘问效劳器。
l 无论人事治理部会见Internet或会见效劳器,Device A都优先处置惩罚。
l Device A在运行历程中,时常发明网络拥塞。为了包管营业顺遂运转,要求使用WRR行列调理,对研发部和市场部会见邮件数据库、会见文件数据库、会见人为盘问数据库的IP数据报凭证6:2:1的比例来调理。
说明
研发部(192.168.45.2~253/24)、市场部(192.168.46.2~253/24)和人事治理部(192.168.47.2~253/24)划分接入Device A的接口G0/1、G0/2和G0/3;人为盘问效劳器(192.168.10.2/24)、邮件效劳器(192.168.10.3/24)和文件效劳器(192.168.10.4/24)毗连在Device A的接口G0/23。
图1-7 行列调理和拥塞阻止应用场景
(1) 在Device A上建设会见种种效劳器的ACL,并建设类匹配这些ACL。
(2) 建设战略,关联各个类,为会见种种效劳器的报文重新指定802.1p。会见邮件效劳器的报文重新指定802.1p为4,会见文件效劳器的报文重新指定802.1p为3,会见人为盘问效劳器的报文重新制订802.1p为2。并将其关联到研发部和市场部的入口上,设置接口信托802.1p。
(3) 设置人事治理部接口的802.1p为最高优先级7,优先包管人事部发出的报文。
(4) 设置行列的输出调理战略为WRR,轮转权重为1:1:1:2:6:1:1:0,即对人事治理部报文实验SP调理,对研发部与市场部会见邮件数据库、文件数据库、人为盘问数据库的报文凭证6:2:1的比例来调理。
(5) 开启WRED功效。
(6) 设置接口G0/2行列2的低门限为10 20。
(7) 设置接口G0/2行列2的高门限为60 90。
(8) 设置接口G0/2行列2的最大扬弃概率60 80。
(1) 在Device A上设置会见种种效劳器的ACL和对应规则。
# 设置会见人为盘问效劳器的ACL和对应规则。
DeviceA> enable
DeviceA# configure terminal
DeviceA(config)# ip access-list extended salary
DeviceA(config-ext-nacl)# permit ip any host 192.168.10.2
DeviceA(config-ext-nacl)# exit
# 设置会见邮件效劳器的ACL和对应规则。
DeviceA(config)# ip access-list extended mail
DeviceA(config-ext-nacl)# permit ip any host 192.168.10.3
DeviceA(config-ext-nacl)# exit
# 设置会见文件效劳器的ACL和对应规则。
DeviceA(config)# ip access-list extended file
DeviceA(config-ext-nacl)# permit ip any host 192.168.10.4
DeviceA(config-ext-nacl)# exit
(2) 在Device A上设置类。
# 将类salary和允许会见人为盘问效劳器的ACL规则关联起来。
DeviceA(config)# class-map salary
DeviceA(config-cmap)# match access-group salary
DeviceA(config-cmap)# exit
# 将类mail和允许会见邮件效劳器的ACL规则关联起来。
DeviceA(config)# class-map mail
DeviceA(config-cmap)# match access-group mail
DeviceA(config-cmap)# exit
# 将类file和允许会见文件效劳器的ACL规则关联起来。
DeviceA(config)# class-map file
DeviceA(config-cmap)# match access-group file
DeviceA(config-cmap)# exit
(3) 在Device A上设置战略。
# 设置会见效劳器的战略toserver。
DeviceA(config)# policy-map toserver
DeviceA(config-pmap)#
# 将类salary和对应的盛行为关联起来。
DeviceA(config-pmap)# class salary
DeviceA(config-pmap-c)# set cos 2
DeviceA(config-pmap-c)# exit
# 将类mail和对应的盛行为关联起来。
DeviceA(config-pmap)# class mail
DeviceA(config-pmap-c)# set cos 4
DeviceA(config-pmap-c)# exit
# 将类file和对应的盛行为关联起来。
DeviceA(config-pmap)# class file
DeviceA(config-pmap-c)# set cos 3
DeviceA(config-pmap-c)# exit
DeviceA(config-cmap)# exit
(4) 在Device A上应用战略。
# 在接入研发部的接口上应用战略。
DeviceA(config)# interface gigabitethernet 0/1
DeviceA(config-if-GigabitEthernet 0/1)# service-policy input toserver
DeviceA(config-if-GigabitEthernet 0/1)# mls qos trust cos
DeviceA(config-if-GigabitEthernet 0/1)# exit
# 在接入市场部的接口上应用战略。
DeviceA(config)# interface gigabitethernet 0/2
DeviceA(config-if-GigabitEthernet 0/2)# service-policy input toserver
DeviceA(config-if-GigabitEthernet 0/2)# mls qos trust cos
DeviceA(config-if-GigabitEthernet 0/2)# exit
(5) 在Device A上设置接口的802.1p。
# 设置人事治理部接口的802.1p为最高优先级。
DeviceA(config)# interface gigabitethernet 0/3
DeviceA(config-if-GigabitEthernet 0/3)# mls qos cos 7
DeviceA(config-if-GigabitEthernet 0/3)# exit
(6) 在Device A上设置行列的输出调理战略。
# 设置行列的输出调理战略为WRR。
DeviceA(config)# wrr-queue bandwidth 1 1 1 2 6 1 1 0
DeviceA(config)# mls qos scheduler wrr
(7) 在Device A上设置拥塞阻止。
# 开启WRED功效。
DeviceA(config)# queueing wred
# 设置崎岖门限和最大扬弃概率。
DeviceA(config)# interface gigabitethernet 0/2
DeviceA(config-if-GigabitEthernet 0/2)# wrr-queue random-detect min-threshold 2 10 20
DeviceA(config-if-GigabitEthernet 0/2)# wrr-queue random-detect max-threshold 2 60 90
DeviceA(config-if-GigabitEthernet 0/2)# wrr-queue random-detect probability 2 60 80
# 设置内部效劳种别与门限的映射。
DeviceA(config-if-GigabitEthernet 0/2)# wrr-queue cos-map 2 0 1 2 3
DeviceA(config-if-GigabitEthernet 0/2)# exit
# 检查ACL是否建设乐成。
DeviceA# show access-lists
ip access-list extended file
10 permit ip any host 192.168.10.4
ip access-list extended mail
10 permit ip any host 192.168.10.3
ip access-list extended salary
10 permit ip any host 192.168.10.2
# 检查类是否乐成关联ACL。
DeviceA# show class-map
Class Map salary
Match access-group salary
Class Map mail
Match access-group mail
Class Map file
Match access-group file
# 检查战略是否建设乐成,类与盛行为是否绑定乐成。
DeviceA# show policy-map
Policy Map toserver
Class mail
set cos 4
Class file
set cos 3
Class salary
set cos 2
# 检查战略是否乐成应用在接口GigabitEthernet 0/1上。
DeviceA# show mls qos interface gigabitethernet 0/1
Interface: GigabitEthernet 0/1
Ratelimit input:
Ratelimit output:
Attached input policy-map: toserver
Attached output policy-map:
Default trust: cos
Default cos: 0
# 检查战略是否乐成应用在接口GigabitEthernet 0/2上。
DeviceA# show mls qos interface gigabitethernet 0/2
Interface: GigabitEthernet 0/2
Ratelimit input:
Ratelimit output:
Attached input policy-map: toserver
Attached output policy-map:
Default trust: cos
Default cos: 0
# 检查战略是否乐成应用在接口GigabitEthernet 0/3上。
DeviceA# show mls qos interface gigabitethernet 0/3
Interface: GigabitEthernet 0/3
Ratelimit input:
Ratelimit output:
Attached input policy-map:
Attached output policy-map:
Default trust: none
Default cos: 7
# 检查接口的802.1p是否设置乐成,调理战略与轮转权重是否设置乐成。
DeviceA# show mls qos queueing
Cos-queue map:
cos qid
--- ---
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
wrr bandwidth weights:
qid weights
--- -------
1 1
2 1
3 1
4 2
5 6
6 1
7 1
8 0
drr bandwidth weights:
qid weights
--- -------
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
wfq bandwidth weights:
qid weights
--- -------
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
Device A的设置文件
hostname DeviceA
!
wrr-queue bandwidth 1 1 1 2 6 1 1 0
queueing wred
wrr-queue cos-map 2 0 1 2 3
!
class-map salary
match access-group salary
class-map mail
match access-group mail
class-map file
match access-group file
!
policy-map toserver
class salary
set cos 2
class mail
set cos 4
class file
set cos 3
!
interface GigabitEthernet 0/1
ip add 192.168.45.1 255.255.255.0
service-policy input toserver
mls qos trust cos
!
interface GigabitEthernet 0/2
ip add 192.168.46.1 255.255.255.0
wrr-queue random-detect min-threshold 2 10 20
service-policy input toserver
mls qos trust cos
!
interface GigabitEthernet 0/3
ip add 192.168.47.1 255.255.255.0
mls qos cos 7
!