Spanning Tree
配置
PVST+
switch(config)# spanning-tree mode stp
RSTP
switch(config)# spanning-tree mode rapid-pvst
MSTP
switch(config)# spanning-tree mst
switch(config)# spanning-tree mst configuration
switch(config-mst)# name Region1
switch(config-mst)# revision 1
switch(config-mst)# instance 1 vlan 11-13
switch(config-mst)# instance 2 vlan 21-23
Spanning Tree 選舉
選Root Switch (Switches)
- Bridge ID 小
Switch選一個Root Port (Switch ports)
- 去Root的cost 少
- 對接的Switch的Bridge ID 小
- 對接的Port 的 Port ID 小
Link選一個Designated Port (Link ports)
- Root Switch的所有Ports都是Designated Port
- 去Root的cost少
- Ports的Switch的Bridge ID 小
- 剩下的Ports都是non-Designated Port
RSTP Mode限定: 選Alternate/Backup Port (Link ports)
- non-Designated Port的Switch的Bridge ID比對面的Switch大, 就是Alternate Port
- 相反, 則是Backup Port
Port State
PVST+ Port State | BPDU | Function | Forwarding Delay |
---|---|---|---|
Disabled | – | – | – |
Blocking | Rx | – | – |
Listening | Rx & Tx | Election | 15s |
Learning | Rx & Tx | Root Port / Designated Port | 15s |
Forwarding | Rx & Tx | Rx & Tx Frame |
RSTP Port State | BPDU | Function | Forwarding Delay |
---|---|---|---|
Disabled | – | – | – |
– | – | – | – |
– | – | – | – |
Learning | Rx & Tx | Root Port / Designated Port | 15s |
Forwarding | Rx & Tx | Rx & Tx Frame |
Cost
100Mb: 19
155Mb: 14
1000Mb: 4
10000: 2