本文說明如何預測Catalyst 9000系列交換器上流量佇列的佇列緩衝區分配。
思科建議您瞭解以下主題:
本文中的資訊係根據以下軟體和硬體版本:
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
本文件也適用於以下硬體和軟體版本:
附註:本檔案不適用於9500X或9600X,因為這些交換器使用不同的ASIC和QoS架構。
有關Catalyst 9000系列交換機上的QoS的技術概述,請參閱: Catalyst 9000 QoS和隊列白皮書。
通常需要調整緩衝區分配,以響應特定流量類的不希望的輸出丟棄。有關如何診斷和疑難排解Catalyst 9000系列交換器上輸出捨棄的詳細資訊,請參閱以下文章:Catalyst 9000交換器上的輸出捨棄疑難排解
| Qos |
服務品質 |
與網路裝置進出流量分類、標籤、排隊和排程有關的概念/相關功能組 |
| 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,是一個機會性最大值。如果整個系統緩衝區中有足夠的緩衝區,則埠僅使用full 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%的可用基本緩衝區分配給此隊列/類。
在具有多個class的policy-map中,不能將100%的緩衝區分配給單個類。您需要為任何班級分配1/100或至少1%。
在只有一個類的策略中,您只有一個類,您可以將所有緩衝區分配給它。
如前所述,根據配置的隊列緩衝區比率,優先順序隊列會獲得等於其基本緩衝區分佈的硬緩衝區。硬緩衝區不受任何乘數限制。
在標題為Hardmax的列下的輸出中觀察到硬緩衝區。
現在,您擁有一個具有不受任何乘數限制的緩衝區的單個流量類。這樣,您可以顯式推導此埠速度的基本緩衝區分配(只有此平台上的此埠速度有所不同),因為基本緩衝區和hardmax是相等的。
基本緩衝區= ?
隊列比率1 = 100/100 = 1
此隊列的硬體最大值=基本緩衝區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>
如圖所示,此優先順序隊列的hardmax為1200(分配了100%的緩衝區)。
由於hardmax是一個完全未乘/未縮放的值,並且為此隊列配置了100%的緩衝區,因此此特定交換機型號、軟體版本和特定埠速度的基本緩衝區分配是1200。
同一交換機上的其他埠速度以及相同埠速度的其他交換機型號接收到不同的基本緩衝區分配。此基數分配不可由使用者配置,必須通過觀察匯出。
本文檔中的其他方案開始時,都使用相同的交換機、軟體和埠速度。因此,它們都假設基本分配為1200,用於計算以確定最終的緩衝區分配。
附註:請注意,上例中的softmax也為1200。
根據設計,優先順序級別1隊列的softmax完全等於其hardmax。這是預定的,使用者不可配置。
此外,此特定的softmax分配情況不受後面所示的softmax乘數的影響。只有優先順序級別1隊列具有softmax的此行為,這是預期的。
在此案例中,會新增一個佇列。此隊列不使用優先順序級別1,因此softmax會使用乘數進行擴展。
一個乘數是使用者配置的,另一個是隱藏/不可配置的乘數。
將這些乘數與為此連線埠派生的基緩衝區合併,在本案例中根據案例1設定為1200。
演算法上:
當前隊列比率=要預測的隊列/類的隊列緩衝區比率
隱藏乘數= 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.第1季度 — 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>
最終結果:第1季度 — Hardmax:600,Softmax:600.第2季度 — Softmax:28800
在此方案中,配置了5個隊列,但只有4個隊列明確定義了隊列緩衝區比率。分配給這些隊列的緩衝區與先前的示例相同。
未配置的隊列接收所有已配置的隊列緩衝區的總和與100之間的差值。
顯式配置的比值之和=(Q0緩衝比)+(Q1緩衝比)。..(最終緩衝比) — Catalyst 9000系列交換機支援最多8個隊列,因此您最多可以新增8個比值
Implicit Ratio Leftover =(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
值摘要:
計算剩餘的隊列緩衝區比率:
Implicit Ratio Leftover =(100 — 顯式配置的比率之和)。
100 -(20)-(10)-(10)-(50)= 20
當前隊列比率(class2)= 20
計算最終隊列緩衝區分配
Class1 = [基本緩衝區] 1200 x [當前隊列比率(class1)](20/100)= 240 — 優先順序隊列,無進一步計算
類2 = [
[基本緩衝區] 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,第2季度 — Softmax:480,第3季度 — Softmax:480,第4季度 — Softmax:480
在此方案中,配置了5個隊列,並且未配置隊列緩衝區比率。
要確定緩衝區分配,方案2中的相同邏輯會繼續,但您還必須將隱式比率剩餘(Implicit Ratio Leftover)除以沒有隊列緩衝區比率的隱式隊列/隊列總數
此方案使用的策略對映:
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
值摘要:
計算剩餘的隊列緩衝區比率:
Implicit Ratio Leftover =(100 — 顯式配置的比率之和)。
Number of Implicit Queues = 2(class2和class3未定義queue-buffers ratio)
配置比率之和= 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,但隱式隊列並不總是獲得等額分配,因為上文所述的整數結果要求不同。
在此案例中,配置了5個隊列,全部使用隊列緩衝區比率。類中的隊列緩衝區比率的總和小於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(優先順序級別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>
隊列限制配置會影響最終隊列緩衝區分配
影響隊列緩衝區分配的主要機制是在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>
將第三個隊列限制配置新增到隊列時,系統會對該隊列禁用400%的系統隱藏軟緩衝區乘數。但是,該隊列仍尊重使用者配置的qos queue-softmax-multiplier <percent>。
| 修訂 | 發佈日期 | 意見 |
|---|---|---|
3.0 |
24-May-2024
|
重新認證 |
1.0 |
02-Dec-2022
|
初始版本 |