spanning tree for advanced users

0
315

Spanning Tree Protocol

Switches (and bridges) needed a mechanism to prevent loops from forming, and thus Spanning Tree Protocol (STP, or IEEE 802.1D) was developed. STP is enabled by default on all VLANs on Catalyst switches. STP-enabled switches communicate to form a topology of the entire switching network, and then shutting down (or blocking) a port if a loop exists. The blocked port can be reactivated if another link on the switching network goes down, thus preserving fault-tolerance. Once all switches agree on the topology database, the switches are considered converged. STP switches send BPDU’s (Bridge Protocol Data Units) to each other to form their topology databases. BPDU’s are sent out all ports every two seconds, are forwarded to a specific MAC multicast address: 0180.c200.0000.
STP Types
Various flavors of 802.1D STP exist, including:
Common Spanning Tree (CST) – A single STP process is used for all VLANs.
Per-VLAN Spanning Tree (PVST) – Cisco proprietary version of STP, which employs a separate STP process for each VLAN.
Per-VLAN Spanning Tree Plus (PVST+) – Enhanced version of PVST that allows CST-enabled switches and PVST-enabled switches to interoperate. This is default on newer Catalyst switches.
The STP Process
To maintain a loop-free environment, STP performs the following functions
• A Root Bridge is elected
Root Ports are identified
Designated Ports are identified
• If a loop exists, a port is placed in Blocking state.
If the loop isremoved the blocked port is activated again. If multiple loops exist in the switching  environment, multiple ports will be placed in a blocking state.
Electing an STP Root Bridge
The first step in the STP process is electing a Root Bridge, which serves as the centralized point of the STP topology. Good design practice dictates that the Root Bridge be placed closest to the center of the STP topology. The Root Bridge is determined by a switch’s priority. The default priorityis 32,768, and the lowest priority wins. In case of a tie in priority, the switch with the lowest MAC address will be elected root bridge. The combination of a switch’s priority and MAC address make up that switch’s Bridge ID.
Identifying Root Ports
 The second step in the STP process is identifying Root Ports, or the port on each switch that has the lowest path cost to get to the Root Bridge. Each switch has only one Root Port, and the Root Bridge cannot have a Root Port.
Path Cost is a cumulative cost based on the bandwidth of the links. The higher the bandwidth, the lower the Path Cost
 
Identifying Designated Ports
The third and final step in the STP process is to identify Designated Ports. Each network segment requires a single Designated Port, which has the lowest path cost leading to the Root Bridge. This port will not be placed in a blocking state. A port cannot be both a Designated Port and a Root Port.

Find Root Bridge and Alternate Port
Switch0#show spanning-tree
     VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0060.3E51.EDD3
             This bridge is the root
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     0060.3E51.EDD3
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20
Interface        Role Sts Cost      Prio.Nbr Type
—————- —- — ——— ——– ——————————–
Fa0/2            Desg LRN 19        128.2    P2p
Fa0/1            Desg LRN 19        128.1    P2p
Switch1#show spanning-tree
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0060.3E51.EDD3
             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     00E0.B0AB.BBD8
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20
Interface        Role Sts Cost      Prio.Nbr Type
—————- —- — ——— ——– ——————————–
Fa0/1            Root FWD 19        128.1    P2p
Fa0/2            Altn BLK 19        128.2    P2p
Switch2#show spanning-tree
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0060.3E51.EDD3
             Cost        19
             Port        2(FastEthernet0/2)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     00D0.D316.30EE
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20
Interface        Role Sts Cost      Prio.Nbr Type
—————- —- — ——— ——– ——————————–
Fa0/1            Desg FWD 19        128.1    P2p
Fa0/2            Root FWD 19        128.2    P2p

Comments

comments