HCIP spanning tree STP summary

Insert image description here

STP spanning tree

4 elections for bridges

Root bridge:

          有且仅有一台,且由BPDU中的桥ID来决定                                                                               
           桥ID= 网桥优先级(0-65535公有) 默认32768 +  MAC地址(只有存在svi接口的交换机才拥有mac地址,若存在多个mac选数值最小) 
           根网桥的选举   先比较优先级,小优;   若优先级相同,比较mac,数值小优;

Root port:

           在每台非根网桥上,有且仅有一个接口;本地离根网桥最近的接口(最短、星型),接收来自根网桥的BPDU,转发用户的流量(该接口不阻塞)                                                         
           1、比较从根网桥发出后,通过该接口进入时最小的cost值;
           2、入向cost值相同,比较该接口对端设备的BID,小优
           3、对端BID也相同,比较该接口对端设备的接口的PID;先优先级小,若优先级一致,编号小
           4、连对端PID也相同,比较本地PID,小优;

PID=port ID interface priority (0-240, step size 16, default 128) interface number

Specify port:

              在每一段存在STP的物理链路上,有且仅有一个;转发来自根网桥的BPDU,同时可以转发用户流量(不阻塞);默认根网桥上所有接口为指定端口;                                                    
             1、比较从根网桥发出后,通过该接口进入这段链路时的cost值最小(出向)
             2、若出向cost值相同,必须本地的BID,小优;
             3、本地BID相同,比较本地的PID;
             4、本地PID,相同,直接阻塞该端口;

Non-designated port (blocked port):

               当以上所有角色全部选举完成后,剩余没有任何角色的接口为非指定;
               该接口逻辑阻塞,实际可以接收到信息,但不转发;

Interface peer: the previous device that transmits data to this interface

Cost value: Different bandwidths have different costs.

802.1d standard: 802.1T standard
10M = 100 1000M= 20000
100M=19 100M=200000
1000M=4
10000M=2

100000M=1

interface status

down:

        没有BPDU收发,一旦可以进行BPDU收发进入下一状态

Listening:

      强制15s;所有交换机进行BPDU收发,选举所有角色;接口角色为非指定端口直接进入阻塞状态;若为指定端口和根端口进入下一状态;

study:

      强制15s; 指定端口和根端口学习所有接口连接设备的MAC地址,生成MAC表;之后进入下一状态;

Forward:

      指端端口和根端口进入,可以转发用户报文;

block:

      逻辑阻塞;

Note:

  只有到接口进入到转发状态后,才能为用户转发数据报文,之前的30s不能转发任何数据;收敛时间:                                                               
  初次收敛—30s =  15侦听+15s学习

802.1D

There is only one spanning tree in a switching network

BPDU - Bridge Protocol Data Unit - is used between switches to communicate and interact with each other to send and receive data.

  • Configure BPDU

    • There is only one root bridge. In the initial state of the switch network, all switches can be the root bridge. After sending the BPDU, the root bridge is selected based on the comparison of parameters in the data. After that, other non-root bridges cannot Send BPDU again, only accept and forward BPDU. The sending period is 2s, and the hold time is 20s.
  • TCN – topology change message

    • After the link failure of the local switch, STP (Spanning Tree) re-converges. In order to quickly refresh the MAC tables of all switches in the entire network, TCN will be sent to all local STP interfaces (the TCN position in the flag bit is 1), and the neighbor switch receives the TCN. Finally, the ACK bit is first marked as a reply for reliable transmission of the message; then the TCN is forwarded to the root bridge step by step, and the root bridge replies with a TC message to all switches step by step; causing all switches to temporarily transfer the MAC table The aging time is modified to 15s (default, forwarding delay)

shortcoming

  • Slow convergence
  • Low link utilization

PVST

This protocol is a CISCO private protocol - (vlan-based spanning tree protocol)

Within each vlan, there is a tree, and the working principle of each tree is the same as 802.1d; the difference between BPDUs of different vlans is the priority;

优先级=4096倍数+vlan id   人为仅可修改4096倍数备份,且只能修改为4096的整倍

Only supports trunk encapsulation as ISL (cisco private encapsulation)

PVST +

It is an advanced version based on PVST, compatible with 802.1q trunk encapsulation, and designed with partial acceleration

  • Port acceleration

    • Enter the interface for layer connection users. There is no need to wait 30s when establishing a connection. You can use it directly.
  • Uplink acceleration - for direct connect detection

    • 仅在接入层设备上配置,因为配置后,该交换机将自动加大本地的网桥优先级;                          
      

    Under direct connection detection conditions, the blocked interface will skip 30s and enter the forwarding state directly.

  • Backbone acceleration - targeting sub-optimal BPDUs

    •    所有交换机均可配置,针对接收到次优BPDU的阻塞端口可以跳过20s的hold time;                   
      
      Originally it was 50s, 20s hold time; then it was 15s listening + 15s learning.

shortcoming

  • Incomplete acceleration
  • Many trees

rapid spanning tree

cisco's RSTP - vlan-based rapid spanning tree - one vlan, one tree

    pvst+的升级

Public RSTP (802.1w) - one tree for the entire switched network

     802.1d的升级

principle

  • 1. The timer is cancelled, but after the work in one state is completed, it directly enters the next state;
  • 2. Segmented synchronization, step-by-step convergence between the two devices; using request and consent tags; relying on the 1st and 6th bits of the tag bits
  • 3. The keep-alive time of BPDU is 6s; hello time is 2s;
  • 4. Integrate port acceleration (edge ​​interface), uplink acceleration, and backbone acceleration
  • 5. Compatible with 802.1d and PVST, but 802.1d and PVST do not use bits 1-6 of the flag bits, so they cannot converge quickly; therefore, if there is a device in the network that does not support fast convergence, other devices that enable fast convergence will also Not fast;
    when the tcn message appears, the local cam table can be refreshed without waiting for the BPDU of the root bridge;

Note:

  接口默认为半双工时,即便允许RSTP,依然基于慢速的802.1D算法来收敛;                          

Edge interface: The
interface used to connect to the PC. Once it is set as an edge interface, it will no longer send BPDUs and does not perform STP convergence. It will be in the forwarding state directly. However, if the interface receives BPDUs from the opposite end, it will lose Edge characteristics, normal convergence again;

802.1 S/MSTP/MST

Inherits the basis of rapid spanning tree; places multiple vlans in a group, and creates a spanning tree based on each group;

     不同组间的BPDU中优先级= 4096倍数+组号    
     默认存在组0,且所有vlan默认处于该组;优先级= 32768+0

Note:

  若将创建某个组,但该组内的vlan,在本交换机上没有创建,同时没有为该vlan服务的接口;该组将没有任何信息;                                           
  整个交换网络中所有设备的分组信息必须完全一致;

Guess you like

Origin blog.csdn.net/Nirvana92/article/details/132393269