Spanning-Tree Protocol

Spanning-Tree Protocol

A able-bodied arrangement architecture not alone includes able alteration of packets or frames but also

considers how to balance bound from faults in the network. In a Layer 3 environment, the

routing protocol(s) in use keeps clue of bombastic paths to a destination arrangement so that a

secondary aisle can be bound activated if the primary aisle fails. Layer 3 acquisition allows many

paths to a destination to abide up and alive and allows amount administration beyond assorted paths.

In a Layer 2 ambiance (switching or bridging), however, no acquisition protocols are acclimated and

redundant paths are not allowed. Instead, some anatomy of bridging provides abstracts transport

between networks or about-face ports. The Spanning-Tree Agreement (STP) is acclimated to provide

network articulation back-up and amount acclimation so that a Layer 2 switched arrangement can recover

from failures after activity in a adapted manner.

STP is discussed in affiliation to the problems it solves in the afterward sections.

Bridging Loops

Recall that a Layer 2 about-face mimics the activity of a cellophane bridge. A cellophane bridge

must activity analysis amid two networks, while actual cellophane to all the end

devices affiliated to it. For the purpose of this discussion, accede a two-port Ethernet switch

and its similarities to a two-port cellophane bridge.

A cellophane arch (and the Ethernet switch) charge accomplish as follows:

• The arch has no antecedent ability of the area of any end device; therefore, the bridge

must “listen” to frames advancing into anniversary of its ports to amount out on which arrangement a

device resides. The antecedent abode in an admission anatomy is the clue to a device’s

whereabouts—the arch assumes the antecedent accessory is amid abaft the anchorage that the

frame accustomed on. As the alert activity continues, the arch builds a table containing

source MAC addresses and the arch anchorage numbers associated with them.

The arch has the adequacy to consistently amend its bridging table upon

detecting the attendance of a new MAC abode or aloft audition a MAC address

that has afflicted area from one arch anchorage to another. The arch is afresh able

to advanced frames by attractive at the destination address, attractive up the address

in the arch table, and sending the anatomy out the anchorage area the destination

device is located.

Spanning-Tree Agreement 157

• If a anatomy arrives with the advertisement abode as the destination address, the arch must

forward or flood the anatomy out all accessible ports. However, the anatomy is not forwarded out

the anchorage that initially accustomed the frame. In this way, broadcasts are able to ability all

available networks. A arch alone segments blow domains but does not segment

broadcast domains.

• If a anatomy arrives with a destination abode that is not activate in the arch table, the bridge

is clumsy to actuate which anchorage to advanced the anatomy to for transmission. This blazon of

frame is accepted as an alien unicast. In this case, the arch treats the anatomy as if it were

a advertisement and assiduously it out all actual ports. After a acknowledgment to that anatomy is overheard,

the arch will apprentice the area of the alien base and add it to the arch table for

future use.

• Frames that are forwarded beyond the arch cannot be modified.

Bridging or switching in this appearance works well. Any anatomy received, whether to a accepted or

unknown destination, will be forwarded out the adapted anchorage or ports so that it is actual likely

to be accustomed auspiciously at the end device. Amount 5-2 shows a simple two-port switch

functioning as a bridge, forwarding frames amid two end devices. However, this network

design offers no added links or paths for redundancy, should the about-face or one of its links

fail.

Figure 5-2 Cellophane Bridging with a Switch

PC-3 PC-4

PC-1 PC-2

1/1

1/2

Switch A

Segment A

Segment B

158 Affiliate 5: Bombastic About-face Links

To add some redundancy, a additional about-face can be added amid the two aboriginal network

segments, as apparent in Amount 5-3. Now two switches activity the cellophane bridging activity in

parallel. Accede what will appear aback PC-1 sends a anatomy to PC-4. For now, accept that

both PC-1 and PC-4 are accepted to the switches and are in their abode tables. PC-1 sends the

frame out assimilate arrangement Articulation A. About-face A and About-face B both accept the anatomy on their 1/1

ports. Because PC-4 is already accepted to the switches, the anatomy is forwarded out ports 2/1 on

each about-face assimilate Articulation B. The end aftereffect is that PC-4 will accept two copies of the frame

from PC-1. This is not ideal, but is not adverse either.

Figure 5-3 Bombastic Bridging with Two Switches

Now accede the aforementioned activity of sending a anatomy from PC-1 to PC-4. This time, however,

neither about-face knows annihilation about PC-1 or PC-4. PC-1 sends the anatomy to PC-4 by placing

it on Articulation A. The arrangement of contest is as follows:

1 Both About-face A and About-face B accept the anatomy on their 1/1 ports. Because PC-1’s MAC

address has not yet been apparent or recorded, anniversary about-face annal PC-1’s MAC abode in its

address table alternating with the accepting anchorage number, 1/1. From this information, both

switches infer that PC-1 charge abide on Articulation A.

2 Because PC-4’s area is unknown, both switches advanced the anatomy out all available

ports, or their 2/1 ports, and assimilate Articulation B.

PC-3 PC-4

PC-1 PC-2

1/1

2/1

Switch A

Segment A

Segment B

1/1

2/1

Switch B

Spanning-Tree Agreement 159

3 Anniversary about-face places a new anatomy on its 2/1 anchorage on Articulation B. PC-4, amid on Segment

B, receives the two frames destined for it. However, About-face A hears the new frame

forwarded by About-face B, and About-face B hears the new anatomy forwarded by About-face A.

4 About-face A sees that the “new” anatomy is from PC-1 to PC-4. From the abode table, the

switch had abstruse that PC-1 was on anchorage 1/1 or Articulation A. However, the antecedent address

of PC-1 has aloof been heard on anchorage 2/1 on Articulation B. By definition, the about-face must

relearn PC-1’s location, which is now afield affected to be Articulation B. (Switch B

follows the aforementioned procedure, based on the “new” anatomy from About-face A.)

5 At this point, neither About-face A nor About-face B has abstruse the area of PC-4 because no

frames accept been accustomed with PC-4 as the antecedent address. Therefore, the anatomy charge be

forwarded out all accessible ports in an attack to acquisition PC-4. This anatomy is afresh beatific out

Switch A’s 1/1 anchorage and assimilate Articulation A.

6 Now both switches relearn PC-1’s area as Articulation A, advanced the “new” frames back

onto Articulation B, and the accomplished activity repeats.

This activity of forwarding a distinct anatomy about and about amid two switches is known

as a bridging loop. Neither about-face is acquainted of the other, so anniversary aloof appropriately assiduously the same

frame aback and alternating amid its segments. Additionally agenda that because two switches are involved

in the loop, the aboriginal anatomy has been bifold and now gets beatific about in two counterrotating

loops. What stops the anatomy from actuality forwarded in this appearance forever? Nothing.

PC-4 will activate accepting frames addressed to it as fast as the switches can advanced them.

Notice how the abstruse area of the PCs keeps alteration as frames get looped. Alike a unicast

frame has acquired a bridging bend to form, and anniversary switch’s arch table is afresh corrupted

with incorrect data.

What would appear if PC-1 had beatific a advertisement anatomy instead? The bridging loops (remember

that there are two of them produced by the two alongside switches) will anatomy absolutely as before.

The advertisement frames will abide to advertisement forever. Now, however, every end-user device

located on both Segments A and B will accept and activity anniversary and every advertisement frame.

This blazon of advertisement storm can calmly bathe the arrangement segments and accompany every host on

the segments to a halt.

The alone way to end the bridging bend is to physically breach the bend by disconnecting switch

ports or by shutting a about-face down. Rather than breach adverse bridging loops, they should

be prevented instead.

Preventing Loops with Spanning-Tree Protocol

Bridging loops anatomy basically because alongside switches (or bridges) are blind of anniversary other.

STP was developed to affected the achievability of bridging loops so that bombastic switches

and about-face paths could be acclimated for their benefits. In a nutshell, the agreement enables switches to

become acquainted of anniversary added so that they can accommodate a loop-free aisle through the network.

160 Affiliate 5: Bombastic About-face Links

Loops are apparent afore they are opened for use, and bombastic links are shut bottomward to

prevent the loops from forming. In the case of bombastic links, switches can be fabricated acquainted that

a articulation shut bottomward for bend blockage should be bound brought up in case of a articulation failure. This

is discussed in after sections of this chapter.

STP is appear amid all affiliated switches on a network. Anniversary about-face executes the

Spanning-Tree Algorithm (STA) based on advice accustomed from added adjoining switches.

The algorithm chooses a advertence point in the arrangement and calculates all the bombastic paths

to that advertence point. Aback bombastic paths are found, STA picks one aisle to advanced frames

with and disables or blocks forwarding on the added bombastic paths.

As its name implies, STP computes a timberline anatomy that spans all switches in a subnet or

network. Bombastic paths are placed in a blocking or standby accompaniment to anticipate anatomy forwarding.

The switched arrangement is afresh in a loop-free condition. However, if a forwarding anchorage fails or

becomes disconnected, the STA will run afresh to recompute the Spanning-Tree cartography so that

blocked links can be reactivated.

Spanning-Tree Communication: Arch Agreement Abstracts Units

STP operates as switches acquaint with one another. Abstracts letters are exchanged in the

form of Arch Agreement Abstracts Units (BPDUs). A about-face sends a BPDU anatomy out a port, using

the different MAC abode of the anchorage itself as a antecedent address. The about-face is blind of the

other switches about it. Therefore, the BPDU anatomy has a destination abode of the wellknown

STP multicast abode 01-80-c2-00-00-00 to ability all alert switches.

There are two types of BPDU: the Configuration BPDU, acclimated for Spanning Timberline computation;

and the Cartography Change Notification (TCN) BPDU, acclimated to advertise changes in the network

topology. The Configuration BPDU bulletin contains the fields apparent in Table 5-3. The TCN

BPDU is discussed in the “Topology Changes” area after in this chapter.

The barter of BPDU letters works against the ambition of electing advertence credibility as a

foundation for a abiding Spanning-Tree topology. As well, loops will be articular and removed

by agreement specific bombastic ports in a blocking or standby state. Notice that several key fields

in the BPDU are accompanying to arch (or switch) identification, aisle costs, and timer values. These

all assignment calm so that the arrangement of switches will assemble aloft a accepted Spanning-Tree

topology and will baddest the aforementioned advertence credibility aural the network. These advertence points

are authentic in the afterward sections.

BPDUs are beatific out all about-face ports every two abnormal so that accepted cartography advice is

exchanged and loops are articular quickly.

Spanning-Tree Agreement 161

Electing a Base Bridge

For all switches in a arrangement to accede on a loop-free topology, a accepted anatomy of reference

must abide to use as a guide. This advertence point is alleged the Base Bridge. (The appellation “bridge”

continues to be acclimated alike in a switched ambiance because STP was developed for use in

bridges. Therefore, aback you see “bridge,” anticipate “switch.”)

The Base Arch is alleged by an acclamation activity amid all affiliated switches. Anniversary switch

has a different Arch ID that it uses to analyze itself to added switches. The Arch ID is an

8-byte amount that is fabricated up of the afterward fields:

• Arch Antecedence (2 bytes)—The antecedence or weight of a about-face in affiliation to all other

switches. The antecedence acreage can accept a amount of 0 to 65,535 and defaults to 32,768 (or

0x8000) on every Catalyst switch.

• MAC Abode (6 bytes)—The MAC abode acclimated by a about-face can appear from the

Supervisor module, the backplane, or a basin of 1024 addresses that are assigned to every

Supervisor or backplane depending on the about-face model. In any event, this abode is

hardcoded, unique, and cannot be afflicted by the user.

When a about-face aboriginal admiral up, it has a attenuated appearance of its ambience and assumes that it is

the base arch itself. Obviously, this angle will apparently change as added switches analysis in

and access the acclamation process. The acclamation activity afresh gain as follows: Every switch

begins by sending out BPDUs with a Base Arch ID according to its own Arch ID and a Sender

Table 5-3 Configuration BPDU Bulletin Content

Field Description Cardinal of Bytes

Protocol ID (always 0) 2

Version (always 0) 1

Message Blazon (Configuration or Topology

Change Notification BPDU)

1

Flags 1

Root Arch ID 8

Root Aisle Amount 4

Sender Arch ID 8

Port ID 2

Message Age (in 256ths of a second) 2

Maximum Age (in 256ths of a second) 2

Hello Time (in 256ths of a second) 2

Forward Delay (in 256ths of a second) 2

162 Affiliate 5: Bombastic About-face Links

Bridge ID of its own Arch ID. The Sender Arch ID artlessly tells added switches who is the

actual sender of the BPDU message.

Received BPDU letters are analyzed to see if a “better” base arch is actuality announced. A

root arch is advised bigger if the Base Arch ID amount is lower than another. Again, think

of the Base Arch ID as actuality burst up into Arch Antecedence and MAC abode fields. If two

Bridge Antecedence ethics are equal, afresh the lower MAC abode makes the Arch ID better. When

a about-face hears of a bigger Base Bridge, it replaces its own Base Arch ID with the Base Bridge

ID appear in the BPDU. The about-face is afresh appropriate to appoint the new Base Arch ID

in its own BPDU letters although it will still analyze itself as the Sender Arch ID.

Sooner or later, the acclamation will assemble and all switches will accede on the angle that one of

them is the Base Bridge. As ability be expected, if a new about-face with a lower MAC address

powers up, it will activate announcement itself as the Base Bridge. Because the new about-face does

indeed accept a lower Arch ID, all the switches will anon amend and almanac it as the new

Root Bridge. Base Arch acclamation is afresh an advancing process, triggered by Base Arch ID

changes in the BPDUs every two seconds.

As an example, accede the baby arrangement apparent in Amount 5-4. For simplicity, accept that

each Catalyst about-face has a MAC abode of all zeros with the aftermost hex chiffre according to the switch

label.

Figure 5-4 Archetype of Base Arch Election

Catalyst A

32768.00-00-00-00-00-0a Base Bridge

1/1 1/2

1/2 1/2

1/1 100 Mbps 1/1

Cost = 19

100 Mbps

Cost = 19

100 Mbps

Cost = 19

Catalyst B

32768.00-00-00-00-00-0b

Catalyst C

32768.00-00-00-00-00-0c

Spanning-Tree Agreement 163

In this network, anniversary about-face has the absence Arch Antecedence of 32768. The switches are

interconnected with Fast Ethernet links, accepting a absence aisle amount of 19. All three switches try

to accept themselves as the base but all of them accept according Arch Antecedence values. Therefore, the

election is bent by the everyman MAC address—that of Catalyst A.

Electing Base Ports

Now that a advertence point has been nominated and adopted for the absolute switched network,

each non-root about-face charge amount out area it is in affiliation to the Base Bridge. This activity can

be performed by selecting alone one Base Anchorage on anniversary non-root switch.

STP uses the abstraction of amount to actuate abounding things. Selecting a Base Anchorage involves

evaluating the Base Aisle Cost. This amount is the accumulative amount of all the links arch to the

Root Bridge. A accurate about-face articulation has a amount associated with it, too, alleged the Aisle Cost. To

understand the aberration amid these values, bethink that alone the Base Aisle Amount is

carried alternating central the BPDU. As the aisle amount campaign along, added switches can adapt its

value to accomplish it cumulative. The Aisle Cost, however, is not independent in the BPDU. It is known

only to the bounded about-face area the anchorage (or “path” to a adjoining switch) resides.

Path Costs are authentic as a one-byte value, with the absence ethics apparent in Table 5-4. Generally,

the college the bandwidth of a link, the lower the amount of alteration abstracts beyond it. The original

IEEE 802.1D accepted authentic aisle amount as 1000 Mbps disconnected by the articulation bandwidth in Mbps.

These ethics are apparent in the centermost cavalcade of the table. Modern networks frequently use

Gigabit Ethernet and OC-48 ATM, which are both either too abutting to or greater than the

maximum calibration of 1000 Mbps. The IEEE now uses a non-linear calibration for aisle cost, as shown

in the appropriate cavalcade of the table.

Table 5-4 STP Aisle Cost

Link Bandwidth Old STP Amount New STP Cost

4 Mbps 250 250

10 Mbps 100 100

16 Mbps 63 62

45 Mbps 22 39

100 Mbps 10 19

155 Mbps 6 14

622 Mbps 2 6

1 Gbps 1 4

10 Gbps 0 2

164 Affiliate 5: Bombastic About-face Links

NOTE Be acquainted that not all versions of the Catalyst Supervisor cipher use the newer non-linear calibration by

default. For example, Catalyst 5000 versions 2.4 and lower use the earlier beeline scale. Catalyst

5000 versions 3.1 and higher, Catalyst 4000 (all versions), and Catalyst 6000 (all versions) use

the non-linear calibration by default.

The Base Aisle Amount amount is bent in the afterward manner:

1 The Base Arch sends out a BPDU with a Base Aisle Amount amount of aught because its ports

sit anon on the Base Bridge.

2 Aback the abutting abutting acquaintance receives the BPDU, it adds the Aisle Amount of its own port

where the BPDU arrived.

3 Afresh the acquaintance sends out BPDUs with this new accumulative amount as the Base Aisle Cost.

4 This amount is incremented by consecutive about-face anchorage Aisle Costs as the BPDU is received

by anniversary about-face on bottomward the line.

NOTE Agenda the accent on incrementing the Base Aisle Amount as BPDUs are received. When

computing the STA manually, bethink to compute a new Base Aisle Amount as BPDUs appear in

to a about-face port, not as they go out.

After incrementing the Base Aisle Cost, a about-face additionally annal the amount in its memory. Aback a

BPDU is accustomed on accession anchorage and the new Base Aisle Amount is lower than the previously

recorded value, this lower amount becomes the new Base Aisle Cost. In addition, the lower cost

tells the about-face that the Base Arch charge be afterpiece to this anchorage than it was on added ports. The

switch has now bent which of its ports is the abutting to the root—the Base Port.

Figure 5-5 shows the aforementioned arrangement from Amount 5-4 in the activity of Base Anchorage selection.

Spanning-Tree Agreement 165

Figure 5-5 Archetype of Base Anchorage Selection

The Base Bridge, Catalyst A, has already been elected. Therefore, every added about-face in the

network charge accept one anchorage that is abutting to the Base Bridge. Catalyst B selects its anchorage 1/1,

with a Base Aisle Amount of 0+19. Anchorage 1/2 is not alleged because its Base Aisle Amount is 0 (BPDU

from Catalyst A) additional 19 (Path Amount of A-C link) additional 19 (Path Amount of C-B link), or a absolute of

38. Catalyst C makes a agnate best of anchorage 1/1.

Electing Designated Ports

By now, you should activate to see the activity unfolding: a starting or advertence point has been

identified, and anniversary about-face “connects” itself against the advertence point with the abutting single

link. A timberline anatomy is alpha to emerge, but links accept alone been articular at this point.

All links are still affiliated and could be active, abrogation bridging loops.

To abolish the achievability of bridging loops, STP makes a final ciphering to analyze one

Designated Anchorage on anniversary arrangement segment. Suppose that two or added switches accept ports

connected to a distinct accepted arrangement segment. If a anatomy appears on that segment, all the

bridges will attack to advanced it to its destination. Recall that this behavior was the base of a

bridging bend and should be avoided.

Catalyst A

32768.00-00-00-00-00-0a Base Bridge

1/1 1/2

1/2 1/2

1/1 100 Mbps 1/1

Cost = 19

100 Mbps

Cost = 19

100 Mbps

Cost = 19

Catalyst B

32768.00-00-00-00-00-0b

Catalyst C

32768.00-00-00-00-00-0c

Root Anchorage Base Port

Root Aisle Amount = 19 Base Aisle Amount = 19

(Root Aisle Amount = 19 + 19)

166 Affiliate 5: Bombastic About-face Links

Instead, alone one of the links on a articulation should advanced cartage to and from that segment. This

location is the Designated Port. Switches accept a Designated Anchorage based on the lowest

cumulative Base Aisle Amount to the Base Bridge. For instance, a about-face consistently has an abstraction of its

own Base Aisle Cost, which it announces in its own BPDUs. If a adjoining about-face on a shared

LAN articulation sends a BPDU announcement a lower Base Aisle Cost, the acquaintance charge accept the

Designated Port. If a about-face alone learns of college Base Aisle Costs from added BPDUs received

on a port, however, it afresh accurately assumes that its accepting anchorage is the Designated Anchorage for

the segment.

Notice that the accomplished STP assurance activity has alone served to analyze bridges and ports.

All ports are still alive and bridging loops ability still lurk in the network. STP has a set of

progressive states that anniversary anchorage charge go through, behindhand of the blazon or identification. These

states will actively anticipate loops from basic and are declared in the abutting section.

NOTE In anniversary assurance activity discussed so far, two or added links to accepting identical Base Path

Costs is possible. This after-effects in a tie condition, unless added factors are considered. In fact, all

STP decisions are based on the afterward arrangement of four conditions:

1. Everyman Base Arch ID

2. Everyman Base Aisle Amount to Base Bridge

3. Everyman Sender Arch ID

4. Everyman Anchorage ID

Figure 5-6 demonstrates an archetype of Designated Anchorage selection. This amount is identical to

Figure 5-4 and Amount 5-5, with added Spanning Timberline development. The alone changes shown

are the choices of Designated Ports, although seeing all STP decisions apparent in one network

diagram is handy.

Spanning-Tree Agreement 167

Figure 5-6 Archetype of Designated Anchorage Selection

The three switches accept alleged their Designated Ports (DP) for the afterward reasons:

• Catalyst A—Because this about-face is the Base Bridge, all its alive ports are Designated

Ports by definition. At the Base Bridge, the Base Aisle Amount of anniversary anchorage is zero.

• Catalyst B—Catalyst A anchorage 1/1 is the DP for the Articulation A-B because it has the lowest

Root Aisle Amount (0). Catalyst B anchorage 1/2 is the DP for articulation B-C. The Base Aisle Amount for

each end of this articulation is 19, bent from the admission BPDU on anchorage 1/1. Because

the Base Aisle Amount is according on both ports of the segment, the DP charge be alleged by the

next criteria—the everyman Sender Arch ID. Aback Catalyst B sends a BPDU to Catalyst

C, it has the everyman MAC abode in the Arch ID. Catalyst C additionally sends a BPDU to

Catalyst B, but its Sender Arch ID is higher. Therefore, Catalyst B anchorage 1/2 is selected

as the DP of the segment.

Catalyst A

32768.00-00-00-00-00-0a

Designated

Port

1/1 1/2

1/2 1/2

1/1 100 Mbps 1/1

Cost = 19

100 Mbps

Cost = 19

100 Mbps

Cost = 19

Catalyst B

32768.00-00-00-00-00-0b

Catalyst C

32768.00-00-00-00-00-0c

Root Anchorage Base Port

Root Aisle Amount = 19 Base Aisle Amount = 19

Both Base Aisle Amount = 19

Catalyst B has everyman Arch ID

Root Bridge

Designated

Port

Root Aisle Amount = 0

Designated

Port

X

Root Aisle Amount = 0

168 Affiliate 5: Bombastic About-face Links

• Catalyst C—Catalyst A anchorage 1/2 is the DP for Articulation A-C because it has the everyman Root

Path Amount (0). Catalyst B anchorage 1/2 is the DP for Articulation B-C. Therefore, Catalyst C port

1/2 will be neither a Base Anchorage nor a Designated Port. As discussed in the abutting section, any

port that is not adopted to either position will access the blocking state. Area blocking

occurs, bridging loops are broken.