STP - Spanning Tree Protocol 生成树协议 // IEEE 802.1D
BPDU - Bridge Packet Data Unit
生成树协议用于建立一个没有环路的拓扑。基本概念就是利用交换机之间互相交换BPDU数据包,使之甄别出冗余链接。
基本来讲,要经过几个程序:
1. Root Bridge Election - 选择根桥,以此为前提来分析之后的拓扑 // smaller priority <<< smaller MAC address
2. Root Port Election - 非根桥端口选择根端口 (拥有到达根桥的最优路径 & 根桥 root path cost = 0)
3. Designated Port Election - 非根桥之间的连接,选择Designated port // maller root path cost <<< smaller BPDU sender bridge ID // all rest port will be in blocked
STP定义了五种不同的端口状态:
-
disabled
-
listening
-
learning
-
blocking
-
forwarding
STP (802.1D) Port State | RSTP (802.1w) Port State | Is Port Included in Active Topology? | Is Port Learning MAC Addresses? |
---|---|---|---|
Disabled | Discarding | No |