chapter 5 spanning tree protocol (stp) part i -...

33
CCNA3-1 Chapter 5-1 Chapter 5 Chapter 5 Spanning Tree Protocol Spanning Tree Protocol (STP) (STP) Part I Part I CCNA3-2 Chapter 5-1 Note for Instructors Note for Instructors These presentations are the result of a collaboration among These presentations are the result of a collaboration among the instructors at St. Clair College in Windsor, Ontario. the instructors at St. Clair College in Windsor, Ontario. Thanks must go out to Rick Graziani of Cabrillo College. His Thanks must go out to Rick Graziani of Cabrillo College. His material and additional information was used as a reference material and additional information was used as a reference in their creation. in their creation. If anyone finds any errors or omissions, please let me know If anyone finds any errors or omissions, please let me know at: at: [email protected]. [email protected].

Upload: trinhdien

Post on 14-Mar-2018

284 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-1 Chapter 5-1

Chapter 5Chapter 5

Spanning Tree ProtocolSpanning Tree Protocol(STP) (STP)

Part IPart I

CCNA3-2 Chapter 5-1

Note for InstructorsNote for Instructors

•• These presentations are the result of a collaboration among These presentations are the result of a collaboration among the instructors at St. Clair College in Windsor, Ontario.the instructors at St. Clair College in Windsor, Ontario.

•• Thanks must go out to Rick Graziani of Cabrillo College. His Thanks must go out to Rick Graziani of Cabrillo College. His material and additional information was used as a reference material and additional information was used as a reference in their creation.in their creation.

•• If anyone finds any errors or omissions, please let me know If anyone finds any errors or omissions, please let me know at: at:

•• [email protected]@stclaircollege.ca.

Page 2: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-3 Chapter 5-1

Spanning Tree Protocol (STP)Spanning Tree Protocol (STP)

Redundant Layer 2 TopologiesRedundant Layer 2 Topologies

CCNA3-4 Chapter 5-1

Redundant Layer 2 TopologiesRedundant Layer 2 Topologies

•• As businesses become increasingly dependent on the As businesses become increasingly dependent on the network, the availability of the network infrastructure network, the availability of the network infrastructure becomes a critical business concern. becomes a critical business concern.

•• RedundancyRedundancy is the solution for achieving the necessary is the solution for achieving the necessary availability.availability.

•• Layer 2 redundancy improves the availability of the Layer 2 redundancy improves the availability of the network by implementing network by implementing alternate network pathsalternate network paths by by adding equipment and cabling.adding equipment and cabling.

•• Having multiple paths for data to traverse the network Having multiple paths for data to traverse the network allows for a single path to be disruptedallows for a single path to be disrupted without impacting without impacting the connectivity of devices on the network. the connectivity of devices on the network.

Page 3: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-5 Chapter 5-1

RedundancyRedundancy

CCNA3-6 Chapter 5-1

RedundancyRedundancy

Redundant paths create loops in the network.

Redundant paths create Redundant paths create loops loops in the network.in the network.

How are they controlled?Spanning Tree ProtocolHow are they controlled?How are they controlled?Spanning Tree ProtocolSpanning Tree Protocol

Page 4: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-7 Chapter 5-1

RedundancyRedundancy

•• The Spanning Tree Protocol The Spanning Tree Protocol (STP)(STP) is enabled on all is enabled on all switches.switches.

•• STP has placed some switch ports in STP has placed some switch ports in forwardingforwarding state and state and other switch ports in other switch ports in blockingblocking state.state.

ForwardForwardForward

BlockedBlockedBlocked

CCNA3-8 Chapter 5-1

Issues with RedundancyIssues with Redundancy

•• RedundancyRedundancy is an important part of the hierarchical design.is an important part of the hierarchical design.

•• When multiple paths exist between two devices on the When multiple paths exist between two devices on the network and network and STP has been disabledSTP has been disabled on those switches, a on those switches, a Layer 2 loopLayer 2 loop can occur.can occur.

•• If If STP is enabledSTP is enabled on these switches, on these switches, which is the defaultwhich is the default, , a a Layer 2 loop would not occurLayer 2 loop would not occur..

Page 5: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-9 Chapter 5-1

Issues with RedundancyIssues with Redundancy

•• Ethernet frames do not have a Ethernet frames do not have a TimeTime--ToTo--Live (TTL)Live (TTL) parameter parameter like IP packets.like IP packets.

•• As a result, if they are not terminated properly on a As a result, if they are not terminated properly on a switched network, they continue to bounce from switch to switched network, they continue to bounce from switch to switch endlessly.switch endlessly.

CCNA3-10 Chapter 5-1

Issues with RedundancyIssues with Redundancy

•• Remember that switches use the Remember that switches use the Source MAC addressSource MAC address to to learn where the devices are and learn where the devices are and enters this informationenters this information into into their MAC address tables.their MAC address tables.

•• Switches will Switches will flood the frames for unknown destinationsflood the frames for unknown destinations until until they learn the MAC addresses of the devices. they learn the MAC addresses of the devices.

Page 6: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-11 Chapter 5-1

Issues with RedundancyIssues with Redundancy

•• Additionally, Additionally, multicasts and broadcastsmulticasts and broadcasts are also flooded out are also flooded out all ports except the receiving port. all ports except the receiving port. (Multicasts will not be (Multicasts will not be flooded if the switch has been specifically configured to flooded if the switch has been specifically configured to handle multicasts.) handle multicasts.)

CCNA3-12 Chapter 5-1

Issues with RedundancyIssues with Redundancy

PC1 sends a broadcast.

PC1 sends a PC1 sends a broadcast.broadcast.

S2 receives the frame and

updates the MAC table.

S2 receives the S2 receives the frame and frame and

updates the MAC updates the MAC table.table.

S2 floods the broadcast out all ports except the receiving port.

S2 floods the S2 floods the broadcast out all broadcast out all ports except the ports except the receiving port.receiving port.

S3 and S1 update their MAC tablesS3 and S1 update S3 and S1 update their MAC tablestheir MAC tables

S3 and S1 now flood the broadcast.

S3 and S1 now S3 and S1 now flood the broadcast.flood the broadcast.

S3 and S1 update their MAC tables with the wrong

information

S3 and S1 update S3 and S1 update their MAC tables their MAC tables with the wrong with the wrong

informationinformation

S3 and S1 forward the broadcast back

to S2.

S3 and S1 forward S3 and S1 forward the broadcast back the broadcast back

to S2.to S2.

S2 updates its MAC table with

the wrong information

S2 updates its S2 updates its MAC table with MAC table with

the the wrong wrong informationinformation

S2 floods the broadcast again

S2 S2 floodsfloods the the broadcast againbroadcast againS3 and S1 update their MAC tables again with the wrong information

S3 and S1 update their S3 and S1 update their MAC tables again with MAC tables again with the the wrong informationwrong information

Page 7: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-13 Chapter 5-1

Issues with RedundancyIssues with Redundancy

•• Broadcast Storms:Broadcast Storms:

PC1 sends a broadcast

PC1 sends a PC1 sends a broadcastbroadcast

No STP so aloop is createdNo STPNo STP so aso a

loop is createdloop is createdPC4 sends a

broadcastPC4 sends a PC4 sends a

broadcastbroadcastAnother loopAnother loopAnother loopPC3 sends a broadcast and

creates yet another loopPC3 sends a broadcast and PC3 sends a broadcast and

creates yet another loopcreates yet another loopPC2 sends a

broadcastPC2 sends a PC2 sends a

broadcastbroadcast

Because of the high level of traffic, it

cannot be processed.

Because of the high Because of the high level of traffic, it level of traffic, it

cannot be cannot be processed.processed.

In fact, the entire network can no longer process new traffic

and comes to a screeching halt.

In fact, the entire network can In fact, the entire network can no longer process new traffic no longer process new traffic

and comes to a screeching halt.and comes to a screeching halt.

CCNA3-14 Chapter 5-1

Issues with RedundancyIssues with Redundancy

•• Duplicate Unicast Frames:Duplicate Unicast Frames:

PC1 sends a unicast frame

to PC4

PC1 sends a PC1 sends a unicastunicast frame frame

to PC4to PC4

S2 has no entry for PC4 so the frame is flooded out the remaining ports

S2 has no entry for S2 has no entry for PC4 so the frame PC4 so the frame is flooded out the is flooded out the remaining portsremaining ports

Both S3 and S1 have entries for PC4 so the

frame is forwarded

Both S3 and S1 have Both S3 and S1 have entries for PC4 so the entries for PC4 so the

frame is forwardedframe is forwarded

S1 also forwards the frame it

received from S3

S1 also forwards S1 also forwards the frame it the frame it

received from S3received from S3

End result….PC4 receives two copies of the same frame. One from S1 and one from S3.

End resultEnd result……..PC4 receives two copies of the same PC4 receives two copies of the same frame. One from S1 and one from S3.frame. One from S1 and one from S3.

Page 8: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-15 Chapter 5-1

RealReal--World Redundancy IssuesWorld Redundancy Issues

•• Loops in the Wiring Closet:Loops in the Wiring Closet:

•• Usually caused by an error in cabling.Usually caused by an error in cabling.

CCNA3-16 Chapter 5-1

RealReal--World Redundancy IssuesWorld Redundancy Issues

•• Loops in Cubicles:Loops in Cubicles:

•• Some users have a personal switch or hub.Some users have a personal switch or hub.

Affects all of the traffic on S1

Affects all of Affects all of the traffic on S1the traffic on S1

Page 9: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-17 Chapter 5-1

Spanning Tree Protocol (STP)Spanning Tree Protocol (STP)

Introduction to STPIntroduction to STP

CCNA3-18 Chapter 5-1

Introduction to STPIntroduction to STP

•• Redundancy:Redundancy:

•• Increases the availability of the network topology by Increases the availability of the network topology by protecting the network from a single point of failure.protecting the network from a single point of failure.

•• In a Layer 2 design, loops and duplicate frames can In a Layer 2 design, loops and duplicate frames can occur, having severe consequences.occur, having severe consequences.

•• The The Spanning Tree Protocol (STP)Spanning Tree Protocol (STP) was developed to was developed to address these issues.address these issues.

•• STP ensures that there is only one logical path between STP ensures that there is only one logical path between all destinations on the network all destinations on the network by intentionally blocking by intentionally blocking redundant pathsredundant paths that could cause a loop.that could cause a loop.

•• The switches running STP are able to compensate for The switches running STP are able to compensate for failures byfailures by dynamically unblocking the previously blocked dynamically unblocking the previously blocked portsports and permitting traffic to traverse the alternate paths.and permitting traffic to traverse the alternate paths.

Page 10: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-19 Chapter 5-1

SpanningSpanning--Tree Algorithm (STA)Tree Algorithm (STA)

•• STP Topology STP Topology –– Avoiding a loopAvoiding a loop::

STP is in use and S3 has placed port F0/2 in blocking state to

avoid a loop.

STP is in use and S3 STP is in use and S3 has placed port F0/2 has placed port F0/2 in in blocking stateblocking state to to

avoid a loop.avoid a loop.

PC1 sends a broadcast.

PC1 sends a PC1 sends a broadcast.broadcast.

S2 forwards the broadcast – but

not to S3.

S2 forwards the S2 forwards the broadcast broadcast –– but but

not to S3not to S3..

S1 forwards the broadcast.

S1 forwards the S1 forwards the broadcast.broadcast.

Because F0/2 is in blocking state, the broadcast is not

forwarded back to S2. – NO LOOP!

Because F0/2 is in Because F0/2 is in blocking stateblocking state, the , the broadcast is not broadcast is not

forwardedforwarded back to back to S2. S2. –– NO LOOP!NO LOOP!

CCNA3-20 Chapter 5-1

SpanningSpanning--Tree Algorithm (STA)Tree Algorithm (STA)

•• STP Topology STP Topology –– Network FailureNetwork Failure::

Trunk 1 FailureTrunk 1 Trunk 1 FailureFailure

S3 port activatedS3 port S3 port

activatedactivated

PC1 Sends a broadcast.

PC1 Sends a PC1 Sends a broadcast.broadcast.

S2 forwards the broadcast.

S2 forwards the S2 forwards the broadcast.broadcast.

S3 and S1 forward the broadcast.

S3 and S1 forward S3 and S1 forward the broadcast.the broadcast.

Trunk 1 comes back up.

Trunk 1 comes Trunk 1 comes back up.back up.

S3 port back to blocking mode.S3 port back to S3 port back to blocking modeblocking mode..

Page 11: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-21 Chapter 5-1

SpanningSpanning--Tree Algorithm (STA)Tree Algorithm (STA)

•• Terminology:Terminology:

•• Root Bridge:Root Bridge:

•• A single switch used as the A single switch used as the reference pointreference point for all for all calculations.calculations.

•• Root Ports:Root Ports:

•• The switch port closest to the root bridge.The switch port closest to the root bridge.

•• Designated Port:Designated Port:

•• All nonAll non--root ports that are still permitted to forward root ports that are still permitted to forward traffic on the network.traffic on the network.

•• NonNon--designated Ports:designated Ports:

•• All ports configured to be in a blocking state to prevent All ports configured to be in a blocking state to prevent loops.loops.

CCNA3-22 Chapter 5-1

SpanningSpanning--Tree Algorithm (STA)Tree Algorithm (STA)

•• STP uses the STP uses the Spanning Tree Algorithm Spanning Tree Algorithm (STA) to determine (STA) to determine which switch ports on a network need to be configured for which switch ports on a network need to be configured for blocking to prevent loops. blocking to prevent loops.

•• Through an election process, the algorithm designates a Through an election process, the algorithm designates a single switch as the root bridgesingle switch as the root bridge and uses it as the and uses it as the reference point for all calculations.reference point for all calculations.

•• The election process is controlled by the The election process is controlled by the BridgeBridge--ID (BID)ID (BID). .

BridgePriority

MACMACAddressAddress

222 666

Page 12: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-23 Chapter 5-1

Root BridgeRoot Bridge

•• Election Process:Election Process:

•• All switches in the broadcast domain participate.All switches in the broadcast domain participate.

•• After a switch boots, it sends out Bridge Protocol Data After a switch boots, it sends out Bridge Protocol Data Units Units (BPDU)(BPDU) frames containing the frames containing the switch BIDswitch BID and the and the root IDroot ID every 2 seconds.every 2 seconds.

•• TheThe root IDroot ID identifies the root bridge on the network.identifies the root bridge on the network.

•• By defaultBy default, the , the root ID matches the local BIDroot ID matches the local BID for all for all switches on the network. switches on the network.

•• In other words, each switch considers itself as the root In other words, each switch considers itself as the root bridge when it bootsbridge when it boots..

CCNA3-24 Chapter 5-1

Root BridgeRoot Bridge

•• Election Process:Election Process:

•• As the switches forward their BPDU frames, switches in As the switches forward their BPDU frames, switches in the broadcast domain the broadcast domain read the root ID informationread the root ID information from from the BPDU frame.the BPDU frame.

•• If the root ID from the BPDUIf the root ID from the BPDU received is lower than the received is lower than the root ID on the receiving switchroot ID on the receiving switch, the receiving switch , the receiving switch updates its root ID identifying the adjacent switch as the updates its root ID identifying the adjacent switch as the root bridge.root bridge.

•• The switch then forwards The switch then forwards new BPDU frames with the new BPDU frames with the lower root IDlower root ID to the other adjacent switches.to the other adjacent switches.

•• Eventually, Eventually, the switch with the the switch with the lowest BIDlowest BID ends up being ends up being identified as the root bridgeidentified as the root bridge for the spanningfor the spanning--tree tree instance.instance.

Page 13: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-25 Chapter 5-1

Best PathBest Path

•• Now that the root bridge has been elected, the STA starts the Now that the root bridge has been elected, the STA starts the process of determining the process of determining the best paths to the root bridge from best paths to the root bridge from all destinationsall destinations in the broadcast domain.in the broadcast domain.

•• The path information is determined by The path information is determined by summing up the summing up the individual port costsindividual port costs along the path from the destination to the along the path from the destination to the root bridge.root bridge.

•• The The default port costsdefault port costs are specified by the IEEE and defined are specified by the IEEE and defined by the speed at which the port operates.by the speed at which the port operates.

Link SpeedLink Speed CostCost

10Gbps 2

1Gbps 4

100Mbps 19

10Mbps 100

CCNA3-26 Chapter 5-1

Best PathBest Path

•• You are not restricted to the defaultsYou are not restricted to the defaults..

•• The cost of a path The cost of a path can be manually configuredcan be manually configured to specify to specify that a specific path is the preferred path instead of that a specific path is the preferred path instead of allowing the STA to choose the best path.allowing the STA to choose the best path.

•• Realize, however, that changing the cost of a particular Realize, however, that changing the cost of a particular path will affect the results of the STA.path will affect the results of the STA.

•• The The ‘‘nono’’ form of the following command will return the form of the following command will return the cost to its default value.cost to its default value.

switch(config)#interface fa0/1switch(config)#interface fa0/1

switch(configswitch(config--if)#spanningif)#spanning--tree cost tree cost [value][value]

switch(configswitch(config--if)#endif)#end

Page 14: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-27 Chapter 5-1

Best PathBest Path

•• Verifying the port and path costVerifying the port and path cost..

Port CostPort CostPort Cost

Path CostPath CostPath Cost

CCNA3-28 Chapter 5-1

STP Bridge Protocol Data UnitSTP Bridge Protocol Data Unit

•• STP determines a root bridge for the spanningSTP determines a root bridge for the spanning--tree instance tree instance by exchanging Bridge Protocol Data Units by exchanging Bridge Protocol Data Units (BPDU)(BPDU)..

Identifies the root bridge and the

cost of the path to the root bridge.

Identifies the root Identifies the root bridge and the bridge and the

cost of the path to cost of the path to the root bridge.the root bridge.

Page 15: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-29 Chapter 5-1

STP Bridge Protocol Data UnitSTP Bridge Protocol Data Unit

•• STP determines a root bridge for the spanningSTP determines a root bridge for the spanning--tree instance tree instance by exchanging Bridge Protocol Data Units by exchanging Bridge Protocol Data Units (BPDU)(BPDU)..

CCNA3-30 Chapter 5-1

BPDU ProcessBPDU Process

•• Root Bridge Election Process:Root Bridge Election Process:

S3 believes S2 is the root bridge.S1 still thinks it is the root bridge.S3 believes S2 is the root bridge.S3 believes S2 is the root bridge.S1 still thinks it is the root bridge.S1 still thinks it is the root bridge.

Page 16: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-31 Chapter 5-1

BPDU ProcessBPDU Process

•• Root Bridge Election Process:Root Bridge Election Process:

S2 and S1 both think that theyare the root bridge.

S2 and S1 both think that theyS2 and S1 both think that theyare the root bridge.are the root bridge.

CCNA3-32 Chapter 5-1

BPDU ProcessBPDU Process

•• Root Bridge Election Process:Root Bridge Election Process:

S3 recognizes S1 as the root.S2 recognizes S1 as the root.S3 recognizes S1 as the root.S3 recognizes S1 as the root.S2 recognizes S1 as the root.S2 recognizes S1 as the root.

Page 17: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-33 Chapter 5-1

BPDU ProcessBPDU Process

•• Root Bridge Election Process:Root Bridge Election Process:

If the root bridge fails, the election process begins again.

If the root bridge fails, the election If the root bridge fails, the election process begins again.process begins again.

CCNA3-34 Chapter 5-1

Bridge IDBridge ID

Early STP implementation – no VLANs.Early STP implementation Early STP implementation –– no VLANs.no VLANs.

Changed to include VLAN ID.Changed to include VLAN ID.Changed to include VLAN ID.

That means that there is a separate instance of STP for each VLAN.

That means that there is That means that there is a separate a separate instance of STPinstance of STP for each VLAN.for each VLAN.

Page 18: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-35 Chapter 5-1

Bridge IDBridge ID

CCNA3-36 Chapter 5-1

Bridge IDBridge ID

•• Bridge Priority:Bridge Priority:

•• A customizable value that you can use to A customizable value that you can use to influence which influence which switch becomes the root bridgeswitch becomes the root bridge..

(Another rigged election!)(Another rigged election!)

•• The switch with the The switch with the lowest prioritylowest priority, which means lowest , which means lowest BID, BID, becomes the root bridgebecomes the root bridge..

•• TheThe lowerlower the priority the priority valuevalue, the , the higherhigher the the prioritypriority. .

Page 19: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-37 Chapter 5-1

Bridge IDBridge ID

•• Bridge Priority:Bridge Priority:

•• Notice that the addition of the VLAN ID Notice that the addition of the VLAN ID leaves fewer bitsleaves fewer bitsavailable for the bridge priority (4 instead of 16).available for the bridge priority (4 instead of 16).

•• As a result, the bridge priority is assigned in As a result, the bridge priority is assigned in multiples of multiples of 40964096..

•• The The priority is added to the extended system valuepriority is added to the extended system value (VLAN (VLAN ID) to uniquely identify the priority and VLAN of the BPDU ID) to uniquely identify the priority and VLAN of the BPDU frame.frame.

+++

CCNA3-38 Chapter 5-1

Bridge IDBridge ID

•• Bridge Priority:Bridge Priority:

•• For example:For example:

•• The The default default bridge priority is bridge priority is 32,76932,769..

•• (4096 * 8) + VLAN 1 ( native VLAN)(4096 * 8) + VLAN 1 ( native VLAN)

•• If I assign bridge priority 24,576 for VLAN 1 (4096 *6), If I assign bridge priority 24,576 for VLAN 1 (4096 *6), the bridge priority becomes the bridge priority becomes 24,56724,567..

•• This switch will become the root bridge.This switch will become the root bridge.

+++

Page 20: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-39 Chapter 5-1

Bridge IDBridge ID

•• Bridge Priority:Bridge Priority:

Default Priority:Election based on

MAC Address

Default Priority:Default Priority:Election based on Election based on

MAC AddressMAC Address

CCNA3-40 Chapter 5-1

Bridge IDBridge ID

•• Bridge Priority:Bridge Priority:

Modified Priority:Election based on

priority.

Modified Priority:Modified Priority:Election based on Election based on

priority.priority.

Page 21: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-41 Chapter 5-1

Configure and Verify the Bridge IDConfigure and Verify the Bridge ID

•• Two Methods to configure the Bridge ID:Two Methods to configure the Bridge ID:

•• Method 1:Method 1: Ensures that the switch has the lowest priority value after

determining the lowest value on the network.

Ensures that the switch has the Ensures that the switch has the lowest priority valuelowest priority value after after

determining the lowest value on the determining the lowest value on the network.network.

Ensures that the switch will become the root bridge if the primary fails. This one assumes that all other

switches have the default value.

Ensures that the switch will become the root bridge Ensures that the switch will become the root bridge if the primary fails. if the primary fails. This one assumes that all other This one assumes that all other

switches have the default valueswitches have the default value..

CCNA3-42 Chapter 5-1

Configure and Verify the Bridge IDConfigure and Verify the Bridge ID

•• Two Methods to configure the Bridge ID:Two Methods to configure the Bridge ID:

•• Method 2:Method 2:

VLAN ID NumberVLAN ID NumberVLAN ID Number Priority valuePriority valuePriority value

Page 22: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-43 Chapter 5-1

Configure and Verify the Bridge IDConfigure and Verify the Bridge ID

CCNA3-44 Chapter 5-1

Port RolesPort Roles

•• The The root bridgeroot bridge is elected for the spanningis elected for the spanning--tree instance.tree instance.

•• The location of the root bridgeThe location of the root bridge in the network topology in the network topology determines how port roles are calculated.determines how port roles are calculated.

•• Root Port:Root Port:

•• The switch port with the best path to forward traffic to The switch port with the best path to forward traffic to the root bridge.the root bridge.

•• Designated Port:Designated Port:

•• The switch port that receives and forwards frames The switch port that receives and forwards frames toward the root bridgetoward the root bridge as needed. Only as needed. Only oneonedesignated port is allowed per designated port is allowed per segmentsegment..

•• NonNon--designated Port:designated Port:

•• A switch port that is blocked, so it is not forwarding A switch port that is blocked, so it is not forwarding data frames. data frames.

Page 23: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-45 Chapter 5-1

Port RolesPort Roles

•• The STA determines which port role is assigned to each The STA determines which port role is assigned to each switch port. switch port.

•• To determine the To determine the root portroot port on a switch:on a switch:

•• The The switch compares the path costs on all switch portsswitch compares the path costs on all switch portsparticipating in the spanning tree.participating in the spanning tree.

•• When there are two switch ports that have the same path When there are two switch ports that have the same path cost to the root bridge:cost to the root bridge:

•• The switch uses the The switch uses the customizable port priority value, customizable port priority value, or the lowest port IDor the lowest port ID to break the tie.to break the tie.

•• The port ID is the number of the connected port. The port ID is the number of the connected port.

CCNA3-46 Chapter 5-1

Port Roles Port Roles –– Root PortRoot Port

•• For Example:For Example: Default Port Priority = 128Default Port Priority = 128Default Port Priority = 128

F0/1 Priority = 128,1F0/1 Priority = 128,1F0/1 Priority = 128,1

Page 24: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-47 Chapter 5-1

Port Roles Port Roles –– Root PortRoot Port

•• You can specify the root port:You can specify the root port:

•• Configure Port Priority:Configure Port Priority:

•• Priority values Priority values 0 0 -- 240240, in , in increments of 16increments of 16. .

•• DefaultDefault port priority value is port priority value is 128128..

•• The The lowerlower the port priority the port priority valuevalue, the , the higherhigher the the prioritypriority..

CCNA3-48 Chapter 5-1

Port Roles Port Roles –– Root PortRoot Port

•• Verifying the Port Priority:Verifying the Port Priority:

Page 25: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-49 Chapter 5-1

STP Port States and BPDU TimersSTP Port States and BPDU Timers

•• Port States:Port States:

•• The spanning tree is determined by the exchange of the The spanning tree is determined by the exchange of the BPDU frames between the interconnected switches.BPDU frames between the interconnected switches.

•• Each switch port:Each switch port:

•• FiveFive possible port states.possible port states.

•• ThreeThree BPDU timers.BPDU timers.

•• WHY?WHY?

•• The spanning tree is determined The spanning tree is determined immediately afterimmediately after the the switch has finished booting.switch has finished booting.

•• Going directly from a blocking state to a forwarding Going directly from a blocking state to a forwarding state could create a temporary loop.state could create a temporary loop.

•• The five states and the timers address this issue.The five states and the timers address this issue.

CCNA3-50 Chapter 5-1

STP Port States and BPDU TimersSTP Port States and BPDU Timers

•• Port States:Port States:

•• Blocking:Blocking:

•• The port is a The port is a nonnon--designateddesignated port and does not port and does not participate in frame forwarding.participate in frame forwarding.

•• Listening:Listening:

•• STP has determined that the port STP has determined that the port can participate in can participate in frame forwardingframe forwarding according to the BPDU frames that according to the BPDU frames that the switch has received thus far.the switch has received thus far.

•• Learning:Learning:

•• The port The port prepares to participate in frame forwardingprepares to participate in frame forwardingand begins to populate the MAC address table.and begins to populate the MAC address table.

Page 26: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-51 Chapter 5-1

STP Port States and BPDU TimersSTP Port States and BPDU Timers

•• Port States:Port States:

•• Forwarding:Forwarding:

•• The port is considered The port is considered part of the active topologypart of the active topology and and forwards frames and also sends and receives BPDU forwards frames and also sends and receives BPDU frames.frames.

•• Disabled:Disabled:

•• The Layer 2 port The Layer 2 port does not participatedoes not participate in STP and does in STP and does not forward frames.not forward frames.

CCNA3-52 Chapter 5-1

STP Port States and BPDU TimersSTP Port States and BPDU Timers

•• BPDU Timers:BPDU Timers:

•• The amount of time that a port stays in the various port The amount of time that a port stays in the various port states depends on the BPDU timers.states depends on the BPDU timers.

•• Only the switch in the role of root bridgeOnly the switch in the role of root bridge may send may send information through the tree to adjust the timers.information through the tree to adjust the timers.

Page 27: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-53 Chapter 5-1

STP Port States and BPDU TimersSTP Port States and BPDU Timers

•• BPDU Timers:BPDU Timers:

•• At power up:At power up:

•• Every switch port goes through the Every switch port goes through the blocking, listening blocking, listening and learningand learning states.states.

•• The ports then stabilize to the The ports then stabilize to the forwarding or forwarding or blockingblocking state.state.

•• During a topology change:During a topology change:

•• A port temporarily implements the A port temporarily implements the listening and listening and learninglearning states for a specified period. states for a specified period. Power up Delay

Maximum of15 + 15 = 30 Seconds

Power up DelayPower up DelayMaximum ofMaximum of

15 + 15 = 30 Seconds15 + 15 = 30 Seconds

CCNA3-54 Chapter 5-1

STP Port States and BPDU TimersSTP Port States and BPDU Timers

•• BPDU Timers:BPDU Timers:

•• There is a race There is a race between operatingbetween operatingsystems and CPUsystems and CPUmanufacturers. manufacturers.

•• CPU manufacturers keepCPU manufacturers keepmaking the chips faster, while, at the same time, making the chips faster, while, at the same time, operating systems keep slowing down.operating systems keep slowing down.

•• As a result the BPDU timer delays can affect DHCP.As a result the BPDU timer delays can affect DHCP.

•• A network device is often booted and ready to use the A network device is often booted and ready to use the network before the switch port becomes active.network before the switch port becomes active.

•• This can prevent the device from immediately obtaining a This can prevent the device from immediately obtaining a useable IP configuration from DHCP.useable IP configuration from DHCP.

Page 28: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-55 Chapter 5-1

Cisco PortFastCisco PortFast

•• Cisco has addressed this issue with their Cisco has addressed this issue with their PortFastPortFasttechnology.technology.

•• The port is configured as an access port.The port is configured as an access port.

•• The port transitions from The port transitions from blocking to forwarding state blocking to forwarding state immediatelyimmediately, bypassing the listening and learning states., bypassing the listening and learning states.

•• PortFast is disabled by default.PortFast is disabled by default.

•• It should be used It should be used only on access portsonly on access ports..

•• If you enable PortFast on a port connecting to another If you enable PortFast on a port connecting to another switch, you risk creating a spanningswitch, you risk creating a spanning--tree looptree loop..

CCNA3-56 Chapter 5-1

Putting It All TogetherPutting It All Together

• STP Convergence:• Convergence is the time it takes for the network to:

• Determine which switch is going to assume the role of the root bridge.

• Set switch ports to their final spanning-tree port roles where all potential loops are eliminated.

• Three Steps:1. Elect a root bridge.2. Elect the root ports.3. Elect the Designated and Non-designated ports.

Page 29: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-57 Chapter 5-1

Putting It All Together Putting It All Together -- Step 1Step 1

•• Elect a Root Bridge:Elect a Root Bridge:

RootRootRoot

RootRootRoot

RootRootRootRoot ID 32769.00A222Bridge ID 3279.00A222Root ID Root ID 32769.00A22232769.00A222Bridge ID Bridge ID 3279.00A2223279.00A222

Root ID 32769.00A111Bridge ID 3279.00A111Root ID Root ID 32769.00A11132769.00A111Bridge ID Bridge ID 3279.00A1113279.00A111

Root ID 24577.00A333Bridge ID 24577.00A333

Root ID Root ID 24577.00A33324577.00A333Bridge ID Bridge ID 24577.00A33324577.00A333

Root ID 32769.00A111Bridge ID 3279.00A111Root ID Root ID 32769.00A11132769.00A111Bridge ID Bridge ID 3279.00A1113279.00A111

Root ID 32769.00A111Bridge ID 3279.00A222Root ID Root ID 32769.00A11132769.00A111Bridge ID Bridge ID 3279.00A2223279.00A222

Root ID 32769.00A111Bridge ID 3279.00A111Root ID Root ID 32769.00A11132769.00A111Bridge ID Bridge ID 3279.00A1113279.00A111

CCNA3-58 Chapter 5-1

Putting It All Together Putting It All Together –– Step 1Step 1

•• Elect a Root Bridge:Elect a Root Bridge:

RootRootRoot

RootRootRootRoot ID 32769.00A111Bridge ID 3279.00A111Root ID Root ID 32769.00A11132769.00A111Bridge ID Bridge ID 3279.00A1113279.00A111

Root ID 24577.00A333Bridge ID 24577.00A333

Root ID Root ID 24577.00A33324577.00A333Bridge ID Bridge ID 24577.00A33324577.00A333

Root ID 32769.00A111Bridge ID 3279.00A222Root ID Root ID 32769.00A11132769.00A111Bridge ID Bridge ID 3279.00A2223279.00A222

Root ID 32769.00A111Bridge ID 3279.00A222Root ID Root ID 32769.00A11132769.00A111Bridge ID Bridge ID 3279.00A2223279.00A222

Root ID 32769.00A111Bridge ID 3279.00A222Root ID Root ID 32769.00A11132769.00A111Bridge ID Bridge ID 3279.00A2223279.00A222

Page 30: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-59 Chapter 5-1

Putting It All Together Putting It All Together –– Step 1Step 1

•• Elect a Root Bridge:Elect a Root Bridge:

RootRootRoot

RootRootRootRoot ID 32769.00A111Bridge ID 3279.00A111Root ID Root ID 32769.00A11132769.00A111Bridge ID Bridge ID 3279.00A1113279.00A111

Root ID 24577.00A333Bridge ID 24577.00A333

Root ID Root ID 24577.00A33324577.00A333Bridge ID Bridge ID 24577.00A33324577.00A333

Root ID 32769.00A111Bridge ID 3279.00A222Root ID Root ID 32769.00A11132769.00A111Bridge ID Bridge ID 3279.00A2223279.00A222

Root ID 24577.00A333Bridge ID 24577.00A333

Root ID Root ID 24577.00A33324577.00A333Bridge ID Bridge ID 24577.00A33324577.00A333

Root ID 24577.00A333Bridge ID 24577.00A333

Root ID Root ID 24577.00A33324577.00A333Bridge ID Bridge ID 24577.00A33324577.00A333

Root ID 24577.00A333Bridge ID 3279.00A222Root ID Root ID 24577.00A33324577.00A333Bridge ID Bridge ID 3279.00A2223279.00A222

Root ID 24577.00A333Bridge ID 3279.00A111Root ID Root ID 24577.00A33324577.00A333Bridge ID Bridge ID 3279.00A1113279.00A111

CCNA3-60 Chapter 5-1

Root ID 24577.00A333Bridge ID 3279.00A222Root ID Root ID 24577.00A33324577.00A333Bridge ID Bridge ID 3279.00A2223279.00A222

Putting It All Together Putting It All Together –– Step 2Step 2

•• Root Ports:Root Ports:

RootRootRoot

Root ID 32769.00A111Bridge ID 3279.00A111Root ID Root ID 32769.00A11132769.00A111Bridge ID Bridge ID 3279.00A1113279.00A111

Root ID 24577.00A333Bridge ID 24577.00A333

Root ID Root ID 24577.00A33324577.00A333Bridge ID Bridge ID 24577.00A33324577.00A333

Root ID 24577.00A333Bridge ID 3279.00A111Root ID Root ID 24577.00A33324577.00A333Bridge ID Bridge ID 3279.00A1113279.00A111

Throughout the root bridge election, the path cost has also been updated.All links are 100Mbps. Cost = 19

Throughout the root bridge election, the Throughout the root bridge election, the path costpath cost has also been updated.has also been updated.All links are 100Mbps. All links are 100Mbps. Cost = 19Cost = 19

383838

191919

383838

RR

RR

Page 31: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-61 Chapter 5-1

Root ID 24577.00A333Bridge ID 3279.00A222Root ID Root ID 24577.00A33324577.00A333Bridge ID Bridge ID 3279.00A2223279.00A222

Putting It All Together Putting It All Together –– Step 3Step 3

•• Designated and NonDesignated and Non--designated Ports:designated Ports:

RootRootRoot

Root ID 32769.00A111Bridge ID 3279.00A111Root ID Root ID 32769.00A11132769.00A111Bridge ID Bridge ID 3279.00A1113279.00A111

Root ID 24577.00A333Bridge ID 24577.00A333

Root ID Root ID 24577.00A33324577.00A333Bridge ID Bridge ID 24577.00A33324577.00A333RR

RR

DD

DD

S1 is the root bridge so both ports become designated ports.

S1 is the S1 is the root bridgeroot bridge so so both ports become both ports become designateddesignated ports.ports.

Root ID 24577.00A333Bridge ID 3279.00A111Root ID Root ID 24577.00A33324577.00A333Bridge ID Bridge ID 3279.00A1113279.00A111

DD

Root ID 24577.00A333Bridge ID 3279.00A111Root ID Root ID 24577.00A33324577.00A333Bridge ID Bridge ID 3279.00A1113279.00A111

Root ID 24577.00A333Bridge ID 3279.00A222Root ID Root ID 24577.00A33324577.00A333Bridge ID Bridge ID 3279.00A2223279.00A222

CCNA3-62 Chapter 5-1

Root ID 24577.00A333Bridge ID 3279.00A222Root ID Root ID 24577.00A33324577.00A333Bridge ID Bridge ID 3279.00A2223279.00A222

Putting It All Together Putting It All Together –– Step 3Step 3

•• Designated and NonDesignated and Non--designated Ports:designated Ports:

RootRootRoot

Root ID 32769.00A111Bridge ID 3279.00A111Root ID Root ID 32769.00A11132769.00A111Bridge ID Bridge ID 3279.00A1113279.00A111

Root ID 24577.00A333Bridge ID 24577.00A333

Root ID Root ID 24577.00A33324577.00A333Bridge ID Bridge ID 24577.00A33324577.00A333RR

RR

DD

DD

Root ID 24577.00A333Bridge ID 3279.00A111Root ID Root ID 24577.00A33324577.00A333Bridge ID Bridge ID 3279.00A1113279.00A111

DD

NDNDXX

Root ID 24577.00A333Bridge ID 3279.00A222Root ID Root ID 24577.00A33324577.00A333Bridge ID Bridge ID 3279.00A2223279.00A222

Root ID 24577.00A333Bridge ID 3279.00A111Root ID Root ID 24577.00A33324577.00A333Bridge ID Bridge ID 3279.00A1113279.00A111

Page 32: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-63 Chapter 5-1

Putting It All TogetherPutting It All Together

•• Verifying STP Configuration:Verifying STP Configuration:RR

RR

DD

DD

DD

NDNDXX

RootRootRoot

CCNA3-64 Chapter 5-1

Putting It All TogetherPutting It All Together

•• Verifying STP Configuration:Verifying STP Configuration:

RR

RR

DD

DD

DD

NDNDXX

RootRootRoot

Page 33: Chapter 5 Spanning Tree Protocol (STP) Part I - …mars.merhot.dk/mediawiki/images/9/95/Expl_Sw_chapter_05_STP_Part_I.pdfCCNA3-1 Chapter 5-1 Chapter 5 Spanning Tree Protocol (STP)

CCNA3-65 Chapter 5-1

Putting It All TogetherPutting It All Together

•• Verifying STP Configuration:Verifying STP Configuration:RR

RR

DD

DD

DD

NDNDXX

RootRootRoot