Alpha Centauri Studies
CoursesFor Institutions

Loading...

Alpha Centauri Studies

CSEC past papers, worked

Past papers worked question by question, and courses built on the CSEC syllabus, for students across the Caribbean.

Serving Caribbean students since 2025

Explore

CoursesAboutContact

Support

PrivacyTermsHelp

Subscribe to Our Newsletter

New papers and courses, when they land.

Connect With Us
© 2026 Alpha Centauri Studies. All rights reserved.
2.5 Rapid PVST+ Spanning Tree Protocol

TutorialLab 1245 min

Lab 124: Configuring Spanning-Tree Protocol

Lab 124: Configuring Spanning-Tree Protocol

Network loop can create a huge problem in a network. Routing protocols such as RIP and IGRP have their own techniques to stop network loops from occurring at the Network layer of the OSI model. Unfortunately they (routing protocols) cannot be used to stop loops from occurring at the Data Link layer of the OSI model. If you have a network based on layer-2 switches and if the switches are interconnected using the redundant links, your network may suffer from the switching loops. But there is a protocol called Spanning-Tree Protocol (STP) that is used to stop switching loops in a layer-2 switched network.

In this exercise, we will explain how does the spanning-tree protocol work?

STP help a switch to avoid the loop avoidance. It discovers all links in the network andshut down any redundant ones in order to prevent network loops. STP elects a root bridge (switch) on the network through which it passes all the network traffic. The switch with the lowest MAC address becomes the root bridge if the priority of all the switches is set as default which is 32678 plus number of VLANs. However, you can change the priority value of a switch to forcefully make it as a root bridge. Lower value means higher preference in the root bridge election.

The priority value can be any value from 0 through 61440. If you want that a switch should always be the root, set its priority to zero (0). The priority value is set in increments of 4096. If you want to set a switch to be the root bridge for every VLAN in your network, then you have to change the priority for each VLAN.

We will use the following topology to explain the Spanning-Tree Protocol. Create the following topology in Cisco Packet Tracer and connect the switches using the cross-over cables.

Three 2960-24TT switches cabled into a triangle, each labelled with its spanning-tree priority and bridge MAC address. Switch2 sits at the top with Priority 32769 and Address 000C.CF88.1488; its fa0/1 runs down to Switch1 and its fa0/2 runs down to Switch3. Switch1 is bottom left with Priority 32769 and Address 0060.2F49.944D; its fa0/2 goes up to Switch2 and its fa0/1 goes across to Switch3. Switch3 is bottom right with Priority 32769 and Address 0007.EC61.51C2; its fa0/2 goes up to Switch2 and its fa0/1 goes across to Switch1. Five of the six port lights are green; the light on Switch1's fa0/2 is amber.

In the preceding topology, first of all, we will find the Root Bridge. On the Root Bridge, you will find “This bridge is the root” message, and the root ID address and bridge ID address will be same.

  1. Open the console of Switch1 and execute the show spanning-tree command, as shown in the following figure.

Switch1's console showing the output of "sh spanning-tree" for VLAN0001. Spanning tree is enabled, protocol ieee. The Root ID is Priority 32769, Address 0007.EC61.51C2 (highlighted in the source), Cost 19, Port 1(FastEthernet0/1), Hello Time 2 sec, Max Age 20 sec, Forward Delay 15 sec. The Bridge ID is Priority 32769 (priority 32768 sys-id-ext 1), Address 0060.2F49.944D (also highlighted), with the same timers and an Aging Time of 20. The interface table lists Fa0/1 as Root FWD cost 19, Prio.Nbr 128.1, type P2p, and Fa0/2 as Altn BLK cost 19, Prio.Nbr 128.2, type P2p. So Switch1 is not the root bridge and its fa0/2 is the blocked port.

  1. In the preceding figure, you can see that Switch1 is not the Root Bridge because the addresses of Root ID and Bridge ID are different.

  2. Now, move on Switch2, open the console of Switch2 and execute the show spanning-tree command as shown in the following figure.

Switch2's console showing "sh spanning-tree" for VLAN0001. Spanning tree is enabled, protocol ieee. The Root ID is Priority 32769, Address 0007.EC61.51C2 (highlighted), Cost 19, Port 2(FastEthernet0/2), Hello Time 2 sec, Max Age 20 sec, Forward Delay 15 sec. The Bridge ID is Priority 32769 (priority 32768 sys-id-ext 1), Address 000C.CF88.1488 (highlighted), same timers, Aging Time 20. The interface table lists Fa0/2 as Root FWD cost 19, Prio.Nbr 128.2, P2p, and Fa0/1 as Desg FWD cost 19, Prio.Nbr 128.1, P2p. Switch2 reaches the root through fa0/2 and both of its ports forward.

  1. In the preceding figure, you can see that Switch2 is also not the Root Bridge because the addresses of Root ID and Bridge ID are different.

  2. Now, move on Switch3, open the console of Switch3 and execute the show spanning-tree command as shown in the following figure.

Switch3's console showing "sh spanning-tree" for VLAN0001. The Root ID is Priority 32769, Address 0007.EC61.51C2, and the line "This bridge is the root" appears in place of a cost and root port; all three of those lines are highlighted in the source. Hello Time 2 sec, Max Age 20 sec, Forward Delay 15 sec. The Bridge ID is Priority 32769 (priority 32768 sys-id-ext 1) with the same Address 0007.EC61.51C2, same timers and Aging Time 20. The interface table lists Fa0/2 as Desg FWD cost 19, Prio.Nbr 128.2, P2p, and Fa0/1 as Desg FWD cost 19, Prio.Nbr 128.1, P2p: both ports are designated because this switch, with the lowest MAC address of the three, is the root bridge.

  1. In the preceding figure, you can see that Switch2 is the Root Bridge because the addresses of Root ID and Bridge ID are same and it also shows the “This bridge is the root” message.

  2. The above selection of Root Bridge was based on MAC addresses because the priority of all the switches has set as default (32769) and the MAC address (Bridge ID) of Switch3 (0007. EC61.51C2) was the lowest among all the switches.

Manual Selection of Root Bridge

As discussed earlier, you can also make a specific switch to act as a Root Bridge by changing its priority value. The following syntax is used to change the priority value of a switch.

Switch( config)# spanning-tree vlan < vlan number > priority < any value from 0 to
61440 but in multiple of 4096 >
  1. In the following demonstration, we will make Switch1 as a Root Bridge manually for VLAN

  2. To do so, execute the following command.

Switch( config)# spanning-tree vlan 1 priority 8192

Alternatively, you can also use the following command to make a switch as Root Bridge.

Switch( config)# spanning-tree vlan 1 root primary
  1. Next, execute the following command to verify the spanning-tree configuration.
Switch# show spanning-tree

Switch1's console, where the bridge priority is lowered so that this switch becomes the root. The context help for "spanning-tree vlan 1 priority ?" answers "<0-61440> bridge priority in increments of 4096". The command "spanning-tree vlan 1 priority 8192" is then entered (highlighted), followed by "spanning-tree vlan 1 root primary" and exit, which logs %SYS-5-CONFIG_I: Configured from console by console. A following "show spanning-tree" reports VLAN0001 Root ID Priority 8193, Address 0060.2F49.944D and the highlighted line "This bridge is the root"; Bridge ID Priority 8193 (priority 8192 sys-id-ext 1), Address 0060.2F49.944D, Hello Time 2 sec, Max Age 20 sec, Forward Delay 15 sec, Aging Time 20. Both Fa0/1 and Fa0/2 are now Desg FWD cost 19, Prio.Nbr 128.1 and 128.2, type P2p.

  1. In the preceding figure you can see that Switch1 is now the Root Bridge.

Source: itexamanswers.net