The STP is a network protocol that ensures a loop-free topology.
STP 是一種網路通訊協定,可確保拓樸無迴圈。
Several varieties of Spanning Tree Protocols exist:
生成樹協定有多種變體:
- STP (IEEE 802.1D) is the legacy standard that provides a loop-free topology in a network with redundant links. STP creates a Common Spanning Tree (CST) that assumes one spanning tree instance for the entire bridged network, regardless of the number of VLANs.STP(IEEE 802.1D)是舊有標準,能在具有備援鏈路的網路中提供無迴圈拓樸。STP 會建立一個共同生成樹(Common Spanning Tree,CST),假設整個橋接網路只有一個生成樹實例,無論 VLAN 數量多少。
- PVST+ is a Cisco enhancement of STP that provides a separate 802.1D spanning tree instance for each VLAN that is configured in the network.PVST+ 是 Cisco 對 STP 的強化版,會為網路中設定的每個 VLAN 提供各自獨立的 802.1D 生成樹實例。
- MSTP, or IEEE 802.1s, is an IEEE standard that is inspired by the earlier Cisco proprietary Multi-Instance STP (MISTP) implementation. MSTP maps multiple VLANs into the same spanning tree instance.MSTP,即 IEEE 802.1s,是受到早期 Cisco 專屬多實例 STP(MISTP)實作啟發而制定的 IEEE 標準。MSTP 將多個 VLAN 對應到同一個生成樹實例中。
- RSTP, or IEEE 802.1w, is an evolution of STP that provides faster convergence of STP. It redefines port roles and enhances BPDU exchanges.RSTP,即 IEEE 802.1w,是 STP 的演進版本,能提供更快的 STP 收斂速度。它重新定義了連接埠角色,並強化了 BPDU 交換機制。
- Rapid PVST+ is a Cisco enhancement of RSTP that uses PVST+. Rapid PVST+ provides a separate instance of 802.1w per VLAN.Rapid PVST+ 是 Cisco 對 RSTP 的強化版,採用 PVST+ 架構。Rapid PVST+ 會為每個 VLAN 提供各自獨立的 802.1w 實例。
Comparison of Spanning Tree Protocols
生成樹協定比較
The following are the characteristics of various Spanning Tree Protocols:
以下是各種生成樹協定的特性:
- STP assumes one 802.1D spanning tree instance for the entire bridged network, regardless of the number of VLANs. Because only one instance exists, the CPU and memory requirements for this version are lower than for the other protocols. However, because of only one instance, there is only one root bridge and one tree. Traffic for all VLANs flows over the same path, which can lead to suboptimal traffic flows. Because of the limitations of 802.1D, this version is slow to converge. When a change in the topology occurs at a switch (for example, a link goes down), it generates a Topology Change Notification (TCN) BPDU. It then sends this TCN BPDU to the root bridge. When the root bridge receives this TCN BPDU, it will send an update to all non-root switches informing them of the update. It also informs them to change the aging timer for MAC addresses to 15 seconds.STP 假設整個橋接網路只有一個 802.1D 生成樹實例,無論 VLAN 數量多少。由於只有一個實例,這個版本所需的 CPU 與記憶體需求比其他通訊協定低。然而,也正因為只有一個實例,所以只會有一台根橋接器和一棵樹。所有 VLAN 的流量都會走同一條路徑,可能導致流量走向次佳的路徑。由於 802.1D 本身的限制,這個版本的收斂速度較慢。當某台交換器發生拓樸變化(例如鏈路中斷)時,會產生一個拓樸變化通知(Topology Change Notification,TCN)BPDU,並將這個 TCN BPDU 傳送給根橋接器。根橋接器收到這個 TCN BPDU 後,會將更新傳送給所有非根交換器,通知它們進行更新,同時也會通知它們將 MAC 位址的老化計時器改為 15 秒。
- PVST+ is a Cisco enhancement of STP that provides a separate 802.1D spanning tree instance for each VLAN that is configured in the network. The separate instance supports features like PortFast, UplinkFast, BackboneFast, BPDU guard, BPDU filter, root guard, and loop guard to enhance security. Creating an instance for each VLAN increases the CPU and memory requirements but allows for per-VLAN root bridges. The use of PVST+ gives the administrator the ability to load balance traffic per VLAN. For example, the root bridge for VLAN 10 could be switch A and the root bridge for VLAN 20 could be switch B. Convergence of this version is similar to the convergence of 802.1D, meaning that the topology change mechanism is the same as 802.1D. However, convergence is per-VLAN.PVST+ 是 Cisco 對 STP 的強化版,會為網路中設定的每個 VLAN 提供各自獨立的 802.1D 生成樹實例。這個獨立實例支援 PortFast、UplinkFast、BackboneFast、BPDU 防護(BPDU guard)、BPDU 過濾(BPDU filter)、根防護(root guard)與迴圈防護(loop guard)等功能,以強化安全性。為每個 VLAN 建立實例會增加 CPU 與記憶體需求,但可讓每個 VLAN 都有各自的根橋接器。使用 PVST+ 可讓管理員依 VLAN 進行流量負載平衡。舉例來說,VLAN 10 的根橋接器可以是交換器 A,而 VLAN 20 的根橋接器可以是交換器 B。這個版本的收斂方式與 802.1D 類似,也就是拓樸變化機制與 802.1D 相同,只是收斂是以每個 VLAN 為單位進行。
- RSTP, or IEEE 802.1w, is an evolution of STP that provides faster STP convergence. This version addresses many convergence issues, but because it still provides a single instance of STP, it does not address the suboptimal traffic flow issues. To support that faster convergence, the CPU usage and memory requirements of this version are slightly higher than the requirements of the original STP but lower than the requirements of PVST+. When a topology change occurs at a switch, it sends a TCN BPDU to its neighboring switches and flushes out the MAC Addresses in its MAC Address table. All switches receiving the TCN BPDU will repeat this until all switches have done so. Because switches do not wait for a BPDU from the root switch before aging out MAC Addresses, this causes the network to converge faster than in classic STP.RSTP,即 IEEE 802.1w,是 STP 的演進版本,能提供更快的 STP 收斂速度。這個版本解決了許多收斂相關的問題,但由於它仍然只提供單一 STP 實例,因此無法解決流量路徑次佳的問題。為了支援更快的收斂速度,這個版本的 CPU 使用率與記憶體需求略高於原始 STP,但低於 PVST+ 的需求。當某台交換器發生拓樸變化時,它會將 TCN BPDU 傳送給相鄰交換器,並清除其 MAC 位址表中的 MAC 位址。所有收到 TCN BPDU 的交換器都會重複這個動作,直到所有交換器都完成為止。由於交換器不需要等待來自根交換器的 BPDU 才會使 MAC 位址老化失效,因此這個版本的網路收斂速度比傳統 STP 更快。
- Rapid PVST+ is a Cisco enhancement of RSTP that uses PVST+. It provides a separate instance of 802.1w per VLAN. This version addresses both the convergence issues and the suboptimal traffic flow issues. However, this version has the largest CPU and memory requirements. The topology change mechanism in Rapid PVST+ is the same as in RSTP, except it is done per VLAN.Rapid PVST+ 是 Cisco 對 RSTP 的強化版,採用 PVST+ 架構,會為每個 VLAN 提供各自獨立的 802.1w 實例。這個版本同時解決了收斂問題與流量路徑次佳的問題。然而,這個版本對 CPU 與記憶體的需求也是最高的。Rapid PVST+ 的拓樸變化機制與 RSTP 相同,差別只在於是以每個 VLAN 為單位進行。
- MSTP is an IEEE standard that is inspired by the earlier Cisco proprietary MISTP implementation. To reduce the number of required STP instances, MSTP enables the mapping of multiple VLANs into the same spanning-tree instance with a common root bridge. The Cisco implementation of MSTP provides up to 16 instances of RSTP (802.1w) and combines many VLANs with the same physical and logical topology into a common RSTP instance. Each instance supports PortFast, BPDU guard, BPDU filter, root guard, and loop guard security enhancements. The CPU and memory requirements of this version are lower than the requirements of Rapid PVST+ but are higher than the requirements of RSTP. The topology change mechanism in MSTP is similar to the one in RSTP. However, due to having multiple spanning-tree instances (MSTI), the calculation is done per MSTI.MSTP 是受到早期 Cisco 專屬 MISTP 實作啟發而制定的 IEEE 標準。為了減少所需的 STP 實例數量,MSTP 可以將多個 VLAN 對應到同一個具有共同根橋接器的生成樹實例中。Cisco 對 MSTP 的實作最多可提供 16 個 RSTP(802.1w)實例,並將許多具有相同實體與邏輯拓樸的 VLAN 合併到同一個 RSTP 實例中。每個實例都支援 PortFast、BPDU 防護、BPDU 過濾、根防護與迴圈防護等安全強化功能。這個版本的 CPU 與記憶體需求低於 Rapid PVST+,但高於 RSTP。MSTP 的拓樸變化機制與 RSTP 類似,但由於存在多個生成樹實例(MSTI),計算是以每個 MSTI 為單位進行的。
Default Spanning Tree Configuration
預設生成樹設定
The default spanning tree mode for Cisco Catalyst switches is PVST+, which is enabled on all ports. PVST+ has much slower convergence after a topology change than the Rapid PVST but requires less CPU and memory resources to compute the shortest path tree upon topology changes.
Cisco Catalyst 交換器的預設生成樹模式是 PVST+,在所有連接埠上啟用。PVST+ 在拓樸變化後的收斂速度比 Rapid PVST 慢得多,但在拓樸變化時計算最短路徑樹所需的 CPU 與記憶體資源較少。
Where is RSTP defined?RSTP 定義於哪裡?