本產品的文件集力求使用無偏見用語。針對本文件集的目的,無偏見係定義為未根據年齡、身心障礙、性別、種族身分、民族身分、性別傾向、社會經濟地位及交織性表示歧視的用語。由於本產品軟體使用者介面中硬式編碼的語言、根據 RFP 文件使用的語言,或引用第三方產品的語言,因此本文件中可能會出現例外狀況。深入瞭解思科如何使用包容性用語。
思科已使用電腦和人工技術翻譯本文件,讓全世界的使用者能夠以自己的語言理解支援內容。請注意,即使是最佳機器翻譯,也不如專業譯者翻譯的內容準確。Cisco Systems, Inc. 對這些翻譯的準確度概不負責,並建議一律查看原始英文文件(提供連結)。
本檔案將說明PHY計數器如何使用訊框大小而不是詳細流量分析來驗證封包到達。
本文件沒有特定需求。
本文件中的資訊是以下列軟體和硬體版本為依據.
本文提供使用PHY控制器計數器作為交換機上傳入資料包的第一檢查點的資訊。這些計數器根據幀大小而不是詳細的流量分析來顯示資料包是否到達。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
本檔案也適用於以下硬體版本:
注意:在基於Silicon One的平台(例如Catalyst 9600X(Sup-2和Sup-3)、9500X和9350)上進行故障排除測試時,不支援DSCP計數器。
PHY控制器是封包進入交換器時遇到的第一個元件。它在第1層運行,提供對介面上是否實際接收或傳輸資料包的可視性。與更高層的計數器(例如MAC或IP統計資訊)不同,PHY計數器依靠幀大小和位元組計數來確認資料包到達或傳輸。
這使它們成為一種重要的診斷工具,可在資料包到達更高的處理層之前驗證物理層流量行為並檢測潛在的入口或出口問題。
來自Cisco Catalyst交換器的範例顯示在PHY控制器層級收集的統計資訊:
Switch-A#show controllers ethernet-controller GigabitEthernet 1/0/4
Transmit GigabitEthernet1/0/4 Receive
1906 Total bytes 64 Total bytes
1 Unicast frames 1 Unicast frames
64 Unicast bytes 64 Unicast bytes
8 Multicast frames 0 Multicast frames
1842 Multicast bytes 0 Multicast bytes
0 Broadcast frames 0 Broadcast frames
0 Broadcast bytes 0 Broadcast bytes
0 System FCS error frames 0 IpgViolation frames
0 MacUnderrun frames 0 MacOverrun frames
0 Pause frames 0 Pause frames
0 Cos 0 Pause frames 0 Cos 0 Pause frames
0 Cos 1 Pause frames 0 Cos 1 Pause frames
0 Cos 2 Pause frames 0 Cos 2 Pause frames
0 Cos 3 Pause frames 0 Cos 3 Pause frames
0 Cos 4 Pause frames 0 Cos 4 Pause frames
0 Cos 5 Pause frames 0 Cos 5 Pause frames
0 Cos 6 Pause frames 0 Cos 6 Pause frames
0 Cos 7 Pause frames 0 Cos 7 Pause frames
0 Oam frames 0 OamProcessed frames
0 Oam frames 0 OamDropped frames
5 Minimum size frames 1 Minimum size frames
0 65 to 127 byte frames 0 65 to 127 byte frames
0 128 to 255 byte frames 0 128 to 255 byte frames
4 256 to 511 byte frames 0 256 to 511 byte frames
0 512 to 1023 byte frames 0 512 to 1023 byte frames
0 1024 to 1518 byte frames 0 1024 to 1518 byte frames
0 1519 to 2047 byte frames 0 1519 to 2047 byte frames
0 2048 to 4095 byte frames 0 2048 to 4095 byte frames
0 4096 to 8191 byte frames 0 4096 to 8191 byte frames
0 8192 to 16383 byte frames 0 8192 to 16383 byte frames
0 16384 to 32767 byte frame 0 16384 to 32767 byte frame
0 > 32768 byte frames 0 > 32768 byte frames
0 Late collision frames 0 SymbolErr frames
0 Excess Defer frames 0 Collision fragments
0 Good (1 coll) frames 0 ValidUnderSize frames
0 Good (>1 coll) frames 0 InvalidOverSize frames
0 Deferred frames 0 ValidOverSize frames
0 Gold frames dropped 0 FcsErr frames
0 Gold frames truncated
0 Gold frames successful
0 1 collision frames
0 2 collision frames
0 3 collision frames
0 4 collision frames
0 5 collision frames
0 6 collision frames
0 7 collision frames
0 8 collision frames
0 9 collision frames
0 10 collision frames
0 11 collision frames
0 12 collision frames
0 13 collision frames
0 14 collision frames
0 15 collision frames
0 Excess collision frames
LAST UPDATE 346 msecs AGO
Switch-A#show controllers ethernet-controller Gig 1/0/4
Transmit GigabitEthernet1/0/4 Receive
3169535406 Total bytes 307126227 Total bytes
290349 Unicast frames 294295 Unicast frames
18660704 Unicast bytes 18929926 Unicast bytes
33923210 Multicast frames 3074668 Multicast frames
3150872686 Multicast bytes 251494767 Multicast bytes
30 Broadcast frames 141745 Broadcast frames
2016 Broadcast bytes 36701534 Broadcast bytes
0 System FCS error frames 0 IpgViolation frames
0 MacUnderrun frames 0 MacOverrun frames
0 Pause frames 0 Pause frames
0 Cos 0 Pause frames 0 Cos 0 Pause frames
0 Cos 1 Pause frames 0 Cos 1 Pause frames
0 Cos 2 Pause frames 0 Cos 2 Pause frames
0 Cos 3 Pause frames 0 Cos 3 Pause frames
0 Cos 4 Pause frames 0 Cos 4 Pause frames
0 Cos 5 Pause frames 0 Cos 5 Pause frames
0 Cos 6 Pause frames 0 Cos 6 Pause frames
0 Cos 7 Pause frames 0 Cos 7 Pause frames
0 Oam frames 0 OamProcessed frames
0 Oam frames 0 OamDropped frames
1221612 Minimum size frames 847707 Minimum size frames
31115917 65 to 127 byte frames 2403801 65 to 127 byte frames
69441 128 to 255 byte frames 135289 128 to 255 byte frames
1227890 256 to 511 byte frames 112047 256 to 511 byte frames
578669 512 to 1023 byte frames 11824 512 to 1023 byte frames
40 1024 to 1518 byte frames 40 1024 to 1518 byte frames
20 1519 to 2047 byte frames 0 1519 to 2047 byte frames
0 2048 to 4095 byte frames 0 2048 to 4095 byte frames
0 4096 to 8191 byte frames 0 4096 to 8191 byte frames
0 8192 to 16383 byte frames 0 8192 to 16383 byte frames
0 16384 to 32767 byte frame 0 16384 to 32767 byte frame
0 > 32768 byte frames 0 > 32768 byte frames
0 Late collision frames 0 SymbolErr frames
0 Excess Defer frames 0 Collision fragments
0 Good (1 coll) frames 0 ValidUnderSize frames
0 Good (>1 coll) frames 0 InvalidOverSize frames
0 Deferred frames 0 ValidOverSize frames
0 Gold frames dropped 0 FcsErr frames
0 Gold frames truncated
0 Gold frames successful
0 1 collision frames
0 2 collision frames
0 3 collision frames
0 4 collision frames
0 5 collision frames
0 6 collision frames
0 7 collision frames
0 8 collision frames
0 9 collision frames
0 10 collision frames
0 11 collision frames
0 12 collision frames
0 13 collision frames
0 14 collision frames
0 15 collision frames
0 Excess collision frames
LAST UPDATE 3227 msecs AGO
Switch-A#
PHY控制器計數器的一個常見用例正在驗證測試流量是否在介面上傳輸或接收。通過傳送受控流量流(例如特定大小的ICMP資料包)並監控計數器,工程師可以確認流量是否到達PHY層。
最初,介面的PHY計數器在1024-1518位元組範圍內不顯示任何活動。
Switch-A#show controllers ethernet-controller GigabitEthernet 1/0/4
Transmit GigabitEthernet1/0/4 Receive
5 Minimum size frames 1 Minimum size frames
0 65 to 127 byte frames 0 65 to 127 byte frames
0 128 to 255 byte frames 0 128 to 255 byte frames
4 256 to 511 byte frames 0 256 to 511 byte frames
0 512 to 1023 byte frames 0 512 to 1023 byte frames
0 1024 to 1518 byte frames<<<<< 0 1024 to 1518 byte frames <<<<<
0 1519 to 2047 byte frames 0 1519 to 2047 byte frames
0 2048 to 4095 byte frames 0 2048 to 4095 byte frames
0 4096 to 8191 byte frames 0 4096 to 8191 byte frames
0 8192 to 16383 byte frames 0 8192 to 16383 byte frames
0 16384 to 32767 byte frame 0 16384 to 32767 byte frame
0 > 32768 byte frames 0 > 32768 byte frames
ping測試使用1,000個大小為1,200位元組的ICMP資料包執行,這將增加1024-1518位元組的幀計數器。
Switch-A#ping 192.168.8.2 repeat 1000 timeout 0 size 1200
Type escape sequence to abort.
Sending 1000, 1200-byte ICMP Echos to 192.168.8.2, timeout is 0 seconds:
......................................................................
......................................................................
Success rate is 0 percent (0/1000), round-trip min/avg/max = 1/1/1 ms
Switch-A#
測試後,傳輸計數器顯示傳送的資料包,確認它們離開介面,即使沒有收到回覆也是如此。
Switch-A#show controllers ethernet-controller GigabitEthernet 1/0/4
Transmit GigabitEthernet1/0/4 Receive
7 Minimum size frames 6 Minimum size frames
0 65 to 127 byte frames 0 65 to 127 byte frames
0 128 to 255 byte frames 0 128 to 255 byte frames
28 256 to 511 byte frames 2 256 to 511 byte frames
0 512 to 1023 byte frames 0 512 to 1023 byte frames
1000 1024 to 1518 byte frames <<<<< 1000 1024 to 1518 byte frames <<<<<
0 1519 to 2047 byte frames 0 1519 to 2047 byte frames
0 2048 to 4095 byte frames 0 2048 to 4095 byte frames
0 4096 to 8191 byte frames 0 4096 to 8191 byte frames
0 8192 to 16383 byte frames 0 8192 to 16383 byte frames
0 16384 to 32767 byte frame 0 16384 to 32767 byte frame
0 > 32768 byte frames 0 > 32768 byte frames
即使ping測試顯示成功率為0%,PHY控制器計數器仍確認1,000個1,200位元組的封包傳輸成功。這展示了PHY計數器如何獨立於高層響應來驗證流量生成和傳輸。
提示:為一致性運行多個迭代,或預先清除計數器:clear controller ethernet-controller <interface>。
附註:此測試方法在配置為第3層路由埠(無交換機埠)、接入模式埠、中繼埠和EtherChannel成員的介面上可行。對於EtherChannel配置,必須在屬於通道組的各個物理介面上驗證計數器。
硬體QoS計數器高度可靠,僅在硬體管道中運行PHY控制器計數器,可能在入口和出口FIFO級別。這些計數器有助於驗證具有特定差分服務代碼點(DSCP)標籤的資料包是否到達或離開介面。
與PHY控制器計數器相比,HW QoS計數器更易於使用,因為它們提供了跨64個DSCP值的粒度。這樣,工程師就可以根據QoS分類而不是僅依靠幀大小來驗證流量是否存在。
Switch-A#show platform hardware fed switch active qos dscp-cos counters interface GigabitEthernet 1/0/4
Frames Bytes
Ingress DSCP0 374959 0
Ingress DSCP1 0 0
Ingress DSCP2 0 0
Ingress DSCP3 0 0
Ingress DSCP4 0 0
...
Switch-A#
可靠性:HW QoS計數器高度可信,比PHY控制器計數器稍遜一籌。
粒度:支援64個DSCP值可實現精確的流量分類。
需求:具有一致DSCP標籤的控制測試流量對於準確驗證是必需的。
限制:硬體QoS計數器不會區分共用相同DSCP值的多個流。
附註:請參閱本檔案開頭提供的網路圖以作參考。
HW QoS DSCP計數器可有效地用於驗證具有特定DSCP標籤的流量是否到達或離開介面。在涉及受控測試流量的場景中,此功能尤其有用,其中應用了唯一DSCP值以輕鬆跟蹤硬體計數器中資料包的存在。通過使用這些計數器,工程師可以在硬體級別基於QoS分類確認通訊流,不受上層協定的影響。此方法提供精細的可視性,因為HW QoS計數器支援跨64個可能的DSCP值的跟蹤,從而實現對介面上流量存在的精確分類和驗證
最初,計數器不顯示DSCP值1和2的流量:
Switch-A# show platform hardware fed switch 1 qos dscp-cos counters interface GigabitEthernet 1/0/4
Ingress DSCP0 374959 0
Ingress DSCP1 0 0 <<<<
Ingress DSCP2 0 0 <<<<
然後運行ping測試並使用DSCP 2標籤:
Switch-B# ping 192.168.8.1 repeat 1000 timeout 0 dscp 2
Type escape sequence to abort.
Sending 1000, 100-byte ICMP Echos to 192.168.8.1, timeout is 0 seconds:
......................................................................
......................................................................
Success rate is 0 percent (0/1000)
測試後,DSCP 2的計數器增加了1000,確認資料包到達入口介面,即使沒有收到回覆也是如此:
Switch-A# show platform hardware fed switch 1 qos dscp-cos counters interface GigabitEthernet 1/0/4
Ingress DSCP0 374959 0
Ingress DSCP1 0 0
Ingress DSCP2 1000 0 <<<<
DSCP計數器提供了一種在硬體級別確認流量存在的有效方法。通過將測試流量標籤為未使用的DSCP值,工程師可以隔離和驗證資料包轉發,而與更高層的響應無關。此方法允許對硬體計數器中的資料包進行精確跟蹤,確保具有特定DSCP標籤的流量確實通過網路轉發。在受控測試流量中使用唯一的DSCP值有助於隔離和驗證資料包流,這對於思科裝置中的故障排除和QoS策略驗證很有價值。
提示:運行多個迭代,或者先使用以下項清除DSCP計數器:clear platform hardware fed switch active qos dscp-cos counters interface <interface>。
修訂 | 發佈日期 | 意見 |
---|---|---|
1.0 |
07-Oct-2025
|
初始版本 |