Tuesday, August 14, 2012

Spanning Tree Protocol priorities

Spanning Tree Protocol (STP) is vital for detecting loops within a switched network. Spanning tree works by designating a common reference point (the root bridge) and systematically building a loop-free tree from the root to all other bridges. All redundant paths remain blocked unless a designated link fails.

Spanning Tree Protocol operation

Select a root bridge.

Determine the least cost paths to the root bridge.

Disable all other root paths.

Modifications in case of ties.


In summary, the sequence of events to determine the best received BPDU (which is your best path to the root) is
  1. Lowest root bridge ID - Determines the root bridge
  2. Lowest cost to the root bridge - Favors the upstream switch with the least cost to root
  3. Lowest sender bridge ID - Serves as a tie breaker if multiple upstream switches have equal cost to root
  4. Lowest sender port ID - Serves as a tie breaker if a switch has multiple (non-Etherchannel) links to a single upstream switch

Bridge ID = priority (16 bits) + ID [MAC address] ( 48bits)
default bridge priority is 32768

Port ID =  priority (4 bits) + ID [Interface number] ( 12bits)
default port priority is 128

Data rate and STP path cost

The table below shows the default cost of an interface for a given data rate.
Data rate STP Cost (802.1D-1998) RSTP Cost (802.1D-2004 / 802.1w)
4 Mbit/s 250 5,000,000
10 Mbit/s 100 2,000,000
16 Mbit/s 62 1,250,000
100 Mbit/s 19 200,000
1 Gbit/s 4 20,000
2 Gbit/s 3 10,000
10 Gbit/s 2 2,000

http://en.wikipedia.org/wiki/Spanning_Tree_Protocol
http://packetlife.net/blog/2008/may/5/spanning-tree-protocol-priorities/
http://www.cisco.com/warp/public/473/spanning_tree1.swf

No comments:

Post a Comment