017 Spanning Tree Protocol
017 Spanning Tree Protocol
com
Layer 2 convergence occurs when all 802.1d switch ports are assigned to
blocking state or forwarding state. RSTP includes the following features to
minimize convergence time.
BPDUs are advertised from all switches instead of root bridge only.
There is a single discarding state that replaces the older blocking and
listening port states.
Newer alternate and backup port types are added to root, designated,
and blocking port types.
Alternate Port
RSTP adds alternate and backup port types for faster Layer 2
convergence. The alternate port actively discards frames (blocking)
initially. It transitions a switch port from discarding to forwarding
immediately when the root port fails to minimize network convergence.
Backup Port
This port type requires a hub with two switch links to provide redundancy
for faster convergence. RSTP proposal/agreement process is based on a
handshake between switch interfaces. It provides current root bridge state
information to all switches.
The root bridge elected for a spanning tree instance is the switch with the
lowest bridge ID. STP calculates a unique numerical value for the bridge
ID based on the switch priority setting and MAC address. The switch with
the lowest bridge ID is elected as root bridge. The tie breaker is lowest
MAC address, when switches are assigned the same priority. The bridge
ID is calculated by STP to assign the root bridge per VLAN. The priority
setting for a Cisco switch with a default configuration is 32768. You can
manually configure a lower switch priority as well to assign root bridge.
IOS command show spanning-tree vlan [number] is used to list the local
bridge ID and STP port states for the local switch. In addition it lists the
root bridge for the VLAN. The elected root bridge is identified by the MAC
address. The command show cdp neighbor detail displays the MAC
address for each connected switch making it easier to identify the root
bridge (switch).
www.cisconetsolutions.com
VLAN010
Spanning tree enabled protocol rstp
Root ID priority 20490
Address 0000.000a.aaaa Cost 28
Port 1 (GigabitEthernet1/2)
Hello Time 2 sec max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 0000.000b.bbbb
Hello Time 2 sec max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Answer
The results of show spanning tree command list the elected root bridge
for a particular VLAN and port types assigned for each interface. The root
bridge for VLAN 10 is not switch-1. The Root-ID section lists the priority
and MAC address for the elected root bridge. The Bridge-ID section
pertains to switch-1 where the IOS command was issued. The priority is
higher for switch-1 (32769) than the priority (20490) of the switch that was
elected root bridge. In addition, port types are not all designated ports.
The root bridge assigns all switch ports as designated ports.
www.cisconetsolutions.com
Convergence Forwarding
Designated Ports
The switch with the lowest bridge ID is assigned as root bridge. Once the
root bridge is elected, all switch ports on the root bridge are assigned as
designated port type in forwarding state. The designated ports of a root
bridge connect to the root port of non-root switches neighbors.
Root Port
The root port is a switch port on a neighbor switch that has the least cost
path to the root bridge. It is a primary forwarding link to the root bridge
that received the best BPDU. There is only a single root bridge elected for
any spanning tree instance (VLAN).
www.cisconetsolutions.com
STP calculates the least cost path from a non-root switch interface to the
root bridge. The switch interface for that path is assigned as root port to
the root bridge. The forwarding interface is configurable with port priority
setting as well.
The first step is to identify the root bridge that was elected. All switches
are assigned the same priority, so root bridge is elected based on the
lowest MAC address. Each switch is assigned a base MAC address for
the device.
The lowest MAC address is calculated from left to right per Ethernet MAC
number. All numbers match until number 9 where switch-3 has the lower
(a) compared with switch-2 (b) and switch-1 (c). Switch-3 is elected as
root bridge and all switch ports on a root bridge are designated ports.
switch-1 = 0000.abcd.cccc
switch-2 = 0000.abcd.bbbb
switch-3 = 0000.abcd.aaaa = root bridge
www.cisconetsolutions.com
The root port of a non-root bridge is the switch port with the lowest path
cost to the root bridge. That is a directly connected switch port with the
highest bandwidth. That creates the primary links for switch traffic.
The two non-root switches are switch-1 and switch-2. There is a single
Gigabit Ethernet link connecting the non-root switches. As a result the
switch port cost to the network segment is equal. The port of the non-root
switch with the lower bridge ID is assigned as a designated port when
path costs are equal. Switch-2 has a lower bridge-ID than switch-1. As a
result switch-2 port Gi1/2 is a designated port as well. Switch-1 port Gi1/2
is blocking/alternate port type to prevent Layer 2 loops.
Switch-1
Gi1/1 = Root Port
Gi1/2 = Blocking/Alternate Port
Switch-2
Gi1/1 = Root Port
Gi1/2 = Designated Port
Switch-3
Gi1/1 = Designated Port
Gi1/2 = Designated Port
Answer
The switch with the lowest bridge ID is elected as root bridge. In addition
all switch ports of a root bridge are assigned as designated ports. The
switch with the lowest priority is elected root bridge. All switches are
assigned the same default priority so the tie breaker is the switch with the
lowest MAC address.
www.cisconetsolutions.com
The lowest MAC address is calculated from left to right per number. All
numbers match until bit 9 where switch-3 has the lower number (a)
compared with switch-2 (b) and switch-1 (c). As a result, switch-3 is
elected as root bridge. The switch ports Gi1/1 and Gi1/2 on switch-3 are
designated ports.
switch-1 = 0000.abcd.cccc
switch-2 = 0000.abcd.bbbb
switch-3 = 0000.abcd.aaaa = root bridge
All switches become non-root bridges that connect to the root bridge. The
switch ports are assigned as root port, designated port or alternate port
(blocking). The switch port directly connected to the root bridge is lowest
cost and assigned as root port. That would include switch-2 port Gi1/1
and switch-1 port Gi1/1.
The tie breaker is the non-root switch with the lowest MAC address.
Switch-2 has a lower MAC address than switch-1. From left to right the
Ethernet MAC numbers match until bit 9. switch-2 has a lower Ethernet
MAC number (b) than switch-1 with (c). The result is switch-2 port Gi1/2
is the designated port for the switch link to the non-root neighbor.
switch-1 = 0000.abcd.cccc
switch-2 = 0000.abcd.bbbb
Answer
The first step is to identify the root bridge (switch). The switch with the
lowest priority is elected root bridge. All switches have equal priorities
(default) so the switch with the lowest MAC address is elected root
bridge. The priority and MAC address of a switch are used to calculate
bridge ID value. The switch with lowest bridge ID is elected root bridge.
Switch-3 has the lowest MAC address based on numbering from left to
right. All spanning tree ports of the root bridge are assigned as
designated ports. The directly connected switch port of each neighbor
switch is assigned as root port. That is the default when all switch links
are equal bandwidth. Switch-1 (Gi1/1) and switch-2 (Gi1/1) are root ports
as a result. All RSTP switch ports are assigned as a root port, designated
port or alternate port. Switch-1 (Gi1/1) and switch-2 (Gi1/1) are assigned
as root ports already.
The network segment (link) between switch-1 and switch-2 must elect a
designated port. The bridge ID for switch-2 is lower than switch-1. That is
based on the lower MAC address where priority values are equal. As a
result switch-2 (Gi1/2) is designated port for the segment. The connected
neighbor port on switch-1 (Gi1/2) is assigned alternate (discarding) port.
Answer
RSTP is based on the original 802.1d however there are enhancements
that lower convergence time. The port states were reassigned with RSTP
so there is discarding, learning and forwarding. The discarding state
includes the original disabled, blocking and listening states of 802.1d.
The switching topology is converged when all ports are either discarding
or forwarding. The discarding state is assigned to the alternate port type
where traffic blocking is enabled to prevent Layer 2 loops.
STP must assign a designated port for the network segment connecting
switch-1 and switch-2. That is based on the switch link with lower
bandwidth. Switch-1 and switch-2 have two equal bandwidth switch links
connecting them. The tie breaker is the switch with the lower bridge ID.
Switch-1 has a lower priority so switch ports Gi1/2 and Gi1/3 of switch-1
are assigned as designated ports. STP transitions designated ports to
forwarding state.
www.cisconetsolutions.com
The result is that switch-2 (Gi1/2) is the alternate port in discarding state.
Traffic between switch-1 and switch-2 is forwarded across the Gi1/2 link
between switches. That does include access ports however PortFast
transitions the access edge port immediately to forwarding state.
PortFast
PortFast is a Spanning Tree Protocol (STP) enhancement designed for
access layer network devices. Any host endpoint or a network device
connected to an access switch does not receive STP BPDUs. The switch
interconnection interfaces are part of STP election. That is where Layer 2
loops would occur. PortFast is enabled on switch ports where hosts are
connected. That allows the switch ports to transition from disabled or
blocking state to forwarding immediately on startup. The following is the
interface level IOS command to enable PortFast.
BPDU Guard
IOS command spanning-tree bpduguard enable is configured at the
interface level to prevent network devices from affecting the STP
topology. For example, connecting a network switch at your cubicle would
trigger STP recalculation. The new switch is now connected to an access
switch port causing Layer 2 topology changes. The consequences could
include various errors including a new root bridge.