1 / 101

Spanning Tree Protocol (STP) An Introduction

Spanning Tree Protocol (STP) An Introduction. Rick Graziani Cabrillo College graziani@cabrillo.edu. Spanning Tree Protocol (STP). Standard: IEEE 802.1D A loop-prevention protocol Allows Layer 2 devices to communicate with each other to discover physical loops in the network.

Download Presentation

Spanning Tree Protocol (STP) An Introduction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Spanning Tree Protocol (STP)An Introduction Rick Graziani Cabrillo College graziani@cabrillo.edu

  2. Spanning Tree Protocol (STP) • Standard: IEEE 802.1D • A loop-prevention protocol • Allows Layer 2 devices to communicate with each other to discover physical loops in the network. • STP algorithm creates a loop-free logical topology. • STP creates a tree structure of loop-free leaves and branches that spans the entire Layer 2 network. • Term "bridge": Same as "switch" • Legacy terms: Transparent and Translation bridges

  3. Ensures that there will be only one active path to every destination. • STP executes an algorithm called Spanning Tree Algorithm (STA). • STA chooses a reference point, called a root bridge. • Then determines the available paths to that reference point. • If more than two paths exists, STA picks the best path and blocks the rest

  4. Spanning Tree Protocol (STP) “STP often accounts for more than 50% of the configuration, troubleshooting, and maintenance headaches in real-world campus networks (especially if they are poorly designed). A complex protocol that is generally poorly understood.” Radia Perlman – Developer of STP

  5. https://thenetworkcollective.com/2017/10/history-of-networking-radia-perlman-spanning-tree/https://thenetworkcollective.com/2017/10/history-of-networking-radia-perlman-spanning-tree/

  6. Spanning Tree Protocol (STP)An Introduction Rick Graziani Cabrillo College graziani@cabrillo.edu

  7. Redundancy at Layers 1, 2 and 3 Overview of Benefits and Issues Rick Graziani Cabrillo College graziani@cabrillo.edu

  8. Redundancy: Layer 1, 2, and 3 • Redundancy is important for fail over • Layer 3 routers always forward unicasts out a single port • Single path unless there is a routing loop (misconfiguration or convergence issues) • Layer 2 switches always forward unknown unicasts out all ports • Susceptible to continuous loops, duplicate frames, MAC table instability

  9. Ethernet without STP • Makes the LAN interoperable in seconds • Unknown unicasts • Broadcasts

  10. Layer 2 Ethernet Frames: No TTL/Hop Limit • IP has a mechanism to prevent loops. • Unlike IP, Ethernet frames have no TTL field

  11. Redundancy at Layers 1, 2 and 3 Overview of Benefits and Issues Rick Graziani Cabrillo College graziani@cabrillo.edu

  12. STP DisabledDuplicate Frames and MAC Address Table Instability Rick Graziani Cabrillo College graziani@cabrillo.edu

  13. Unknown Unicast Switch Moe learns Kahns’ MAC address. MAC Address Table Port 4: 00-90-27-76-96-93 Moe A Host Kahn A Larry Host Baran

  14. Unknown Unicast Destination MAC is an unknown unicast, so Moe floods it out all ports. MAC Address Table Port 4: 00-90-27-76-96-93 Moe A Host Kahn A Larry Host Baran

  15. Unknown Unicast Switch Larry records the Source MAC of the frame twice. MAC Address Table Port 4: 00-90-27-76-96-93 Moe A Host Kahn A Larry MAC Address Table Port 1: 00-90-27-76-96-93 Port A: 00-90-27-76-96-93 Host Baran

  16. Unknown Unicast Switch Larry floods the unknown unicast out all ports, except the incoming port. MAC Address Table Port 4: 00-90-27-76-96-93 Moe A Host Kahn A Larry MAC Address Table Port A: 00-90-27-76-96-93 Host Baran

  17. Unknown Unicast Switch Moe receives the frame, changes the MAC address table with newer information and floods the unknown unicast out all ports. MAC Address Table Port 4: 00-90-27-76-96-93 Port 1: 00-90-27-76-96-93 Moe A Host Kahn A Larry MAC Address Table Port A: 00-90-27-76-96-93 Host Baran

  18. Unknown Unicast MAC Address Table Port 4: 00-90-27-76-96-93 Port 1: 00-90-27-76-96-93 And the cycle continues! Moe A Host Kahn A Larry MAC Address Table Port A: 00-90-27-76-96-93 Host Baran

  19. STP DisabledDuplicate Frames and MAC Address Table Instability Rick Graziani Cabrillo College graziani@cabrillo.edu

  20. STP Disabled: Broadcast Frames Rick Graziani Cabrillo College graziani@cabrillo.edu

  21. Broadcasts (ARP Request)

  22. STP Disabled: Broadcast Frames Rick Graziani Cabrillo College graziani@cabrillo.edu

  23. STP – Introducing the Bridge ID and Path Cost Rick Graziani Cabrillo College graziani@cabrillo.edu

  24. STP Prevents Loops • The purpose of STP is to avoid and eliminate loops in the network by negotiating a loop-free path through a root bridge. • STP determines where the are loops and blocks links that are redundant. • Ensures that there will be only one active path to every destination. X

  25. Spanning Tree Algorithm X • STP executes an algorithm called Spanning Tree Algorithm (STA). • STA chooses a reference point, called a root bridge. • Then determines the available paths to that reference point. • If more than two paths exists, STA picks the best path and blocks the rest

  26. Rick Graziani graziani@cabrillo.edu Two-key STP Concepts • STP calculations make extensive use of two key concepts in creating a loop-free topology: • Bridge ID • Path Cost

  27. Rick Graziani graziani@cabrillo.edu Bridge ID (BID) Bridge ID Without the Extended System ID • Bridge ID (BID) is used to identify each bridge/switch. • The BID is used in determining the center of the network, in respect to STP, known as the root bridge. Bridge ID with the Extended System ID

  28. Bridge ID (BID) • Consists of two components: • A 2-byte Bridge Priority: Cisco switch defaults to 32,768 or 0x8000. • Usually expressed in decimalformat • A 6-byte MAC address • Usually expressed in hexadecimalformat.

  29. Bridge ID (BID) • Each switch has a unique BID. • Original 802.1D standard, the BID = Priority Field +MAC address of the switch. • All VLANs were represented by a CST – one spanning tree for all vlans (later). • PVST requires that a separate instance of spanning tree run for each VLAN • BID field is required to carry VLAN ID (VID). • Extendedsystem ID to carry a VID.

  30. What is the BID of this switch? Core# show spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 32769 Address 0001.964E.7EBB Cost 4 Port 25(GigabitEthernet0/1) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 0001.C945.A573 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 20

  31. Bridge ID (BID) • Used to elect a root bridge (coming) • Lowest Bridge ID is the root. • If all devices have the same priority, the bridge with the lowest MAC address becomes the root bridge. (Yikes) • Note: For simplicity, in our topologies we will use Bridge Priorities without the Extended System ID. (Same process, just done per VLAN.)

  32. Path Cost – Original Spec (Linear) • Bridges use the concept of cost to evaluate how close they are to other bridges. • Used to create the loop-free topology . • Originally, 802.1D defined cost as 1 billion/bandwidth of the link in Mbps. • Cost of 10 Mbps link = 100 • Cost of 100 Mbps link = 10 • Cost of 1 Gbps link = 1 • Running out of room for faster switches including 10 Gbps Ethernet

  33. Path Cost – Revised Spec (Non-Linear) • IEEE modified the most to use a non-linear scale with the new values of: • 4 Mbps 250 (cost) • 10 Mbps 100 (cost) • 16 Mbps 62 (cost) • 45 Mbps 39 (cost) • 100 Mbps 19 (cost) • 155 Mbps 14 (cost) • 622 Mbps 6 (cost) • 1 Gbps 4 (cost) • 10 Gbps 2 (cost) • You can change the path cost by modifying the cost of a port. • Exercise caution when you do this! • BID and Path Cost are used to develop a loop-free topology . • Coming very soon!

  34. STP – Introducing the Bridge ID and Path Cost Rick Graziani Cabrillo College graziani@cabrillo.edu

  35. STP – Introducing the STP Process (Algorithm) Rick Graziani Cabrillo College graziani@cabrillo.edu

  36. STP Convergence and Decision Sequences STP ConvergenceStep 1 Elect one Root BridgeStep 2 Elect Root PortsStep 3 Elect Designated Ports When creating a loop-free topology, STP always uses the same five-step decision sequence: Five-Step decision Sequence Step 1:Lowest root bridge ID - Determines the root bridge Step 2:Lowest cost to the root bridge - Favors the upstream switch with the least cost to root Step 3: Lowest sender bridge ID - Serves as a tie breaker if multiple upstream switches have equal cost to root Step 4 - Lowest Port Priority - Serves as a tie breaker if a switch has multiple (non-Etherchannel) links to a single upstream switch (configurable) Step 5: Lowest sender Port ID (port priority then port ID) - Serves as a tie breaker if a switch has multiple (non-Etherchannel) links to a single upstream switch with the same priority

  37. Key BPDU concepts BPDU key concepts: • Bridges send STP BPDUs (Bridge Protocol Data Units) on all ports every 2 seconds. • This describes their best path to the Root Bridge • As every BPDU arrives, it is checked against this five-step sequence to see if it is more attractive (lower in value) than the existing BPDU saved for that port. • Only the best value BPDU is saved.

  38. Steps to STP Convergence STP ConvergenceStep 1 Elect one Root BridgeStep 2 Elect Root PortsStep 3 Elect Designated Ports Five-Step decision Sequence Step 1 - Lowest Root BID Step 2 - Lowest Path Cost to Root Bridge Step 3 - Lowest Sender BID Step 4 - Lowest Port Priority Step 5 - Lowest Sender Port ID • Root Port is the port closest to the Root Bridge. • Designated port is port with “best” path to root (smallest BPDU) on link • All other ports are Blocked (Undesignated Port)

  39. Root Bridge Lowest Bridge ID is the root.

  40. Root Ports: Best path to Root Bridge Root Port is the port closest to the Root Bridge. Designated port is port with “best” path to root (smallest BPDU) on link All other ports are Blocked (Undesignated Port)

  41. Designated Ports – Root Bridge Root Port is the port closest to the Root Bridge. Designated port is port with “best” path to root (smallest BPDU) on link All other ports are Blocked (Undesignated Port)

  42. Designated Ports: Which switch has best path? Root Port is the port closest to the Root Bridge. Designated port is port with “best” path to root (smallest BPDU) on link All other ports are Blocked (Undesignated Port)

  43. Another Example BID: 24577.5555.5555.5555 BID: 24577.1111.1111.1111

  44. Another example: Other videos 

  45. STP – Introducing the STP Process (Algorithm) Rick Graziani Cabrillo College graziani@cabrillo.edu

  46. STP Bridge Protocol Data Unit (BPDU) and Propagating BPDUs Rick Graziani Cabrillo College graziani@cabrillo.edu

  47. There are three kinds of BPDUs: • Configuration BPDU: Provides information to all switches. • TCN (Topology Change Notification): Announces changes in the topology. • TCA (Topology Change Acknowledgment): Confirms reception of the TCN. By default the BPDUs are sent every 2 seconds.

  48. Rick Graziani graziani@cabrillo.edu Its all done with BPDUs!

  49. STP Bridge Protocol Data Unit (BPDU) and Propagating BPDUs Rick Graziani Cabrillo College graziani@cabrillo.edu

  50. Danger of Disabling STP Rick Graziani Cabrillo College graziani@cabrillo.edu

More Related