Using the Spanning Tree Protocol with the EtherSwitch Network Module
The EtherSwitch Network Module uses Spanning Tree Protocol (STP) (the IEEE 802.1D bridge protocol) on all VLANs. By default, a single instance of STP runs on each configured VLAN (provided that you do not manually disable STP). You can enable and disable STP on a per-VLAN basis.
When you create fault-tolerant internetworks, you must have a loop-free path between all nodes in a network. The spanning tree algorithm calculates the best loop-free path throughout a switched Layer 2 network. Switches send and receive spanning tree frames at regular intervals. The switches do not forward these frames but use the frames to construct a loop-free path.
Multiple active paths between end stations cause loops in the network. If a loop exists in the network, end stations might receive duplicate messages and switches might learn endstation MAC addresses on multiple Layer 2 interfaces. These conditions result in an unstable network.
STP defines a tree with a root switch and a loop-free path from the root to all switches in the Layer 2 network. STP forces redundant data paths into a standby (blocked) state. If a network segment in the spanning tree fails and a redundant path exists, the spanning tree algorithm recalculates the spanning tree topology and activates the standby path.
When two ports on a switch are part of a loop, the spanning tree port priority and port path cost setting determine which port is put in the forwarding state and which port is put in the blocking state. The spanning tree port priority value represents the location of an interface in the network topology and how well located it is to pass traffic. The spanning tree port path cost value represents media speed.
Spanning Tree Port States
Propagation delays occur when protocol information passes through a switched LAN. As a result, topology changes take place at different times and at different places in a switched network. When a Layer 2 interface changes from nonparticipation in the spanning tree topology to the forwarding state, it creates temporary data loops. Ports must wait for new topology information to propagate through the switched LAN before starting to forward frames. They must allow the frame lifetime to expire for frames that are forwarded using the old topology.
Each Layer 2 interface on a switch using Spanning Tree Protocol (STP) exists in one of the following states:
-
Blocking—The Layer 2 interface does not participate in frame forwarding.
-
Disabled—The Layer 2 interface does not participate in spanning tree and is not forwarding frames.
-
Forwarding—The Layer 2 interface forwards frames.
-
Learning—The Layer 2 interface prepares to participate in frame forwarding.
-
Listening—First transitional state after the blocking state when spanning tree determines that the Layer 2 interface must participate in frame forwarding.
A Layer 2 interface moves through the following states:
-
From blocking state to listening or disabled state.
-
From forwarding state to disabled state.
-
From initialization to blocking state.
-
From learning state to forwarding or disabled state.
-
From listening state to learning or disabled state.
The figure below illustrates how a port moves through these five states.
Boot-up Initialization
When you enable Spanning Tree Protocol (STP), every port in the switch, VLAN, or network goes through the blocking state and transitory states of listening and learning at power up. If properly configured, each Layer 2 interface stabilizes to the forwarding or blocking state.
When the spanning tree algorithm places a Layer 2 interface in the forwarding state, the following process occurs:
-
The Layer 2 interface is put into the listening state while it waits for protocol information to go to the blocking state.
-
The Layer 2 interface waits for the forward delay timer to expire, moves the Layer 2 interface to the learning state, and resets the forward delay timer.
-
The Layer 2 interface continues to block frame forwarding in the learning state as it learns end station location information for the forwarding database.
-
The Layer 2 interface waits for the forward delay timer to expire and then moves the Layer 2 interface to the forwarding state, where both learning and frame forwarding are enabled.
Blocking State
A Layer 2 interface in the blocking state does not participate in frame forwarding, as shown in the figure below. After initialization, a bridge protocol data unit (BPDU) is sent out to each Layer 2 interface in the switch. The switch initially assumes it is the root until it exchanges BPDUs with other switches. This exchange establishes which switch in the network is the root or root bridge. If only one switch is in the network, no exchange occurs, the forward delay timer expires, and the ports move to the listening state. A port enters the blocking state following switch initialization.
A Layer 2 interface in the blocking state performs as follows:
-
Discards frames received from the attached segment.
-
Discards frames switched from another interface for forwarding.
-
Does not incorporate end station location into its address database. (There is no learning on a blocking Layer 2 interface, so there is no address database update.)
-
Does not transmit BPDUs received from the system module.
-
Receives BPDUs and directs them to the system module.
-
Receives and responds to network management messages.
Listening State
The listening state is the first transitional state a Layer 2 interface enters after the blocking state. The Layer 2 interface enters this state when STP determines that the Layer 2 interface must participate in frame forwarding. The figure below shows a Layer 2 interface in the listening state.
A Layer 2 interface in the listening state performs as follows:
-
Discards frames received from the attached segment.
-
Discards frames switched from another interface for forwarding.
-
Does not incorporate end station location into its address database. (There is no learning on a blocking Layer 2 interface, so there is no address database update.)
-
Receives and directs BPDUs to the system module.
-
Receives, processes, and transmits BPDUs received from the system module.
-
Receives and responds to network management messages.
Learning State
The learning state prepares a Layer 2 interface to participate in frame forwarding. The Layer 2 interface enters the learning state from the listening state. The figure below shows a Layer 2 interface in the learning state.
A Layer 2 interface in the learning state performs as follows:
-
Discards frames received from the attached segment.
-
Discards frames switched from another interface for forwarding.
-
Incorporates end station location into its address database.
-
Receives BPDUs and directs them to the system module.
-
Receives, processes, and transmits BPDUs received from the system module.
-
Receives and responds to network management messages.
Forwarding State
A Layer 2 interface in the forwarding state forwards frames, as shown in the figure below. The Layer 2 interface enters the forwarding state from the learning state.
A Layer 2 interface in the forwarding state performs as follows:
-
Forwards frames received from the attached segment.
-
Forwards frames switched from another Layer 2 interface for forwarding.
-
Incorporates end station location information into its address database.
-
Receives BPDUs and directs them to the system module.
-
Processes BPDUs received from the system module.
-
Receives and responds to network management messages.
Disabled State
A Layer 2 interface in the disabled state does not participate in frame forwarding or spanning tree, as shown in the figure below. A Layer 2 interface in the disabled state is virtually nonoperational.
A Layer 2 interface in the disabled state performs as follows:
-
Discards frames received from the attached segment.
-
Discards frames switched from another Layer 2 interface for forwarding.
-
Does not incorporate end station location into its address database. (There is no learning on a blocking Layer 2 interface, so there is no address database update.)
-
Does not receive BPDUs for transmission from the system module.
Default Spanning Tree Configuration
The table below shows the default Spanning Tree Protocol (STP) configuration values.
Feature |
Default Value |
---|---|
Bridge priority |
32768 |
Enable state |
Spanning tree enabled for all VLANs |
Forward delay time |
15 seconds |
Hello time |
2 seconds |
Maximum aging time |
20 seconds |
Spanning tree port cost (configurable on a per-interface basis; used on interfaces configured as Layer 2 access ports) |
Fast Ethernet: 19 Ethernet: 100 Gigabit Ethernet: 19 when operated in 100 Mb mode, and 4 when operated in 1000 Mb mode |
Spanning tree port priority (configurable on a per-interface basis; used on interfaces configured as Layer 2 access ports) |
128 |
Spanning tree VLAN port cost (configurable on a per-VLAN basis; used on interfaces configured as Layer 2 trunk ports) |
Fast Ethernet: 10 Ethernet: 10 |
Spanning tree VLAN port priority (configurable on a per-VLAN basis; used on interfaces configured as Layer 2 trunk ports) |
128 |