Chinaunix首页 | 论坛 | 博客
  • 博客访问: 852885
  • 博文数量: 275
  • 博客积分: 3904
  • 博客等级: 中校
  • 技术积分: 4605
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-17 21:10
文章分类

全部博文(275)

文章存档

2014年(9)

2013年(124)

2012年(142)

分类:

2012-09-12 14:25:52

Part I. QoS总架构

1>分类
2>入口映射
3>出口映射(主要指cos/dscp->出口队列)
wrr-queue cos-map {queue-id} {cos1 cos2 ... cos8}         (c2950/c3550)
mls srr-queue out-put cos-map queue {queue-id} threshold {threshold-id} {cos1 cos2 ... cos8}    (c2970/c3560/c3750)
mls qos srr-queue output dscp-map queue {queue-id} threshold {threshold-id} {dscp1 dscp2 ... dscp8}    (c2970/c3560/c3750)
4>定义缓冲区大小
wrr-queue queue-limit {weight1} {weight2} {weight3} {weight4}     (c3550)
mls qos queue-set output {qset-id} buffers {allocation1} {allocation2} {allocation3} {allocation4}    (c2970/c3560/c3750)
5>每个队列根据WRED或尾丢弃阈值判断缓冲区的漫溢程度
wrr-queue threshold {queue-id} {threshold-percentage1} {threshold-percentage2}    (c3550)
wrr-queue random-detect max-threshold {queue-id} {threshold-percentage1} {threshold-percentage2}    (c3550)
mls qos queue-set output {qset-id} threshold {drop-threshold1} {drop-threshold2} {reserved-threshold} {maximum-threshold}    (c2970/c3560/c3750)
6>调度器根据的bandwidth权重值,决定每个队列分组的调度频率。
wrr-queue bandwidth {weight1} {weight2} {weight3} {weight4}     (c2950/c3550)
srr-queue bandwidth share {weight1} {weight2} {weight3} {weight4}    (c2970/c3560/c3750)
srr-queue bandwidth shape {weight1} {weight2} {weight3} {weight4}    (c2970/c3560/c3750)

Part II. 分类、标记

1>c2950默认启用QoS)
(1)两种分类方法:
<1>基于物理接口(不基于VLAN的分类)
<2>基于MQC/ACL
(2)默认物理接口是不可信任的。
(3)c2950不完全支持DSCP范围,只支持:0、8、10、16、18、24、26、32、34、40、46、48、56
2>c3550默认禁用QoS)
三种分类方法:
(1)每端口级别分类
(2)每端口/VLAN分类
(3)端口信任及MQC/ACL分类
3>c2970/c3560/c3750:
基本与c3550相同,只是不支持每端口/VLAN分类。
注:基于MQC/ACL的分类支持的ACL类型有:标准IP ACL、扩展IP ACL、第2层MAC ACL。
4>Configuration:
mls qos trust cos                        (c2950/c3550/c2970/c3560/c3750)
mls qos trust dscp                       (c3550/c2970/c3560/c3750)
mls qos trust ip-precedence              (c3550/c2970/c3560/c3750)
mls qos trust device-phone               (c2950/c3550/c2970/c3560/c3750)
Part III. 映射

1>映射汇总(由于c2950支持QoS功能较少,所以只标记c2950支持的映射,其它默认支持)
in-interface                      local                   out-interface
======================================================================================================
cos->dscp  (c2950)           dscp->cos (c2950)         dscp->dscp(dscp_mutation)
ip-precedence->dscp                                    cos->发送队列 (c2950)
trust cos/dscp (c2950)                                 dscp->markdown-dscp(policed_dscp)
trust ip-precedence                                    dscp->发送队列(exclude c3550)
trust device
dscp->丢弃阈值
=======================================================================================================
2>默认值
默认cos->dscp映射SCP=cos*8
默认dscp->cos映射:cos=INT(DSCP/8)
默认cos->发送队列映射:
队列       1               2              3             4
cos    (0,1)         (2,3)           (4,5)           (6,7)
3>映射配置
(1)cos->dscp/ip-precedence->dscp
mls qos map cos-dscp {DSCP-list}               (c2950/c3550/c2970/c3560/c3750)
mls qos map ip-prec-dscp {DSCP-list}           (c3550/c2970/c3560/c3750)

(2)turst cos/dscp/ip-precedence/device
mls qos trust cos                              (c2950/c3550/c2970/c3560/c3750)
mls qos trust dscp                             (c2950/c3550/c2970/c3560/c3750)
mls qos trust ip-precedence                    (c3550/c2970/c3560/c3750)
mls qos trust device cisco-phone               (c2950/c3550/c2970/c3560/c3750)

(3)dscp->丢弃阈值
c3550:
wrr-queue dscp-map {threshold-id} {dscp1 dscp2 ... dscp8}  (在流量入口配置,只有GigabitEthernet接口支持,快速以太网接口默认映射到阈值2)
wrr-queue threshold {queue-id} {threshold-percentage1} {threshold-percentage2}    (尾丢弃阈值,默认方式,在流量出口配置)
wrr-queue random-detect max-threshold {queue-id} {threshold-percentage1} {threshold-percentage2}   (WRED阈值,在流量出口配置)
c2970/c3560/3750:
mls qos srr-queue output dscp-map queue {queue-id} threshold {threshold-id} {dscp1 dscp2 ... dscp8}
mls qos queue-set output {qset-id} threshold {drop-threshold1} {drop-threshold2} {reserved-threshold} {maximum-threshold}

(4)dscp->cos
mls qos map dscp-cos {DSCP-list} to {cos}      (c2950/c3550/c2970/c3560/c3750)

(5)dscp->dscp(dscp_mutation,当接口连接到两个DiffServ域时使用)
mls qos map dscp-mutation {dscp-mutation-name} {in-dscp} to {out-dscp}
int gigabitethernet1/1/1
mls qos trust dscp
mls qos dscp-mutation {dscp-mutation-name}
注:
1>8个in-dscp映射到一个out-dscp。
2>每个吉比特以太网接口支持唯一一个DSCP转换映射,每16个快速以太网支持一个DSCP转换映射。
3>另一个DiffServ域边界交换机上需要配置一个补充策略进行反方向映射。

(6)cos->发送队列
wrr-queue cos-map {queue-id} {cos1 cos2 ... cos8}         (c2950/c3550)
mls qos srr-queue out-put cos-map queue {queue-id} threshold {threshold-id} {cos1 cos2 ... cos8}    (c2970/c3560/c3750)

(7)dscp->mark-down dscp(policed_dscp)
mls qos map policed-dscp {DSCP-list} to {mark-down-dscp}
注:
8个DSCP-list在超过定义的速率时被标记为mark-down-dscp值。

(8)dscp->发送队列
mls qos srr-queue output dscp-map queue {queue-id} threshold {threshold-id} {dscp1 dscp2 ... dscp8}    (c2970/c3560/c3750)

Part IV. 管制(监控)

1>可实现功能:
(1)信任
(2)标记
(3)速率监控

2>c2950(只支持入口的专用管制,不支持集合管制)
==================================================================================
QoS监控特性                              c2950 EI                c3550
基于端口监控                         所有接口都支持         所有物理接口都支持
集合基于端口的监控                       不支持             所有物理接口都支持
每端口的基于VLAN的监控                   不支持               仅仅在入口支持
监控速率参数                         只有速率和突发           只有速率和突发
每吉比特以太网端口的入口监控程序数         60                     128
每快速以太网端口的入口监控程序             6                       8
每吉比特以太网端口的出口监控程序数       不支持                    8
每快速以太网的出口监控程序数             不支持                    8
出口监控                                 不支持                  支持
==================================================================================
配置命令:
police {rate-bps} {burst-byte} [exceed-action {dscp|dscp {dscp-name}}]
突发大小计算公式:
=2**
注:
(1)此公式只针对TCP流量
(2)如果不知道RTT,可以根据估算的延迟取RTT值从1ms到1s不等。

3>c3550(支持入口及出口的专用、集合管制)
=================================================================================
QoS监控特性                               c2950 EI               c3550
基于端口监控                         所有接口都支持          所有物理接口都支持
集合基于端口的监控                       不支持              所有物理接口都支持
每端口的基于VLAN的监控                   不支持                仅仅在入口支持
监控速率参数                         只有速率和突发            只有速率和突发
每吉比特以太网端口的入口监控程序数         60                     128
每快速以太网端口的入口监控程序数           6                       8
每吉比特以太网端口的出口监控程序数       不支持                    8
每快速以太网的出口监控程序数             不支持                    8
出口监控                                 不支持                   支持
=================================================================================
配置命令:
(1)专用管制
police {rate-bps} {burst-byte} [exceed-action {drop|policed-dscp-transmit}]
(2)集合管制
mls qos aggregate-policer {policer-name} {rate-bps} {burst-byte} [exceed-action {transmit|drop|policed-dscp-transmit}]
(3)每端口/VLAN管制
class-map match-all VOICE
match ip dscp 46
class-map match-all VVLAN-VOICE
match vlan 110
match class-map VOICE
policy-map ss
class VVLAN-VOICE
priority 64000
突发大小计算公式:
=2**
注:
(1)此公式只针对TCP流量
(2)如果不知道RTT,可以根据估算的延迟取RTT值从1ms到1s不等。

4>c2970/c3560/c3750(除不支持每端口/每VLAN管制外,其它与c3550都相同)
每接口支持64个管制器,每个端口ASIC的管制器最大数目为256。


Part V. 排队与丢弃

1>c2950(支持四个队列,只支持尾丢弃)
(1)调度方式
<1>WRR(4q1t)
<2>严格优先级(1p3q1t),默认
(2)调度权重配置
wrr-queue bandwidth {weight1} {weight2} {weight3} {weight4}
注:
<1>当weight4配置为0时,指示该队列不参与WRR调度,调度器以严格优先级方式运行 ,并且将队列4做为加速队列(EF)。
<2>每队列近似带宽=(队列权重/总权重)*出口接口总带宽
<3>权重值为相对值,每个权值除以它们的公分母可对其进行化简。

2>c3550(支持四个队列,支持尾丢弃及WRED)
(1)调度方式
<1>吉比特以太网(4q2t,1p3q2t)
<2>快速以太网(4q1t,1p3q1t)
默认为公平队列
(2)调度权重配置
wrr-queue bandwidth {weight1} {weight2} {weight3} {weight4}
注:
<1>队列默认为公平队列,可以使用命令priority-queue out将队列4配置为优先级队列。
<2>如果严格优先级队列在接口上被启用,weight4值将被忽略,一般将其配置为1(而不是c2950的0),指示队列4不参与WRR调 度。
<3>每队列近似带宽=(队列权重/总权重)*出口接口总带宽
<4>权重值为相对值,每个权值除以它们的公分母可对其进行化简。
(3)发送队列大小(队列缓冲区大小)配置
默认每个队列分配25%的缓冲空间。
推荐为数据队列分配较大的缓冲区,为语音队列分配较小的缓冲区。
调整缓冲区大小需要权衡对网络延迟的影响。
<1>GigabitEthernet
c3550的每个吉比特以太网接口有4096个分组的缓冲区。
配置命令:
wrr-queue queue-limit {weight1} {weight2} {weight3} {weight4}
此处为队列4配置的weight4值必须显示的配置一个值,而不能像wrr-queue bandwidth命令中一样配置为1,因为优先级队列的数据也需要配置缓冲区大小。
<2>FastEthernet
c3550通过全局配置为快速以太网配置最小缓冲区层次,再在每个接口应用及其队列。
配置命令:
mls qos min-reserve {min-reserve-level} {min-reserve-buffersize}
interface f0/4
wrr-queue min-reserve {queue-id} {min-reserve-level}
注:
min-reserve-level:最小缓冲区层次,范围1-8。
min-reserve-buffersize:缓冲区大小,范围10-170个分组。
(4)丢弃
c3550支持在GigabitEthernet上配置2个拥塞阈值,在FastEthernet上配置1个拥塞阈值。
GigabitEthernet上需要在流量入口配置DSCP到拥塞阈值的映射,FastEthernet上默认映射到阈值2。
<1>尾丢弃
interface GigabitEthernet0/1
wrr-queue dscp-map {threshold-id} {dscp1 dscp2 ... dscp8}  (在流量入口配置,只有GigabitEthernet接口支持,快速以太网接口默认映射到阈值2)
interface GigabitEthernet0/2
wrr-queue threshold {queue-id} {threshold-percentage1} {threshold-percentage2}    (尾丢弃阈值,默认方式,在流量出口配置)
<2>WRED
interface GigabitEthernet0/1
wrr-queue dscp-map {threshold-id} {dscp1 dscp2 ... dscp8}  (在流量入口配置,只有GigabitEthernet接口支持,快速以太网接口默认映射到阈值2)
interface GigabitEthernet0/2
wrr-queue random-detect max-threshold {queue-id} {threshold-percentage1} {threshold-percentage2}   (WRED阈值,在流量出口配置)

3>c2970/c3560/c3750(支持入口/出口调度,4个出口队列,支持WTD(加权尾丢弃,支持3个阈值)和WRED)
(1)调度方式
<1>4q3t,默认
<2>1p3q3t
默认队列为公平队列,可以使用priority-queue out命令将队列1配置为优先级队列。
支持配置不同的队列集合qset-id,使接口继承相应集合的配置使用4q3t队列或1p3q3t队列。
(2)Cisco Stack Wise技术
使用专门的栈互连线缆和堆叠软件(栈互连是32Gbit/s),Cisco Stack Wise技术最多可将9台单独的c3750交换机结合成一个单个的逻辑单元,称为栈。栈作为一个单个的交换单元使用,由从每个成员交换机中选举出来的主交 换机进行管理。主交换机自动创建和升级所有的交换和可选的路由表。正在工作的栈可以接收新成员或删除旧成员,不会有服务中断。
(3)调度算法SRR(通用整形循环)
c2970/c3560/c3750主要使用SRR算法来服务非优先级队列,可以将SRR配置为两种模式运行:
<1>shaped:将队列限制到一个特定的带宽百分比,即使其它队列空闲,shaped队列的流量也不会超过其被分配的百分比,其权重绝对 值用于计算队列的可用带宽。
<2>sharing:将队列保证到一个特定的带宽百分比,如果其它队列空闲,sharing队列的流量可共享占用其它队列的带宽,其权重的 比值决定了出列队的频率,绝对值无意义。
入口/出口的队列调度全部由SRR实现,SRR确定了分组发送的频率。
<1>在入口队列中,SRR将分组发送到栈环,默认为其唯一支持的sharing模式。
<2>在出口队列中,SRR将分组发送到出口接口。
(4)调度权重配置
srr-queue bandwidth share {weight1} {weight2} {weight3} {weight4}
srr-queue bandwidth shape {weight1} {weight2} {weight3} {weight4}
注:
<1>shaped模式中权重绝对值用于计算队列的可用带宽,1/权重决定了每个队列的整形带宽。
<2>sharing模式中的权重比值决定了出列队的频率,绝对值无意义。
<3>shaped模式中权重为0,指示该队列以sharing模式运行 。
<4>shaped模式配置覆盖sharing模式。
<5>如果配置了严格优先队列,则覆盖任何模式下为其配置的权重,一般这时将队列1的权重配置为1。
(5)出口队列大小(缓冲区)配置
默认每个队列缓冲区大小为25%的接口缓冲区。
配置命令:
mls qos queue-set output {qset-id} buffers {allocation1} {allocation2} {allocation3} {allocation4}
注:
<1>所有已分配的缓冲总和为预留池(最小保证缓冲),剩余的缓冲都为公用池。
<2>缓冲区使用规程:分配于各队列的预留池--->公用池--->丢弃分组
(6)丢弃
为了确保缓冲区可用,需要配置丢弃阈值,在适当的时候丢弃一些分组,以避免缓冲溢出。
WTD(加权尾丢弃):
在帧映射到特定队列时,WTD将帧对应的cos或dscp值映射到不同的阈值,如果特定cos或dscp的分组缓冲占用超过了相应的阈值,则丢弃那个分 组。
每个队列最多支持3个WTD阈值,前两个为用户可配置(显式WTD阈值),最后一个为不可配置(隐式阈值,预设为100%)。
配置命令:
mls qos queue-set output {qset-id} threshold {drop-threshold1} {drop-threshold2} {reserved-threshold} {maximum-threshold}
注:
<1>drop-threshold:指定两个丢弃阈值。
<2>reserved-threshold:每个队列自己预留缓冲区大小,范围1%-100%,一般配置为100%。
<3>maximum-threshold:队列可以获得的比它预留的更多的缓冲数,范围1%-400%,一般配置为100%。
<4>一般只有队列2、4需要手工重新配置丢弃阈值,而不使用默认值,推荐配置为:
mls qos queue-set output 1 threshold 2 70 80 100 100
mls qos queue-set output 1 threshold 4 40 100 100 100
<5>配置cos/DSCP到队列阈值映射(dscp->队列映射会覆盖cos->队列的映射,但推荐尽力将它们的映射保持一 致):
mls qos srr-queue out-put cos-map queue {queue-id} threshold {threshold-id} {cos1 cos2 ... cos8}
mls qos srr-queue output dscp-map queue {queue-id} threshold {threshold-id} {dscp1 dscp2 ... dscp8}
mls qos queue-set output {qset-id} threshold {drop-threshold1} {drop-threshold2} {reserved-threshold} {maximum-threshold}

阅读(1773) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~