Sie sind auf Seite 1von 117

Chapter 5 - Spanning Tree Protocol

CCNA Exploration 4.0

Objectives

Explain the role of redundancy in a converged network. network Summarize how STP works to eliminate Layer 2 p g loops in a converged network. Explain how the STP algorithm uses three steps to converge on a loop-free topology. Implement rapid PVST+ in a LAN to prevent loops between redundant switches.

Hc vin mng Bch Khoa - Website: www.bkacad.com

Layer 2 redundancy

Hc vin mng Bch Khoa - Website: www.bkacad.com

Redundancy in a hierarchical network

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

Hc vin mng Bch Khoa - Website: www.bkacad.com

Examine a redundant design

In a hierarchical design, redundancy is achieved at the distribution and core layers through additional hardware and alternate paths through the additional hardware hardware.

Hc vin mng Bch Khoa - Website: www.bkacad.com

Examine a redundant design

Hc vin mng Bch Khoa - Website: www.bkacad.com

Examine a redundant design

Hc vin mng Bch Khoa - Website: www.bkacad.com

Examine a redundant design

Hc vin mng Bch Khoa - Website: www.bkacad.com

Examine a redundant design

Hc vin mng Bch Khoa - Website: www.bkacad.com

Types of Traffic

Unknown U i U k Unicast

Types of traffic ( y 2 p p yp (Layer perspective) ) Known Unicast: Destination addresses are in Switch Tables Unknown Unicast: Destination addresses are not in Switch Tables Multicast: Traffic sent to a group of addresses g p Broadcast: Traffic forwarded out all interfaces except incoming interface.
Hc vin mng Bch Khoa - Website: www.bkacad.com 10

Issues with Redundancy

Hc vin mng Bch Khoa - Website: www.bkacad.com

11

Issues with Redundancy


A redundant switched topology (STP disabled) may cause: Layer 2 Loops y p Broadcast Storms Duplicate Unicast Frames MAC address table instability

Hc vin mng Bch Khoa - Website: www.bkacad.com

12

Layer 2 Loops

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

Hc vin mng Bch Khoa - Website: www.bkacad.com

13

Broadcast Storms

A broadcast storm occurs when there are so many broadcast frames caught in a Layer 2 loop that all available bandwidth is consumed.

Hc vin mng Bch Khoa - Website: www.bkacad.com

14

Duplicate Unicast Frames

Unicast frames sent onto a looped network can result in duplicate frames arriving at the destination device.

Hc vin mng Bch Khoa - Website: www.bkacad.com

15

Issues with Redundancy

Incorrectly learn the MAC address

Hc vin mng Bch Khoa - Website: www.bkacad.com

16

Real-world Redundancy Issues


Loops in the Wiring Closet If the network cables are not properly labeled when they are terminated in th i the patch panel in th wiring closet. N t t h l i the i i l t Network l k loops th t are a result that lt of accidental duplicate connections in the wiring closets are a common occurrence.

Hc vin mng Bch Khoa - Website: www.bkacad.com

17

Real-world Redundancy Issues


Loops in the Cubicles

Hc vin mng Bch Khoa - Website: www.bkacad.com

18

Prevent loop, storm bordcast?



Block redundant link and auto unblock redundant link when primary link down. Via Spanning Tree Protocol

Hc vin mng Bch Khoa - Website: www.bkacad.com

19

Spanning Tree Protocol p g

Hc vin mng Bch Khoa - Website: www.bkacad.com

20

The Spanning Tree Algorthm



STP ensures that there is only one logical path between all destinations on the network by intentionally blocking redundant paths that could cause a loop. This is Critical. A port is considered blocked when network traffic is prevented from entering or leaving that port. The physical paths still exist to provide redundancy, but these paths are disabled to di bl d t prevent th l t the loops f from occurring. i If the path is ever needed to compensate for a network cable or switch failure, STP recalculates the paths and unblocks the necessary ports to allow the redundant path to become active active.

Hc vin mng Bch Khoa - Website: www.bkacad.com

21

Spanning-Tree Protocol

Layer 2 protocol STP executes an algorithm called Spanning Tree Algorithm (STA) (STA). STA chooses a reference point, called a root bridge, and then determines the available paths to that reference point. If more t a t o pat s exists, S o e than two paths e sts, STA p c s t e best pat a d b oc s picks the path and blocks the rest STP calculations make extensive use of two key concepts in creating a loop-free topology: Bridge ID Path Cost
Hc vin mng Bch Khoa - Website: www.bkacad.com 22

STP Algorithm


STP uses the Spanning Tree Algorithm (STA) to determine which switch ports on a network need to be configured for blocking to prevent loops from occurring.
Root Bridge The lowest BID Root Ports - Switch ports closest to the root bridge. Designated ports - All non-root ports that are still permitted to forward traffic on the network. Non-designated ports - All ports configured to be in a blocking state to prevent loops.

Hc vin mng Bch Khoa - Website: www.bkacad.com

23

The Root Bridge

Every spanning-tree instance (switched LAN or broadcast domain) has a switch designated as the root bridge. The root bridge serves as a reference point for all spanning tree calculations to determine which spanning-tree redundant paths to block.

Hc vin mng Bch Khoa - Website: www.bkacad.com

24

Bridge ID (BID)

For each Network, the switch with the highest switch priority (the lowest numerical priority value) is elected as the root switch. The details f Th d t il of each BID fi ld are di h field discussed l t b t it i useful t d later, but is f l to know now that the BID is made up of a priority value, an extended system ID, and the MAC address of the switch.

Hc vin mng Bch Khoa - Website: www.bkacad.com

25

Bridge ID (BID)
Priority-based decision

Hc vin mng Bch Khoa - Website: www.bkacad.com

26

Bridge ID (BID)
Priority-based decision

Hc vin mng Bch Khoa - Website: www.bkacad.com

27

Bridge ID (BID)
Configure and Verify the BID

Hc vin mng Bch Khoa - Website: www.bkacad.com

28

Best Paths to the Root Bridge

When the root bridge has been designated for the spanning-tree instance, the STA starts the process of determining the best paths to the root bridge from all destinations in the broadcast domain.

Hc vin mng Bch Khoa - Website: www.bkacad.com

29

Best Paths to the Root Bridge


Example

Hc vin mng Bch Khoa - Website: www.bkacad.com

30

STP BPDU

The BPDU Fields

Hc vin mng Bch Khoa - Website: www.bkacad.com

31

STP BPDU
The BPDU Process

Hc vin mng Bch Khoa - Website: www.bkacad.com

32

STP BPDU
The BPDU Process

Hc vin mng Bch Khoa - Website: www.bkacad.com

33

STP BPDU
The BPDU Process

Hc vin mng Bch Khoa - Website: www.bkacad.com

34

STP BPDU
The BPDU Process

Hc vin mng Bch Khoa - Website: www.bkacad.com

35

STP BPDU
The BPDU Process

Hc vin mng Bch Khoa - Website: www.bkacad.com

36

STP BPDU
The BPDU Process

Hc vin mng Bch Khoa - Website: www.bkacad.com

37

STP BPDU
The BPDU Process

Hc vin mng Bch Khoa - Website: www.bkacad.com

38

STP BPDU
The BPDU Process

Hc vin mng Bch Khoa - Website: www.bkacad.com

39

STP BPDU
The BPDU Process

Hc vin mng Bch Khoa - Website: www.bkacad.com

40

Port Roles

There are four distinct port roles that switch ports are automatically configured for during the spanning-tree process. Root Port The root port exists on non-root bridges and is the switch port with the best path to the root bridge. Designated Port The designated port exists on root and non-root bridges. For root bridges, all switch ports are designated ports. For non root bridges, a designated port is the switch port that receives and non-root forwards frames toward the root bridge as needed. Only one designated port is allowed per segment. g Non-designated Port The non-designated port is a switch port that is blocked, so it is not forwarding data frames and not populating the MAC address table with source addresses.

A non-designated p is not a root port or a designated p g port p g port.

Hc vin mng Bch Khoa - Website: www.bkacad.com

41

Port Roles
Disabled Port The disabled port is a switch port that is administratively shut down. A disabled di bl d port does not function in the spanning-tree process. td tf ti i th i t

Hc vin mng Bch Khoa - Website: www.bkacad.com

42

Port Roles
Configure Port Priority The port priority values range from 0 - 240, in increments of 16. The default d f lt port priority value i 128 t i it l is 128.

Hc vin mng Bch Khoa - Website: www.bkacad.com

43

Port Roles
Port Role Decisions

Hc vin mng Bch Khoa - Website: www.bkacad.com

44

Port Roles
Port Role Decisions

Hc vin mng Bch Khoa - Website: www.bkacad.com

45

Port Roles
Port Role Decisions

Hc vin mng Bch Khoa - Website: www.bkacad.com

46

Port Roles
Port Role Decisions

Hc vin mng Bch Khoa - Website: www.bkacad.com

47

Port Roles
Port Role Decisions

Hc vin mng Bch Khoa - Website: www.bkacad.com

48

Port Roles
Port Role Decisions

Hc vin mng Bch Khoa - Website: www.bkacad.com

49

Port Roles
Port Role Decisions

Hc vin mng Bch Khoa - Website: www.bkacad.com

50

Port Roles - Summary



One Root bridge per network One Root port on nonroot bridge p g One Designated port on segment Nondesignated ports are blocked

Hc vin mng Bch Khoa - Website: www.bkacad.com

51

STP Port States and BPDU Timers


Port States

Blocking - The port is a non-designated port and does not participate in frame forwarding. forwarding The port receives BPDU frames to determine the location and root ID of the root bridge switch and what port roles each switch port should assume in the final active STP topology. Listening - STP has determined that the port can p g p participate in frame p forwarding according to the BPDU frames that the switch has received thus far. At this point, the switch port is not only receiving BPDU frames, it is also transmitting its own BPDU frames and informing adjacent switches that the switch port is preparing to participate in the active topology topology. Learning - The port prepares to participate in frame forwarding and begins to populate the MAC address table. Forwarding - The port is considered part of the active topology and forwards frames and also sends and receives BPDU frames. Disabled - The Layer 2 port does not participate in spanning tree and does not p forward frames. The disabled state is set when the switch port is administratively disabled.
Hc vin mng Bch Khoa - Website: www.bkacad.com 52

STP Port States and BPDU Timers

Hc vin mng Bch Khoa - Website: www.bkacad.com

53

STP Port States and BPDU Timers


BPDU Timers

Hc vin mng Bch Khoa - Website: www.bkacad.com

54

STP Port States and BPDU Timers


Cisco PortFast Technology PortFast is a Cisco technology. When a switch port configured with PortFast is configured as an access port that port transitions from blocking to forwarding port, state immediately, bypassing the typical STP listening and learning states.

Hc vin mng Bch Khoa - Website: www.bkacad.com

55

STP Convergence

The STP algorithm uses three simple steps to converge on a loop-free topology. Switches go through three steps for their initial convergence: STP Convergence Step 1 Elect one Root Bridge p Step 2 Elect Root Ports Step 3 Elect Designated Ports All STP decisions are based on a the following predetermined sequence: FourFour-Step decision Sequence Step 1 - Lowest BID Step 2 - Lowest Path Cost to Root Bridge Step 3 - Lowest Sender BID Step 4 - Lowest Port ID

Hc vin mng Bch Khoa - Website: www.bkacad.com

56

STP Convergence STP Convergence Step 1 Elect one Root Bridge Step 2 Elect Root Ports Step 3 Elect Designated Ports

Hc vin mng Bch Khoa - Website: www.bkacad.com

57

STP Convergence
Step 1 Elect one Root Bridge

Hc vin mng Bch Khoa - Website: www.bkacad.com

58

Step 1 Elect one Root Bridge

Hc vin mng Bch Khoa - Website: www.bkacad.com

59

Step 1. Elect one Root Bridge

Verify Root Bridge Election

Hc vin mng Bch Khoa - Website: www.bkacad.com

60

STP Convergence STP Convergence Step 1 Elect one Root Bridge Step 2 Elect Root Ports Step 3 Elect Designated Ports

Hc vin mng Bch Khoa - Website: www.bkacad.com

61

Step 2. Elect Root Ports

Hc vin mng Bch Khoa - Website: www.bkacad.com

62

Step 2. Elect Root Ports

Hc vin mng Bch Khoa - Website: www.bkacad.com

63

Step 2. Elect Root Ports

Hc vin mng Bch Khoa - Website: www.bkacad.com

64

Step 2. Elect Root Ports

Hc vin mng Bch Khoa - Website: www.bkacad.com

65

Step 2. Elect Root Ports


Verify the Root Port

Hc vin mng Bch Khoa - Website: www.bkacad.com

66

STP Convergence STP Convergence Step 1 Elect one Root Bridge Step 2 Elect Root Ports Step 3 Elect Designated Ports

Hc vin mng Bch Khoa - Website: www.bkacad.com

67

Step 3. Electing Designated Ports and NonDesignated Ports

Hc vin mng Bch Khoa - Website: www.bkacad.com

68

Step 3. Electing Designated Ports and NonDesignated Ports

Hc vin mng Bch Khoa - Website: www.bkacad.com

69

Step 3. Electing Designated Ports and NonDesignated Ports

Hc vin mng Bch Khoa - Website: www.bkacad.com

70

Step 3. Electing Designated Ports and NonDesignated Ports

Hc vin mng Bch Khoa - Website: www.bkacad.com

71

Step 3. Electing Designated Ports and NonDesignated Ports

Hc vin mng Bch Khoa - Website: www.bkacad.com

72

Step 3. Electing Designated Ports and NonDesignated Ports

Hc vin mng Bch Khoa - Website: www.bkacad.com

73

Step 3. Electing Designated Ports and NonDesignated Ports

Hc vin mng Bch Khoa - Website: www.bkacad.com

74

Step 3. Electing Designated Ports and NonDesignated Ports


Verify DP and Non-DP

Hc vin mng Bch Khoa - Website: www.bkacad.com

75

STP Topology Change


STP Topology Change Notification Process

Hc vin mng Bch Khoa - Website: www.bkacad.com

76

STP (802.1D) Enhancements



UplinkFast is an access-layer STP solution that provides fast failover when the root port or root switch fails. BackboneFast is a distribution and access-layer STP solution that provides fast convergence in the network for indirect link failures failures. PortFast is an access-layer STP solution that causes a port to enter the spanning tree forwarding state immediately, bypassing the listening and learning states.

Hc vin mng Bch Khoa - Website: www.bkacad.com

77

Cisco and STP Variants

Hc vin mng Bch Khoa - Website: www.bkacad.com

78

PVST+

Cisco developed PVST+ so that a network can run an STP instance for each VLAN in the network. And Creating different STP root switches per VLAN creates a more redundant network. t d d t t k With PVST+, more than one trunk can block for a VLAN and load sharing can be implemented.

Hc vin mng Bch Khoa - Website: www.bkacad.com

79

PVST+

PVST+ Bridge ID The following provides more details on the PVST+ fields: Bridge priority - A 4-bit field carries the bridge priority Extended system ID - A 12-bit field carrying the VID for PVST+. MAC address - A 6-byte field with the MAC address of a single y g switch.

Hc vin mng Bch Khoa - Website: www.bkacad.com

80

PVST+

Hc vin mng Bch Khoa - Website: www.bkacad.com

81

PVST+

Configure PVST+

Hc vin mng Bch Khoa - Website: www.bkacad.com

82

PVST+

Configure PVST+

Hc vin mng Bch Khoa - Website: www.bkacad.com

83

RSTP
What is RSTP? RSTP (IEEE 802.1w) is an evolution of the 802.1D standard. RSTP can achieve much f t convergence i a properly configured hi h faster in l fi d network, sometimes in as little as a few hundred milliseconds.

Hc vin mng Bch Khoa - Website: www.bkacad.com

84

New Features

New Port States and Port Roles New BPDU Format New BPDU Handling Rapid Transition to Forwarding State Proposal/Agreement Handshake Sequence New Topology Change Mechanisms

Hc vin mng Bch Khoa - Website: www.bkacad.com

85

RSTP Port States and Port Roles


RSTP Port States RSTP provides rapid convergence following a failure or during reestablishment of a switch switch port or link switch, port, link. An RSTP topology change causes a transition in the appropriate switch ports to the forwarding state through either explicit handshakes or a proposal and agreement process and synchronization. synchronization

Hc vin mng Bch Khoa - Website: www.bkacad.com

86

RSTP Port Roles

The role is now a variable assigned to a given port. The root port and designated port roles remain. The blocking port role is now split into the backup and alternate port roles. The S Th Spanning T i Tree Al ith (STA) d t Algorithm determines th role of a port b i the l f t based on d Bridge Protocol Data Units (BPDUs). To keep things simple, the thing to remember about a BPDU is that there is always a way of comparing any two of them and deciding whether one is more useful than the other. This is based on the value stored in the BPDU and occasionally on the port on which they are received.
Hc vin mng Bch Khoa - Website: www.bkacad.com 87

Rapid Spanning Tree Protocol (RSTP)

Hc vin mng Bch Khoa - Website: www.bkacad.com

88

Rapid Spanning Tree Protocol (RSTP)

Hc vin mng Bch Khoa - Website: www.bkacad.com

89

Rapid Spanning Tree Protocol (RSTP)

Hc vin mng Bch Khoa - Website: www.bkacad.com

90

Rapid Spanning Tree Protocol (RSTP)

Hc vin mng Bch Khoa - Website: www.bkacad.com

91

Edge Ports
Edge Ports The edge port concept is already well known to Cisco spanning tree
users, users as it basically corresponds to the PortFast feature All ports feature. directly connected to end stations cannot create bridging loops in the network. Therefore, the edge port directly transitions to the forwarding state, and skips the listening and learning stages. , p g g g

Hc vin mng Bch Khoa - Website: www.bkacad.com

92

Link Types

The link type is automatically derived from the duplex mode of a port. A port that operates in fullduplex is assumed to be pointtopoint, while a halfduplex port is considered as a shared port by default RSTP can default. only achieve rapid transition to the forwarding state on edge ports and on pointtopoint links.

Hc vin mng Bch Khoa - Website: www.bkacad.com

93

RSTP
RTSP BPDU RSTP (802.1w) uses type 2, version 2 BPDUs, so an RSTP bridge can communicate 802.1D on any shared link or with any switch running i t 802 1D h d li k ith it h i 802.1D.

Hc vin mng Bch Khoa - Website: www.bkacad.com

94

RSTP Proposal or Agreement Process



In IEEE 802.1D STP, when a port has been selected by spanning tree to become a designated port, it must wait two times the forward delay before transitioning the port to the forwarding state state. RSTP significantly speeds up the recalculation process after a topology change, because it converges on a link-by-link basis and does not rely on timers expiring before ports can transition Rapid transition. transition to the forwarding state can only be achieved on edge ports and point-to-point links.

Hc vin mng Bch Khoa - Website: www.bkacad.com

95

RSTP Proposal or Agreement Process

View Flash on Curriculum 5.4.6 RSTP Port States and Port Roles

Hc vin mng Bch Khoa - Website: www.bkacad.com

96

Configuring rapid PVST+

Hc vin mng Bch Khoa - Website: www.bkacad.com

97

Design STP for Trouble Avoidance


Know Where the Root Is You now know that the primary function of the STA is to break loops that d d t links th t redundant li k create i b id networks. t in bridge t k

Hc vin mng Bch Khoa - Website: www.bkacad.com

98

Design STP for Trouble Avoidance


VTP Pruning

Hc vin mng Bch Khoa - Website: www.bkacad.com

99

Design STP for Trouble Avoidance


Manual Pruning VTP pruning can help, but this feature is not necessary in the core of the network.

Hc vin mng Bch Khoa - Website: www.bkacad.com

100

Design STP for Trouble Avoidance


What is Layer 3 Switch? Layer 3 switching means routing approximately at the speed of switching. A router performs two main functions: it hi t f t i f ti It builds a forwarding table. The router generally exchanges information with peers by way of routing protocols. It receives packets and forwards them to the correct interface based on the destination address. High-end Cisco Layer 3 switches are now able to perform this second function, at the same speed as the Layer 2 switching function. In the figure: There is no speed penalty with the routing hop and an additional segment between C1 and C2. Core switch C1 and core switch C2 are Layer 3 switches. VLAN 20 and VLAN 30 are no longer bridged between C1 and C2, so there is no possibility for a loop.
Hc vin mng Bch Khoa - Website: www.bkacad.com 101

Design STP for Trouble Avoidance


Use Layer 3 Switching

The design ensures a convergence that is even faster than convergence with STP. STP no longer blocks any single port, so there is no potential for a bridging loop. Leaving the VLAN by Layer 3 switching is as fast as bridging inside the g y y g g g VLAN.

Hc vin mng Bch Khoa - Website: www.bkacad.com

102

Design STP for Trouble Avoidance

Hc vin mng Bch Khoa - Website: www.bkacad.com

103

Troubleshoot STP Operation


Switch or Link Failure view flash on curriculum

For some reason port F0/3 on switch S2 fails to receive BPDUs for the Default max_age max age time of 20 seconds seconds.

Hc vin mng Bch Khoa - Website: www.bkacad.com

104

Troubleshoot STP Operation


Example: Switch or Link Failure Problem During normal operation, bridge B is designated on the link BC. Bridge B sends BPDUs down to C, which is blocking the port. The port is blocked while C sees BPDUs from B on that link. Now, consider what happens if the link BC fails in the direction of C. C stops receiving traffic from B, however, B still receives traffic from C.

Hc vin mng Bch Khoa - Website: www.bkacad.com

105

Troubleshoot STP Operation


Example: Switch or Link Failure

Solution: U Uses U idi Unidirectional Link Detection f t ti l Li k D t ti feature on switch. it h

Hc vin mng Bch Khoa - Website: www.bkacad.com

106

Troubleshoot STP Operation

Troubleshoot a Failure

Hc vin mng Bch Khoa - Website: www.bkacad.com

107

Troubleshoot STP Operation


PortFast Configuration Error Problem You typically enable PortFast only for a port or interface that connects to a host. When the link comes up on this port, the bridge skips the first stages of the STA and directly transitions to the forwarding mode.

Hc vin mng Bch Khoa - Website: www.bkacad.com

108

Troubleshoot STP Operation


PortFast Configuration Error Solution To prevent this situation, most Catalyst switches that run Cisco IOS software have a feature called BPDU guard. BPDU guard disables a PortFast-configured port or interface if the port or interface receives a BPDU. BPDU

Hc vin mng Bch Khoa - Website: www.bkacad.com

109

Troubleshoot STP Operation


Network Diameter Issues The conservative default values for the STP timers impose a maximum network diameter of seven. t k di t f

Hc vin mng Bch Khoa - Website: www.bkacad.com

110

Troubleshoot STP Operation


Activity

Hc vin mng Bch Khoa - Website: www.bkacad.com

111

Troubleshoot STP Operation


Activity

Hc vin mng Bch Khoa - Website: www.bkacad.com

112

Lab - Basic Spanning Tree Protocol

Hc vin mng Bch Khoa - Website: www.bkacad.com

113

Challenge Lab Spanning Tree Protocol

Hc vin mng Bch Khoa - Website: www.bkacad.com

114

Troubleshooting Spanning Tree Protocol

Hc vin mng Bch Khoa - Website: www.bkacad.com

115

Summary

Hc vin mng Bch Khoa - Website: www.bkacad.com

116

Hc vin mng Bch Khoa - Website: www.bkacad.com

117

Das könnte Ihnen auch gefallen