Lets explore the behavior of STP (802.1D) on our new device “Switch1”. We plug it in, power it up and connect to the console with our console cable. We quickly enter enable mode and run show ver and note our base MAC address.
We can run a few more commands to see what is going on with spanning tree on the switch.
Switch1#show spanning-tree
Switch1#show spanning-tree active
Switch1#show spanning-tree detail
Switch1#show spanning-tree vlan 1
The commands above will all return the output: No spanning tree instance exists.
The commands show spanning-tree inconsistentports will return limited output. The command show spanning-tree summary will give us a summary of features, most importantly at this point is that it lets us know that the switch is running STP per vlan by default.
Connecting the switch to a shutdown router interface will initiate the STP instance. Once the router interface is powered on or a device with an active interface is connected, we can observe the spanning tree instance in action.
Switch1#sh spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 00 01.6376.BDED
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 0001.6376.BDED
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
—————- —- — ——— ——– ——————————–
Fa0/1 Desg LSN 19 128.1 P2p
The switch will quickly establish himself as the root / begins BPDU exchange and the interface will begin transitioning through the STP States:
Power On / Initialize
▼
Blocking
▼
Listening state
▼
Learning state
▼
Forwarding state
====
add summarization of port state above.
====
SWITCH1 will send out BPDUs to multicast address(es) 01:80:C2:00:00:00 – 01:80:C2:00:00:10 every 2 seconds according to the default timer avobe. By default the BPDU’s will carry the default priority of 32769 (about half of 2^16).
BPDU will contain a Root ID (8 bytes – initially self) and a Bridge ID (8 bytes – initially self) and other fields such as the STP version, the timers and BPDU type. For now lets understand the Bridge ID
Again – the Bridge ID is 8 bytes. Its composed of the MAC address of the switch/bridge and the priority. the mac address in this case is 0001.6376.BDED that’s 12 nybles, or 6 bytes the remaining 2 bytes are used for the Priority.
The details above while wordy are not unimportant. The root election when other switches are plugged in will depend entirely on the contents of the Bridge ID in the BPDU exchange.
The show spanning-tree details command will now give a more verbose explanation of the spanning tree elements, including very valuable detail regarding topology changes and their source.
Switch1#show spanning-tree detail
VLAN0001 is executing the ieee compatible Spanning Tree Protocol
Bridge Identifier has priority of 32768, sysid 1, 0001.6376.BDED
Configured hello time 2, max age 20, forward delay 15
Current root has priority 32769
Topology change flag not set, detected flag not set
Number of topology changes 0 last change occurred 00:00:00 ago
from FastEthernet0/1
Times: hold 1, topology change 35, notification 2
hello 2, max age 20, forward delay 15
Timers: hello 0, topology change 0, notification 0, aging 300
Port 1 (FastEthernet0/1) of VLAN0001 is designated forwarding
Port path cost 19, Port priority 128, Port Identifier 128.1
Designated bridge has priority 32769, address 0001.6376.BDED
Designated port id is 128.1, designated path cost 19
Timers: message age 16, forward delay 0, hold 0
Number of transitions to forwarding state: 1
Link type is point-to-point by default
Here are some of the other commands and their output:
Switch1#show spanning-tree summary
Switch is in pvst mode
Root bridge for: default
Extended system ID is enabled
Portfast Default is disabled
PortFast BPDU Guard Default is disabled
Portfast BPDU Filter Default is disabled
Loopguard Default is disabled
EtherChannel misconfig guard is disabled
UplinkFast is disabled
BackboneFast is disabled
Configured Pathcost method used is short
Name Blocking Listening Learning Forwarding STP Active
———————- ——– ——— ——– ———- ———-
VLAN0001 0 0 0 1 1
———————- ——– ——— ——– ———- ———-
1 vlans 0 0 0 1 1
Switch1#show spanning-tree interface fastEthernet 0/1
Vlan Role Sts Cost Prio.Nbr Type
—————- —- — ——— ——– ——————————–
VLAN0001 Desg FWD 19 128.1 P2p
The output above lets us know that f0/1 on Switch1 is participating in Spanning Tree for VLAN1. Which has converged (we know this because the port is “Designated” and has transitioned to FWD state. I will continue this next time with the effects of directly connecting a 2nd and 3rd switch to Switch 1.
That’s all for today. Later gaters!
~