Determine the Root Switch, Root Ports on Nonroot Switches, and Designated Port on each LAN Segment

Finding the Root Switch

Step 1 - Pick a switch to begin with, use the show spanning-tree vlan vlan-id command to find the root switch's BID and the local switches BID

Step 2 - If the root BID and local BID are equal, it is the root switch

Step 3 - If the local switch is not the root do the following

a.) Find the RP interface on the local switch with show spanning-tree
b.) Use CDP to determine which switch is on the other side of the Root Port RP
c.) log in to the switch on the other end of the RP and use the show spanning-tree vlan vlan-id command to display the priority and mac values to determine if they match.

Finding the Root Port on Nonroot Switches

Step 1 - Identify all possible paths over which a frame, sent by the non root switch can reach the root switch.
Step 2 - Fore each possible path add the cost of all outgoing interfaces in that path
Step 3 - Locate the path with the lowest cost
Step 4 - If there is a cost tie, use the following tiebreakers: lowest neighbor bride ID, lowest neighbor port priority, lowest neighbor internal port number.

Finding the Designated Port on Each LAN Segment

Step 1 - For switches on the same LAN segment, the switch with the lowest cost to the root switch is the DP on that segment.
Step 2 - In case of a tie, the switch wit the lowest BID wins