一   环路

  ①二层环路:交换机与交换机所产生的   (路径混乱,引起无限死循环)

  ②三层环路:路由器与路由器之间    (配置错误,协议缺陷)

解决方法:STP 

网络环路的影响:

1.

广播风暴

 

2.

多重复数据帧

 

3.MAC

地址表不稳定

 


二  STP (生成树)

 解决环路问题,提高网络安全,激活冗余备份链路。

注:VRRP 对网关备份 

     MSTP :基于VLAN的实例,从而生成多生成树 

分类:STP   RSTP    MSTP 

三   STP 端口状态

STP _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  




实验 


STP _路由交换_02

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>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-if)#exi

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)#^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

             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

             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

  Spanning tree enabled protocol rstp

  Root ID    Priority    32778

             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    32778  (priority 32768 sys-id-ext 10)

             Address     00D0.975D.0A24

             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

             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

Fa0/10           Desg FWD 19        128.10   P2p

Switch#conf

Switch(config)#int f 0/1 

Switch(config-if)#shu

Switch#show spanning-tree 

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

Reply from 192.168.1.3: bytes=32 time=0ms TTL=128

Reply from 192.168.1.3: bytes=32 time=0ms TTL=128


(关闭一个接口,STP 作用体现)