Spanning Tree Protocol: overview

Definition:

Spanning Tree Protocol:

The spanning tree provides the same safety that routing protocols offer in Layer 3 forwarding environments to Layer-2 bridging environments. A single best path to a main bridge is found and maintained in the Layer 2 domain, and other redundant paths are managed by selective port blocking. Appropriate blocked ports start begin forwarding when primary paths to the main bridge are no longer available.

The IEEE published the first Spanning Tree Protocol (STP) standard, 802.1d, in 1990. The last version of 802.1d was published in 2004 and included several enhancements. The 802.1d standard supported single common spanning tree.

Real-time switch to switch negotiation after a topology change. The choice of ports



 For blocking or forwarding was fast, as was the flushing of invalid MAC addresses in the affected switches. The 802.1w standard, like the 802.1d standard, supported a single common spanning tree instance.

Multiple Instance Spanning Tree Protocol (MISTP), IEEE 802.1s, allows several VLANs to be mapped to a reduced number of spanning-tree instances. Cisco curriculums refer to IEEE 802.1s as Multiple Spanning Tree (MST). Each MST instance handles multiple VLANs that have the same Layer 2 topology.

Two Cisco proprietary spanning tree protocols are using in common use:

1.Per VLAN Spanning Tree Plus (PVST+)
2.Per VLAN Rapid Spanning Tree Plus (PVRST+)

 Both protocols allow an instance of either STP or RSTP to run on each VLAN configured on the switch side. PVST+ is based on the IEEE 802.1D standard and includes Cisco proprietary such as Backbone-fast, Uplink-Fast, and PortFast. PVRST+ is based on the IEEE 802.1w standard and has a faster convergence time than 802.1D.

 Enabling Spanning Tree Protocol:

SW1(config)#spanning-tree vlan 10
Enables STP on VLAN 5
SW1(config)#no spanning-tree vlan 10
Disables STP on VLAN 5

 Configuring the Root Switch:

SW1(config)#spanning-tree vlan 10 root {primary | secondary}
Let’s Modify the switch priority from the default 32768 to a lower value to allow the switch to become the primary or secondary root switch for VLAN 5.



SW1(config)#spanning-
tree vlan 10 root primary
Configures the switch to become the root switch for VLAN 10.
SW1(config) #spanning-tree vlan 10
root primary diameter 7
Configures the switch to be the root switch for VLAN 10 and sets the network diameter to 7.

Configuring a Secondary Root Switch:

SW1(config)#spanning-tree
vlan 10 root secondary
Configures the switch to become the root switch for VLAN 10 should the primary root switch fail.
SW1(config)#spanning-tree vlan 10 root secondary
diameter 7
Configures the switch to be the secondary root switch for VLAN 10 and sets the network diameter to 7.

Configuring Port Priority:

SW1(config)#interface
gigabitethernet 0/1
Moves to configuration interface mode.
SW1(config-if)
#spanning-tree port-priority 64
Configures the port priority for the interface that is an access port on Switch.
SW1(config-if) #spanning tree vlan 10 port-priority 64
Configures the VLAN port priority for an interface that is a trunk port on switch.


Configuring the Path Cost:

 
SW1(config)#interface
gigabitethernet 0/1
Moves to interface configuration mode.
SW1(config-if)#spanning-
tree cost 10000
Configures the cost for the interface that is an access port on switch.
SW1(config-if)#spanning tree vlan 10 cost 100000
Configures the VLAN cost for an interface that is a trunk port on switch.

Configuring the Switch Priority of the VLAN:

 
SW1(config)#spanning-tree
vlan 10 priority 12288
Configures the switch priority of VLAN 10 to 12288

NOTE:

The default is 32768. The lower Switch priority, the more likely the switch will be chosen as the root switch. Following numbers can be used as priority values:

0
4096
8192
12288
16384
20480
24576
28672
32768
36864
40960
45056
49152
53248
57344
61440
  
Configuring STP Timers:

SW1(config)#spanning-tree
vlan 10 hello-time 5
Changes the hello-delay timer to 5 seconds on VLAN 10
SW1(config)#spanning-tree
vlan 10 forward-time 15
Changes the forward-delay timer to 15 seconds on VLAN 10
SW1(config)#spanning-tree
vlan 10 max-age 30
Changes the maximum-aging timer to 30 seconds on VLAN 10



2 comments: