Thursday, September 5, 2019

STP States


STP States



To participate in STP, each port of a switch must progress through several states. A port begins its life in a Disabled state, moving through several passive states and, finally, into an active state if allowed to forward traffic. The STP port states are as follows:

Disabled: Ports that are administratively shut down by the network administrator, or by the system because of a fault condition, are in the Disabled state. This state is special and is not part of the normal STP progression for a port.

Blocking: After a port initializes, it begins in the Blocking state so that no bridging loops can form. In the Blocking state, a port cannot receive or transmit data and cannot add MAC addresses to its address table. Instead, a port is allowed to receive only BPDUs so that the switch can hear from other neighboring switches. In addition, ports that are put into standby mode to remove a bridging loop enter the Blocking state.

Listening: A port is moved from Blocking to Listening if the switch thinks that the port can be selected as a root port or designated port. In other words, the port is on its way to begin forwarding traffic.

In the Listening state, the port still cannot send or receive data frames. However, the port is allowed to receive and send BPDUs so that it can actively participate in the Spanning Tree topology process. Here, the port finally is allowed to become a root port or designated port because the switch can advertise the port by sending BPDUs to other switches. If the port loses its root port or designated port status, it returns to the Blocking state.

Learning: After a period of time called the forward delay in the Listening state, the port is allowed to move into the Learning state. The port still sends and receives BPDUs as before. In addition, the switch now can learn new MAC addresses to add to its address table. This gives the port an extra period of silent participation and allows the switch to assemble at least some address information. The port cannot yet send any data frames, however.

Forwarding: After another forward delay period of time in the Learning state, the port is allowed to move into the Forwarding state. The port now can send and receive data frames, collect MAC addresses in its address table, and send and receive BPDUs. The port is now a fully functioning switch port within the spanning-tree topology.

Remember that a switch port is allowed into the Forwarding state only if no redundant links (or loops) are detected and if the port has the best path to the root bridge as the root port or designated port.

Table 2.7 summarizes the STP port states and what can and cannot be done in those
states.

Table 2.7 STP States and Port Activity

STP State
The Port Can…
The Port Cannot...
Duration             
Disabled
N/A
Send or receive data
N/A
Blocking             
Receive BPDUs
Send or receive data or
learn MAC addresses
Indefinite if loop has
been detected
Listening
Send and receive BPDUs
Send or receive data or
learn MAC addresses
Forward Delay timer (15
seconds)
Learning
Send and receive BPDUs
and learn MAC addresses
Send or receive data
Forward Delay timer (15
seconds)
Forwarding
Send and receive BPDUs,
learn MAC addresses,
and send and receive data

Indefinite as long as port
is up and loop is not
detected



Example 2.8 shows the output from a switch as one of its ports progresses through
 the STP port states.

Example 2.8 Switch Port Progressing Through the STP Port States

Switch(config)# interface gigabitethernet1/0/1
Switch(config-if)# no shutdown
Switch(config-if)# ^Z
Switch#

Mar 30 08:12:11.199: STP SW: Gi1/0/1 new blocking req for 1 vlans
Mar 30 08:12:13.196: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/1, changed state
to up
Mar 30 08:12:14.203: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to up

Switch# show spanning interface gigabitethernet1/0/1
Vlan Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001 Desg LIS 4 128.1 P2p
Mar 30 08:12:26.207: STP SW: Gi1/0/1 new learning req for 1 vlans

Switch# show spanning interface gigabitethernet1/0/1
Vlan Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001 Desg LRN 4 128.1 P2p
Mar 30 08:12:41.214: STP SW: Gi1/0/1 new forwarding req for 1 vlans

Switch# show spanning interface gigabitethernet1/0/1
Vlan Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001 Desg FWD 4 128.1 P2p
Switch#

The example begins as the port is administratively disabled from the command line. When the port is enabled, successive show spanning-tree interface type member/ module/number commands display the port state as Listening, Learning, and then Forwarding. These are shown in the shaded text of the example. Notice also the time stamps and port states provided by the debug spanning-tree switch state command, which give a sense of the timing between port states. Because this port was eligible as a root port, the show command never could execute fast enough to show the port in the Blocking state.

No comments:

Post a Comment

Tables Used in Switching

Tables Used in Switching Catalyst switches maintain several types of tables to be used in the switching process. The tables are tailo...