Latest

CCNA RnS Article #31: STP Behavior

CCNA RnS Article #31: STP Behavior

In this article, we are going to see how STP behaves in a network setup – when the network topology is stable and when there is a change in the topology. This article focuses only on the STP behavior in a network (RSTP behaves differently in a network – I’ll work on this topic in the future).

Scenario 1: Stable/Converged Network

In a converged network, the root switch by default sends hello BPDU every 2 seconds. Non-root switches forward the hello BPDU (after some modifications) to its designated ports. This way hello BPDU flows over the network.

Figure 1: STP in Converged State

STP Root switch sends Hello BPDU to all non-Root switches (Switch 2 & Switch 3). This Hello packet has the root cost 0 (as switch 1 is root and it’s local cost is 0).  This hello BPDU is forwarded over all the active ports on root switch.

Switch 2 receives the Hello packet on the Root Port. It forwards this Hello BPDU to its designated ports (not on Root Port) with the following changes – Bridge ID (its own Bridge ID) and the root Cost (Root cost + the local port cost).

The same is true for Switch 3. This process continues until some change happens in the topology.

Scenario 2: Change in Topology

A switch understands change in topology when it stops receiving Hello BPDU – it could be due to link failure or switch failure. Hello BPDU is a heat beat that ensures the link to the root switch from the non-root switch is working fine. Once a switch stops receiving the hello on the root port or changed contents, it means something has failed so the switch starts the process of changing the forwarding STP topology.

It raises the question of how long a switch should wait to react to failure. That is decided by the timers STP uses. These timers are detected by the root switch and obeyed by non-root switches. STP uses the following timers for convergence purposes –

Hello Timer – every 2 Second – Time period between Hello Packets generated by Root

MaxAGE – 10 times of Hello (20 Seconds) – How long a switch should wait, after missing to hear Hello before changing the STP topology

Forward Delay – 15 Seconds – Time to change an interface from blocking to forwarding state. Interface state transition from Blocking to à Listening State to à Learning state to à Forwarding.

STP transitions an interface from blocking to listening, then to learning, and finally to the forwarding state. Each transition from listening to learning is equal to the time of forward delay = 15 sec. As a result, it can take 30 seconds to transition an interface from blocking to the forwarding state. In addition, it might take MaxAge timer before even thinking to move an interface from blocking to forwarding state.

Figure 2: STP Convergence in case of topology change

Let’s say the link between the Root Switch and Switch 3 goes down. Switch 3 would stop receiving the hello BPDU on its root port. It will for the MaxAge timer to expire which is 10 times the hello timer. After 20 seconds, it will be certain that there is link failure and change in the topology.

Now the link between Switch 2 and Switch 3 is up it will start to transition to the listening state for the next 15 seconds and then to the learning state for 15 seconds and after it will transition to the forwarding state. All that resulted in 50 seconds convergence delay.

STP Interface states:

Blocking State: User data frames in blocking states are not forwarded. MAC address learning is not performed in this state. The blocking state is a stable state.

Listening State: User data frames in the listening state are not forwarded. MAC address learning is not performed in this state. The listening state is the transitory/temporary state.

Learning State: User data frames in the learning state are not forwarded. MAC address learning happens based on the received frames in the learning state. The learning state is the transitory/temporary state.

Forwarding State: User data frames in the forwarding state are forwarded. MAC address learning happens based on the received frames. The forwarding state is the stable state.

Disabled State: User data frames in the disabled state are not forwarded. MAC address learning is not performed in this state. The disabled state is the stable state.

STP convergence time (minimum 50 seconds) is a drawback in a campus network and it motivates the upgrade of this protocol to RSTP. With extra port roles in RSTP, the convergence time is rapid. That’s why it is named Rapid STP (RSTP). We’ll cover the RSTP in our next articles. Hope you find this informative.

Continue Reading...