Cisco CCNA Spanning Tree Protocol (STP) Questions and Answers — Questions and Answers
Question 1: Three switches are connected in a full mesh topology. SwitchA has a priority of 32768 and MAC address 0000.AAAA.AAAA. SwitchB has a priority of 28672 and MAC address 0000.BBBB.BBBB. SwitchC has a priority of 32768 and MAC address 0000.CCCC.CCCC. Which switch will be elected as the Spanning Tree Protocol (STP) root bridge?
- SwitchA
- SwitchB (Correct answer)
- SwitchC
- The switch with the highest MAC address
Correct answer: SwitchB
The STP root bridge election is based on the lowest Bridge ID (BID). The BID is composed of a 2-byte bridge priority and the 6-byte MAC address. The switch with the lowest priority becomes the root. In this case, SwitchB has a priority of 28672, which is lower than the priority of 32768 for both SwitchA and SwitchC. Therefore, SwitchB will be elected as the root bridge.
Question 2: A network administrator wants to prevent a user-facing access port from causing a Layer 2 loop if another switch is accidentally connected. The desired behavior is for the port to shut down immediately if it receives a BPDU. Which Cisco feature should be configured on this port?
- Root Guard
- BPDU Filter
- Loop Guard
- BPDU Guard (Correct answer)
Correct answer: BPDU Guard
BPDU Guard is a Cisco feature designed for access ports, especially those with PortFast enabled. If a port with BPDU Guard enabled receives any BPDU, it will immediately be placed into an err-disabled state, effectively shutting it down. This prevents unauthorized switches from influencing the STP topology.
Question 3: In the context of the original 802.1D Spanning Tree Protocol, which of the following best describes a Root Port?
- A port on the Root Bridge that is in the forwarding state.
- The port on any switch that has the fastest link speed.
- The single port on a non-root switch that has the lowest path cost to the root bridge. (Correct answer)
- Any port that is actively forwarding traffic on a network segment.
Correct answer: The single port on a non-root switch that has the lowest path cost to the root bridge.
Every non-root switch in an STP topology must select one Root Port. The Root Port is the interface on that switch that has the lowest calculated path cost to reach the root bridge. It represents the best path from that switch toward the root.
Question 4: Rapid Spanning Tree Protocol (RSTP, 802.1w) improves convergence over the original 802.1D standard by modifying port states. Which three 802.1D port states are consolidated into the single 'Discarding' state in RSTP?
- Listening, Learning, and Forwarding
- Disabled, Blocking, and Listening (Correct answer)
- Blocking, Learning, and Forwarding
- Disabled, Listening, and Learning
Correct answer: Disabled, Blocking, and Listening
RSTP streamlines the port state machine for faster convergence. The 802.1D states of Disabled, Blocking, and Listening are functionally combined into a single state in RSTP called Discarding. In this state, the port does not forward user frames or learn MAC addresses.
Question 5: A network topology consists of SwitchA (Root Bridge), SwitchB, and SwitchC. SwitchB connects to SwitchA via a 1 Gbps link. SwitchC connects to SwitchB via a 100 Mbps link. Assuming default STP costs are used, what is the root path cost for SwitchC?
- 4
- 19
- 38
- 23 (Correct answer)
Correct answer: 23
The root path cost is the cumulative cost of all links to the root bridge. The default short path cost for a 1 Gbps link is 4, and for a 100 Mbps link is 19. SwitchB's cost to the root is 4. SwitchC's total cost is its own link cost to SwitchB plus SwitchB's cost to the root. Therefore, SwitchC's root path cost is 19 (SwitchC-to-SwitchB link) + 4 (SwitchB-to-SwitchA link) = 23.
Question 6: During the standard 802.1D STP convergence process, in which port state does a switch begin to populate its MAC address table but does not yet forward user data frames?
- Forwarding
- Blocking
- Learning (Correct answer)
- Listening
Correct answer: Learning
The sequence of STP port states is Blocking, Listening, Learning, and finally Forwarding. In the Listening state, the port processes BPDUs but does not populate the MAC address table. In the Learning state, the port continues to process BPDUs and begins populating the MAC address table from incoming frames, but it still does not forward user data frames.
Three switches are connected in a full mesh topology.
SwitchA has a priority of 32768 and MAC address 0000.AAAA.AAAA.
SwitchB has a priority of 28672 and MAC address 0000.BBBB.BBBB.
SwitchC has a priority of 32768 and MAC address 0000.CCCC.CCCC.
Which switch will be elected as the Spanning Tree Protocol (STP) root bridge?