尊龙时凯

      工厂研学 丨 尊龙时凯网络数字化智能工厂“黑科技”大揭秘
      预约直播
      乐享业务保障服务 丨 守护医疗业务连续稳定
      预约直播
      产品
      < 返回主菜单
      产品中心
      产品
      解决方案
      < 返回主菜单
      解决方案中心
      行业
      合作伙伴
      返回主菜单
      选择区域/语言

      Qos是什么,如何配置?

      发布时间:2023-03-24
      点击量:5042

      QoS功能介绍

      QoSQuality of Service,服务质量)能够满足用户对不同应用不同服务质量的要求。根据用户的要求分配和调度资源,对不同的报文提供不同的服务质量。

      在传统的IP网络中,设备对所有的报文都采用等同对待方式,按照报文到达的时间先后,先入先出的排队策略(FIFO)处理,尽最大的努力(Best-Effort)将报文传送到目的地。当网络带宽充裕的时候,所有的报文都得到了较好的处理;而当网络发生拥塞的时候,所有的报文都有可能被丢弃。

      QoS针对某种类别的报文,可以为它赋予某个级别的传输优先级,标识它的相对重要性,并使用设备所提供的各种优先级转发策略、拥塞避免等机制为这些报文提供特殊的传输服务。对实时性强且重要的报文优先处理;对于实时性不强的普通报文,提供较低的处理优先级,网络拥塞时甚至丢弃。

      QoS增加了网络性能的可预知性,并能够有效地分配网络带宽,更加合理地利用网络资源。

      典型配置举例

      1  配置接口限速和优先级重标记

      1.    组网需求

      某学校为了满足正常的教学业务需要,要求满足以下四点需求:

      l  限制学校访问Internet的流量为100Mbps,丢弃超出限制的报文。

      l  限制宿舍楼的出口流量为50Mbps,丢弃超出限制的报文。

      l  限制实验楼发出DSCP优先级为7的报文的速率为20Mbps,将速率超过20M的此类报文丢弃。

      l  限制教学楼的出口流量为30Mbps,丢弃超出限制的报文。

      *     说明

      某学校通过Device AG0/24上联Internet,Device AG0/1、G0/2G0/3分别下联的教学楼(192.168.194.2~253/24)、实验楼(192.168.195.2~253/24)和宿舍楼(192.168.196.2~253/24)

       

      2.    组网图

      图1-6     接口限速和优先级重标记应用场景

       

      3.    配置要点

      (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

      4.    配置步骤

      (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

      5.    验证配置结果

      检查接口限速配置是否成功。

      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

      6.    配置文件

      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

      !

      2  配置队列调度和拥塞避免

      1.    组网需求

      配置优先级重标记和队列调度,实现下述需求:

      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/2G0/3;工资查询服务器(192.168.10.2/24)、邮件服务器(192.168.10.3/24)和文件服务器(192.168.10.4/24)连接在Device A的接口G0/23

       

      2.    组网图

      图1-7     队列调度和拥塞避免应用场景

       

      3.    配置要点

      (1)   Device A上创建访问各类服务器的ACL,并创建类匹配这些ACL

      (2)   创建策略,关联各个类,为访问各类服务器的报文重新指定802.1p。访问邮件服务器的报文重新指定802.1p4,访问文件服务器的报文重新指定802.1p3,访问工资查询服务器的报文重新制定802.1p2。并将其关联到研发部和市场部的入口上,配置接口信任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

      4.    配置步骤

      (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

      5.    验证配置结果

      检查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

      6.    配置文件

      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

      !

       

      返回顶部

      收起
      文档评价
      该资料是否解决了您的问题?
      您对当前页面的满意度如何?
      不咋滴
      非常好
      您满意的原因是(多选)?
      您不满意的原因是(多选)?
      您是否还有其他问题或建议?
      为了快速解决并回复您的问题,您可以留下联系方式
      邮箱
      手机号
      感谢您的反馈!
      请选择服务项目
      关闭咨询页
      售前咨询 售前咨询
      售前咨询
      售后服务 售后服务
      售后服务
      意见反馈 意见反馈
      意见反馈
      更多联系方式