本文档介绍如何预测Catalyst 9000系列交换机上流量队列的队列缓冲区分配。
Cisco 建议您了解以下主题:
本文档中的信息基于以下软件和硬件版本:
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。
本文档还可与以下硬件和软件版本一起使用:
注意:本文档不适用于9500X或9600X,因为它们使用不同的ASIC和QoS架构。
有关Catalyst 9000系列交换机上的QoS的技术概述,请参阅: Catalyst 9000 QoS和队列白皮书。
通常需要调整缓冲区分配,以响应特定流量类的不必要的输出丢弃。有关如何诊断和排除Catalyst 9000系列交换机上的输出丢弃的更多信息,请参阅以下文章:Catalyst 9000 交换机输出丢包故障排除
| 服务质量 |
服务质量 |
与网络设备进出流量的分类、标记、排队和调度相关的概念/功能组 |
| DSCP |
差分服务代码点 |
数据包的IP报头中包含的流量分类机制 |
| CoS |
服务类别 |
数据包的以太网帧报头中包含的流量分类机制 |
| ACE |
访问控制项 |
访问控制列表(ACL)中的单个规则或线路 |
| ACL |
访问控制列表 |
各种功能使用的一组访问控制条目(ACE)来匹配流量并采取措施 |
| ASIC |
专用集成电路 |
一种计算机芯片,设计用于高效率地执行特定的任务或任务集。 |
| UADP |
统一接入数据平面 |
Catalyst 9000系列交换机中使用的Cisco ASIC可执行许多网络数据包处理任务。 |
| PBC |
数据包缓冲区复杂性 |
Cisco UADP ASIC子系统,充当中央数据包缓冲区,用于处理、排队和调度数据包。 |
| AQM |
活动队列管理 |
Cisco UADP ASIC子系统,用于管理网络端口的流量队列和调度操作。 |
| DTS |
动态阈值和扩展 |
Cisco UADP ASIC技术,可动态调整和扩展端口缓冲区,以优化硬件利用率 |
作为一种概念,当交换或路由到端口的数据超过该端口将数据放置到线路上的能力时,缓冲区是用于吸收数据瞬时爆发的内存。端口具有固定的传输速率,可以从队列中传输和删除数据。从概念上讲,缓冲区只是数据存储或排队,直到数据从接口传输出去。
在Catalyst 9000系列交换机上,字缓冲区有两个用途。系统缓冲区作为一个整体也称为ASIC的数据包缓冲区复合体(PBC)。单词缓冲区也可以指代PBC的小单位。按队列为端口分配缓冲区。换句话说,从整个系统缓冲区中为端口队列分配了大量的小型独立缓冲区。
在基于Cisco UADP ASIC的平台上,一个缓冲区最多包含256字节的数据,缓冲区链接在一起表示大于256字节的帧。
每个队列的可用缓冲区的最终计算受以下因素的影响:
软缓冲区是端口之间共享的缓冲区。这些缓冲区称为软缓冲区,因为它们不能保证对端口有效。
系统有意过度分配软缓冲区。这允许任意一个端口在需要时使用大量缓冲区,但是随着更多端口需要缓冲区,所有端口和队列都会作为Cisco UADP ASIC DTS流程的一部分动态且公平地缩减。
总之,软缓冲区(在输出中称为softmax)是一个机会最大值。如果整个系统缓冲区中可用的缓冲区数量,则端口仅使用完整的softmax。随着其他端口和队列中的缓冲区需求增加,该端口可用的最大缓冲区会减少。
硬缓冲区是为端口显式保留的缓冲区,不受DTS进程的影响。由于硬缓冲区是保证的缓冲区,因此分配给端口的总硬缓冲区总数永远不会超过专用于这些硬缓冲区的PBC段。
控制软缓冲区的活动规模的机制称为DTS(动态阈值和规模),如Catalyst 9000系列QoS白皮书中所述。
当您配置系统时,专用于为硬缓冲区和软缓冲区排队的PBC段的大小会动态变化,并且在此输出中可显示为AQM GlobalSoftLimit和GlobalHardLimit:
C9500#show platform hardware fed active qos queue stats interface twe1/0/1
----------------------------------------------------------------------------------------------
AQM Global counters
GlobalHardLimit: 18072 | GlobalHardBufCount: 0
GlobalSoftLimit: 37224 | GlobalSoftBufCount: 0
C9500#show platform hardware fed active qos queue config interface tw1/0/1 Asic:0 Core:1 DATA Port:20 GPN:101 LinkSpeed:0x12 AFD:Disabled FlatAFD:Disabled QoSMap:0 HW Queues: 160 - 167 DrainFast:Disabled PortSoftStart:2 - 4320 BufferSharing:Disabled DTS Hardmax Softmax PortSMin GlblSMin PortStEnd QEnable ----- -------- -------- -------- -------- --------- ------- 0 1 2 480 3 1920 16 960 0 0 4 5760 En <--- default configuration has a mix of hard buffer and soft buffer in queue 0 1 1 0 0 4 2880 16 1440 8 720 4 5760 En <--- default configuration has two queues so some buffers are seen in queue 1
C9500(config)#policy-map test
C9500(config-pmap)#class class-default
C9500(config-pmap-c)#priority level 1 <--- Priority level 1 queue configuration on first queue, which is queue 0 in the next output
C9500(config-pmap-c)#exit
C9500(config-pmap)#exit
C9500(config)#int tw1/0/1
C9500(config-if)#service-policy output test
C9500(config-if)#end
C9500#show platform hardware fed active qos queue config interface twe1/0/1
Asic:0 Core:1 DATA Port:20 GPN:101 LinkSpeed:0x12
AFD:Disabled FlatAFD:Disabled QoSMap:0 HW Queues: 160 - 167
DrainFast:Disabled PortSoftStart:4 - 1800 BufferSharing:Disabled
DTS Hardmax Softmax PortSMin GlblSMin PortStEnd QEnable
----- -------- -------- -------- -------- --------- -------
0 1 4 1200 7 1200 0 0 0 0 3 2400 En <--- Hardmax increased to 1200 from 480 in queue 0, softmax reduced to 1200 from 1920
1 1 0 0 0 0 0 0 0 0 3 2400 En <--- queue 1 now no longer has any values, as no second queue is configured
C9500#show platform hardware fed active qos queue stats interface twe1/0/1
----------------------------------------------------------------------------------------------
AQM Global counters
GlobalHardLimit: 18792 | GlobalHardBufCount: 0 <--- GlobalHardLimit increased to 18792 from 18072, or by 720
GlobalSoftLimit: 36504 | GlobalSoftBufCount: 0 <--- GlobalSoftLimit decreased from 37224 to 36504, or by 720
注意:请注意GlobalHardLimit的增加以及GlobalSoftLimit的比例减少。
此外,当您配置优先级1时,该队列的softmax被静态设置为完全等于hardmax。您只能修改优先级级别1队列的硬缓冲区。
GlobalHardLimit和GlobalSoftLimit中的更改等于720。这也等于配置后hardmax中的更改。
本文档中的场景说明了如何计算和预测多个策略映射配置中的softmax和hardmax分配。
队列最终缓冲区值部分是首先跨队列分配的基本值的函数。 然后,在软缓冲情况下,此值会倍增。
乘法因子与其他隐式行为结合,使得使用给定配置确定给定队列的最终值成为挑战。
阐明结果队列缓冲区分配的第一步是确定基本缓冲区值。
为此,请使用优先级队列,优先级队列接收硬缓冲区与队列数量或配置的队列缓冲区比率成正比。
使用特定配置,您可以明确派生分配给给定端口速度的基本缓冲区数量。
配置所有缓冲区并将其分配给单个非乘法队列(优先级1队列)
在本示例中,class-default类用于匹配所有流量,因为未配置其他类。
Switch(config)#policy-map test1
Switch(config-pmap)#class class-default
Switch(config-pmap-c)#priority level 1 <--- Assign hard buffer to the port, which is not affected by multipliers
Switch(config-pmap-c)#queue-buffers ratio 100 <--- Assign all buffers to this queue only
上例中的配置采取以下操作:
queue-buffers ratio 100将100/100或100%的可用基本缓冲区分配给此队列/类。
在具有多个类的policy-map中,不能将100%的缓冲区分配给单个类。您需要将1/100或至少1%的百分比分配给任何班级。
在只有一个类的策略中,您只有一个类,您可以为其分配所有缓冲区。
如前所述,优先级队列根据配置的队列缓冲区比率,获得等于其基本缓冲区分布的硬缓冲区。硬缓冲不受任何乘数限制。
在标题为Hardmax的列下的输出中观察到硬缓冲区。
现在,您拥有单个流量类,其缓冲区不受任何乘数限制。这样,您可以明确推导此端口速度的基本缓冲区分配(并且只有此平台上的此端口速度不同,其他端口速度不同),因为基本缓冲区和hardmax是相等的。
基本缓冲区= ?
队列比率1 = 100/100 = 1
此队列的Hardmax =基本缓冲区x队列比率1
X = Y x 1
X / 1 = Y
X = Y
X = Y =硬最大=基本缓冲区= 1200(参见示例2)。
在本示例中,policy-map test1作为输出服务策略应用到接口
9500H(config)#int tw1/0/3
9500H(config-if)#service-policy output test1 <--- service policy that assigns all buffer to the first queue, as a priority queue 1
9500H#show platform hardware fed active qos queue config interface tw1/0/3 Asic:0 Core:1 DATA Port:22 GPN:103 LinkSpeed:0x12 AFD:Disabled FlatAFD:Disabled QoSMap:0 HW Queues: 176 - 183 DrainFast:Disabled PortSoftStart:4 - 1800 BufferSharing:Disabled DTS Hardmax Softmax PortSMin GlblSMin PortStEnd QEnable ----- -------- -------- -------- -------- --------- ------- 0 1 4 1200 7 1200 0 0 0 0 3 2400 En <--- hardmax 1200 - the maximum amount of buffer this port can use without multiplication 1 1 0 0 0 0 0 0 0 0 3 2400 En 2 1 0 0 0 0 0 0 0 0 3 2400 En 3 1 0 0 0 0 0 0 0 0 3 2400 En 4 1 0 0 0 0 0 0 0 0 3 2400 En 5 1 0 0 0 0 0 0 0 0 3 2400 En 6 1 0 0 0 0 0 0 0 0 3 2400 En 7 1 0 0 0 0 0 0 0 0 3 2400 En
<snip>
如图所示,分配了100%缓冲区的此优先级队列的硬件最大值为1200。
由于hardmax是一个完全未乘积/未缩放的值,并且为此队列配置了100%的缓冲区,因此此特定交换机型号、软件版本和特定端口速度的基本缓冲区分配为1200。
同一交换机上的其他端口速度,以及相同端口速度的其他交换机型号接收不同的基本缓冲区分配。此基数分配不可由用户配置,必须通过观察推导。
本文档中的其他方案都使用相同的交换机、软件和端口速度。因此,它们都假设基本分配为1200,用于计算以确定最终的缓冲区分配。
注意:请注意,上例中的softmax也为1200。
根据设计,优先级为1的队列的softmax完全等于其hardmax。这是预定的,用户不可配置。
此外,此特定的softmax分配不受后面所示的softmax乘数的影响。只有优先级级别1的队列具有此行为,适用于softmax。
在此场景中,添加了一个额外的队列。此队列不使用优先级1,因此softmax使用乘数进行扩展。
一个乘数是用户配置的,另一个是隐藏/不可配置的乘数。
将这些乘数与为此端口派生的基本缓冲区结合使用,在本例中为1200(根据场景1)。
算法:
当前队列比率=要预测的队列/类的队列缓冲区比率
隐藏乘数= 400%
用户乘数=您在qos queue-softmax-multiplier <percent>中配置的百分比值。默认值为 100%
Softmax =(基本缓冲区x(当前队列比率/100))x隐藏乘数x(用户乘数/100)
9500H(config)#policy-map test2
9500H(config-pmap)# class class1
9500H(config-pmap-c)# priority level 1
9500H(config-pmap-c)# queue-buffers ratio 50 <-- class 1 / first queue gets 50% of base buffer
9500H(config-pmap-c)# class class-default
9500H(config-pmap-c)# bandwidth remaining percent 100 <-- required configuration due to priority queue, can be ignored for this example
9500H(config-pmap-c)# queue-buffers ratio 50 <-- class 2 / first queue gets 50% of base buffer
值摘要:
确定Class1缓冲区分配:
由于class1是优先级队列,因此它接收hardmax(硬缓冲区),并且是softmax的一个特殊情况,不受乘数的影响。
Class1 hardmax =(基本缓冲区x当前队列比率(class1)/ 100)
Class1 hardmax = 1200 x(50/100)= 600 — 由于优先级队列的特殊情况,请停止所有计算,将结果分配给hardmax。Softmax等于Hardmax作为优先级1的规则。
确定class-default缓冲区分配:
Class class-default =(基本缓冲区x(当前队列比率(class-default / 100))x隐藏乘数x(用户乘数/ 100)
Class class-default = [
[基本缓冲区] 1200 x [当前队列比率](50/100)= 600
[上一个结果] 600 x [隐藏乘数] 4 x [用户乘数](100/100)= 2400
]
9500H(config)#int tw1/0/3
9500H(config-if)#service-policy output test2 <-- apply the policy
9500H#show platform hardware fed active qos queue config interface tw1/0/3 Asic:0 Core:1 DATA Port:22 GPN:103 LinkSpeed:0x12 AFD:Disabled FlatAFD:Disabled QoSMap:0 HW Queues: 176 - 183 DrainFast:Disabled PortSoftStart:5 - 3600 BufferSharing:Disabled DTS Hardmax Softmax PortSMin GlblSMin PortStEnd QEnable ----- -------- -------- -------- -------- --------- ------- 0 1 5 600 9 600 0 0 0 0 1 4800 En <-- Hardmax is 600 as predicted, Softmax is set equal to Hardmax due to priority level 1 1 1 0 0 10 2400 16 1200 8 600 1 4800 En <-- Softmax is 2400 as predicted
<snip>
最终结果:Q0 - Hardmax:600 Softmax:600. Q1 - Softmax:2400
此方案开始与方案2相同,只不过现在您配置qos queue-softmax-multiplier 1200。
这会将当前配置中的softmax缓冲区乘以1200%,即乘以12。
值摘要:
确定Class1缓冲区分配:
由于class1是优先级队列,因此它接收hardmax(硬缓冲区),并且是softmax的一个特殊情况,不受乘数的影响。
Class1 hardmax =(基本缓冲区x当前队列比率(class1)/ 100)
Class1 hardmax = 1200 x(50/100)= 600 — 由于优先级队列的特殊情况,请停止所有计算,将结果分配给hardmax。Softmax等于Hardmax作为优先级1的规则。
确定class-default缓冲区分配:
Class class-default =(基本缓冲区x(当前队列比率(class-default / 100))x隐藏乘数x(用户乘数/ 100)
Class class-default =[
[基本缓冲区] 1200 x [当前队列比率](50/100)= 600
[上一个结果] 600 x [隐藏乘数] 4 x [用户多重生成器](1200/100)= 28800
]
配置qos queue-softmax-multiplier 1200并观察softmax的变化(softmax是该队列的最大缓冲区值,根据当前的整体缓冲区使用情况动态缩放):
9500H(config)#qos queue-softmax-multiplier 1200
9500H#show platform hardware fed active qos queue config interface tw1/0/3
Asic:0 Core:1 DATA Port:22 GPN:103 LinkSpeed:0x12 AFD:Disabled FlatAFD:Disabled QoSMap:0 HW Queues: 176 - 183 DrainFast:Disabled PortSoftStart:3 - 31500 BufferSharing:Disabled DTS Hardmax Softmax PortSMin GlblSMin PortStEnd QEnable ----- -------- -------- -------- -------- --------- ------- 0 1 5 600 5 600 0 0 0 0 6 42000 En <-- Queue 0 does not change as its configured with priority level 1 1 1 0 0 6 28800 1 900 1 900 6 42000 En <-- Softmax increases by 12x to 28800 from 1200 due to queue-softmax-multiplier 1200
<snip>
最终结果:Q1 — 硬件最大值:600,Softmax:600. Q2 - Softmax:28800
在此方案中,配置了五个队列,但只有四个队列明确定义了queue-buffers ratio。分配给这些队列的缓冲区与前面的示例相同。
未配置的队列接收所有已配置的队列缓冲区总和与100之间的差值。
显式配置的比值之和=(Q0缓冲比率)+(Q1缓冲比率)。..(最终缓冲比率) — Catalyst 9000系列交换机支持最多8个队列,因此您最多可以添加8个比率
隐式比率剩余=(100 — 显式配置的比率之和)。
Implicit Ratio Leftover是分配给未配置队列缓冲区比率的队列。
此方案使用的策略映射:
9500H(config)#policy-map test3
9500H(config-pmap)# class class1
9500H(config-pmap-c)# priority level 1
9500H(config-pmap-c)# queue-buffers ratio 20
9500H(config-pmap-c)# class class2
9500H(config-pmap-c)# bandwidth remaining percent 10 <-- no queue-buffers ratio statement for this class
9500H(config-pmap-c)# class class3
9500H(config-pmap-c)# bandwidth remaining percent 10
9500H(config-pmap-c)# queue-buffers ratio 10 <-- rest of queues have an explicit queue-buffers ratio
9500H(config-pmap-c)# class class4
9500H(config-pmap-c)# bandwidth remaining percent 10
9500H(config-pmap-c)# queue-buffers ratio 10
9500H(config-pmap-c)# class class-default
9500H(config-pmap-c)# bandwidth remaining percent 70
9500H(config-pmap-c)# queue-buffers ratio 40
值摘要:
计算剩余的队列缓冲区比率:
隐式比率剩余=(100 — 显式配置的比率之和)。
100 -(20)-(10)-(10)-(50)= 20
当前队列比率(class2)= 20
计算最终队列缓冲区分配
Class1 = [Base Buffer] 1200 x [Current Queue Ratio(class1)](20/100)= 240 — 优先级队列,无进一步计算
Class2 = [
[基本缓冲区] 1200 x [当前队列比率(class2)](10/100)= 240 — 此队列的基本缓冲区分配,但必须将其乘以才能获得非优先级队列的softmax
[此队列的基本缓冲区分配] 120 x [隐藏乘数] 4 x [用户乘数](100/100)= 960
]
对剩余队列重复:
3类= [
1200 x(10/100)= 120
120 x 4 x(100/100)= 480
]
4类= [
1200 x(10/100)= 120
120 x 4 x(100/100)= 480
]
Class class-default = [
1200 x(40/100)= 480
600 x 4 x(100/100)= 1920
]
与预测比较应用的test3策略映射的结果:
9500H(config)#int tw1/0/3
9500H(config-if)#service-policy output test3
9500H#show platform hardware fed active qos queue config interface tw1/0/3 Asic:0 Core:1 DATA Port:22 GPN:103 LinkSpeed:0x12 AFD:Disabled FlatAFD:Disabled QoSMap:0 HW Queues: 176 - 183 DrainFast:Disabled PortSoftStart:4 - 2880 BufferSharing:Disabled DTS Hardmax Softmax PortSMin GlblSMin PortStEnd QEnable ----- -------- -------- -------- -------- --------- ------- 0 1 5 240 8 240 0 0 0 0 6 3840 En 1 1 0 0 9 960 16 480 8 240 6 3840 En <-- queue without queue buffers ratio configured receives any leftover ratio, as predicted 2 1 0 0 11 480 16 240 8 120 6 3840 En 3 1 0 0 11 480 16 240 8 120 6 3840 En 4 1 0 0 4 1920 16 960 8 480 6 3840 En
<snip>
最终结果:Q0 - Hardmax:240,Softmax:240. Q1 - Softmax:960,Q2 - Softmax:480,Q3 - Softmax:480,Q4 - Softmax:480
在此方案中,配置了五个队列,并且没有配置两个队列缓冲区比率。
要确定缓冲区分配,方案2中的相同逻辑会继续,但您还必须将隐式剩余比率除以没有队列缓冲区比率的隐式队列/队列总数
此方案使用的策略映射:
9500H(config)#policy-map test4
9500H(config-pmap)# class class1
9500H(config-pmap-c)# priority level 1
9500H(config-pmap-c)# queue-buffers ratio 20
9500H(config-pmap-c)# class class2
9500H(config-pmap-c)# bandwidth remaining percent 10 <-- no queue-buffers ratio statement for this class
9500H(config-pmap-c)# class class3
9500H(config-pmap-c)# bandwidth remaining percent 10 <-- no queue-buffers ratio statement for this class
9500H(config-pmap-c)# class class4
9500H(config-pmap-c)# bandwidth remaining percent 10
9500H(config-pmap-c)# queue-buffers ratio 10
9500H(config-pmap-c)# class class-default
9500H(config-pmap-c)# bandwidth remaining percent 70
9500H(config-pmap-c)# queue-buffers ratio 40
值摘要:
计算剩余的队列缓冲区比率:
隐式比率剩余=(100 — 显式配置的比率之和)。
隐式队列数= 2(类2和类3未定义队列缓冲比)
配置比率之和= 20+40+10 = 7
隐式剩余比率= 100 - 70 = 30
隐式队列比率分配= [隐式比率剩余] 30 / [隐式队列数] 2 = 15
计算最终队列缓冲区分配:
Class1 =
[基本缓冲区] 1200 x [当前队列比率(class1)](20/100)= 240 — 优先级队列,无进一步计算
2类=
[基本缓冲区] 1200 x [隐式队列比率分配](15/100)= 180 — 由于类2没有定义的queue-buffers ratio,因此显式队列中的剩余队列缓冲区比率在隐式队列之间共享。
[此队列的基本缓冲区分配] 180 x [隐藏乘数] 4 x [用户乘数](100/100)= 720
对剩余队列重复:
3类= [
1200 x(15/100)= 180
120 x 4 x(100/100)= 720
]
4类= [
1200 x(10/100)= 120
120 x 4 x(100/100)= 480
]
Class class-default = [
1200 x(40/100)= 480
600 x 4 x(100/100)= 1920
]
将test4策略映射应用于预测的结果:
9500H(config)#interface tw1/0/3
9500H(config-if)#service-policy output test4
9500H#show platform hardware fed active qos queue config interface tw1/0/3 Asic:0 Core:1 DATA Port:22 GPN:103 LinkSpeed:0x12 AFD:Disabled FlatAFD:Disabled QoSMap:0 HW Queues: 176 - 183 DrainFast:Disabled PortSoftStart:4 - 2880 BufferSharing:Disabled DTS Hardmax Softmax PortSMin GlblSMin PortStEnd QEnable ----- -------- -------- -------- -------- --------- ------- 0 1 5 240 8 240 0 0 0 0 6 3840 En 1 1 0 0 9 720 16 360 8 180 6 3840 En <-- queue 1 and 2 were not configured with queue-buffers ratio 2 1 0 0 9 720 16 360 8 180 6 3840 En <-- queue 1 and 2 get an equal share of leftover buffer ratio 3 1 0 0 11 480 16 240 8 120 6 3840 En 4 1 0 0 4 1920 16 960 8 480 6 3840 En
<snip>
注意:如果隐式队列比率分配的结果不是整数,则不可能存在相等的共享。结果会在策略映射中提前舍入队列,在以后的队列中舍入队列。 分配的队列缓冲区比率的最终总和仍为100,但隐式队列并不总是获得相等的分配,因为刚才描述的整数结果要求不同。
在此方案中,配置了五个队列,所有队列均具有队列缓冲区比率。类中的队列缓冲区比率总和小于100。
在这种情况下,未分配的缓冲区比率平均分布在各类中。
与上一个场景类似,如果剩余队列缓冲区比率的除数结果不是整数,则对每个队列的最终分配将向上或向下舍入并添加到配置的队列缓冲区比率。
此方案使用的策略映射:
9500H(config)#policy-map test5
9500H(config-pmap)# class class1
9500H(config-pmap-c)# priority level 1
9500H(config-pmap-c)# queue-buffers ratio 10
9500H(config-pmap-c)# class class2
9500H(config-pmap-c)# bandwidth remaining percent 10
9500H(config-pmap-c)# queue-buffers ratio 10
9500H(config-pmap-c)# class class3
9500H(config-pmap-c)# bandwidth remaining percent 10
9500H(config-pmap-c)# queue-buffers ratio 10
9500H(config-pmap-c)# class class4
9500H(config-pmap-c)# bandwidth remaining percent 10
9500H(config-pmap-c)# queue-buffers ratio 10
9500H(config-pmap-c)# class class-default
9500H(config-pmap-c)# bandwidth remaining percent 70
9500H(config-pmap-c)# queue-buffers ratio 12
值摘要:
配置比率的总和= 10 + 10 + 10 + 10 + 12 = 52
缓冲区剩余比例= 100% - 52% = 48%
[缓冲区剩余比率] 48% / [队列总数] 5 = 9.6% added per queue — 这不是整数,因此其对队列的最终应用必须按队列向上或向下舍入
要获取系统使用的最终队列缓冲区比率值,必须在已配置的队列缓冲区比率中添加9或10。
策略映射中较高的类接收向上舍入值10。策略映射中较低的类接收向下舍入值9。
计算最终队列缓冲区分配
缓冲区剩余数量= 48
Class1 = [基本缓冲区] x([当前队列比率(class1)+共享缓冲区比率剩余值的舍入值)]
Class1 = 1200 x((10% + 10%)/100)= 240 — 优先级队列,无进一步计算
缓冲区比率剩余=(48 - 10)= 38
Class2 = [基本缓冲区] x([当前队列比率(class2)+共享缓冲区比率剩余值的舍入值)]
Class2 = 1200 x((10% + 10%)/100)= 240 — 将此值乘以用户和系统乘数,因为这不是优先级队列
Class2 = [此队列的基本缓冲区分配] 240 x [隐藏乘数] 4 x [用户乘数](100/100)= 960 — 此队列的softmax结果
缓冲区比率剩余=(38 - 10)- 28
对剩余队列重复:
3类= [
1200 x((10+10)/100)= 240
120 x 4 x(100/100)= 960
]
缓冲区比率剩余=(28 - 10)= 18
4类= [
1200 x((10+9)/100)= 240
120 x 4 x(100/100)= 912
]
缓冲区比率剩余= 9
Class class-default= [
1200 x((12+9)/100)= 252
120 x 4 x(100/100)= 1008
]
缓冲区比率剩余= 0
将test5策略映射应用于预测的结果:
9500H#show platform hardware fed active qos queue config interface tw1/0/3 Asic:0 Core:1 DATA Port:22 GPN:103 LinkSpeed:0x12 AFD:Disabled FlatAFD:Disabled QoSMap:0 HW Queues: 176 - 183 DrainFast:Disabled PortSoftStart:5 - 1512 BufferSharing:Disabled DTS Hardmax Softmax PortSMin GlblSMin PortStEnd QEnable ----- -------- -------- -------- -------- --------- ------- 0 1 5 240 9 240 0 0 0 0 6 2016 En 1 1 0 0 10 960 16 480 8 240 6 2016 En 2 1 0 0 10 960 16 480 8 240 6 2016 En 3 1 0 0 11 912 16 456 8 228 6 2016 En 4 1 0 0 12 1008 16 504 8 252 6 2016 En
<snip>
在此方案中,策略映射中的类配置有优先级2。
与priority level 1不同(其中softmax不受乘数影响,并设置为hardmax),priority level 2允许将softmax相乘,同时它还具有硬缓冲区(hardmax)分配。
此方案使用的策略映射:
9500H(config)#policy-map test6
9500H(config-pmap)#class class1
9500H(config-pmap-c)#priority level 1
9500H(config-pmap-c)#queue-buffers ratio 50 <-- 50 / 50 split between both queues
9500H(config-pmap-c)#class class-default
9500H(config-pmap-c)#priority level 2 <-- Priority level 2 in use now
9500H(config-pmap-c)#queue-buffers ratio 50 <-- 50 / 50 split between both queues
应用test6策略映射的结果:
9500H#show platform hardware fed active qos queue config interface tw1/0/3 Asic:0 Core:1 DATA Port:22 GPN:103 LinkSpeed:0x12 AFD:Disabled FlatAFD:Disabled QoSMap:0 HW Queues: 176 - 183 DrainFast:Disabled PortSoftStart:5 - 3600 BufferSharing:Disabled DTS Hardmax Softmax PortSMin GlblSMin PortStEnd QEnable ----- -------- -------- -------- -------- --------- ------- 0 1 5 600 9 600 0 0 0 0 1 4800 En <-- Softmax is equal to hardmax 1 1 5 600 10 2400 16 1200 0 0 1 4800 En <-- Softmax is multiplied by Hidden Multiplier (400%) and User Multiplier (100% default)r
<snip>
在前面显示的输出中,第二个队列softmax比第一个队列多4个softmax。这是因为优先级1 softmax不受系统softmax乘数的影响,但优先级别2会受影响。
如果配置用户softmax乘数,则仅会影响优先级2队列:
9500H(config)#qos queue-softmax-multiplier 200
9500H#show platform hardware fed active qos queue config interface tw1/0/3
Asic:0 Core:1 DATA Port:22 GPN:103 LinkSpeed:0x12 AFD:Disabled FlatAFD:Disabled QoSMap:0 HW Queues: 176 - 183 DrainFast:Disabled PortSoftStart:5 - 7200 BufferSharing:Disabled DTS Hardmax Softmax PortSMin GlblSMin PortStEnd QEnable ----- -------- -------- -------- -------- --------- ------- 0 1 5 600 9 600 0 0 0 0 5 9600 En <--- priority-level 1 queue unaffected by softmax multiplier 1 1 5 600 10 4800 8 1200 0 0 5 9600 En <--- User multiplier increased to 200%, softmax for this queue doubles
<snip>
queue-limit配置会影响最终队列缓冲区分配
影响队列缓冲区分配的主要机制是在MQC策略映射中按队列添加的队列缓冲区比率配置。
但是,队列缓冲区分配受其他配置的影响。
Queue-limit定义丢弃特定流量类(通过加权尾部丢弃,WTD)时所依据的阈值,本文档未对此进行介绍。
在特定情况下,queue-limit会修改软缓冲区队列的系统隐藏乘数 — 这会影响应用队列限制的队列的整体软缓冲区分配。
首先,要知道,每个类最多可以配置3次队列限制。这可以为每个DSCP或CoS的WTD定义最多3个阈值。
在下一个输出中,只定义了两个阈值。
将两个队列限制应用于策略映射:
9500H(config)#policy-map test7
9500H(config-pmap)# class class1
9500H(config-pmap-c)# priority level 1
9500H(config-pmap-c)# queue-buffers ratio 50
9500H(config-pmap-c)# class class-default
9500H(config-pmap-c)# priority level 2
9500H(config-pmap-c)# queue-buffers ratio 50
9500H(config-pmap-c)# queue-limit dscp af11 percent 10 <-- Tells system to drop af11 traffic at 10% queue utilization
9500H(config-pmap-c)# queue-limit dscp af12 percent 50 <-- Tells system to drop af12 traffic at 50% queue utilization
观察缓冲区分配的结果:
9500H(config-pmap-c)#interface tw1/0/3
9500H(config-if)#service-policy output test7
9500H#show platform hardware fed active qos queue config interface tw1/0/3 Asic:0 Core:1 DATA Port:22 GPN:103 LinkSpeed:0x12 AFD:Disabled FlatAFD:Disabled QoSMap:0 HW Queues: 176 - 183 DrainFast:Disabled PortSoftStart:5 - 7200 BufferSharing:Disabled DTS Hardmax Softmax PortSMin GlblSMin PortStEnd QEnable ----- -------- -------- -------- -------- --------- ------- 0 1 5 600 9 600 0 0 0 0 5 9600 En 1 1 5 600 10 4800 8 1200 0 0 5 9600 En <--- final result for queue that contains 2 queue-limit statements is 4800
<snip>
在下一个示例中,第三个queue-limit配置被添加到class class-default中。
观察缓冲区分配的结果:
9500H(config)#policy-map test7
9500H(config-pmap)#class class-default
9500H(config-pmap-c)#queue-limit dscp af13 percent 100
9500H#show platform hardware fed active qos queue config interface tw1/0/3
Asic:0 Core:1 DATA Port:22 GPN:103 LinkSpeed:0x12 AFD:Disabled FlatAFD:Disabled QoSMap:0 HW Queues: 176 - 183 DrainFast:Disabled PortSoftStart:5 - 1800 BufferSharing:Disabled DTS Hardmax Softmax PortSMin GlblSMin PortStEnd QEnable ----- -------- -------- -------- -------- --------- ------- 0 1 5 600 9 600 0 0 0 0 5 2400 En 1 1 5 600 10 1200 32 1200 0 0 5 2400 En <-- Softmax reduces by 400% from previous example
<snip>
当第三个queue-limit配置添加到队列时,系统会为该队列禁用400%的系统隐藏软缓冲区乘数。但是,该队列仍遵循用户配置的qos queue-softmax-multiplier <percent>。
| 版本 | 发布日期 | 备注 |
|---|---|---|
3.0 |
24-May-2024
|
重新认证 |
1.0 |
02-Dec-2022
|
初始版本 |