簡介
本檔案介紹如何對Cisco IOS® XE路由器上的介面封包舍棄進行疑難排解。
需求
有關資料包流和Cisco IOS XE的基本知識。
採用元件
本文檔基於Cisco IOS XE路由器平台,例如ISR 4000和ASR1000路由器。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
背景資訊
在Cisco IOS XE路由器上,資料包丟棄可能會發生在不同的元件上,包括:
在介面上的輸入或輸出方向上均可觀察到這些丟包。分析QFP時,主要關注輸出丟包。
有關影響Cisco IOS XE裝置上控制平面的丟包資訊,請參閱指南中概述的丟包資訊:排除策略器超出閾值故障。
輸入捨棄
介面可能會在輸入隊列中遇到輸入丟棄。可以使用show interfaces命令在輸入佇列欄位中看到此計數器,drops counter區段:
---- show interfaces ----
GigabitEthernet0/0/0 is up, line protocol is up
Input queue: 0/375/71966/0 (size/max/drops/flushes); Total output drops: 47009277
介面上的輸入丟棄計數器也在show interface summary命令的IQD列下可見,該列表示從輸入隊列丟棄的資料包。
---- show interface summary ----
Interface IHQ IQD OHQ OQD RXBS RXPS TXBS TXPS TRTL
-----------------------------------------------------------------------------------------------------------------
* Te0/0/0 0 0 0 0 29544000 2830 1957000 1446 0
* Te0/0/1 0 0 0 0 23476000 2555 16655000 3346 0
* GigabitEthernet0/0/0 0 71966 0 47019440 18852000 5321 59947000 6064 0
介面上的輸入丟棄通常發生在輸入隊列變得不堪重負且無法及時處理時。因此,可以根據正在使用的排隊演算法選擇性地丟棄資料包。
導致輸入丟棄的可能原因包括:
- 傳送裝置以比接收裝置能夠處理的速率更高的速率傳送資料包,導致輸入隊列耗盡
- 流量模式中的突發或微突發
- 平台限制
您可以在介面層級下使用hold-queue指令嘗試增加輸入佇列大小:
Router(config-if)#hold-queue ?
<0-240000> Queue length
附註:Hold-queue命令在某些平台上無效。驗證平台規範或向TAC提交案例。
注意:流量控制機制也可用於從接收裝置向傳送裝置傳送暫停幀。檢視特定平台的《介面和硬體元件配置指南》中有關流量控制的更多資訊。
介面上的輸出丟棄
輸出隊列中介面清單上的輸出丟棄,並可使用show interfaces命令檢視
---- show int gi 1/0/46 ----
GigabitEthernet1/0/46 is up, line protocol is up (connected)
Input queue: 0/2000/0/0 (size/max/drops/flushes); Total output drops: 154786
Total Output Drops計數器指示受影響介面的輸出隊列飽和。服務品質(QoS)等機制可能會加劇這種情況,這些機制可以選擇性地丟棄資料包來管理擁塞。
由於QoS會更改流量的優先順序,因此另一個故障排除步驟是通過使用命令service-policy output在輸出方向上配置的策略對映,驗證介面是否正在使用非預設排隊策略。
interface GigabitEthernet0/1
service-policy output PRIORITIZE-VOICE
要驗證輸出丟棄是否是由於實施的服務品質機制所致,請使用命令show policy-map interface <interface-name> out。以下範例所示:
---- show policy-map interface gi0/0/0 output ----
GigabitEthernet0/0/0
Service-policy output: PRIORITIZE-VOICE
queue stats for all priority classes:
Queueing
queue limit 512 packets
(queue depth/total drops/no-buffer drops) 0/0/0
(pkts output/bytes output) 0/0
Class-map: VOICE (match-any)
0 packets, 0 bytes
5 minute offered rate 0000 bps, drop rate 0000 bps
Match: dscp ef (46)
Priority: Strict, b/w exceed drops: 0
Class-map: class-default (match-any)
0 packets, 0 bytes
5 minute offered rate 0000 bps, drop rate 0000 bps
Match: any
queue limit 4166 packets
(queue depth/total drops/no-buffer drops) 0/0/0
(pkts output/bytes output) 0/0
Router#
此命令顯示所配置的類中由於服務品質機制而發生的丟棄。
附註:如果介面上的輸出丟棄與策略對映中看到的丟棄相關,則通常由於所配置的服務品質而預期該丟棄。如果需要,請與TAC聯絡,深入瞭解所使用的服務品質機制,並參閱相應指南瞭解此功能。
有關QoS工作以及如何實施的其他資訊,請參閱服務品質配置指南、Cisco IOS XE 17.x配置指南。
要檢視排隊策略,請使用show interfaces命令並檢查排隊策略值。預設情況下,出站資料包處理策略為先進先出(FIFO)。
---- show interfaces gigabitEthernet 0/0/0 ----
Queueing strategy: Class-based queueing
未設定服務品質時的輸出丟棄
如果介面在服務品質輸出方向上沒有關聯的策略對映,則其他原因可能導致輸出丟棄。
在不具有服務品質的介面上,輸出丟棄的原因包括:
- 形成埠通道和超訂用單個輸出介面的傳入介面
- 量子流處理器(QFP)背壓
- 許可吞吐量限制
- 平台限制
請參閱本檔案的「Quantum Flow處理器(QFP)丟棄」一節,進一步對此情況疑難排解。
Quantum Flow Processor(QFP)丟棄
要驗證QFP丟棄的原因,請使用show platform hardware qfp active statistics drop命令,如下所示:
---- show platform hardware qfp active statistics drop ----
Last clearing of QFP drops statistics : never
-------------------------------------------------------------------------
Global Drop Stats Packets Octets
-------------------------------------------------------------------------
BFDoffload 23944858 1904416850
IpTtlExceeded 184211 28644972
IpsecIkeIndicate 175 26744
IpsecInput 686112 171458640
IpsecInvalidSa 1 80
Ipv4Martian 4 392
Ipv4NoAdj 19776 6587643
Ipv4NoRoute 75 10950
Ipv6NoRoute 27068 1515808
ReassDrop 3489529 450382594
ReassNoFragInfo 4561070 6387610348
ReassOverlap 3 198
ReassTimeout 7408271 2631950860
TailDrop 193769387 157113756882
此命令顯示QFP丟棄的不同原因以及每個類別的相關資料包計數器。
附註:大多數QFP丟包類別原因從其名稱本身就可以解釋。原因類別指導故障排除流程。對於非常見丟包類別(如果需要),請提交Cisco TAC案例。
尾部丟棄
TailDrop計數器是最常見的drop型別之一,它通常因以下原因而增加:
生成的日誌型別:
%BW_LICENSE-4-THROUGHPUT_MAX_LEVEL:F0/0:cpp_ha_top_level_server:在過去<period>小時內,<sampling-number>取樣週期內的平均吞吐量速率接近許可頻寬<mbps> Mbps,取樣週期為<sampling-period>秒
驗證命令:
- show platform hardware qfp active infrastructure bqs queue output default interface <interface>
- show platt hardware qfp active infrastructure bqs queue output default all
- show platform hardware qfp active feature lic-bw oversubscription
- show platform hardware throughput level
- show platform hardware throughput crypto
要瞭解受影響的流量是否正在丟棄以及QFP是否提供了更詳細的資料包處理檢視,您可以使用資料包跟蹤功能。請參閱使用Cisco IOS-XE資料路徑資料包跟蹤功能進行故障排除。
生成的日誌型別:
%IOSXE_QFP-2-LOAD_EXCEED:插槽:0、QFP:0、Load <load-percentage>%超出設定閾值。
附註:請參閱資料表中的平台限制吞吐量數量和擴展。吞吐量根據裝置配置中功能的數量和使用情況而變化。它也會因注入到QFP中的每秒聚合位數(bps)而異。
您可以使用命令show platform hardware qfp active datapath utilization summary檢驗過去5秒、1分鐘、5分鐘或60分鐘內的QFP利用率。
---- show platform hardware qfp active datapath utilization summary ----
CPP 0: 5 secs 1 min 5 min 60 min
Input: Total (pps) 1 2 2 2
(bps) 320 1032 1032 1032
Output: Total (pps) 0 1 1 1
(bps) 0 8560 8560 8576
Processing: Load (pct) 0 0 0 0
Crypto/IO
Crypto: Load (pct) 0 0 0 0
RX: Load (pct) 0 0 0 0
TX: Load (pct) 2 2 2 2
Idle (pct) 97 97 97 97
有關QFP中的其他丟棄驗證,請使用show drops { bqs | crypto| firewall| interface| ip-all| nat| punt| qfp| qos|history}命令,請參閱Cisco Catalyst 8500和8500L系列邊緣平台軟體配置指南。
資料包丟棄故障排除的其他提示
介面上的計數器
顯示了通過show interfaces [interface]命令的不同計數器。有關每個計數器的含義的說明,請參閱乙太網故障排除文檔。
基於CLI的每秒歷史位數圖表
可以使用介面級別下的history bps命令,在CLI中從介面傳入和傳出方向啟用歷史位每秒圖形檢視。此配置會在介面上生成歷史bps的圖形。
Router(config)#interface gigabitEthernet 0/0/0
Router(config-if)#history bps
您還可以啟用history bps output-drops和其他計數器歷史記錄。
要隨時間推移顯示歷史記錄計數器結果,請使用命令show interfaces <interface> history 命令:
---- show interfaces gigabitEthernet 0/0/0 history ? ----
60min Display 60 minute histograms only
60sec Display 60 second histograms only
72hour Display 72 hour histograms only
all Display all three histogram intervals
both Display both input and output histograms
input Display input histograms only
output Display output histograms only
| Output modifiers
#show int gi1 history 60sec
90100 *
82100 *
74100 ******
66100 ***********
58100 ***********
50100 ****************
42100 *********************
34100 *******************************
26100 ************************************
18100 ***************************************************
10100 **********************************************************
0....5....1....1....2....2....3....3....4....4....5....5....6
0 5 0 5 0 5 0 5 0 5 0
GigabitEthernet1 output rate(mbits/sec) (last 60 seconds)
clear counters
這些命令用於清除各種計數器統計資訊:
- clear counters:清除介面級計數器資料。
- show platform hardware qfp active statistics drop clear:重置QFP(量子流處理器)上的丟棄計數器。
一段時間內的丟棄百分比
要驗證輸出丟棄的數量是否受到影響,除了在介面級別使用history bps output-drops 命令瞭解隨時間變化的丟棄情況外,還可以使用其他計數器值來獲取自上次清除計數器以來輸出丟棄的總體百分比。
如果自上次啟動後尚未清除計數器,請使用命令show version獲取系統的正常運行時間,或者使用命令show interfaces參閱show interface counters值的上次清除時間。
確定計數器上次被清除的時間或確定裝置正常運行時間後,計算該時間段內發生的輸出丟棄的百分比。
這可以通過將總輸出丟棄值乘以100,然後將show interfaces <interface>命令的資料包輸出計數器值之間的結果除以實現。此操作的結果給出了該時間幀期間該介面的輸出丟包的百分比。
附註:請記住,show interfaces和show platform hardware qfp active statistics drop中的計數器是自上次清除它們以來歷史的和累積的。如果重新載入完成,計數器會清除。
請參閱以下範例輸出:
---- show version ----
Hostname uptime is 51 weeks, 1 day, 14 hours, 17 minutes
---- show interface GigabitEthernet0/0/1 ----
GigabitEthernet0/0/1 is up, line protocol is up
Last clearing of "show interface" counters never
Input queue: 0/375/0/0 (size/max/drops/flushes); Total output drops: 1351
219128599 packets output, 84085726336 bytes, 0 underruns
示例輸出表明介面的計數器從未被清除,這意味著在裝置運行時間的最後51週,總輸出丟棄的百分比為(1351 x 100)/ 219128599 = .0006%。
此百分比的解釋可能是,此介面上的總輸出丟棄並不顯著,並且由於此計數器是歷史的、累積的,並且鑑於較長的正常運行時間,這意味著丟棄沒有影響。
載入間隔
Load interval是來自介面級別的配置參數,它指示資料用於計算負載統計資訊的時間長度。
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface gigabitEthernet 0/0/0
Router(config-if)#load-interval ?
<30-600> Load interval delay in seconds
load-interval引數的結果會顯示在輸入和輸出速率值下面的show interfaces命令中:
---- show interfaces gigabitEthernet 0/0/0 ----
GigabitEthernet0/0/0 is administratively down, line protocol is down
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
在執行show interfaces命令時,在驗證每秒位速率時,這一點非常重要。
輸入和輸出速率值有助於瞭解介面每秒傳入和傳出的位數。
使用命令show interface summary可大致瞭解所有介面的輸入和輸出速率值,並可從物理介面獲取聚合輸出速率,這有助於瞭解特定時間點每秒輸出的總聚合位數。 請參閱此範例輸出中的RXBS和TXBS計數器:
---- show interfaces summary ----
*: interface is up
IHQ: pkts in input hold queue IQD: pkts dropped from input queue
OHQ: pkts in output hold queue OQD: pkts dropped from output queue
RXBS: rx rate (bits/sec) RXPS: rx rate (pkts/sec)
TXBS: tx rate (bits/sec) TXPS: tx rate (pkts/sec)
TRTL: throttle count
Interface IHQ IQD OHQ OQD RXBS RXPS TXBS TXPS TRTL
-----------------------------------------------------------------------------------------------------------------
* GigabitEthernet0/0/0 1 0 0 0 9000 19 0 0 0
GigabitEthernet0/0/1 0 0 0 0 0 0 0 0 0
GigabitEthernet0/0/2 0 0 0 0 0 0 0 0 0
* GigabitEthernet0/0/3 0 0 0 0 9000 19 0 0 0
臨時刪除QoS策略
要排除故障,請暫時從受影響的介面刪除QoS策略。在介面配置級別使用命令no service-policy output <policy-name>。
- 如果沒有QoS策略而持續出現丟包,則問題與QoS無關。
- 如果在刪除QoS策略後停止刪除,則可能是該策略的原因。
附註:如果需要TAC幫助,則隔離確定丟棄是否由於服務品質所致,這對於在早期階段將案例路由到適當的專家而言是很重要的。
附註:丟棄也可能是由於ipsec功能。Ipsec丟棄通常在用作隧道源的物理介面中聚集。如果僅在使用通道時存在捨棄專案,則重要的一點是,如果需要協助,請向TAC指出。這有助於在早期階段將案例路由到相應的團隊
相關文章和文檔