Spanning Tree Protocol

802.1D

802.1D Spanning Tree Protocol (STP) is a Layer 2 loop-prevention mechanism. It is an IEEE standards-based protocol. Over the years, Cisco has enhanced this protocol with new features to make muchneeded improvements. This chapter discusses those improvements and new IEEE versions of the protocol that dramatically improve the technology.

Layer 2 loops are terrible because of no Time To Live (TTL) value in frame. Loops can cause broadcast storms, MAC table corruption, and multiple-frame copies.

STP process

The bridge ID is a critical element for the creation of the spanning-tree, loop-free topology. The bridge ID consists of a 2-byte bridge priority and a 6-byte MAC address. The default priority is 32,768. Newer switch operating systems feature a third component for the bridge ID: the extended system ID. This value is just the VLAN ID. Use of the three-part bridge ID allows each VLAN to have a unique bridge ID while still using the same MAC address and priority value. Previously, multiple MAC addresses were needed for each VLAN to ensure uniqueness.

Path cost is the measure of distance from one bridge to another. Links are assigned a cost value by STP. This cost value is based on bandwidth. Higher-bandwidth links receive a lower-cost value, and STP deems a lower-cost path as preferred to a higher-cost path. Initially with STP operations, a root bridge must be selected. This root bridge will have all of its ports in the forwarding state (designated ports) and will be the central reference point for the creation of a loopfree Layer 2 topology. For the “election” of this device, configuration bridge protocol data units (BPDU) are sent between switches for each port. Switches use a four-step process to save a copy of the “best” BPDU seen on every port. When a port receives a better BPDU, it stops sending them. If the BPDUs stop arriving for 20 seconds (the default), the port begins sending them again. The process for selecting the best
BPDU is as follows:

1. Lowest root bridge ID (BID)
2. Lowest path cost to root bridge
3. Lowest sender BID
4. Lowest port ID (for example, Fa0/10 versus Fa0/20)

After the root bridge for the network has been determined, this reference point can be used to create the loop-free topology. This initial creation of the loop-free topology takes place in three steps:

Step 1. Elect a root bridge. The lowest BID wins.
Step 2. Elect root ports. Every nonroot bridge selects one root port.
Step 3. Elect designated ports. Each segment has one designated port (the bridge with the designated port is the designated bridge for that segment); all active ports on the root bridge are designated (unless you connect two ports to each other).






When convergence occurs, BPDUs radiate out from the root bridge over loop-free paths. Figure below shows an example of STP in action.


Ports have a port state under 802.1D STP. Ports begin life on the switch as disabled and gradually transition to a forwarding state as long as STP deems it is safe to do so. The possible states are listed here along with the timers that control the transition times. Note that the states are carefully ordered here to demonstrate the order of transition:

1. Disabled—Administratively down
2. Blocking—BPDUs received only (20 sec)
3. Listening—BPDUs sent and received (15 sec)
4. Learning—Bridging table is built (15 sec)
5. Forwarding—Sending/receiving data

STP timers are used in the process to control convergence:

■ Hello—2 sec (time between each configuration BPDU)
■ Forward Delay—15 sec (controls durations of listening/learning states)
■ Max Age—20 sec (controls the duration of the blocking state)

Default convergence time is 30 to 50 seconds. Timer modification is possible from the root bridge. See Below figure:- Although the timers can be manipulated, Cisco does not recommend this. Instead, there are Cisco mechanisms that can be used to improve convergence times without direct manipulation of the timers by the administrator. Convergence time is a recognized issue with STP and the exact reason for IEEE’s creation of new versions of the protocol.


No comments:

Post a Comment