320 likes | 412 Views
Spanning Tree Protocol (STP). What STP is, why do we need it, and how to configure STP (properly ). Frank Olshansky – Frank_Olshansky@iu13.org. Introduction to the Spanning Tree Protocol. Also known as STP Developed in 1990 IEEE 802.1D standard. Why do we need STP.
E N D
Spanning Tree Protocol (STP) What STP is, why do we need it, and how to configure STP (properly) Frank Olshansky – Frank_Olshansky@iu13.org
Introduction to the Spanning Tree Protocol • Also known as STP • Developed in 1990 • IEEE 802.1D standard
Why do we need STP • STP was developed to allow for redundancy between switches and to prevent Layer 2 loops • No Layer 2 equivalent of Time To Live (TTL) • If there was no STP: • Broadcast Storms • Unstable MAC address table • Multiple copies of same frame
Without STP 2 1 3
Without STP 2 1 3
Without STP 2 1 3
Without STP 2 1 3
Without STP 2 1 3
Without STP 2 1 3
What STP does 2 1 3
What STP does 2 3 1
What STP does 2 1 3
Root bridge • STP elects a single root bridge for the network • The root bridge is selected through an election process, and the switch that wins is the switch with the lowest Bridge ID (BID) • The bridge ID is an 8 byte field • 2 byte bridge priority • 0-61440 • 32768 is the default • 6 byte MAC address of the switch
Bridge Protocol Data Unit (BPDU) • Frames that contain information about STP • Sent as multicast to 01:80:C2:00:00:00 • Configuration BPDUs are sent every 2 seconds by default • Three types • Configuration BPDU: Provides information to all switches. • TCN (Topology Change Notification): Lets switches know about changes in the STP topology. • TCA (Topology Change Acknowledgment): Acknowledges TCN.
STP port states • Root Port – Port on a non-root bridge that is closest to the root bridge, according to STP port cost • Designated Port – The port on a network link that is closest to the root bridge, according to STP port cost • Note: Every network link has a designated port • Non-designated port – Port that is blocked by STP, so that a loop-free Layer 2 topology is maintained • Disabled port – A port that is administratively down
STP port costs • 10 Mbps = 100 • 100 Mbps = 19 • 1 Gbps = 4 • 10 Gbps = 2
STP port states 2 1 3
STP convergence times • When primary link to root bridge down, it takes 50 seconds for the switch to transition to the backup link • The switch links go through the following states: • Blocking – Switch listens for BPDUs from root • 20 seconds • Listening – Listens to any BPDUs arriving on any interfaces • 15 seconds • Learning – Populating MAC address table • 15 seconds • Forwarding
STP Flavors • Common Spanning Tree (CST) – One spanning tree topology for all of the VLANs • Per-VLAN Spanning Tree plus (PVST+) – One spanning tree topology per VLAN; Cisco proprietary • PVST – Over ISL trunk • PVST+ – Over an 802.1Q trunk • Multiple Spanning Trees (MST) – One spanning tree topology for one or multiple vlans • IEEE 802.1s
STP Flavors • The bridge ID is an 8 byte field • 2 byte bridge priority • 0-61440 • 32768 is the default • 6 byte MAC address of the switch • With PVST+ and MST, the bridge priority field is split • 4 bit bridge priority • Increments of 4096 • 12 bit extended system id • 1 to 4095 corresponding to the VLAN
Rapid Spanning Tree Protocol • Spanning tree topology convergence is much quicker • Convergence time goes from 50 seconds to 3 seconds
Rapid Spanning Tree Port Roles • Root port – Same as root STP port state in STP • Port on a non-root bridge that is closest to the root bridge, according to STP port cost • Designated Port – Same as designated port state in STP • The port on a network link that is closest to the root bridge, according to STP port cost • Note: Every network link has a designated port • Disabled Port – Same as disabled port state in STP • A port that is administratively down
Rapid Spanning Tree Port Roles • No such thing as non-designated ports • Alternate Port – Port that STP blocks, so that a loop-free Layer 2 topology is maintained • Can be changed to a designated port very quickly • Backup port – Only occurs when there are two connections going into a hub
Rapid Spanning Tree Port States • Disabled – Data is not forwarded on port • Disabled ports, Backup ports, and Alternate ports • Learning – Switch is learning MAC addresses through port • Seen when port is transitioning from disabled to forwarding • Forwarding – Data is being forwarded on port • Root and Designated ports
Rapid Spanning Tree Link Types • Point-to-Point – Inter-switch connections • Shared – Link going from a switch to a hub • Edge – Link going from switch to an edge device
Spanning Tree “Optional” Features • PortFast • Allows a switch port to go into forwarding state almost immediately • Configured on ports connecting to endpoints • Can set it up by default or on a per-interface basis • Turned off on trunk ports
Spanning Tree “Optional” Features • BPDU Guard • Causes a port to go into an error disabled state if a BPDU is received on that port • Can be enabled by default or on a per interface basis • Should be configured on any port that should not be connecting to other switches