Lecture 4: Spanning-Tree Protocol (PDF) - Cisco Networking
Document Details
![CleanerRecorder864](https://quizgecko.com/images/avatars/avatar-20.webp)
Uploaded by CleanerRecorder864
2025
Brent MacRae
Tags
Summary
This document is a slide deck from a lecture on the Spanning Tree Protocol (STP), covering topics related to network redundancy, MAC database instability, and broadcast storms. It includes diagrams, explanations, and discussion of Cisco's STP implementation. The lecture is from January 2025 focusing on networking concepts.
Full Transcript
Lecture 4: Spanning-Tree Protocol INFR 1421 Introduction to Networking II Brent MacRae January 2025 4.1 Spanning-Tree Concepts © 2025 Brent MacRae 2 Dundas Dundas doesn’t...
Lecture 4: Spanning-Tree Protocol INFR 1421 Introduction to Networking II Brent MacRae January 2025 4.1 Spanning-Tree Concepts © 2025 Brent MacRae 2 Dundas Dundas doesn’t know Bay Spadina Queen doesn’t doesn’t know Bay know Bay Spadina Queen Delivery for Bay Jarvis Purpose of Spanning Tree Redundancy at OSI Layers 1 and 2 ▪ Three-tier model (Core, Distribution, Access) with redundancy attempt to eliminate a single point of failure in the network. ▪ Multiple cabled paths between switches: Provide physical redundancy in a switched network. Improves the reliability and availability of the network. Enables users to access network resources, despite path disruption. © 2025 Brent MacRae 4 Purpose of Spanning Tree Redundancy at OSI Layers 1 and 2 © 2025 Brent MacRae 5 Purpose of Spanning Tree Redundancy at OSI Layers 1 and 2 ▪ Considerations when implementing redundancy: MAC database instability Broadcast storms Multiple frame transmission © 2025 Brent MacRae 6 Purpose of Spanning Tree Issues with Layer 1 Redundancy: MAC Database Instability ▪ Ethernet frames do not have a time to live (TTL) attribute. Frames continue to propagate between switches endlessly, or until a link is disrupted and breaks the loop. Results in MAC database instability. Can occur due to broadcast frames forwarding. ▪ If there is more than one path for the frame to be forwarded out, an endless loop can result. When a loop occurs, it is possible for the MAC address table on a switch to constantly change with the updates from the broadcast frames, resulting in MAC database instability. © 2025 Brent MacRae 7 Switch 1 Switch 2 Switch 1 MAC Table F0/1 F0/1 Switch 2 MAC Table PC1 = F0/3 PC1 = F0/1 F0/2 F0/3 F0/2 F0/2 F0/3 F0/3 Switch 2 and Switch 4 update their MAC tables with PC1’s new information PC 1 F0/3 F0/2 F0/3 F0/2 Switch 4 MAC Table F0/1 F0/1 PC1 =F0/3 = F0/1 =F0/2 Switch 3 Switch 4 All PC1 Eachswitches sends Switchswitch Switches This update broadcast forwards 3 continue will forwards will their the continueframe the MAC broadcast forever address astoLayer switch received to forwardout all tables 3 ports 2broadcast broadcasts frames do with frames except out PC1’s the notallhave aallinformation out ingress non-ingressportsport except ports time-to-live the ingress (TTL) field. and update their MAC address tables with the new location of PC1 Purpose of Spanning Tree Issues with Layer 1 Redundancy: Broadcast Storms ▪ A broadcast storm occurs when there are so many broadcast frames caught in a Layer 2 loop that all available bandwidth is consumed. It is also known as denial of service ▪ A broadcast storm is inevitable on a looped network. As more devices send broadcasts over the network, more traffic is caught within the loop; thus consuming more resources. This eventually creates a broadcast storm that causes the network to fail. © 2025 Brent MacRae 9 Purpose of Spanning Tree Issues with Layer 1 Redundancy: Broadcast Storms © 2025 Brent MacRae 10 Purpose of Spanning Tree Issues with Layer 1 Redundancy: Duplicate Unicast Frames ▪ Unicast frames sent onto a looped network can result in duplicate frames arriving at the destination device. ▪ Most upper layer protocols are not designed to recognize, or cope with, duplicate transmissions. ▪ Layer 2 LAN protocols, such as Ethernet, lack a mechanism to recognize and eliminate endlessly looping frames. © 2025 Brent MacRae 11 STP Operation Spanning Tree Algorithm: Introduction ▪ Redundancy is necessary in networks, but can lead to issue such as loops and broadcast storms. ▪ Spanning Tree Protocol (STP) ensures that there is only one logical path between all destinations on the network by intentionally blocking redundant paths that could cause a loop. ▪ A port is considered blocked when user data is prevented from entering or leaving that port. This does not include bridge protocol data unit (BPDU) frames that are used by STP to prevent loops. ▪ The physical paths still exist to provide redundancy, but these paths are disabled to prevent the loops from occurring. ▪ If the path is ever needed to compensate for a network cable or switch failure, STP recalculates the paths and unblocks the necessary ports to allow the redundant path to become active. © 2025 Brent MacRae 12 Spanning Tree In Action! Switch 1 Switch 2 Dundas Spadina Queen Jarvis Switch 3 Switch 4 Switch Each 2 only switch onlyreceives has one one copy logical of every path frame to each now destination STP Operation Spanning Tree Algorithm: Introduction ▪ The first step in the STA is to determine which ports to “block” to prevent loops. ▪ The STA designates a single switch as the root bridge and uses it as a reference for all path calculations. ▪ All switches in STP send BPDUs (bridge protocol data unit) to determine which switch has the lowest bridge ID (BID). ▪ Switch with the lowest BID automatically becomes the root bridge. © 2025 Brent MacRae 14 STP Operation Spanning Tree Algorithm: BPDUs ▪ A BPDU is a messaging frame exchanged by switches for use in STP. ▪ BPDUs contain a Bridge ID (BID) that identifies the switch that sent the BPDU. ▪ BID contains: Priority value MAC address of sending switch An optional extended system ID ▪ Lowest BID is determined as a combination of the above three fields. © 2025 Brent MacRae 15 STP Operation Spanning Tree Algorithm: Port Roles ▪ After root bridge has been selected, STA calculates the shortest path to it from all switchports in the broadcast domain ▪ STA considers both path and port costs when determining which path to select as the best one Port costs are determined based on the speed of the link Path cost is the sum of all port costs to the root bridge ▪ STA is also used to determine which ports to block ▪ During this time, traffic cannot be forwarded through the network. © 2025 Brent MacRae 16 "802.1D IEEE Standard for Local and Metropolitan Area Networks. Media Access Control (MAC) Bridges" (PDF). IEEE. STP Operation Spanning Tree Algorithm: Port Roles ▪ Once STA has determined which paths to select, it assigns port roles to the participating switch ports ▪ Port roles describe relation in the network and whether or not the port is permitted to forward traffic Root Ports: switch ports closest to the root bridge (in terms of path cost, not physically!) Designated Ports: All non-root ports that are still permitted to forward traffic. The other end of a root port is always a designated port. All ports on the root bridge are designated ports. Alternate and Backup: Ports configured in a blocking state to prevent loops. Selected on links where there is no root port. Only one end is blocked; provides for faster transition to forwarding, if needed. *Note, original STP used “non-designated” instead of alternate. Alternate is a newer naming convention used by RSTP. © 2025 Brent MacRae 17 STP Operation Spanning Tree Algorithm: Root Bridge ▪ Every STP instance elects one root bridge. ▪ All switches in the broadcast domain participate in the election. ▪ After a switch boots, it begins broadcasting BPDUs every 2 seconds. Contain the switches BID and the root ID (BID of the root bridge) ▪ In the beginning, all switches assume they are the root bridge. ▪ If the RID from a received BPDU is lower than RID on the current switch, the switch updates its RID. © 2025 Brent MacRae 18 Spanning Tree Protocol Root Bridge Election Switch 1 Switch 2 Bridge ID: Bridge ID: Priority: 32769 Priority: 32769 MAC: AAAA MAC: BBBB Root ID: AAAA Root BBBB Root ID: AAAA Bridge Bridge ID: Bridge ID: Priority: 32769 Priority: 32769 Priority: 32769 MAC: CCCC MAC: DDDD CCCC Root ID: AAAA Switch 3 Switch 4 DDDD AAAA Root ID: CCCC STP Operation Spanning Tree Algorithm: Path Cost ▪ After the root bridge has been selected, the STA needs to determine the best path to the root bridge from each destination in the broadcast domain. ▪ Determined by summing up the individual port costs along the path from destination to the root bridge. ▪ Individual port costs have default values, as seen in the table below. ▪ These values change over time as faster technologies become available. © 2025 Brent MacRae 20 STP Operation Spanning Tree Algorithm: Path Cost © 2025 Brent MacRae 21 STP Operation Spanning Tree Algorithm: Root Ports 1. Select the port with the lowest overall path cost to the root bridge. Each switch can only have one root port 2. If multiple paths with same cost exist, select a port connected to a switch advertising the lowest BID (priority, MAC, EID) 3. If all paths go through the same switch, select the local port that receives the lowest port ID (port priority, port number) Customizable port priority is used first If priority is default, lowest sending port ID is used © 2025 Brent MacRae 22 STP Operation Spanning Tree Algorithm: Root Ports ▪ The other end of a root port is always designated ▪ All ports on root bridge are designated ▪ Steps for selecting a designated port: 1. Select the port on the switch with the lowest accumulated path cost to the root bridge 2. If there is a tie, select the port on the switch with the lowest BID ▪ The other end of a designated port on a non-root segment is always an alternate port © 2025 Brent MacRae 23 STP Operation Spanning Tree Algorithm: Root Ports Root Bridge R D A D D R © 2025 Brent MacRae 24 STP Operation 2048 1024 512 256 128 16 32 64 1 4 2 8 Extended System ID 11111111.11111111.11111111.11111111 Bridge Priority Defaults to 32,768 Configurable in increments of 4096 Lowest priority determines root bridge Extended System ID Added to support separate STP instances for different VLANs 12 bits reserved for VLAN ID Leftmost 4 bits used for priority Priority and extended system ID are added together to identify the vlan (vlan 1 priority would be 32768+1) MAC Address Used as a tiebreaker to determine root bridge © 2025 Brent MacRae 25 4.2 Varieties of Spanning Tree Protocols © 2025 Brent MacRae 26 Overview List of Spanning Tree Protocols ▪ STP or IEEE 802.1D – 1998 Original iteration; one STP instance for entire network ▪ PVST+ Cisco enhancement; separate STP instance for each VLAN ▪ IEEE 802.1D – 2004 Enhanced version of STP incorporating 802.1w ▪ Rapid Spanning Tree Protocol (RSTP) or IEEE 802.1w Evolution of STP providing faster convergence ▪ Rapid PVST+ Cisco enhancement of 802.1w that provides a separate instance of RSTP per VLAN ▪ Multiple Spanning Tree Protocol (MSTP) or IEEE 802.1s IEEE standard that allows multiple VLANs to be mapped to one STP instance © 2025 Brent MacRae 27 STP Overview Characteristics of the Spanning Tree Protocols © 2025 Brent MacRae 28 PVST+ Overview of PVST+ ▪ A network can run an independent IEEE 802.1D STP instance for each VLAN in the network. ▪ Possible to load balance traffic at layer 2 (block one trunk port for one VLAN while allowing it for another) ▪ One spanning-tree instance for each VLAN maintained can mean a considerable waste of CPU cycles for all the switches in the network. © 2025 Brent MacRae 29 PVST+ Port States and PVST+ Operation ▪ Switch port transitions through five states in order to learn about the entire STP topology ▪ Ensures no loops © 2025 Brent MacRae 30 STP Configuration Issues Spanning-Tree Failure Consequences ▪ STP erroneously moves one or more ports into the forwarding state. ▪ Any frame that is flooded by a switch enters the loop. © 2025 Brent MacRae 31 STP Configuration Issues Repairing a Spanning Tree Problem ▪ One way to correct spanning-tree failure is to manually remove redundant links in the switched network, either physically or through configuration, until all loops are eliminated from the topology. ▪ Before restoring the redundant links, determine and correct the cause of the spanning-tree failure. ▪ Carefully monitor the network to ensure that the problem is fixed. © 2025 Brent MacRae 32