一 環路
①二層環路:交換機與交換機所産生的 (路徑混亂,引起無限死循環)
②三層環路:路由器與路由器之間 (配置錯誤,協定缺陷)
解決方法:STP
網絡環路的影響:
1.
廣播風暴
2.
多重複資料幀
3.MAC
位址表不穩定
二 STP (生成樹)
解決環路問題,提高網絡安全,激活備援備份鍊路。
注:VRRP 對網關備份
MSTP :基于VLAN的執行個體,進而生成多生成樹
分類:STP RSTP MSTP
三 STP 端口狀态

阻塞 (Blocking)
聽 (listening)
學習 (learning)
轉發 (forwarding)
禁止 (disable)
注意:橋ID小的被選為根橋,優先級小的為優,MAC 位址小為優
STP 端口角色
①根端口 rp ②指定端口 dp ③ ap
注:dp, rp ap, 根據coat 值計算
四 配置BPDU 比較原則---優先級最小為優
① 首先比較RootBridgeID (根橋ID),② 其次比較RootPathCost (根路徑開銷) ,③ 再次比較DesignaterBridgeID (指定ID),④再其次比較DesignatePortID (指定端口ID),⑤最後比較BridgePortID (本地橋端口ID)
五 STP 的3種計時器
① Hello 時間 ② 轉發延遲 ③ 最大老化時間
六 RSTP (快速生成樹)
① 端口狀态:Discarding Learning Forwaring
注:無法實作不同VLAN在多餘 Trunk 鍊路上的負載分擔,Trunk 鍊路實行運作多個VLAN,所有VLAN共用一顆生成樹。
七 MSTP (多生成樹)
注:将多個VLAN 捆綁到一個執行個體,每個執行個體生成獨立的生成樹,在多條Trunk 鍊路上實作VLAN負載分擔
MSTP 具有RSTP 的快速收斂,同時又具有負載分擔機制,MSTP相容STP 和RSTP
實驗
SW1
Switch>en
Switch#conf
Switch(config)#vl 10
Switch(config-vlan)#exi
Switch(config)#int f 0/10
Switch(config-if)#switchport access vl 10
Switch(config)#int range f 0/1 -2
Switch(config-if-range)#switchport mode trunk
Switch(config-if-range)#exi
Switch(config)#spanning-tree mode rapid-pvst
Switch(config)#
SW2
Switch(config-if)#exi
Switch(config)#^Z
Switch#show spanning-tree
VLAN0001
Spanning tree enabled protocol rstp
Root ID Priority 32769
Address 0090.0C35.20D3
Cost 19
Port 1(FastEthernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 00D0.975D.0A24
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/2 Altn BLK 19 128.2 P2p
Fa0/1 Root FWD 19 128.1 P2p
VLAN0010
Root ID Priority 32778
Bridge ID Priority 32778 (priority 32768 sys-id-ext 10)
Fa0/10 Desg FWD 19 128.10 P2p
Switch(config)#int f 0/1
Switch(config-if)#shu
PC>ping -t 192.168.1.3
Pinging 192.168.1.3 with 32 bytes of data:
Reply from 192.168.1.3: bytes=32 time=0ms TTL=128