8/3/2019 CCNA Exp3 - Chapter05 - STP
1/148
Please purchase a personal license.
CCNA Ex loration 4.0
8/3/2019 CCNA Exp3 - Chapter05 - STP
2/148
Objectives
Explain the role of redundancy in a convergednetwork.
Summarize how STP works to eliminate Layer 2loops in a converged network.
Explain how the STP algorithm uses three steps to
H c vi n m ng Bch Khoa - Website: www.bkacad.com 2
converge on a loop-free topology. Implement rapid PVST+ in a LAN to prevent loops
between redundant switches.
8/3/2019 CCNA Exp3 - Chapter05 - STP
3/148
Redundancy
Redundancy in a hierarchical network Layer 2 redundancy improves the availability of the network by
implementing alternate network paths by adding equipment and
cabling.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 3
8/3/2019 CCNA Exp3 - Chapter05 - STP
4/148
Redundancy
Examine a redundant design In a hierarchical design, redundancy is achieved at the distribution and
core layers through additional hardware and alternate paths throughthe additional hardware.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 4
8/3/2019 CCNA Exp3 - Chapter05 - STP
5/148
Redundancy
Examine a redundant design
H c vi n m ng Bch Khoa - Website: www.bkacad.com 5
8/3/2019 CCNA Exp3 - Chapter05 - STP
6/148
Redundancy
Examine a redundant design
H c vi n m ng Bch Khoa - Website: www.bkacad.com 6
8/3/2019 CCNA Exp3 - Chapter05 - STP
7/148
Redundancy
Examine a redundant design
H c vi n m ng Bch Khoa - Website: www.bkacad.com 7
8/3/2019 CCNA Exp3 - Chapter05 - STP
8/148
Redundancy
Examine a redundant design
H c vi n m ng Bch Khoa - Website: www.bkacad.com 8
8/3/2019 CCNA Exp3 - Chapter05 - STP
9/148
Types of Traffic
H c vi n m ng Bch Khoa - Website: www.bkacad.com 9
Types of traffic (Layer 2 perspective)1. Known Unicast : Destination addresses are in Switch Tables2. Unknown Unicast : Destination addresses are not in Switch Tables3. Multicast : Traffic sent to a group of addresses4. Broadcast : Traffic forwarded out all interfaces except incoming
interface.
Unknown Unicast
8/3/2019 CCNA Exp3 - Chapter05 - STP
10/148
Issues with Redundancy
A redundant switched topology (STP disabled) may cause:1. Layer 2 Loops
2. Broadcast Storms3. Duplicate Unicast Frames4. MAC address table instability
H c vi n m ng Bch Khoa - Website: www.bkacad.com 10
8/3/2019 CCNA Exp3 - Chapter05 - STP
11/148
Issues with Redundancy
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.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 11
8/3/2019 CCNA Exp3 - Chapter05 - STP
12/148
Issues with Redundancy
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.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 12
8/3/2019 CCNA Exp3 - Chapter05 - STP
13/148
Issues with Redundancy
Duplicate Unicast Frames Unicast frames sent onto a looped network can result in duplicate
frames arriving at the destination device.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 13
8/3/2019 CCNA Exp3 - Chapter05 - STP
14/148
Issues with Redundancy
Incorrectly learn the MAC address
H c vi n m ng Bch Khoa - Website: www.bkacad.com 14
8/3/2019 CCNA Exp3 - Chapter05 - STP
15/148
Real-world Redundancy Issues
Loops in the Wiring Closet If the network cables are not properly labeled when they are terminated
in the patch panel in the wiring closet. Network loops that are a result
of accidental duplicate connections in the wiring closets are a commonoccurrence.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 15
8/3/2019 CCNA Exp3 - Chapter05 - STP
16/148
Real-world Redundancy Issues
Loops in the Cubicles
H c vi n m ng Bch Khoa - Website: www.bkacad.com 16
8/3/2019 CCNA Exp3 - Chapter05 - STP
17/148
Prevent loop, storm bordcast?
H c vi n m ng Bch Khoa - Website: www.bkacad.com 17
Enable Spanning Tree Protocol (STP) 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. A port is considered blocked when networktraffic is prevented from entering or leaving that port.
Block redundant link and auto unblock redundant link when primary linkdown.
8/3/2019 CCNA Exp3 - Chapter05 - STP
18/148
Spanning-Tree Protocol (STP)
H c vi n m ng Bch Khoa - Website: www.bkacad.com 18
STP is a Layer 2 link-management protocol that is used to maintain aloop-free network.
The Spanning-Tree Protocol requires network devices to exchange messagesto detect bridging loops, is called a Bridge Protocol Data Unit (BPDU).
BPDUs continue to be received on blocked ports.
8/3/2019 CCNA Exp3 - Chapter05 - STP
19/148
Spanning-Tree Protocol
H c vi n m ng Bch Khoa - Website: www.bkacad.com 19
STP executes an algorithm called Spanning Tree Algorithm (STA). STA chooses a reference point, called a root bridge, and thendetermines the available paths to that reference point. If more than two paths exists, STA picks the best path and blocks
the rest STP calculations make extensive use of 2 key concepts in creating a
loop-free topology:1. Bridge ID2. Path Cost
8/3/2019 CCNA Exp3 - Chapter05 - STP
20/148
STP Algorithm
H c vi n m ng Bch Khoa - Website: www.bkacad.com 20
1. Root Bridge The lowest BID2. Root Ports - Switch ports closest to the root bridge.3. Designated ports - All non-root ports that are still permitted to forward traffic
on the network.4. Non-designated ports - All ports configured to be in a blocking state to
prevent loops.
8/3/2019 CCNA Exp3 - Chapter05 - STP
21/148
The Root Bridge
Every spanning-tree instance (switched LAN or broadcast domain) hasa switch designated as the root bridge. The root bridge serves as areference point for all spanning-tree calculations to determine which
redundant paths to block.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 21
Lowest Bridge ID valueis the root !
8/3/2019 CCNA Exp3 - Chapter05 - STP
22/148
Extra: The Root Bridge
H c vi n m ng Bch Khoa - Website: www.bkacad.com 22
The root bridge maintains the stability of the forwarding paths between allswitches for a single STP instance.
A spanning tree instance is when all switches exchanging BPDUs andparticipating in spanning tree negotiation are associated with a single root. If this is done for all VLANs, it is called a Common Spanning Tree (CST)
instance. There is also a Per VLAN Spanning Tree (PVST) implementation that
provides one instance, and therefore one root bridge, for each VLAN.
8/3/2019 CCNA Exp3 - Chapter05 - STP
23/148
Bridge ID (BID)
H c vi n m ng Bch Khoa - Website: www.bkacad.com 23
For each Network, the switch with the highest switch priority (thelowest numerical priority value ) is elected as the root switch.
The BID is made up of a priority value , an extended system ID , andthe MAC address of the switch.
8/3/2019 CCNA Exp3 - Chapter05 - STP
24/148
Bridge ID (BID)
H c vi n m ng Bch Khoa - Website: www.bkacad.com 24
8/3/2019 CCNA Exp3 - Chapter05 - STP
25/148
Bridge ID (BID)
H c vi n m ng Bch Khoa - Website: www.bkacad.com 25
Priority-based decision The default value for the priority of all Cisco switches is 32768. The priority range is between 1 and 65536; therefore, 1 is the highest
priority.
8/3/2019 CCNA Exp3 - Chapter05 - STP
26/148
Bridge ID (BID)
MAC Address-based decision
H c vi n m ng Bch Khoa - Website: www.bkacad.com 26
8/3/2019 CCNA Exp3 - Chapter05 - STP
27/148
Configure and Verify the BID
H c vi n m ng Bch Khoa - Website: www.bkacad.com 27
8/3/2019 CCNA Exp3 - Chapter05 - STP
28/148
Configure and Verify the BID
H c vi n m ng Bch Khoa - Website: www.bkacad.com 28
8/3/2019 CCNA Exp3 - Chapter05 - STP
29/148
Best Paths to the Root Bridge
When the root bridge has been designated for the spanning-treeinstance, the STA starts the process of determining the best paths tothe root bridge from all destinations in the broadcast domain.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 29
8/3/2019 CCNA Exp3 - Chapter05 - STP
30/148
Best Paths to the Root Bridge
H c vi n m ng Bch Khoa - Website: www.bkacad.com 30
8/3/2019 CCNA Exp3 - Chapter05 - STP
31/148
Best Paths to the Root Bridge
H c vi n m ng Bch Khoa - Website: www.bkacad.com 31
Each bridge advertises the spanning tree path cost in the BPDU. Thisspanning tree path cost is the cumulative cost of all the links from the rootbridge to the switch sending the BPDU.
In Figure, switch Y receives a BPDU from the root bridge (switch X) on itsswitch port on the Fast Ethernet segment, and another BPDU on its switch porton the Ethernet segment. The root path cost in both cases is 0. The local path cost on the Fast Ethernet switch port is 19 , while the local
path cost on the Ethernet switch port is 100 .
8/3/2019 CCNA Exp3 - Chapter05 - STP
32/148
Bridge Protocol Data Unit (BPDU)
H c vi n m ng Bch Khoa - Website: www.bkacad.com 32
The BPDUs are transmitted in one direction from the root switch , andeach switch sends configuration BPDUs to communicate and tocompute the STP topology.
8/3/2019 CCNA Exp3 - Chapter05 - STP
33/148
BPDU Field Format
802.3 Header Destination: 01:80:C2:00:00:00 Mcast 802.1d Bridge group Source: 00:D0:C0:F5:18:D1 LLC Length: 38
802.2 Logical Link Control (LLC) Header Dest. SAP: 0x42 802.1 Bridge Spanning Tree Source SAP: 0x42 802.1 Bridge Spanning Tree Command: 0x03 Unnumbered Information
802.1 - Bridge Spanning Tree
H c vi n m ng Bch Khoa - Website: www.bkacad.com 33
ro oco en er:
Protocol Version ID: 0 Message Type: 0x00 Configuration Message Flags: 00000000 Root Priority/ID: 0x8000/ 00:D0:C0:F5:18:C0 Cost Of Path To Root: 0x00000000 (0) Bridge Priority/ID: 0x8000/ 00:D0:C0:F5:18:C0 Port Priority/ID: 0x80/ 0x1D Message Age: 0/256 seconds (exactly 0 seconds) Maximum Age: 5120/256 seconds (exactly 20 seconds) Hello Time: 512/256 seconds (exactly 2 seconds) Forward Delay: 3840/256 seconds (exactly 15 seconds)
8/3/2019 CCNA Exp3 - Chapter05 - STP
34/148
Extra: BPDU Field Format
H c vi n m ng Bch Khoa - Website: www.bkacad.com 34
802.1d uses 2 types of BPDUs: A configuration BPDU , used for initial STP configuraion. Type field=0x00 A topology change notification (TCN) BPDU used for topology changes.
Type field=0x80
8/3/2019 CCNA Exp3 - Chapter05 - STP
35/148
Extra: BPDU Field Format
H c vi n m ng Bch Khoa - Website: www.bkacad.com 35
8/3/2019 CCNA Exp3 - Chapter05 - STP
36/148
The BPDU Process
H c vi n m ng Bch Khoa - Website: www.bkacad.com 36
8/3/2019 CCNA Exp3 - Chapter05 - STP
37/148
The BPDU Process
When the network first starts, all bridges are announcing a chaotic mixof BPDUs.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 37
8/3/2019 CCNA Exp3 - Chapter05 - STP
38/148
The BPDU Process
H c vi n m ng Bch Khoa - Website: www.bkacad.com 38
8/3/2019 CCNA Exp3 - Chapter05 - STP
39/148
The BPDU Process
H c vi n m ng Bch Khoa - Website: www.bkacad.com 39
8/3/2019 CCNA Exp3 - Chapter05 - STP
40/148
The BPDU Process
The BPDU Process
H c vi n m ng Bch Khoa - Website: www.bkacad.com 40
8/3/2019 CCNA Exp3 - Chapter05 - STP
41/148
The BPDU Process
H c vi n m ng Bch Khoa - Website: www.bkacad.com 41
8/3/2019 CCNA Exp3 - Chapter05 - STP
42/148
The BPDU Process
H c vi n m ng Bch Khoa - Website: www.bkacad.com 42
8/3/2019 CCNA Exp3 - Chapter05 - STP
43/148
The BPDU Process
H c vi n m ng Bch Khoa - Website: www.bkacad.com 43
h
8/3/2019 CCNA Exp3 - Chapter05 - STP
44/148
The BPDU Process
H c vi n m ng Bch Khoa - Website: www.bkacad.com 44
Th BPDU P
8/3/2019 CCNA Exp3 - Chapter05 - STP
45/148
The BPDU Process
H c vi n m ng Bch Khoa - Website: www.bkacad.com 45
P R l
8/3/2019 CCNA Exp3 - Chapter05 - STP
46/148
Port Roles
H c vi n m ng Bch Khoa - Website: www.bkacad.com 46
P t R l
8/3/2019 CCNA Exp3 - Chapter05 - STP
47/148
Port Roles
1. Root Port The root port exists on non-root bridges and is the switch port with the
best path to the root bridge.2. 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
forwards frames toward the root bridge as needed.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 47
Only one designated port is allowed per segment .
3. 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 withsource addresses.
A non-designated port is not a root port or a designated port.4. Disabled Port The disabled port is a switch port that is administratively shut down . A
disabled port does not function in the spanning-tree process.
C fig P t P i it
8/3/2019 CCNA Exp3 - Chapter05 - STP
48/148
Configure Port Priority
The port priority values range from 0 - 240, in increments of 16. Thedefault port priority value is 128.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 48
Configure Port Priority
8/3/2019 CCNA Exp3 - Chapter05 - STP
49/148
Configure Port Priority
H c vi n m ng Bch Khoa - Website: www.bkacad.com 49
If all ports have the same priority, the port with the lowest port numberforwards frames.
(config-if)# spanning-tree port-priority {number}
(config-if)# spanning-tree port-priority {number}
Port Role Decisions
8/3/2019 CCNA Exp3 - Chapter05 - STP
50/148
Port Role Decisions
H c vi n m ng Bch Khoa - Website: www.bkacad.com 50
Port Role Decisions
8/3/2019 CCNA Exp3 - Chapter05 - STP
51/148
Port Role Decisions
H c vi n m ng Bch Khoa - Website: www.bkacad.com 51
Port Role Decisions
8/3/2019 CCNA Exp3 - Chapter05 - STP
52/148
Port Role Decisions
H c vi n m ng Bch Khoa - Website: www.bkacad.com 52
Port Role Decisions
8/3/2019 CCNA Exp3 - Chapter05 - STP
53/148
Port Role Decisions
H c vi n m ng Bch Khoa - Website: www.bkacad.com 53
Port Role Decisions
8/3/2019 CCNA Exp3 - Chapter05 - STP
54/148
Port Role Decisions
H c vi n m ng Bch Khoa - Website: www.bkacad.com 54
Port Role Decisions
8/3/2019 CCNA Exp3 - Chapter05 - STP
55/148
Port Role Decisions
H c vi n m ng Bch Khoa - Website: www.bkacad.com 55
Port Role Decisions
8/3/2019 CCNA Exp3 - Chapter05 - STP
56/148
Port Role Decisions
H c vi n m ng Bch Khoa - Website: www.bkacad.com 56
Port Roles - Summary
8/3/2019 CCNA Exp3 - Chapter05 - STP
57/148
Port Roles Summary
H c vi n m ng Bch Khoa - Website: www.bkacad.com 57
STP Port States and BPDU Timers
8/3/2019 CCNA Exp3 - Chapter05 - STP
58/148
Port States1. Blocking - The port is a non-designated port and does not participate
in frame forwarding. The port receives BPDU frames to determine thelocation and root ID of the root bridge switch and what port roles eachswitch port should assume in the final active STP topology.
2. Listening - STP has determined that the port can participate in frameforwarding according to the BPDU frames that the switch has receivedthus far. At this point, the switch port is not only receiving BPDU
H c vi n m ng Bch Khoa - Website: www.bkacad.com 58
adjacent switches that the switch port is preparing to participate in theactive topology.
3. Learning - The port prepares to participate in frame forwarding andbegins to populate the MAC address table. The port is still sendingand receiving BPDUs .
4. Forwarding - The port is considered part of the active topology andforwards frames and also sends and receives BPDU frames.
5. Disabled - The Layer 2 port does not participate in spanning tree anddoes not forward frames. The disabled state is set when the switchport is administratively disabled.
STP Port States and BPDU Timers
8/3/2019 CCNA Exp3 - Chapter05 - STP
59/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 59
If a bridge thinks it is the Root Bridge immediately after booting or in the absence of BPDUs for a certain period of time, the port transitions into the Listening state.
STP Port States and BPDU Timers
8/3/2019 CCNA Exp3 - Chapter05 - STP
60/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 60
STP Port States and BPDU Timers
8/3/2019 CCNA Exp3 - Chapter05 - STP
61/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 61
The BPDU timers not be adjusted directly because the values have beenoptimized for the seven-switch diameter.
Adjusting the spanning-tree diameter value on the root bridge to a lower valueautomatically adjusts the forward delay and maximum age timers proportionallyfor the new diameter.
Extra: BPDU Timers
8/3/2019 CCNA Exp3 - Chapter05 - STP
62/148
Hello timer: Determines how often root bridge sendsconfiguration BPDUs . The default is 2 seconds.
Maximum A e Max A e : Tells the brid e how lon to
H c vi n m ng Bch Khoa - Website: www.bkacad.com 62
keep ports in the blocking state before listening. Thedefault is 20 seconds. Forward Delay (Fwd Delay): Determines how long to stay
in the listening state before going to the learning state, andhow long to stay in the learning state before forwarding.The default is 15 seconds.
Extra: STP Timers
8/3/2019 CCNA Exp3 - Chapter05 - STP
63/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 63
STP Port States and BPDU Timers
8/3/2019 CCNA Exp3 - Chapter05 - STP
64/148
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 forwardingstate immediately, bypassing the typical STP listening and learning states.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 64
STP Convergence
8/3/2019 CCNA Exp3 - Chapter05 - STP
65/148
The STP algorithm uses three simple steps to converge on a loop-freetopology.
Switches go through three steps for their initial convergence:STP ConvergenceSTP Convergence
Step 1 Elect one Root BridgeStep 2 Elect Root PortsStep 3 Elect Designated Ports
H c vi n m ng Bch Khoa - Website: www.bkacad.com 65
All STP decisions are based on a the following predeterminedsequence:FourFour- -Step decision SequenceStep decision SequenceStep 1 - Lowest BIDStep 2 - Lowest Path Cost to Root BridgeStep 3 - Lowest Sender BIDStep 4 - Lowest Port ID
STP Convergence
8/3/2019 CCNA Exp3 - Chapter05 - STP
66/148
STP ConvergenceSTP ConvergenceStep 1 Elect one Root BridgeStep 2 Elect Root PortsStep 3 Elect Designated Ports
H c vi n m ng Bch Khoa - Website: www.bkacad.com 66
Step 1. Elect one Root Bridge
8/3/2019 CCNA Exp3 - Chapter05 - STP
67/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 67
Step 1. Elect one Root Bridge
8/3/2019 CCNA Exp3 - Chapter05 - STP
68/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 68
Step 1. Elect one Root Bridge
8/3/2019 CCNA Exp3 - Chapter05 - STP
69/148
Verify Root Bridge Election
H c vi n m ng Bch Khoa - Website: www.bkacad.com 69
STP Convergence
8/3/2019 CCNA Exp3 - Chapter05 - STP
70/148
STP ConvergenceSTP ConvergenceStep 1 Elect one Root Bridge
Step 2 Elect Root PortsStep 3 Elect Designated Ports
H c vi n m ng Bch Khoa - Website: www.bkacad.com 70
Step 2. Elect Root Ports
8/3/2019 CCNA Exp3 - Chapter05 - STP
71/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 71
Step 2. Elect Root Ports
8/3/2019 CCNA Exp3 - Chapter05 - STP
72/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 72
Step 2. Elect Root Ports
8/3/2019 CCNA Exp3 - Chapter05 - STP
73/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 73
Step 2. Elect Root Ports
8/3/2019 CCNA Exp3 - Chapter05 - STP
74/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 74
Step 2. Elect Root Ports
8/3/2019 CCNA Exp3 - Chapter05 - STP
75/148
Verify the Root Port
H c vi n m ng Bch Khoa - Website: www.bkacad.com 75
STP Convergence
8/3/2019 CCNA Exp3 - Chapter05 - STP
76/148
STP ConvergenceSTP ConvergenceStep 1 Elect one Root Bridge
Step 2 Elect Root PortsStep 3 Elect Designated Ports
H c vi n m ng Bch Khoa - Website: www.bkacad.com 76
Step 3. Electing Designated Ports and Non-Designated Ports
8/3/2019 CCNA Exp3 - Chapter05 - STP
77/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 77
Step 3. Electing Designated Ports and Non-Designated Ports
8/3/2019 CCNA Exp3 - Chapter05 - STP
78/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 78
Step 3. Electing Designated Ports and Non-Designated Ports
8/3/2019 CCNA Exp3 - Chapter05 - STP
79/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 79
Step 3. Electing Designated Ports and Non-Designated Ports
8/3/2019 CCNA Exp3 - Chapter05 - STP
80/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 80
Step 3. Electing Designated Ports and Non-Designated Ports
8/3/2019 CCNA Exp3 - Chapter05 - STP
81/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 81
Step 3. Electing Designated Ports and Non-Designated Ports
8/3/2019 CCNA Exp3 - Chapter05 - STP
82/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 82
Step 3. Electing Designated Ports and Non-Designated Ports
8/3/2019 CCNA Exp3 - Chapter05 - STP
83/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 83
Step 3. Electing Designated Ports and Non-Designated Ports
8/3/2019 CCNA Exp3 - Chapter05 - STP
84/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 84
Step 3. Electing Designated Ports and Non-Designated Ports
8/3/2019 CCNA Exp3 - Chapter05 - STP
85/148
Verify DP and Non-DP
H c vi n m ng Bch Khoa - Website: www.bkacad.com 85
STP Topology Change
8/3/2019 CCNA Exp3 - Chapter05 - STP
86/148
Topology change notification (TCN) Topology change acknowledgement (TCA) Topology change (TC)
H c vi n m ng Bch Khoa - Website: www.bkacad.com 86
designated bridge
In legacy STP, TCNs weregenerated for any active port that was not configured for PortFast.
STP Topology Change
8/3/2019 CCNA Exp3 - Chapter05 - STP
87/148
When the Root Bridge receives the (upstream) topology-changemessage (TCN BPDU), it sends out Configuration BPDUs to indicatethat a topology change is occurring (using the low-order bit in the Flagfield).
The Root Bridge sets the topology change in the configuration for aperiod of time equal to the sum of the Forward Delay and Max Ageparameters ( 20s+15s= 35s )
H c vi n m ng Bch Khoa - Website: www.bkacad.com 87
A bridge receiving a (downstream) topology change configurationmessage from the Root Bridge will use the Forward Delay timer (15seconds) to age out entries in the address table . This allows the device to age out entries faster than the normal 5-
minute default so that stations no longer available are aged out
faster. The bridge continues this process until it no longer receivestopology change configuration messages from the Root Bridge.
STP (802.1D) Enhancements
8/3/2019 CCNA Exp3 - Chapter05 - STP
88/148
UplinkFast is an access-layer STP solution that providesfast failover when the root port or root switch fails.
BackboneFast is a distribution and access-layer STPsolution that provides fast convergence in the network forindirect link failures.
-
H c vi n m ng Bch Khoa - Website: www.bkacad.com 88
port to enter the spanning tree forwarding stateimmediately, bypassing the listening and learning states.
Extra: PortFast
8/3/2019 CCNA Exp3 - Chapter05 - STP
89/148
(config-if)# spanning-tree portfast
(config)# spanning-tree portfast default Enable portfast by default on all access ports
H c vi n m ng Bch Khoa - Website: www.bkacad.com 89
When a device is connected to a port, the port normally enters the spanning tree Listening state.When the Forward Delay timer expires, the port enters the Learning state. When the Forward Delaytimer expires a second time, the port is transitioned to the Forwarding or Blocking state.
When PortFast is enabled on a switch or trunk port, the port is immediately transitioned to theForwarding state. As soon as the switch detects the link, the port is transitioned to the Forwardingstate ( less than 2 seconds after the cable is plugged in).
Extra: PortFast
8/3/2019 CCNA Exp3 - Chapter05 - STP
90/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 90
Extra: UplinkFast
8/3/2019 CCNA Exp3 - Chapter05 - STP
91/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 91
STP UplinkFast accelerates the choice of a new Root Port when a link or switch fails orwhen STP reconfigures itself. The Root Port transitions to the Forwarding stateimmediately without going through the Listening and Learning states , as it would withthe usual STP process.
UplinkFast also limits the burst of multicast traffic by reducing the max-update-rate . ForIOS the default for this parameter is 150 packets per second.
This change takes approximately 1 to 5 seconds
(config)# spanning-tree uplinkfast
Di bl U li kF
Extra: UplinkFast
8/3/2019 CCNA Exp3 - Chapter05 - STP
92/148
Disable UplinkFast
H c vi n m ng Bch Khoa - Website: www.bkacad.com 92
Enable UplinkFast
CAM T bl U d
Extra: UplinkFast
8/3/2019 CCNA Exp3 - Chapter05 - STP
93/148
CAM Table Update
H c vi n m ng Bch Khoa - Website: www.bkacad.com 93
Switch A begins to flood dummy packetswith the different MAC addresses
that it has in its CAM table as a source.
Extra: BackboneFast
8/3/2019 CCNA Exp3 - Chapter05 - STP
94/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 94
BackboneFast is a Catalyst feature that is initiated when a Root Port or Blocked port on a switchreceives inferior BPDUs from its Designated Bridge. An inferior BPDU identifies one switch as boththe Root Bridge and the Designated Bridge . When a switch receives an inferior BPDU, it means that alink to which the switch is not directly connected (an indirect link) has failed. That is, the DesignatedBridge has lost its connection to the Root Bridge. Under STP rules, the switch ignores inferior BPDUsfor the configured Max Age (the default is 20 seconds).
This switchover takes approximately 30 seconds , twice the Forward Delay time if the default ForwardDelay time of 15 seconds is set. This saves up to 20 seconds.
(config)# spanning-tree backbonefast
Extra: BackboneFast
8/3/2019 CCNA Exp3 - Chapter05 - STP
95/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 95
Other Example
8/3/2019 CCNA Exp3 - Chapter05 - STP
96/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 96
PVST+ RSTP d R id PVST+
8/3/2019 CCNA Exp3 - Chapter05 - STP
97/148
PVST+, RSTP and Rapid PVST+
H c vi n m ng Bch Khoa - Website: www.bkacad.com 97
Cisco and STP Variants
8/3/2019 CCNA Exp3 - Chapter05 - STP
98/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 98
Cisco and STP Variants
8/3/2019 CCNA Exp3 - Chapter05 - STP
99/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 99
Cisco and STP Variants
8/3/2019 CCNA Exp3 - Chapter05 - STP
100/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 100
PVST+
Cisco developed PVST+ so that a network can run an STP instance for
8/3/2019 CCNA Exp3 - Chapter05 - STP
101/148
peach VLAN in the network. And Creating different STP root switchesper VLAN creates a more redundant network.
With PVST+, more than one trunk can block for a VLAN and loadsharing can be implemented.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 101
PVST+
PVST+ Bridge ID
8/3/2019 CCNA Exp3 - Chapter05 - STP
102/148
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 switch.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 102
PVST+
8/3/2019 CCNA Exp3 - Chapter05 - STP
103/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 103
Default Switch Configuration
The table shows the default spanning-tree configuration for a Cisco
8/3/2019 CCNA Exp3 - Chapter05 - STP
104/148
Catalyst 2960 series switch. Notice that the default spanning-treemode is PVST+.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 104
Configure PVST+
8/3/2019 CCNA Exp3 - Chapter05 - STP
105/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 105
Configure PVST+
8/3/2019 CCNA Exp3 - Chapter05 - STP
106/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 106
RSTP
What is RSTP?S ( 802 1 ) i l i f h 802 1 d d S
8/3/2019 CCNA Exp3 - Chapter05 - STP
107/148
RSTP (IEEE 802.1w) is an evolution of the 802.1D standard. RSTP canachieve much faster convergence in a properly configured network, sometimesin as little as a few hundred milliseconds.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 107
If a port is configured to be an alternate or a backup port it can immediately change to a forwarding state without waiting for thenetwork to converge.
RSTP
8/3/2019 CCNA Exp3 - Chapter05 - STP
108/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 108
The immediate consideration with STP is convergence time. Depending on the type offailure, it takes anywhere from 30 to 50 seconds to converge the network. RSTP helps with convergence issues that plague legacy STP.
RSTP has additional features similar to UplinkFast and BackboneFast that offer betterrecovery at Layer 2.
RSTP is proactive and therefore negates the need for the 802.1D delay timers . RSTP (802.1w) supersedes 802.1D, while still retaining backward compatibility. Much of
the 802.1D terminology remains, and most parameters are unchanged. In addition,802.1w is capable of reverting back to 802.1D to interoperate with legacy switches on aper-port basis.
Because the RSTP and Cisco-proprietary enhancements are functionally similar,features such as UplinkFast and BackboneFast are not compatible with RSTP .
RTSP BPDU
RSTP (802.1w) uses type 2, version 2 BPDUs, so an RSTP bridge can communicate 802.1D on anyshared link or with any switch running 802.1D.
8/3/2019 CCNA Exp3 - Chapter05 - STP
109/148
Because BPDUs are used as a keepalive mechanism, 3 consecutively missed BPDUs indicatelost connectivity between a bridge and its neighboring root or designated bridge.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 109
Extra: Examining the RSTP BPDU
8/3/2019 CCNA Exp3 - Chapter05 - STP
110/148
RSTP sends BPDUs and populates the flag byte in a slightly different manner than802.1D:
H c vi n m ng Bch Khoa - Website: www.bkacad.com 110
(2 seconds by default), even if it does not receive any BPDUs from the root bridge .
Protocol information can be immediately aged on a port if hellos are not received forthree consecutive hello times or if the max age timer expires . Because BPDUs are now used as a keepalive mechanism, three consecutively
missed BPDUs indicate lost connectivity between a bridge and its neighboring rootor designated bridge. This fast aging of the information allows quick failuredetection .
Unlike in legacy STP, each switch generates its own BPDUs regardless if it hearsBPDUs from the root. In legacy STP, BPDUs were only generated by the root and propagated throughout thespanning tree domain. As a result, when a switch did not receive a configuration BPDU,it did not know where the failure occurred.
In RSTP mode, the switch needs to worry only about its immediate neighbors.
Edge Ports
Ports not participating in spanning tree are called edge ports.
The edge port concept is already well known to Cisco spanning tree users, as it basicallyd t th P tF t f t
8/3/2019 CCNA Exp3 - Chapter05 - STP
111/148
corresponds to the PortFast feature. All ports directly connected to end stations cannot create bridging loops in the network.
Therefore, the edge port directly transitions to the forwarding state, and skips thelistening and learning stages .
H c vi n m ng Bch Khoa - Website: www.bkacad.com 111
Unlike PortFast, an RSTP edge port that receives a BPDU loses its edge port statusimmediately and becomes a normal spanning-tree port.
The edge port immediately becomes a non-edge port if a BPDU is heard on the port.
Extra: Explaining Edge Ports
8/3/2019 CCNA Exp3 - Chapter05 - STP
112/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 112
Unlike PortFast, an edge port that receives a BPDU loses its edge portstatus immediately and becomes a normal spanning tree port. When aswitch with an edge port receives a BPDU, it generates a TCN.
Link Types
Non-edge ports are categorized into 2 link types:1. point-to-point2 shared
8/3/2019 CCNA Exp3 - Chapter05 - STP
113/148
2. shared. 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 portby default.
RSTP can only achieve rapid transition to the forwarding state on edge ports and on pointtopointlinks .
Non-edge ports participate in the spanning tree algorithm and only non-edge ports generate to olo chan es TCs on the network when transitionin to forwardin state. TCs are not
H c vi n m ng Bch Khoa - Website: www.bkacad.com 113
generated for any other RSTP states.
Extra: Describing RSTP Link Types
8/3/2019 CCNA Exp3 - Chapter05 - STP
114/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 114
Root ports do not use the link type parameter . Root ports are able to make a rapidtransition to the forwarding state as soon as the port is in sync. In addition, alternate and backup ports do not use the link type parameter in most cases . Designated ports make the most use of the link type parameter . Rapid transition to the
forwarding state for the designated port occurs only if the link type parameter indicates apoint-to-point link.
RSTP Port States
RSTP provides rapid convergence following a failure or during re-establishment of aswitch, switch port, or link. A RSTP t l g h g t iti i th i t it h t t th
8/3/2019 CCNA Exp3 - Chapter05 - STP
115/148
An RSTP topology change causes a transition in the appropriate switch ports to theforwarding state through either explicit handshakes or a proposal and agreementprocess and synchronization.
With RSTP, the role of a port is separated from the state of a port . For example, adesignated port could be in the discarding state temporarily, even though its final state isto be forwarding.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 115
RSTP Port Roles
8/3/2019 CCNA Exp3 - Chapter05 - STP
116/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 116
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 Spanning Tree Algorithm (STA) determines the role of a port based on
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 moreuseful than the other.
This is based on the value stored in the BPDU and occasionally on the port onwhich they are received.
RSTP Port Roles
8/3/2019 CCNA Exp3 - Chapter05 - STP
117/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 117
Alternate Port
8/3/2019 CCNA Exp3 - Chapter05 - STP
118/148
An alternate port provides
H c vi n m ng Bch Khoa - Website: www.bkacad.com 118
an a ternate pat to t e rootbridge and could thereforereplace the root port should itfail.
Backup Port
8/3/2019 CCNA Exp3 - Chapter05 - STP
119/148
A backup port provides
H c vi n m ng Bch Khoa - Website: www.bkacad.com 119
segment and cannot guarantee an
alternate connectivity to the rootbridge. It was therefore excludedfrom the uplink group.
RSTP Proposal or Agreement Process
8/3/2019 CCNA Exp3 - Chapter05 - STP
120/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 120
In IEEE 802.1D STP, when a port has been selected by spanning tree tobecome a designated port, it must wait two times the forward delay beforetransitioning the port to the forwarding state.
RSTP significantly speeds up the recalculation process after a topologychange, because it converges on a link-by-link basis and does not rely ontimers expiring before ports can transition. Rapid transition to the forwarding state can only be achieved on edge ports
and point-to-point links.
RSTP Proposal or Agreement Process
A port is in-sync if it meets eitherof the following criteria:
8/3/2019 CCNA Exp3 - Chapter05 - STP
121/148
It is in a Blocking state(which means discarding, ina stable topology).
It is an edge port.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 121
RSTP Proposal or Agreement Process
8/3/2019 CCNA Exp3 - Chapter05 - STP
122/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 122
Switch A has a path to the root via switch B and switch C. A new link is then createdbetween the root and switch A, and both ports are in designated blocking state untilthey receive a BPDU from their counterpart. When a designated port is in a discardingor learning state (and only in this case), it sets the proposal bit on the BPDUs it sendsout. This is what happens for port P0 of the root bridge.
Switch A sees that the proposal BPDU has a superior path cost. It blocks all non-edgedesignated ports other than the one over which the proposal-agreement process are
occurring. This operation is called sync and prevents switches below A from causing aloop during the proposal-agreement process. Edge ports do not have to be blockedand remain unchanged during sync.
Bridge A sends an agreement that allows the root bridge to put root port P0 inforwarding state. Port P1 becomes the root port for A.
RSTP Proposal or Agreement Process
Animation 5.4.6.3
8/3/2019 CCNA Exp3 - Chapter05 - STP
123/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 123
Configuring rapid PVST+
8/3/2019 CCNA Exp3 - Chapter05 - STP
124/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 124
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 redundant links
create in bridge networks.
8/3/2019 CCNA Exp3 - Chapter05 - STP
125/148
g Generally, choose a powerful bridge in the middle of the network . If you put the root
bridge in the center of the network with a direct connection to the servers and routers,
you reduce the average distance from the clients to the servers and routers.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 125
8/3/2019 CCNA Exp3 - Chapter05 - STP
126/148
Design STP for Trouble Avoidance
VTP Pruning Only switch D1 receives unnecessary broadcast and multicast traffic for VLAN
20, but it is also blocking one of its ports for VLAN 30.
8/3/2019 CCNA Exp3 - Chapter05 - STP
127/148
, g p The are three redundant paths between core switch C1 and core switch C2.
This redundancy results in more blocked ports and a higher likelihood of aloop.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 127
Design STP for Trouble Avoidance
Manual Pruning VTP pruning can help, but this feature is not necessary in the core of the
network.
8/3/2019 CCNA Exp3 - Chapter05 - STP
128/148
network. Only one port is blocked per VLAN.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 128
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:
8/3/2019 CCNA Exp3 - Chapter05 - STP
129/148
switching. A router performs two main functions: 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
H c vi n m ng Bch Khoa - Website: www.bkacad.com 129
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 thefigure: 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 20and VLAN 30 are no longer bridged between C1 and C2, so thereis no possibility for a loop.
Design STP for Trouble Avoidance
8/3/2019 CCNA Exp3 - Chapter05 - STP
130/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 130
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 VLAN.
Design STP for Trouble Avoidance
8/3/2019 CCNA Exp3 - Chapter05 - STP
131/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 131
Troubleshoot STP Operation
8/3/2019 CCNA Exp3 - Chapter05 - STP
132/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 132
Switch or Link Failure
(Animation 5.4.9.1) For some reason port F0/3 on switch S2 fails to receive BPDUs for the Default
max_age time of 20 seconds.
8/3/2019 CCNA Exp3 - Chapter05 - STP
133/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 133
Switch or Link Failure
(Animation 5.4.9.1) For some reason port F0/3 on switch S2 fails to receive BPDUs for the Default
max_age time of 20 seconds.
8/3/2019 CCNA Exp3 - Chapter05 - STP
134/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 134
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
8/3/2019 CCNA Exp3 - Chapter05 - STP
135/148
g g pport is blocked while C sees BPDUs from B on that link.
Now, consider what happens if the link BC fails in the direction ofC. C stops receiving traffic from B, however, B still receives trafficfrom C.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 135
Switch or Link Failure
Solution: Uses Unidirectional Link Detection feature on switch.
8/3/2019 CCNA Exp3 - Chapter05 - STP
136/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 136
Troubleshoot STP Operation
8/3/2019 CCNA Exp3 - Chapter05 - STP
137/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 137
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
8/3/2019 CCNA Exp3 - Chapter05 - STP
138/148
stages of the STA and directly transitions to the forwarding mode.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 138
PortFast Configuration Error
Solution To prevent this situation, most Catalyst switches that run Cisco IOS softwarehave a feature called BPDU guard . BPDU guard disables a PortFast-configured port or interface if the port or interface receives a BPDU.
8/3/2019 CCNA Exp3 - Chapter05 - STP
139/148
g p p
H c vi n m ng Bch Khoa - Website: www.bkacad.com 139
Network Diameter Issues
The conservative default values for the STP timers impose a maximum network diameterof seven . When a BPDU propagates from the root bridge toward the leaves of the tree, the age
field increments each time the BPDU goes though a switch . Eventually, the switch
8/3/2019 CCNA Exp3 - Chapter05 - STP
140/148
discards the BPDU when the age field goes beyond maximum age.
H c vi n m ng Bch Khoa - Website: www.bkacad.com 140
Extra: STP Vulnerabilities
8/3/2019 CCNA Exp3 - Chapter05 - STP
141/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 141
Troubleshoot STP Operation
Activity
8/3/2019 CCNA Exp3 - Chapter05 - STP
142/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 142
Troubleshoot STP Operation
Activity
8/3/2019 CCNA Exp3 - Chapter05 - STP
143/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 143
Lab - Basic Spanning Tree Protocol
8/3/2019 CCNA Exp3 - Chapter05 - STP
144/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 144
Challenge Lab Spanning Tree Protocol
8/3/2019 CCNA Exp3 - Chapter05 - STP
145/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 145
Troubleshooting Spanning Tree Protocol
8/3/2019 CCNA Exp3 - Chapter05 - STP
146/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 146
Summary
8/3/2019 CCNA Exp3 - Chapter05 - STP
147/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 147
8/3/2019 CCNA Exp3 - Chapter05 - STP
148/148
H c vi n m ng Bch Khoa - Website: www.bkacad.com 148
Top Related