test me

Site Search:

Introduction to STP



To break down the materials for CCENT, we need to know
Redundant Topology Caused three problems:
  • Broadcast Storm

  • Multiple Frame Copies

  • MAC database Instability

As the solution, Spanning Tree Protocol (STP) creates a loop-free topology by putting certain ports in blocking state. STP is enabled by default on Cisco switches. Use command show spanning-tree to check the status.

SWITCH#show spanning-tree

VLAN0001
  Spanning tree enabled protocol rstp
  Root ID    Priority    32769
             Address     0011.f1s2.4189
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     0011.f1s2.4189
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- ---------------------------
Fa0/1               Desg BLK 19        128.3    P2p

There are three basic rules for spanning tree:

  1. There's one root bridge per network.

  2. There's one root port per non-root bridge.

  3. There's one designated port per one segment.

Root bridge is the bridge with the best bridge ID. The root bridge is the focal point in the network. Important decisions such as which port is to be blocked and which port is to be put in forwarding mode - are made from the prespective of the root bridge.

The root bridge is elected with Bridge ID. Bridge ID have two parts: bridge priority (32,768 by default on all Cisco switches) and MAC address. If the bridge priority is the same, the bridge with lowest MAC address will be elected as the root bridge.

The Root Port is the link directly connected to the root bridge, or the shortest path to the root bridge. If more than one link connects to the root bridge, then the lowest-cost port becomes the root port.

A designated port is one that has been determined as having the lowest cost. A designated port will be marked as a forwarding port.

A nondesignated port is one with a higher cost than the designated port. Nondesignated ports are put in blocking mode -- they are not forwarding ports.

The STP decides which port is root port and which port is desigated port and which port to block by the concept of the cost. Cost is associated with bandwidth. The faster the path to the root bridge, lower the cost.

this video explains broadcast storm and STP protocol


The root bridge send out Bridge Protocol Data Unites (BPDU's) every two seconds. If those BPDU are not received, the non-designated bridges know that the root bridge is down. These non-designated bridges then transition their port from:

  • Blocking to

  • Listening to

  • Learning to

  • Forwarding

Blocking A locked port won't forward frames; it just listens to BPDUs. All ports are in blocking state by default when the seitch is powered up.

Listening The port listens to BPDUs to make sure no loops occur on the network before passing data frames. A port in listening state prepares to forward data frames without populating the MAC address table.

Learning The switch port listens to BPDUs and learns all the paths in the switched network. A port in learning state populates the MAC address table but doesn't forward data frames. Forward delay means the time it takes to transition a port from listening to learning mode, which is set to 15 seconds by default.

Forwarding The port sends and receives all data frames on the bridged port. If the port is still a designated or root port at the end of the learning state, it enters the forwarding state.

Spanning Tree Convergence is reached when all ports have transition into either blocking state or forwarding state. No data will be forwarded until convergence is complete.


Basic commands:
observe spanning tree behavior:
switch#show spanning-tree

enable STP on a VLAN:
switch(config)#spanning-tree vlan vlan-id

set a switch to be root bridge:
switch(config)#spanning-tree vlan vlan-id root primary

set the switch priority
switch(config)#spanning-tree vlan vlan-id priority priority

change spanning tree mode:
switch(config)#spanning-tree mode {pvst|rapid-pvst}

ICND1 and ICND2 break down

No comments:

Post a Comment