SPANNING-TREE PROTOCOL

Spanning-tree Protocol:
- STP stop the loops which occurs when you have multiple links between switches
- STP stops avoiding Broadcast Storms, Multiple Frame copies & Database instability
- STP is a open standard (IEEE 802.1D)
- STP enabled by default on all Cisco Catalyst Switches

How Spanning-tree Protocol works:
- Selecting the Root Bridge
- Selecting the Root Port
- Selecting Designated port and Non Designated port

01 Selecting the Root Bridge
- The bridge with the Best(Lowest) Bridge ID
- Bridge ID = Priority + MAC address of the switch(least is best)
- Out of all the switches in the network, one is elected as a root bridge that becomes the focal point in the network

02 Selecting the Root Port
- Shortest path to the Root Bridge
- Every Non-root bridge looks the best way to go Root Bridge
- For every non-root bridge there is only one root port
- Least cost(Speed)
- Bridge-ID of forwarding switch
- Least port of forwarding switch
- Rot port selection based on Cost(least cost(Speed))
10mbps(BW) – 100(Cost)
100mbps(BW) – 19(Cost)
1-Gigabit Ethernet(BW) – 4(Cost)
10-Gigabit Ethernet(BW) – 2(Cost)

03 Selecting Designated port & Non Designated port
- Least cost(Speed)
- The least local switch-ID
- Lowest local port number

BPDU:
- All switches exchange information through what is call Bridge Protocol Data Units(BPDUs)
- BPDUs are sent every 2 sec and dead in 20 sec
- A BPDU contains information regarding ports, switches, port priority and addresses

Lab: