#The Facts About Spanning Tree
* Original STP (802.1D) was created to prevent loops
* Switches send "Probes" into the network called Bridge Protocol Data Units (BPDUs) to discover loops
* The BPDU probes also help elect the core switch of the network, caled the ROOT BRIDGE
* The simplistic view of STP: All switches find the best way to reach the root bridge then BLOCK all redundant links.
#Understanding BPDUs and Elections
*BPDUs are sent once every 2 seconds
--------------------------
| Priority | MAC Address |
--------------------------
*Priority is some value between 0 and 61440 (Default is 32768); increments of 4096 - lower is better
Ej: 32768.aaaa.aaaa.aaaa
#Three Port Types
* ROOT Port: Used to reach the root bridge
* DESIGNATED Port: Forwarding port, one per link
* BLOCKING / NON-DESIGNATED Port: where the tree fell
#How STP Finds The Best Path
* Elect the ROOT
* Switches find lowest cost path to root
Costs:
--------------------------------
Link Bandwidth STP Cost
--------------------------------
4 Mbps 250
--------------------------------
10 Mbps 100
--------------------------------
16 Mbps 62
--------------------------------
45 Mbps 39
--------------------------------
100 Mbps 19
--------------------------------
155 Mbps 14
--------------------------------
622 Mbps 6
--------------------------------
1 Gbps 4
--------------------------------
10 Gbps 2
--------------------------------
#Electing Designated Ports
1. Lowest root bridge ID
2. Lowest root path cost to root bridge
3. Lowest sender bridge ID
4. Lowest sender port ID
* Use lower bridge ID on equal cost path.
* Use lower port to break a tie (2 switch)
#Per VLAN Spanning-Tree
* All modern Cisco switches run PVST
* One ROOT BRIDGE elected for each VLAN
* Helps load-balance more effectively
---------------------------------
| Priority | VLAN | MAC Address |
---------------------------------
Ej:
Vlan 1´s Priority = 32768 + 1 = 32779.MAC
Vlan 10´s Priority = 32768 + 10 = 32778.MAC
#Problems With Spanning-Tree 50 Sec !!!
------------- * 15 Seconds of Listening for BPDUs
| Listening | ->
------------- * Switch sends / recives BPDUs
------------ * 15 Seconds of Learning MAC addresses
| Learning | ->
------------ * Populates Switch CAM table
--------------
| Forwarding | -> * Port is Forwarding Traffic
--------------
------------ * BONUS - Switch will wait up to 20 seconds
| Blocking | -> (MAX-AGE) before moving a blocked port into
------------ Listening phase.
#Configuration BPDU Message Content
---------------------------------------------------------
Field Description Number of Bytes
---------------------------------------------------------
Protocol ID (always 0) 2
---------------------------------------------------------
Version (always 0) 1
---------------------------------------------------------
Message Type (Configuration or TNC BPDU) 1
---------------------------------------------------------
Flags 1
---------------------------------------------------------
Root Bridge ID 8
---------------------------------------------------------
Root Path Cost 4
---------------------------------------------------------
Sender Bridge ID 8
---------------------------------------------------------
Port ID 2
---------------------------------------------------------
Message Age (in 256 ths of a second) 2
---------------------------------------------------------
Maximum Age (in 256 ths of a second) 2
---------------------------------------------------------
Hello Timer (in 256 ths of a second) 2
---------------------------------------------------------
Forward Delay (in 256 ths of a second) 2
---------------------------------------------------------
#Topology Change Notification BPDU Message Content
---------------------------------------------------------
Field Description Number of Bytes
---------------------------------------------------------
Protocol ID (always 0) 2
---------------------------------------------------------
Version (always 0) 1
---------------------------------------------------------
Message Type (Configuration or TNC BPDU) 1
---------------------------------------------------------