Chapter 2 was another long one. I remember doing chapters 1-3 and the NetSim labs on the very first day of my schedule. STP or Spanning Tree Protocol is talked about as being a fairly heavy topic on the exam and while I don’t feel like an expert, I feel like I have the basics down. The question is whether the basics are enough or whether I will get drilled by the details. Here are my notes from the review I just finished.
STP (Spanning Tree Protocol) is a loop prevention mechanism used by switches.
STP prevents loops by placing each port in either a Forwarding State or Blocking State.
Ports in a Blocking State do not pass traffic but do pass STP messages.
STP determines whether to place a port into forwarding or blocking state as follows:
1. STP elects a root bridge. All ports on the root bridge are set to forward.
2. Each non-root bridge places the port with the least cost to the root-bridge in a forwarding state. These are called root ports or RP. Each switch will only have 1 RP.
3. On each segment connected to another switch, the switch with the lowest cost to the root bridge is used as the designated port or DP.
4. All other ports connected to another switch go into blocking state.
Access only ports will always be in a forwarding state as they will never receive BPDUs.
Each switch has an 8 BYTE Bridge ID which consists of 2 BYTE prioriy field and the MAC address of the switch.
STP message are called BPDUs (Bridge Protocol Data Units)
The HELLO BPDU message lists the switch’s Bridge ID, Root Bridge ID, Cost to reach the Root, and a Timer.
The switch with the lowest Bridge ID is elected the root bridge.
Funny note: All switches initially declare themselves the winner and advertise as such. Once they receive BPDUs with lower Bridge IDs they stop declaring themselves as the winner and advertise the new lower Bridge ID as the root bridge. The messages continue around until only one switch is declared the winner. Not unlike the political primaries we have in this country. 🙂
The root bridge sends out Hello BPDUs every 2 seconds.
The default Max Age is 10 * Hello Timer (2 seconds) which equals 20 seconds. If the switch does not hear a BPDU Hello in 20 seconds it consider the remote end to be down.
At that point the STA is run to determine which ports need to be RP and DP. (Re-convergence)
The forward delay timer determines how long each transitioning state will be maintained. Default is 15 seconds.
When a change occurs that causes the switch to re-evaluate its RP and DP and interface is first placed in a LISTENING state and no frames are forwarded. Then it transitions to a LEARNING state where it learns MAC addresses but still does not forward frames. Finally it moves to a FORWARDING state.
LISTENING (15 seconds) >> LEARNING (15 seconds) >> FORWARDING
EtherChannel combines multiple equal speed links (up to 8) into a single virtual interface.
EtherChannel load balances across the links in the channel.
EtherChannel is also know as Port Channel
Portfast immediately places a switchport in a FORWARDING state and should only be enabled on ports that connect to end-devices and will never connect to another switch.
BPDU Guard is a Cisco proprietary protocol that disables a port if any BPDUs are received on the port. It is intended only for access ports.
Root Guard disables a port if it receives a BPDU with a lower Bridge ID than itself.
STP is defined by 802.1d and RSTP (Rapid Spanning Tree Protocol) is defined by 802.1w.
RSTP calls the blocking state the DISCARDING state.
RSTP improves converge times by only waiting 3 * Hello Timer (6 seconds by default) instead of 10 * Hello Timer. RSTP also does not use the Forward Delay Timer.
RSTP use 2 more port roles above RP and DP to help with convergence times.
1. Alternate port is the switch’s 2nd best port to the root bridge.
2. Backup port only applies when a switch has 2 links to the same segment. (Hubs)
RSTP automatically places Edge ports (Access) in FORWARDING state during convergence similar to Cisco’s PortFast.
RSTP does not use the LISTENING state.
RSTP is not enabled by default on CIsco switches. 802.1d is used with a Cisco proprietary Per-VLAN Spanning Tree Plus. (PVST+)
Bridge ID = 32,768 + VLAN #
Cost = 100 for 100Mbs, 19 for 1000Mbs, 4 for 1Gbs, and 2 for 10Gbs
Portfast = Disabled
BPDU = Disabled
To change defaults use:
Switch(config)#spanning-tree vlan 10 root [primary | secondary]
Switch(config-if)#spanning-tree vlan 10 priority 1
Switch(config-if)#spanning-tree bpduguard enable
Commands to show STP operation:
Switch#show spanning-tree vlan 10
Switch#show spanning-tree root
Switch#show spanning-tree bridge
Switch#show spanning-tree interface Fa0/24
Switch(config)#spanning-tree mode rapid-pvst