CCNA 3 v3.0 Module 7
Spanning-Tree Protocol
Cisco Networking Academy
© 2003, Cisco Systems, Inc. All rights reserved.
1
Spanning-Tree Objectives
• Redundant Topologies
• Spanning-Tree Protocol
© 2003, Cisco Systems, Inc. All rights reserved.
2
Redundancy
Redundant networking topologies are
designed to ensure that networks continue
to function in the presence of single points
of failure.
© 2003, Cisco Systems, Inc. All rights reserved.
3
Redundant Topologies
• A goal of redundant topologies is to
eliminate network outages caused by a
single point of failure.
• All networks need redundancy for
enhanced reliability.
• However, transparent bridging begins to
have problems when redundant paths are
added to the Layer 2 network.
© 2003, Cisco Systems, Inc. All rights reserved.
4
Simple Redundant Switched Topology
© 2003, Cisco Systems, Inc. All rights reserved.
5
Media Access Control Database Instability
Unknown Unicast
In a redundant switched network, it is possible for
switches to learn the wrong information. A switch can
learn that a MAC address is on a port when it is not.
© 2003, Cisco Systems, Inc. All rights reserved.
6
Broadcast Storm
1/1
1/2
2/1
2/2
The process of continually propagating a broadcast is known as a broadcast
storm which will eventually bring the network down when the switches’
processor utilization reaches 100%.
© 2003, Cisco Systems, Inc. All rights reserved.
7
Using Bridging Loops for Redundancy
© 2003, Cisco Systems, Inc. All rights reserved.
8
Spanning-Tree Protocol
© 2003, Cisco Systems, Inc. All rights reserved.
9
L2 Loops
• Broadcasts and Layer 2 loops can be a
dangerous combination.
• Ethernet frames have no TTL field.
• After an Ethernet frame starts to loop, it will
probably continue until someone shuts off one of
the switches or breaks a link.
• Ethernet switches associate the source MAC in
the Layer 2 header with the a port number
© 2003, Cisco Systems, Inc. All rights reserved.
10
Spanning-Tree Protocol (STP)
• STP is a loop-prevention protocol.
• allows L2 devices to communicate with each
other to discover physical loops in the network.
• specifies an algorithm that L2 devices can use to
create a loop-free logical topology.
• creates a tree structure of loop-free leaves and
branches that spans the entire Layer 2 network.
© 2003, Cisco Systems, Inc. All rights reserved.
11
STP Prevents Loops
• The purpose of STP is to avoid and
eliminate loops in the network by
negotiating a loop-free path through a root
bridge.
• STP determines where the are loops and
blocks links that are redundant.
–Ensures that there will be only one active path to
every destination.
© 2003, Cisco Systems, Inc. All rights reserved.
12
Spanning-Tree Algorithm
• STP executes an algorithm called STA
(Spanning-Tree Algorithm).
• STA chooses a reference point, called a
root bridge, and then determines the
available paths to that reference point.
–If more than two paths exists, STA picks the best
path and blocks the rest.
–How does STP learn the network topology?
© 2003, Cisco Systems, Inc. All rights reserved.
13
Spanning-Tree BPDUs
• All switches using STP must exchange
Bridge Protocol Data Units with other
switches.
• Sent every 2 seconds on every active port.
© 2003, Cisco Systems, Inc. All rights reserved.
14
BPDUs
The exchange of BPDU messages results
in the following:
–The election of a root switch
–The election of a designated switch for every
switched segment
–The removal of loops in the switched network by
placing redundant switch ports in a backup state
© 2003, Cisco Systems, Inc. All rights reserved.
15
BPDUs
Bridge protocol data unit
(BPDU)
© 2003, Cisco Systems, Inc. All rights reserved.
16
Bridge ID
© 2003, Cisco Systems, Inc. All rights reserved.
17
Bridge ID
•
Consists of two components:
1. A 2-byte priority: Cisco switch defaults to 32,768 or
0x8000.
2. A 6-byte MAC address
•
Used to elect a root bridge.
•
Lowest Bridge ID is the root.
•
If all devices have the same priority, the bridge
with the lowest MAC address becomes the root
bridge -- Yikes!!!
© 2003, Cisco Systems, Inc. All rights reserved.
18
Spanning-Tree Operation 802.1d
• One root bridge per
network.
• One root port per
nonroot bridge.
• One designated port
per segment.
• Nondesignated ports
are unused.
© 2003, Cisco Systems, Inc. All rights reserved.
19
Root Port
•
Root Port: The port receiving the best
BPDU on a bridge is the root port.
– This is the port that is the closest to the
root bridge in terms of path cost
– The root bridge sends BPDUs that are more
useful than the ones that any other bridge
can send.
– The root bridge is the only bridge in the
network that does not have a root port.
© 2003, Cisco Systems, Inc. All rights reserved.
20
Designated Port
•
A port is designated if it can send the best
BPDU on the segment to which it is
connected.
•
On a given segment, there can be only one
path toward the root bridge otherwise
redundant paths would create a bridging
loop.
– All bridges connected to a given segment listen
to each other's BPDUs and agree on the bridge
sending the best BPDU as the designated
bridge for the segment.
© 2003, Cisco Systems, Inc. All rights reserved.
21
Spanning-Tree Example
© 2003, Cisco Systems, Inc. All rights reserved.
22
Spanning-Tree Link Costs
Shortest path is based on cumulative link costs.
Link costs are based on the speed of the link.
© 2003, Cisco Systems, Inc. All rights reserved.
23
Spanning-Tree Port States
These values have been calculated on an assumption that there will be a
maximum of seven switches (diameter of seven) in any branch of the
spanning tree from the root bridge.
© 2003, Cisco Systems, Inc. All rights reserved.
24
Spanning-Tree Port States
• The Max Age allows topology change
information to propagate from one side of the
network to the other.
• In the listening state, switches determine if there
are any other paths to the root bridge and path
cost is compared.
• In the learning state user data is not forwarded,
but MAC addresses are learned from any traffic
that is seen.
• In the forwarding state user data is forwarded
and MAC addresses continue to be learned.
© 2003, Cisco Systems, Inc. All rights reserved.
25
Spanning-Tree Recalculation
Root port
Root port
A switched internetwork has converged when all the switch and
bridge ports are in either the forwarding or blocked state.
Convergence on a new spanning-tree topology using the IEEE
802.1D standard can take up to 50 seconds.
© 2003, Cisco Systems, Inc. All rights reserved.
26
Spanning-Tree Recalculation
• During the time that the Layer 2 network is
converging, MAC addresses that can no longer be
reached still exist in the CAM table.
• STP topology change process forces the switch to
purge MAC addresses in the CAM table faster.
• When a root bridge sends out a topology change
BPDU the topology change is set to a period of time
equal to the sum of the max age and fwd delay timers
(50 seconds).
• A switch receiving the topology change BPDU uses
the fwd delay timer (15 seconds) to age out entries in
its MAC address table – the default time is five
minutes.
© 2003, Cisco Systems, Inc. All rights reserved.
27
Rapid Spanning-Tree Protocol (RST)
•
The IEEE 802.1w LAN standard and protocol
introduce the following:
1. Clarification of new port states and roles
2. Definition of a set of link types that can
go to forwarding state rapidly
3. Allowing switches, in a converged
network, to generate their own BPDUs
rather than relaying root bridge BPDUs
© 2003, Cisco Systems, Inc. All rights reserved.
28
Rapid Spanning-Tree
•
According to the 802.1w standard:
1. The “blocked” state of a port has been
renamed as the “discarding” state.
2. A role of a discarding port is an
“alternate port”.
3. The discarding port can become the
“designated port” in the event of the failure of
the designated port for the segment.
4. Link types have been defined as point-to-point,
edge-type, and shared.
© 2003, Cisco Systems, Inc. All rights reserved.
29
Alternate and Backup Ports
• These two port roles correspond to the blocking
state of 802.1d (discarding MACs).
–A blocked port is defined as not being the designated
or root port.
–A blocked port receives a more useful BPDU than the
one it would send out on its segment.
• An alternate port is a port blocked by receiving
more useful BPDUs from another bridge.
• A backup port is a port blocked by receiving more
useful BPDUs from the same bridge it is on.
© 2003, Cisco Systems, Inc. All rights reserved.
30
Alternate and Backup Ports
© 2003, Cisco Systems, Inc. All rights reserved.
31
New BPDU Format
• BPDU are sent every hello-time, and not
simply relayed anymore.
• With 802.1d, a non-root bridge would only
generate BPDUs when it received one on its root
port.
– Actually, every bridge only relays the root bridge’s
BPDU
– With 802.1w, every bridge generates it’s own BPDU
even if it does not receive one from the root bridge.
• The Rapid Spanning-Tree Protocol, IEEE 802.1w,
will eventually replace the Spanning-Tree
Protocol, IEEE 802.1D.
© 2003, Cisco Systems, Inc. All rights reserved.
32
Rapid Spanning-Tree Port Designations
The Rapid Spanning Tree Protocol, IEEE
802.1w, will eventually replace the Spanning
Tree Protocol, IEEE 802.1D.
© 2003, Cisco Systems, Inc. All rights reserved.
33