caexs3c5stp-091211035914-phpapp02
TRANSCRIPT
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
1/58
CCNA Semester 3
Chapter 5 -
Spanning Tree Protocol
CCNA Exploration 4.0
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
2/58
2
Objectives
Explain the role of redundancy in a converged
network
Summarize how STP works to eliminate Layer 2
loops in a converged network Explain how the STP algorithm uses three steps to
converge on a loop-free topology
Implement rapid per VLAN spanning tree (rapid
PVST+) in a LAN to prevent loops between redundantswitches.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
3/58
3
Role of redundancy
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
4/58
4
Redundancy in a hierarchical network
The hierarchical design model addresses issues found in theflat model network topologies. One of the issues is
redundancy.
Having multiple paths for data to traverse the network allows
for a single path to be disrupted without impacting theconnectivity of devices on the network.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
5/58
5
Issues with Redundancy : Layer 2 Loop
When multiple paths exist between two devices on thenetwork, a Layer 2 loop can occur.
Ethernet frames do not have a time to live (TTL) like IP
packets traversing routers. So, if they are not terminated
properly on a switched network, they continue to bouncefrom switch to switch endlessly.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
6/58
6
Issues with Redundancy : Broadcast Storm
A broadcast storm occurs when there are so many broadcastframes caught in a Layer 2 loop that all available bandwidth
is consumed.
As a result, no bandwidth is available bandwidth for
legitimate traffic, and the network becomes unavailable fordata communication.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
7/587
Issues with Redundancy : Duplicate Unicast Frames
Unicast frames sent onto a looped network can result induplicate frames arriving at the destination device.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
8/588
Real-world redundancy issues
Network loops that are a result of accidental duplicateconnections in the wiring closets are a common occurrence.
The example displays a loop that occurs if a switch is
connected to two different switches on a network that are
both also interconnected. The impact of this type of loop ismuch greater because it affects more switches directly.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
9/589
The Spanning Tree Algorithm
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
10/5810
Spanning Tree Protocol
STP ensures that there is only one logical path between alldestinations on the network by intentionally blocking
redundant paths that could cause a loop.
STP prevents loops from occurring by configuring a loop-free
path through the network using strategically placed blockingstate ports
A port is considered
blocked when
network traffic isprevented from
entering or leaving
that port
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
11/5811
Spanning Tree Algorithm (STA)
The STA designates a single switch as the root bridge anduses it as the reference point for all path calculations.
After the root bridge has been determined, the STA
calculates the shortest path to the root bridge. Each switch
uses the STA to determine which ports to block.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
12/5812
Spanning Tree Algorithm (STA) (cont)
When the STA has determined which paths are to be leftavailable, it configures the switch ports into distinct port
roles.
Root ports : Switch ports closest to the root bridge.
Designated ports : All non-root ports that are stillpermitted to forward traffic on the network.
Non-designated ports :
All ports configured to be
in a blocking state toprevent loops
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
13/5813
Root Bridge & Election Process
The root bridge serves as a reference point for all spanning-treecalculations to determine which redundant paths to block.
An election process determines which switch becomes the root
bridge.
1. After a switch boots, it sends out BPDU frames (more detail
later) containing the switch BID and the root ID every 2seconds.
2. Initially, each switch identifies itself as the root bridge after
bootup.
3. If the root ID from the BPDU received is lower than the root ID on
the receiving switch, the receiving switch updates its root ID
identifying the adjacent switch as the root bridge
4. The switch then forwards new BPDU frames with the lower root
ID to the other adjacent switches.
5. Eventually, the switch with the lowest BID ends up beingidentified as the root bridge for the spanning-tree instance.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
14/5814
Root Bridge & Election Process
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
15/5815
Root Bridge & Election Process (cont)
BID Structure
Root Bridge
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
16/58
16
Best Path to the Route Bridge
The path information is determined by summing up theindividual port costs along the path from the destination to
the root bridge.
The default port costs are defined by the speed at which the
port operates.
Although switch ports have a default port cost associatedwith them, the port cost is configurable
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
17/58
17
Best Path to the Route Bridge (cont)
Path cost is the sum of all the port costs along the path tothe root bridge.
The paths with the lowest path cost become the preferred
path, and all other redundant paths are blocked.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
18/58
18
Port Roles
Root Port :
The root port exists on non-root bridges and is the switch port withthe best path to the root bridge. Root ports forward traffic toward theroot bridge.
Designated Port :
For root bridges, all switch ports are designated ports.
For non-root bridges, a designated port is the switch port thatreceives and forwards frames toward the root bridge as needed
Only one designated port is allowed per segment
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 tablewith source addresses
Disabled Port :
The disabled port is a switch port that is administratively shut down. Adisabled port does not function in the spanning-tree process
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
19/58
19
Port Roles (cont)
When determining the root port on a switch, the switchcompares the path costs on all switch ports participating in
the spanning tree.
The switch port with the lowest overall path cost to the root is
automatically assigned the root port role because it is closest
to the root bridge.
When there are two switch ports that have the same lowest
path cost to the root bridge, the switch uses the
customizable port priority value, or the lowest port ID if both
port priority values are the same.
The port ID is the interface ID of the switch port.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
20/58
20
Port Roles (cont) example
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
21/58
21
Port Roles (cont) example
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
22/58
22
Port Roles (cont) example
After a switch determines which of its ports is the root port,the remaining ports must be configured as either a
designated port (DP) or a non-designated port (non-DP)
When two switches exchange their BPDU frames, they
examine the sending BID of the received BPDU frame to see
if it is lower than its own.
The switch with the lower BID wins the competition and its
port is configured in the designated role. The losing switch
configures its switch port to be non-designated and,
therefore, in the blocking state to prevent the loop from
occurring.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
23/58
23
Port Roles (cont) example
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
24/58
24
BPDU
STP determines a root bridge for the spanning-tree instanceby exchanging BPDUs.
BPDU Fields
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
25/58
25
BPDU (cont)
By default, BPDU frames are sent every 2 seconds after aswitch is booted.
When adjacent switches receive a BPDU frame, they
compare the root ID from the BPDU frame with the local root
ID.
If the root ID in the BPDU is lower than the local root ID,
the switch updates the local root ID and the ID in its
BPDU messages
If the local root ID is lower than the root ID received in the
BPDU frame, the BPDU frame is discarded.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
26/58
26
BID
The BID field of a BPDU frame contains three separatefields: bridge priority, extended system ID, and MAC
address. Each field is used during the root bridge election.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
27/58
27
BID (cont)
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
28/58
28
Port States and BPDU Timers
To facilitate the learning of the logical spanning tree, each switch
port transitions through five possible port states and three BPDUtimers.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
29/58
29
Port States and BPDU Timers (cont)
Blocking - The port is a non-designated port and does notparticipate in frame forwarding.
Listening - In this state, 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.
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 forward frames.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
30/58
30
Port States and BPDU Timers (cont)
Cisco PortFast Technology When a switch port configured with PortFast is configured
as an access port, that port transitions from blocking to
forwarding state immediately, bypassing the typical STP
listening and learning states.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
31/58
31
Port States and BPDU Timers (cont)
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
32/58
32
STP Topology Change
A switch considers it has detected a topology change eitherwhen a port that was forwarding is going down (blocking for
instance) or when a port transitions to forwarding and the
switch has a designated port.
When a change is detected, the switch notifies the root
bridge of the spanning tree. The root bridge then broadcasts
the information into the whole network.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
33/58
33
Cisco and STP Variants
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
34/58
34
Cisco and STP Variants
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
35/58
35
PVST +
Cisco developed PVST+ so that a network can run an STPinstance for each VLAN in the network. With PVST+, more
than one trunk can block for a VLAN and load sharing can
be implemented.
In a Cisco PVST+ environment, you can tune the spanning-
tree parameters so that half of the VLANs forward on each
uplink trunk
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
36/58
36
PVST + Bridge ID
Bridge priority - A 4-bit field carries the bridge priority.Because of the limited bit count, the priority is conveyed in
discrete values in increments of 4096. The default priority is
32,768.
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.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
37/58
37
Configure PVST +
Step 1. Select the switches you want for the primary and secondary root
bridges for each VLAN.
Step 2. Configure the switch to be a primary bridge for one VLAN, for
example switch S3 is a primary bridge for VLAN 20.
Step 3. Configure the switch to be a secondary bridge for the other
VLAN, for example, switch S3 is a secondary bridge for VLAN 10.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
38/58
38
Configure PVST + (cont)
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
39/58
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
40/58
40
RSTP (cont)
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
41/58
41
RSTP BPDU
RSTP (802.1w) uses type 2, version 2 BPDUs, so an RSTPbridge can communicate 802.1D on any shared link or with
any switch running 802.1D
Protocol information can be immediately aged on a port if
hellos are not received for three consecutive hello times,
6 seconds by default, or if the max age timer expires
Because BPDUs are used as a keepalive mechanism,
three consecutively missed BPDUs indicate lost
connectivity between a bridge and its neighboring root or
designated bridge
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
42/58
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
43/58
43
RSTP (cont) : Edge Port
An RSTP edge port is a switch port that is never intended tobe connected to another switch device. It immediately
transitions to the forwarding state when enabled.
Unlike PortFast, an RSTP edge port that receives a BPDU
loses its edge port status immediately and becomes a
normal spanning-tree port.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
44/58
44
RSTP (cont) : Link Types
The link type provides a categorization for each portparticipating in RSTP
The link type is automatically determined, but can be
overwritten with an explicit port configuration.
Root ports do not use the link type parameter. Root ports areable to make a rapid transition to the forwarding state as
soon as the port is in sync.
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 a point-to-point link.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
45/58
45
RSTP (cont) : Port States
RSTP provides rapid convergence following a failure orduring re-establishment of a switch, switch port, or link.
There are three possible RSTP port states: discarding,
learning, and forwarding.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
46/58
46
RSTP (cont) : Port Roles
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
47/58
47
Configuring rapid PVST +
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
48/58
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
49/58
49
Design STP for Trouble Avoidance
Know Where the Root Is
Minimize the Number of Blocked Ports
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
50/58
50
Design STP for Trouble Avoidance (contd)
VTP Pruning
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
51/58
51
Design STP for Trouble Avoidance (contd)
Use Layer 3 Switching
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 C1and C2, so there is no possibility for a loop.
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
52/58
52
Design STP for Trouble Avoidance (contd)
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
53/58
53
Troubleshoot STP Operation
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
54/58
54
Troubleshoot STP Operation
To troubleshoot a bridging loop, you need to know:
The topology of the bridge network
The location of the root bridge
The location of the blocked ports and the redundant links
Some possible failure Switch or Link Failure
PortFast Configuration Error
Network Diameter Issues
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
55/58
55
Switch or Link Failure
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
56/58
56
PortFast Configuration Error
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
57/58
57
Network Diameter Issues
-
7/29/2019 caexs3c5stp-091211035914-phpapp02
58/58
Summary