You are on page 1of 2

What is STP (Spanning Tree Protocol)?

STP (IEEE802.1d) is a mechanism to prevent loops forming in layer 2 Switches. By default, STP is enabled in Catalyst
Switches.

Types of STP (IEEE802.1D) –

CST

PVST

PVST+

RSTP (IEEE 802.1w)

MSTP (IEEE 802.1s)

STP Process –

1) Electing Root Bridge (Electing by Switch Priority value or Bridge ID (SwitchPriority+MAC Address))
2) Identify Root Port (Lowest Path Cost or Port ID (6-bit Port ID Value+MAC Address))
3) Identify Designated Port (Lowest Path cost to reach to Root Bridge or Port ID (6-Bit Port ID+MAC Add))
4) If loop exist in any port than STP immediately block that port and enable after only in loop free environment.

Electing Root Bridge – Root Bridge is elected by switches priority value. By default, every switch priority is 32768 and lower
priority becomes Root Bridge. In case of tie in switch priority value than BID (Bridge ID becomes a tie breaker. Bridge ID is
the combination of Switch priority and Switch MAC Address the lowest BID will become Root Bridge.

Identifying Root Port – Second step of STP Process is to identify Root port and every root port in every switches is
identifying by the lowest path cost to reach to the root bridge. Path cost is the cumulative cost based on the bandwidth of
the link. Highest bandwidth has lowest path cost. And Lowest wins.

In case of tie in path cost value than Bridge ID or port id becomes the tie breaker. Port ID is the combination of 6-bit port
priority value and MAC Address of that Port. Lowest will win. By default, 128 is the port priority value.

To decrease port priority value means that you are making that port as a root port manually –

Switch(Config)# int fa0/1

Switch (Config-int) # spanning-tree port-priority 50

Extended System ID - extended system is the combination of 12-bit System or VLAN ID, 4-bit Switch Priority and 48-bit
MAC Address.

As we know that Switch Bridge ID is 64-bit ID the combination of 16-bit switch priority and 48 bot MAC Address. We need
to add 12 bit VLAN ID as system ID into switch bridge ID so instead of adding additional 12 bit into 64-bit Switch Bridge ID
we borrowed 12 bits from 16-bit Switch priority and add 12 bit VLAN ID into Switch Bridge ID.

After enabling Extended System ID switch accomplish 2 things –

1) Increase the numbers of VLAN’s from 1005 to 4094


2) Add VLAN ID into Switch bridge ID

Also switch priority value decreased from 65535 to 61440 in the multiplication of 4094.
Switch(Config)# spanning-tree extend system-id

STP Port States - There are total 5 STP Port States –

1) Blocking State – This is the default state of any Switch Port when we powered on or it could be disabled by STP to
eliminate lops. In block state port cannot forward BPDU’s or can’t learn MAC address. Still it will listen for BPDU’s to
know about the changes in topology.
2) Listening State – Now the block port will be placed into the listening state only if it is not blocked by STP to
eliminate loops. In listening state port cannot forward BPDU’s(Frames) and cannot learn MAC Address. This port
will listen for BPDU’s to participate into electing root bridge, to select root port and to select designated port. In
this state port become root port and designated Port.
3) Learning State –After a brief period of time called Forward delay the port becomes either root port or designated
port in the listening state and placed into learning state. In the learning state port still unable to forward
BPDU’s(Frames) but in this state port can learn BPDU’s and it could learn MAC Address also. If a port in Listening
state is not elect as a root port or Designated Port than port will be back to block state.
4) Forwarding state –After one more forward delay port will be come into forwarding state from learning state. In this
state port can forward any type of BPDU’s (Frames) into network and also keep continue to build MAC table
5) Disabled State – A port in a disabled state when it is administratively down and does not participate into STP
Process.

Note – On average any port taking 30-50 Seconds to reach from Blocking state to forwarding state.

You might also like