802.1d Spanning Timberline Protocol 61
Foundation Topics
802.1d Spanning Timberline Protocol
Although abounding CCIE candidates already apperceive STP well, the capacity are calmly forgotten. For
instance, you can install a campus LAN, possibly about-face on a few STP optimizations and security
features out of habit, and accept a alive LAN application STP—without anytime absolutely contemplating
how STP does what it does. And in a arrangement that makes acceptable use of Layer 3 switching, anniversary STP
instance ability amount alone three to four switches, authoritative the STP issues abundant added manageable—
but added forgettable in agreement of allowance you bethink things you charge to apperceive for the exam.
This affiliate reviews the capacity of IEEE 802.1d STP, and afresh goes on to accompanying topics—802.1w
RSTP, assorted spanning trees, STP optimizations, and STP aegis features.
STP uses messaging amid switches to balance the arrangement into a logical, loop-free topology.
To do so, STP causes some interfaces (popularly alleged ports aback discussing STP) to artlessly not
forward or accept traffic—in added words, the ports are in a blocking state. The actual ports,
in an STP forwarding state, calm accommodate a loop-free aisle to every Ethernet articulation in the
network.
Choosing Which Ports Forward: Allotment Root
Ports and Appointed Ports
To actuate which ports advanced and block, STP follows a three-step process, as listed in
Table 3-2. Afterward the table, anniversary of the three accomplish is explained in added detail.
Table 3-2 Three Major 802.1d STP Action Steps
Electing a Basis Switch
Only one about-face can be the basis of the spanning tree; to baddest the root, the switches authority an
election. Anniversary about-face begins its STP argumentation by creating and sending an STP Hello arch protocol
Major Step Description
Elect the basis about-face The about-face with the everyman arch ID wins; the accepted arch ID
is 2-byte antecedence followed by a MAC abode altered to that
switch.
Determine anniversary switch’s Root
Port
The one anchorage on anniversary about-face with the atomic amount aisle aback to the root.
Determine the Appointed Port
for anniversary segment
When assorted switches affix to the aforementioned segment, this is the
switch that assiduously the atomic amount Hello assimilate a segment.
62 Affiliate 3: Spanning Timberline Protocol
data assemblage (BPDU) message, claiming to be the basis switch. If a about-face hears a above Hello—a
Hello with a lower arch ID—it stops claiming to be basis by abeyance to arise and accelerate Hellos.
Instead, the about-face starts forwarding the above Hellos accustomed from the above candidate.
Eventually, all switches except the about-face with the best arch ID cease to arise Hellos; that
one about-face wins the acclamation and becomes the basis switch.
The aboriginal IEEE 802.1d arch ID captivated two fields:
■ The 2-byte Antecedence field, which was advised to be configured on the assorted switches to
affect the after-effects of the STP acclamation process.
■ A 6-byte MAC Abode field, which was included as a tiebreaker, because anniversary switch’s
bridge ID includes a MAC abode amount that should be altered to anniversary switch. As a result,
some about-face charge win the basis election.
The architecture of the aboriginal 802.1d arch ID has been redefined. Figure 3-1 shows the aboriginal and
new architecture of the arch IDs.
Figure 3-1 IEEE 802.1d STP Arch ID Formats
The architecture was afflicted mainly due to the appearance of assorted spanning copse as accurate by Per
VLAN Spanning Timberline Additional (PVST+) and IEEE 802.1s Assorted Spanning Copse (MST). With the
old-style arch ID format, a switch’s arch ID for anniversary STP instance (possibly one per VLAN)
was identical if the about-face acclimated a distinct MAC abode aback architecture the arch ID. Having
multiple STP instances with the aforementioned arch ID was confusing, so vendors such as Cisco Systems
used a altered Ethernet BIA for anniversary VLAN aback creating the old-style arch IDs. This
provided a altered arch ID per VLAN, but it captivated a ample cardinal of aloof BIAs in
each switch.
The System ID Extension allows a arrangement to use assorted instances of STP, alike one per VLAN,
but afterwards the charge to absorb a abstracted BIA on anniversary about-face for anniversary STP instance. The System
ID Extension acreage allows the VLAN ID to be placed into what was aforetime the aftermost 12 $.25 of the
Priority
(0 – 65,535)
System ID
(MAC Address)
System ID Extension
(Typically Holds VLAN ID)
Priority
Multiple
of 4096
6 Bytes
System ID
(MAC Address)
2 Bytes
4 $.25 12 Bits
Original Format
Bridge ID
System ID
Extension
(MAC Address
Reduction)
6 Bytes
802.1d Spanning Timberline Protocol 63
Priority field. A about-face can use a distinct MAC abode to body arch IDs, and with the VLAN
number in the System ID Extension acreage still accept a altered arch ID in anniversary VLAN. The use of
the System ID Extension acreage is additionally alleged MAC abode reduction, because of the charge for many
fewer aloof MAC addresses on anniversary switch.
Determining the Basis Port
Once the basis is elected, the blow of the switches now charge to actuate their Basis Anchorage (RP). The
process gain as declared in the afterward list:
1. The basis creates and sends a Hello every Hello timer (2 abnormal default).
2. Anniversary about-face that receives a Hello assiduously the Hello afterwards afterlight the afterward fields in the
Hello: the cost, the forwarding switch’s arch ID, forwarder’s anchorage priority, and forwarder’s
port number.
3. Switches do not advanced Hellos out ports that balance into a blocking state.
4. Of all the ports in which a about-face receives Hellos, the anchorage with the atomic affected amount to the
root is the RP.
A about-face charge appraise the amount amount in anniversary Hello, additional the switch’s STP anchorage costs, in adjustment to
determine its atomic amount aisle to ability the root. To do so, the about-face adds the amount listed in the Hello
message to the switch’s anchorage amount of the anchorage on which the Hello was received. For example,
Figure 3-2 shows the bend arrangement architecture and capacity several STP amount circulations.
Figure 3-2 Calculating STP Costs to Actuate RPs
In Figure 3-2, SW1 happened to become root, and is basic Hellos of amount 0. SW3 receives
two Hellos, one with amount 0 and one with amount 38. However, SW3 charge afresh account its amount to
reach the root, which is the advertised amount (0 and 38, respectively) additional SW3’s anchorage costs (100 and
19, respectively). As a result, although SW3 has a absolute articulation to SW1, the affected amount is lower
SW1
RP
Fa0/4
Cost 19
BL
DP
DP
DP
DP
RP
RP
Cost 1
Cost 19
Cost 19
Cost out fa0/1 = 0 +
100 = 100; amount out
fa0/4 = 38 + 19 = 57!
Fa0/1
Cost 100
Root Hello Amount 0
Loop Architecture – All Anchorage Costs 19 Unless Shown
SW3
SW2
SW4
Adding my admission cost
setting fields for forwarder’s
bridge ID, anchorage priority, and
port number.
Hello Amount 38
Hello Amount 0 Hello Amount 19
64 Affiliate 3: Spanning Timberline Protocol
out interface fa0/4 (cost 57) than it is out interface fa0/1 (cost 100), so SW3 chooses its fa0/4
interface as its RP.
While the costs apparent in Figure 3-2 ability assume a bit contrived, the aforementioned aftereffect would happen
with absence anchorage costs if the articulation from SW1 to SW3 were Fast Ethernet (default amount 19), and the
other links were Gigabit Ethernet (default amount 4). Table 3-3 lists the absence anchorage costs according
to IEEE 802.1d. Note that the IEEE adapted 802.1d in the backward 1990s, alteration the suggested
default anchorage costs.
Table 3-3 Absence Anchorage Costs According to IEEE 802.1d
When a about-face receives assorted Hellos with according affected cost, it uses the following
tiebreakers:
1. Pick the everyman amount of the forwarding switch’s arch ID.
2. Use the everyman anchorage antecedence of the adjoining switch. The adjoining about-face added its own
port antecedence to the Hello afore forwarding it.
3. Use the everyman centralized anchorage cardinal (of the forwarding switch) as listed central the received
Hellos.
Note that if the aboriginal tiebreaker in this account fails to aftermath an RP, this about-face charge accept multiple
links to the aforementioned adjoining switch. The aftermost two tiebreakers artlessly advice adjudge which of the
multiple alongside links to use.
Determining the Appointed Port
A converged STP cartography after-effects in alone one about-face forwarding assimilate anniversary LAN segment. The
switch that assiduously assimilate a LAN articulation is alleged the appointed about-face for that segment, and
NOTE Abounding bodies anticipate of STP costs as actuality associated with a segment; however, the cost
is absolutely associated with interfaces. Acceptable architecture practices behest application the aforementioned STP amount on
each end of a point-to-point Ethernet segment, but the ethics can be different.
Speed of Ethernet Aboriginal IEEE Amount Revised IEEE Cost
10 Mbps 100 100
100 Mbps 10 19
1 Gbps 1 4
10 Gbps 1 2
802.1d Spanning Timberline Protocol 65
the anchorage that it uses to advanced frames assimilate that articulation is alleged the Appointed Anchorage (DP). By
definition, alone the DP on that articulation should advanced frames assimilate the segment.
To win the adapted to be the DP, a about-face charge accelerate the Hello with the everyman advertised amount onto
the segment. For instance, accede the articulation amid SW3 and SW4 in Figure 3-2 afore the
DP has been bent on that segment. SW3 would get Hellos anon from SW1, compute its
cost to the basis over that path, and afresh advanced the Hello out its fa 0/4 interface to SW4, with cost
100. Similarly, SW4 will advanced a Hello with amount 38, as apparent in Figure 3-2. SW4’s fa 0/3 port
becomes the DP due to its lower advertised cost.
Only the DP assiduously Hellos assimilate a LAN articulation as well. In the aforementioned example, SW4 keeps
sending the cost-38 Hellos out the port, but SW3 stops sending its inferior Hellos.
When the amount is a tie, STP uses the aforementioned tiebreakers to accept the DP as aback allotment an RP:
lowest forwarder’s arch ID, everyman forwarder’s anchorage priority, and everyman forwarder’s port
number.
Converging to a New STP Topology
STP argumentation monitors the accustomed advancing Hello action aback the arrangement cartography is stable; when
the Hello action changes, STP afresh needs to acknowledge and assemble to a new STP topology. When
STP has a abiding topology, the afterward occurs:
1. The basis about-face generates a Hello consistently based on the Hello timer.
2. Anniversary non-root about-face consistently (based on the Hello timer) receives a archetype of the root’s
Hello on its RP.
3. Anniversary about-face updates and assiduously the Hello out its Appointed Ports.
4. For anniversary blocking port, the about-face consistently receives a archetype of the Hello from the DP on that
segment. (The switches do not advanced Hellos out blocking interfaces.)
When some aberration from these contest occurs, STP knows that the cartography has afflicted and that
convergence needs to booty place. For instance, one simple case ability be that the basis about-face loses
power; the blow of the switches will not apprehend any Hello messages, and afterwards the Maxage timer
expires (default 10 times Hello, or 20 seconds), the switches accept a new basis based on the logic
described beforehand in this chapter.
For a added attenuate example, accede Figure 3-3, which shows the aforementioned bend arrangement as in
Figure 3-2. In this case, however, the articulation from SW1 to SW2 has aloof failed.
66 Affiliate 3: Spanning Timberline Protocol
Figure 3-3 Reacting to Loss of Articulation Amid SW1 and SW2
The afterward account describes some of the key accomplish from Figure 3-3:
1. SW2 ceases to accept Hellos on its RP.
2. Because SW2 is not accepting Hellos over any added path, it begins a new basis acclamation by
claiming to be basis and calamity Hellos out every port.
3. SW4 notices that the latest Hello implies a new basis switch, but SW4 ends up with the same
RP (for now). SW4 assiduously the Hello out against SW3 afterwards afterlight the adapted fields
in the Hello.
4. SW3 receives the Hello from SW4, but it is inferior to the one SW3 receives from SW1. So,
SW3 becomes the DP on the articulation amid itself and SW4, and starts forwarding the
superior Hello on that port.
Remember, SW1 had won the beforehand election; as of Accomplish 3 and 4, the Hellos from SW1 and
SW2 are competing, and the one claiming SW1 as basis will afresh win. The blow of the process
results with SW3’s fa0/4 as DP, SW4’s fa 0/3 as RP, SW4’s fa 0/2 as DP, and SW3’s fa 0/4
as RP.
Topology Change Notification and Afterlight the CAM
When STP reconvergence occurs, some Content Addressable Memory (CAM) entries might
be invalid (CAM is the Cisco appellation for what’s added generically alleged the MAC abode table,
switching table, or bridging table on a switch). For instance, afore the articulation abortion apparent in
Figure 3-3, SW3’s CAM ability accept had an access for 0200.1111.1111 (Router1’s MAC address)
pointing out fa0/4 to SW4. (Remember, at the alpha of the book declared in Figure 3-3,
Loop Architecture – All Anchorage Costs 19 Unless Shown
SW1
Fa0/4
Cost 19
Disabled
Fa0/3
Fa0/2
Fa0/4
Disabled
Cost 1
SW1’s arch ID is better.
So I’m sending the
superior Hello on this
Fa0/1 segment. I am now DP!
Cost 100
MAC 0200.1111.1111
Root
SW3
SW2
SW4
My RP failed. I am
receiving no added Hellos.
I charge be the basis now!
Hello Basis =
Sw2 Amount 0
Hello Basis =
Sw2 Amount 19
Hello Basis =
Sw1 Amount 0
Hello Basis =
Sw1 Amount 100
R1
1
1
2
4 3
802.1d Spanning Timberline Protocol 67
SW3 was blocking on its fa0/1 interface aback to SW1.) Aback the articulation amid SW1 and SW2
failed, SW3 would charge to change its CAM access for 0200.1111.111 to point out anchorage fa0/1.
To amend the CAMs, two things charge to occur:
■ All switches charge to be notified to time out their CAM entries.
■ Anniversary about-face needs to use a abbreviate timer, agnate to the Advanced Adjournment timer (default 15
seconds), to time out the CAM entries.
Because some switches ability not anon apprehension a change in the STP topology, any about-face that
detects a change in the STP cartography has a albatross to acquaint the blow of the switches. To do
so, a about-face artlessly notifies the basis about-face in the anatomy of a Cartography Change Notification (TCN)
BPDU. The TCN goes up the timberline to the root. Afterwards that, the basis notifies all the blow of the switches.
The action runs as follows:
1. A about-face experiencing the STP anchorage accompaniment change sends a TCN BPDU out its Basis Port; it
repeats this bulletin every Hello time until it is acknowledged.
2. The abutting about-face accepting that TCN BPDU sends aback an accepting via its next
forwarded Hello BPDU by appearance the Cartography Change Accepting (TCA) bit in
the Hello.
3. The about-face that was the DP on the articulation in the aboriginal two accomplish repeats the aboriginal two steps,
sending a TCN BPDU out its Basis Port, and apprehension accepting from the DP on that
segment.
By anniversary alternating about-face repeating Accomplish 1 and 2, eventually the basis receives a TCN BPDU.
Once received, the basis sets the TCA banderole on the abutting several Hellos, which are forwarded to all
switches in the network, advice them that a change has occurred. A about-face accepting a Hello
BPDU with the TCA banderole set uses the abbreviate (Forward Adjournment time) timer to time out entries in
the CAM.
Transitioning from Blocking to Forwarding
When STP reconverges to a new, abiding topology, some ports that were blocking ability accept been
designated as DP or RP, so these ports charge to be in a forwarding state. However, the transition
from blocking to forwarding accompaniment cannot be fabricated anon afterwards the accident of causing loops.
To alteration to forwarding accompaniment but additionally anticipate acting loops, a about-face aboriginal puts a formerly
blocking anchorage into alert state, and afresh into acquirements state, with anniversary accompaniment abiding for the length
of time authentic by the advanced adjournment timer (by default, 15 seconds). Table 3-4 summarizes the key
points about all of the 802.1d STP anchorage states.
IEEE 802.1d Spanning Timberline Interface States
In summary, aback STP argumentation senses a change in the topology, it converges, possibly picking
different ports as RP, DP, or neither. Any about-face alteration its RPs or DPs sends a TCN BPDU
to the basis at this point. For the ports anew appointed as RP or DP, 802.1d STP aboriginal uses the
listening and acquirements states afore extensive the forwarding state. (The alteration from forwarding
to blocking can be fabricated immediately.)
State
Forwards
Data Frames?
Learn Source MACs of
Received Frames?
Transitory or
Stable State?
Blocking No No Stable
Listening No No Transitory
Learning No Yes Transitory
Forwarding Yes Yes Stable
Disabled No No Stable