In this section we will learn how to approach questions on the exam pertaining to the root port and root switch in an STP configuration. Below shows an overview of the three step process.
- Issue show spanning-tree and or show spanning-tree root commands on available switches
- Examine the show spanning-tree output, because it lists the root cost in two places.Once at the top of the output and once at the bottom of the output. Remember the bottom section is the interface's cost not the total root cost. Use the CDP neighbor command to verify the device name of devices.
- For problems that require root cost calculations, do the following
- memorize default STP cost values
100 for 10Mbps19 for 100Mbps4 for 1Gbps2 for 10Gbps
- look for indications of spanning-tree cost configuration commands, do not assume default values are used
- when default values are used check the actual speed of the link as well. Cisco switches choose the STP default cost based upon the speed of the link, not the maximum speed allowed on the link
Three Cisco 2960 switches are connected together on one LAN segment. Switch0, Switch1 and Switch2 are all connected and running a fully converged STP configuration. From Switch 2 determine which switch has been elected the root and it's cost from Switch2.
Step 1 - Console into the device and issue the show spanning-tree command
Step 2 - Examine the Output
By examining the output we can quick notice that this switch is not the root. The first indication is that the Root ID in the top section of the output lists a different BID than the Bridge ID output, this is our first clue. The second is at the bottom in the columns labeled Role and Sts, if this switch was the root it would not have a root port and it would also have all ports in a forwarding state and none in a blocking state. This confirms that Switch2 is not the root. Fa0/1 however has a Role of Root meaning that Fa0/1 was elected the root port and off that interface is the Root Switch, Switch0. To confirm this theory we can use the cdp neighbors command.
Step 3 - Determine the cost to the root
By examining the output of the show spanning-tree command again we can easily find the cost. Listed in the column labeled cost in the row for Fa0/1 is the root cost of 19. This value was chosen by STP because the cable connecting the two switches is a FastEthernet cable with a speed of 100mbps.