14 Spanning Tree Protocol

This chapter covers

  • How Layer 2 loops lead to broadcast storms
  • How Spanning Tree Protocol detects and prevents Layer 2 loops
  • The various STP port roles, states, and timers
  • Using PortFast to accelerate STP convergence

This chapter is about Spanning Tree Protocol (STP), a protocol that runs on all Cisco switches by default and solves a significant problem in LANs: Layer 2 loops that result in frames looping around the network indefinitely. STP is mentioned in exam topic 2.5: Identify basic operations of Rapid PVST+ Spanning Tree Protocol. Exam topic 2.5 specifically refers to the rapid version of the protocol, the topic of chapter 15. However, to understand Rapid STP, we first have to cover the original protocol, and that’s what we’ll do in this chapter.

14.1 The need for STP

In chapter 7 (IPv4 addressing), we briefly covered the fields of the IPv4 header; one of those is the Time-to-Live (TTL) field, which is decremented each time a router forwards a packet. When the value in the TTL field reaches 0, the packet is dropped, preventing packets from looping around the network indefinitely as the result of a misconfiguration; this is called a routing loop or Layer 3 loop.

14.2 How STP works

14.3 The STP algorithm

14.3.1 Root bridge election

14.3.2 Root port selection

14.3.3 Designated port selection

14.4 STP port states and timers

14.4.1 STP port states

14.4.2 STP timers

14.5 PortFast and BPDU Guard

14.5.1 PortFast

14.5.2 BPDU Guard

Summary