本文描述解決與生成樹協定(STP)相關的常見問題的各種方法。
思科建議您瞭解以下主題:
本文件所述內容不限於特定軟體和硬體版本。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路正在作用,請確保您已瞭解任何指令可能造成的影響。
本節介紹一些用於排除STP常見問題的方法。
為了對STP問題進行故障排除,必須知道當前根橋的交換機。顯示Nexus 5000系列交換機上STP根的命令為:
Nexus-5000# show spanning-tree vlan 1
VLAN0001
Spanning tree enabled protocol rstp
Root ID Priority 32769
Address c84c.75fa.6000
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address c84c.75fa.6000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
以下是其他一些相關命令:
Nexus-5000# show spanning-tree vlan 1 detail
Nexus-5000# show spanning-tree vlan 1 summary
確定當前根目錄後,您可以檢查事件歷史記錄以檢視它是否更改以及拓撲更改通知的來源。
Nexus-5000# show spanning-tree internal event-history tree 1 brief
2012:11:06 13h:44m:20s:528204us T_EV_UP
VLAN0001 [0000.0000.0000.0000 C 0 A 0 R none P none]
2012:11:06 13h:44m:21s:510394us T_UT_SBPDU
VLAN0001 [8001.547f.ee18.e441 C 0 A 0 R none P Po1]
2012:11:06 13h:44m:21s:515129us T_EV_M_FLUSH_L
VLAN0001 [1001.001b.54c2.5a42 C 6 A 5 R Po1 P none]
2012:11:06 13h:44m:23s:544632us T_EV_M_FLUSH_R
VLAN0001 [1001.001b.54c2.5a42 C 6 A 5 R Po1 P Po1]
2012:11:06 13h:44m:24s:510352us T_EV_M_FLUSH_R
VLAN0001 [1001.001b.54c2.5a42 C 6 A 5 R Po1 P Po1]
此命令用於顯示介面的事件。
Nexus-5000# show spanning-tree internal event-history tree 1 interface
ethernet 1/3 brief
2012:11:05 13h:42m:20s:508027us P_EV_UP Eth1/3 [S DIS R Unkw A 0 Inc no]
2012:11:05 13h:42m:20s:508077us P_STATE Eth1/3 [S BLK R Desg A 0 Inc no]
2012:11:05 13h:42m:20s:508294us P_STATE Eth1/3 [S LRN R Desg A 0 Inc no]
2012:11:05 13h:42m:20s:508326us P_STATE Eth1/3 [S FWD R Desg A 0 Inc no]
此命令用於調查介面上的STP更改。此輸出提供許多詳細資訊:
Nexus-5000# show spanning-tree internal info tree 1 interface port-channel 11
------- STP Port Info (vdc 1, tree 1, port Po11) ---------
dot1d info: port_num=4106, ifi=0x1600000a (port-channel11)
ISSU FALSE non-disr, prop 0, ag 0, flush 0 peer_not_disputed_count 0
if_index 0x1600000a
namestring port-channel11
.................... cut to save space ............
stats
fwd_transition_count 1 bpdus_in 40861 bpdus_out 40861
config_bpdu_in 0 rstp_bpdu_in 40861 tcn_bpdu_in 0
config_bpdu_out 0 rstp_bpdu_out 40861 tcn_bpdu_out 0
bpdufilter_drop_in 0
bpduguard_drop_in 0
err_dropped_in 0
sw_flood_in 0
.................... cut to save space ............
本節介紹如何使用Ethanalyzer擷取BPDU:
Ethanalyzer local interface inbound-hi display-filter "vlan.id == 1 && stp"
Example:
Nexus-5000# ethanalyzer local interface inbound-hi display-filter "vlan.id
== 1 && stp"
Capturing on eth4
2013-05-11 13:55:39.280951 00:05:73:f5:d6:27 -> 01:00:0c:cc:cc:cd STP RST.
Root = 33768/00:05:73:ce:a9:7c Cost = 1 Port = 0x900a
2013-05-11 13:55:40.372434 00:05:73:ce:a9:46 -> 01:00:0c:cc:cc:cd STP RST.
Root = 33768/00:05:73:ce:a9:7c Cost = 0 Port = 0x900a
2013-05-11 13:55:41.359803 00:05:73:f5:d6:27 -> 01:00:0c:cc:cc:cd STP RST.
Root = 33768/00:05:73:ce:a9:7c Cost = 1 Port = 0x900a
2013-05-11 13:55:42.372405 00:05:73:ce:a9:46 -> 01:00:0c:cc:cc:cd STP RST.
Root = 33768/00:05:73:ce:a9:7c Cost = 0 Port = 0x900a
要檢視詳細的資料包,請使用detail命令:
Nexus-5000# ethanalyzer local interface inbound-hi detail display-filter
"vlan.id == 1 && stp"
Capturing on eth4
Frame 7 (68 bytes on wire, 68 bytes captured)
Arrival Time: May 11, 2013 13:57:02.382227000
[Time delta from previous captured frame: 0.000084000 seconds]
[Time delta from previous displayed frame: 1368280622.382227000 seconds]
[Time since reference or first frame: 1368280622.382227000 seconds]
Frame Number: 7
Frame Length: 68 bytes
Capture Length: 68 bytes
[Frame is marked: False]
[Protocols in frame: eth:vlan:llc:stp]
Ethernet II, Src: 00:05:73:ce:a9:46 (00:05:73:ce:a9:46), Dst: 01:00:0c:cc:cc:cd
(01:00:0c:cc:cc:cd)
Destination: 01:00:0c:cc:cc:cd (01:00:0c:cc:cc:cd)
Address: 01:00:0c:cc:cc:cd (01:00:0c:cc:cc:cd)
.... ...1 .... .... .... .... = IG bit: Group address (multicast/broadcast)
.... ..0. .... .... .... .... = LG bit: Globally unique address
(factory default)
Source: 00:05:73:ce:a9:46 (00:05:73:ce:a9:46)
Address: 00:05:73:ce:a9:46 (00:05:73:ce:a9:46)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
.... ..0. .... .... .... .... = LG bit: Globally unique address
(factory default)
Type: 802.1Q Virtual LAN (0x8100)
802.1Q Virtual LAN
111. .... .... .... = Priority: 7
...0 .... .... .... = CFI: 0
.... 0000 0000 0001 = ID: 1
Length: 50
Logical-Link Control
DSAP: SNAP (0xaa)
IG Bit: Individual
SSAP: SNAP (0xaa)
CR Bit: Command
Control field: U, func=UI (0x03)
000. 00.. = Command: Unnumbered Information (0x00)
.... ..11 = Frame type: Unnumbered frame (0x03)
Organization Code: Cisco (0x00000c)
PID: PVSTP+ (0x010b)
Spanning Tree Protocol
Protocol Identifier: Spanning Tree Protocol (0x0000)
Protocol Version Identifier: Rapid Spanning Tree (2)
BPDU Type: Rapid/Multiple Spanning Tree (0x02)
BPDU flags: 0x3c (Forwarding, Learning, Port Role: Designated)
0... .... = Topology Change Acknowledgment: No
.0.. .... = Agreement: No
..1. .... = Forwarding: Yes
...1 .... = Learning: Yes
.... 11.. = Port Role: Designated (3)
.... ..0. = Proposal: No
.... ...0 = Topology Change: No
Root Identifier: 33768 / 00:05:73:ce:a9:7c
Root Path Cost: 0
Bridge Identifier: 33768 / 00:05:73:ce:a9:7c
Port identifier: 0x900a
Message Age: 0
Max Age: 20
Hello Time: 2
Forward Delay: 15
Version 1 Length: 0
若要將此資訊寫入PCAP檔案,請使用以下命令:
Nexus-5000# ethanalyzer local interface inbound-hi display-filter
"vlan.id == 1 && stp" write bootflash:bpdu.pcap
Capturing on eth4
3 << Lists how many packets were captured.
在BPDU捕獲中,源MAC地址是遠端裝置的介面MAC地址。
在Ethanalyzer捕獲中,埠以十六進位制格式顯示。若要識別連線埠號碼,您需要先將號碼轉換為十六進位制:
0x900a(來自上一個跟蹤)= 36874
以下是將該數字解碼為連線埠的命令:
Nexus-5000# show spanning-tree internal info all |
grep -b 50 "port_id 36874" | grep "Port Info"
------- STP Port Info (vdc 1, tree 1, port Po11) ----------
------- STP Port Info (vdc 1, tree 300, port Po11) ---------
------- STP Port Info (vdc 1, tree 800, port Po11) ---------
------- STP Port Info (vdc 1, tree 801, port Po11) ---------
------- STP Port Info (vdc 1, tree 802, port Po11) ---------
------- STP Port Info (vdc 1, tree 803, port Po11) ---------
------- STP Port Info (vdc 1, tree 999, port Po11) ---------
在本例中,它是port-channel 11。
如果需要調查STP收斂,請使用show spanning-tree internal interactions 命令。此命令可深入瞭解觸發STP更改的事件。一旦問題發生,必須立即收集此資訊,因為日誌很大,並且會隨著時間推移而變化。
Nexus-5000#show spanning-tree internal interactions
- Event:(null), length:123, at 81332 usecs after Sat May 11 12:01:47 2013
Success: pixm_send_set_mult_cbl_vlans_for_multiple_ports, num ports 1
VDC 1, state FWD, rr_token 0x21b9c3 msg_size 584
- Event:(null), length:140, at 81209 usecs after Sat May 11 12:01:47 2013
vb_vlan_shim_set_vlans_multi_port_state(2733): Req (type=12) to PIXM
vdc 1, inst 0, num ports 1, state FWD
[Po17 v 800-803,999-1000]
- Event:(null), length:123, at 779644 usecs after Sat May 11 12:01:46 2013
Success: pixm_send_set_mult_cbl_vlans_for_multiple_ports, num ports 1
VDC 1, state FWD, rr_token 0x21b99a msg_size 544<
- Event:(null), length:127, at 779511 usecs after Sat May 11 12:01:46 2013
vb_vlan_shim_set_vlans_multi_port_state(2733): Req (type=12) to PIXM
vdc 1, inst 0, num ports 1, state FWD
[Po17 v 300]
- Event:(null), length:123, at 159142 usecs after Sat May 11 12:01:32 2013
Success: pixm_send_set_mult_cbl_vlans_for_multiple_ports, num ports 1
VDC 1, state LRN, rr_token 0x21b832 msg_size 584
- Event:(null), length:140, at 159023 usecs after Sat May 11 12:01:32 2013
vb_vlan_shim_set_vlans_multi_port_state(2733): Req (type=12) to PIXM
vdc 1, inst 0, num ports 1, state LRN
[Po17 v 800-803,999-1000]
- Event:(null), length:123, at 858895 usecs after Sat May 11 12:01:31 2013
Success: pixm_send_set_mult_cbl_vlans_for_multiple_ports, num ports 1
VDC 1, state LRN, rr_token 0x21b80b msg_size 544
- Event:(null), length:127, at 858772 usecs after Sat May 11 12:01:31 2013
vb_vlan_shim_set_vlans_multi_port_state(2733): Req (type=12) to PIXM
vdc 1, inst 0, num ports 1, state LRN
[Po17 v 300]
.................... cut to save space ............
Nexus 5000系列交換器使用內部VLAN來對應外部VLAN編號以進行轉送。有時VLAN ID是內部VLAN ID。若要取得與外部VLAN的對應,請輸入:
Nexus-5000# show platform afm info global
Gatos Hardware version 0
Hardware instance mapping
-------------------------
Hardware instance: 0 asic id: 0 slot num: 0
-------------- cut to save space --------------------------
Hardware instance: 12 asic id: 1 slot num: 3
AFM Internal Status
-------------------
[unknown label ]: 324
[no free statistics counter ]: 2
[number of verify ]: 70
[number of commit ]: 70
[number of request ]: 785
[tcam stats full ]: 2
Vlan mapping table
------------------
Ext-vlan: 1 - Int-vlan: 65
排除STP故障的另一種方法是使用調試。但是,使用STP調試可能會導致CPU使用率激增,這在某些環境中會造成問題。要在運行調試時顯著降低CPU使用率,請使用debug-filter並將活動記錄到日誌檔案。
Nexus-5000#debug logfile spanning-tree.txt
Nexus-5548P-L3# dir log:
31 Nov 06 12:46:35 2012 dmesg
----- cut to save space----
7626 Nov 08 22:41:58 2012 messages
0 Nov 08 23:05:40 2012 spanning-tree.txt
4194304 Nov 08 22:39:05 2012 startupdebug
Nexus-5000# debug spanning-tree bpdu_rx interface e1/30
<<< setup your spanning-tree for bpdus
Nexus-5000# copy log:spanning-tree.txt bootflash:
2012 Nov 8 23:08:24.238953 stp: BPDU RX: vb 1 vlan 300, ifi 0x1a01d000
(Ethernet1/30)
2012 Nov 8 23:08:24.239095 stp: BPDU Rx: Received BPDU on vb 1 vlan 300
port Ethernet1/30 pkt_len 60 bpdu_len 36 netstack flags 0x00ed enc_type ieee
2012 Nov 8 23:08:35.968453 stp: RSTP(300): Ethernet1/30 superior msg
2012 Nov 8 23:08:35.968466 stp: RSTP(300): Ethernet1/30 rcvd info remaining 6
2012 Nov 8 23:08:36.928415 stp: BPDU RX: vb 1 vlan 300, ifi 0x1a01d000
(Ethernet1/30)
2012 Nov 8 23:08:36.928437 stp: BPDU Rx: Received BPDU on vb 1 vlan 300
port Ethernet1/30 pkt_len 60 bpdu_len 36 netstack flags 0x00ed enc_type ieee
2012 Nov 8 23:08:36.928476 stp: RSTP(300): msg on Ethernet1/30
.................... cut to save space ............
若要解決此問題,請檢查事件歷史記錄以確定Nexus 5000系列交換機是否假定為根。如果Nexus 5000未處理BPDU或未接收它們,則它假設為根。為了調查導致問題的原因,您應該確定是否有其它交換機連線到指定網橋。如果沒有其他網橋出現問題,則很可能是Nexus 5000沒有處理BPDU。如果其他網橋出現問題,則很可能是因為網橋沒有傳送BPDU。
修訂 | 發佈日期 | 意見 |
---|---|---|
1.0 |
12-Jul-2013 |
初始版本 |