Introduction
This document describes the Spanning Tree Protocol (STP) Root Inconsistency due to Path Cost Mismatch between access and distribution switch.
Prerequisites
Requirements
Cisco recommends that you have knowledge of STP concepts.
Components Used
This document is not restricted to specific software and hardware versions.
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, ensure that you understand the potential impact of any command.
Feature Description
The root guard feature provides a way to enforce the root bridge placement in the network.
The root guard ensures that the port on which root guard is enabled is the designated port. Normally, root bridge ports are all designated ports, unless two or more ports of the root bridge are connected together. If the bridge receives superior STP Bridge Protocol Data Units (BPDUs) on a root guard-enabled port, root guard moves this port to a root-inconsistent STP state. This root-inconsistent state is effectively equal to a listening state. No traffic is forwarded across this port. In this way, the root guard enforces the position of the root bridge.
Problem
The example in this section illustrates how the addition of a new access switch to the network can cause the root guard port to enter a root inconsistency state on the distribution switch when there is a path cost mismatch between the access and distribution switches.
In Image 1, Switches 1 and 2 constitute the distribution layer of the network, with Switch 1 serving as the root bridge for Even VLANs and Switch 2 acting as the root bridge for Odd VLANs. A Layer 2 PortChannel has been established between Switch 1 and Switch 2. Switch 3 functions as an access layer switch. The link between Switch 1 and Switch 3 is blocked on the Switch 3 side for Odd VLANs, while the link between Switch 2 and Switch 3 is blocked on the Switch 3 side for Even VLANs.
Figure 1. Distribution and Access Switch Connectivity
SW1 all Vlans are in Forwarding State
SW1 Spanning-Tree for Vlan10 and Vlan20
SW2 all Vlans are in Forwarding state
SW2 Spanning-Tree for Vlan20
SW3 Blocked port details for Odd and Even no of Vlans
SW3 Root Port Details for Odd and Even no of Vlans
SW3 Spanning-Tree for Vlan10 and Vlan20
Packet capture taken on Switch3 Eth0/1 port indicates that the STP frame received from Switch1 for VLAN20 has a Root Path Cost of 0 to reach the root bridge.
Packet Capture on SW3 Eth0/1 port for Vlan20
Packet capture taken on Switch3 Eth0/2 port indicates that the STP frame received from Switch2 for VLAN20 has a Root Path Cost of 1000000 to reach the root bridge.
Packet Capture on SW3 Eth0/2 port for Vlan20
Packet capture taken on Switch3 Eth0/1 port indicates that the STP frame received from Switch1 for VLAN10 has a Root Path Cost of 1000000 to reach the root bridge.
Packet Capture on SW3 Eth0/1 port for Vlan10
Packet capture taken on Switch3 Eth0/2 port shows that that STP frame received from Switch2 for VLAN10 has Root Path Cost 0 to reach root bridge.
Packet Capture on SW3 Eth0/2 port for Vlan10
Now, the Access Switch - Switch 3 has encountered a fault and has been replaced with a new Access Switch. Upon the addition of the new Access Switch (Switch 3) to the network, it is observed that STP blocked the port on the distribution switch, and the designated ports on Switch 1 and Switch 2 entered a 'Root Inconsistency' state.
Figure 2: Switch2 Eth0/2 port moved to Blocking state
This diagram shows that Switch 2 Eth0/2 port goes to blocking mode for Even number of VLANs.
Switch 1 is the root bridge for VLAN 20, 40, 60 and the cost to reach the root bridge on Switch 2 via PO1 is 1000000 and via Eth0/2 is 2000100 (2000000+100).
Switch 3 has the cost of 100 on Eth0/1 to reach root bridge and cost of 1000100 via Eth0/2 to reach the root bridge.
Since the cost on Switch 2 Eth0/2 was on higher side, it blocked the port Eth0/2 for VLAN 20, 40, 60.
Feb 10 04:31:55.516: %SPANTREE-2-ROOTGUARD_BLOCK: Received a superior STP BPDU from bridge aabb.cc00.0500. Root guard blocking port Ethernet0/2 on VLAN0060.
Feb 10 04:32:26.086: %SPANTREE-2-ROOTGUARD_BLOCK: Received a superior STP BPDU from bridge aabb.cc00.0500. Root guard blocking port Ethernet0/2 on VLAN0040
SW2 Root Inconsistency Port Details for Even no of Vlans
SW3 all Vlans are in Forwarding State
Figure 3: Switch1 Eth0/1 port moved to Blocking state
This diagram shows that Switch 1 Eth0/1 port goes to blocking mode for Odd number of VLANs.
Switch 2 is the root bridge for VLAN 10, 30, 50, 70 and the cost to reach the root bridge on Switch 1 via PO1 is 1000000 and via Eth0/1 is 2000100 (2000000+100).
Switch 3 has the cost of 100 on Eth0/2 to reach root bridge and cost of 1000100 via Eth0/1 to reach the root bridge.
Since the cost on Switch 1 Eth0/1 was on higher side it blocked the port Eth0/2 for VLAN 10, 30, 50, 70.
Feb 10 14:49:58.952: %SPANTREE-2-ROOTGUARD_BLOCK: Received a superior STP BPDU from bridge aabb.cc00.0500. Root guard blocking port Ethernet0/1 on VLAN0010.
SW1 Root Inconsistency Port Details for Odd no of Vlans
Packet capture taken on Switch1 Eth0/1 port indicates that the STP frame received from Switch3 for VLAN10 has a Root Path Cost of 100 to reach the root bridge.
Packet Capture taken on SW1 Eth0/1 for Vlan10
Packet capture taken on Switch 2 Eth0/2 port indicates that the STP frame received from Switch 3 for VLAN20 has a Root Path Cost of 100 to reach the root bridge.
Packet Capture Taken on SW2 Eth0/2 port for Vlan20
Switch 3 was integrated into the network utilizing the path cost method designated as 'short'. In contrast, Switch 1 and Switch 2 employed the path cost method classified as 'long'. Switch 3 transmitted a superior BPDU to both Switch 1 and Switch 2. Upon receiving the superior BPDU, the Root Guard placed the port into the root-inconsistent STP state.
Solution
This issue was solved when the pathcost configuration was modified from 'short' to 'long' on Access Switch 3.
SW3(config)#spanning-tree pathcost method long
SW1#
*Feb 10 08:07:40.188: %SPANTREE-2-ROOTGUARD_UNBLOCK: Root guard unblocking port Ethernet0/1 on VLAN0010.
SW2#
*Feb 10 08:07:39.188: %SPANTREE-2-ROOTGUARD_UNBLOCK: Root guard unblocking port Ethernet0/2 on VLAN0020
*Feb 10 08:07:40.188: %SPANTREE-2-ROOTGUARD_UNBLOCK: Root guard unblocking port Ethernet0/2 on VLAN0040
SW3 Eth0/2 moved to Blocking state for Even no of Vlan
SW3 Eth0/1 moved to Blocking State for Odd no of Vlan