You are on page 1of 29

CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Spanning-Tree Protocol

Redundant Topologies
Spanning-Tree Protocol

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Redundancy
• Increase uptime by having backup media/
network devices
• If a switch fails the redundant switch can take
over
• Adds cost to a network design –
– is the cost in lost sales/lost production/reduced
productivity greater than the additional cost of
hardware?

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Redundant Topologies 1
• Khan can reach 10BaseT Ports (12)

Baran via 2 A
paths Host Kahn A
• If the link Hub 00-90-27-76-96-93

between the 10BaseT Ports (12) A


hub and Switch
B
B fails there is 1 2 100BaseT
an alternative Host Baran Ports

00-90-27-76-5D-FE

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Redundant Topologies 2
Problem! 10BaseT Ports (12)

• Khan sends an A
ARP broadcast to
find destination Host Kahn A
MAC of Baran Hub 00-90-27-76-96-93
• Frame is
10BaseT Ports (12) A
broadcast by
Khan, Switch A B
(all ports), Switch 1 2 100BaseT
B (all ports) – Host Baran Ports

BROADCAST
STORM 00-90-27-76-5D-FE

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Redundant Topologies 3
Another Problem! 10BaseT Ports (12)

• Port A on Switch A
A might think that A
Host Kahn
Host Baran is
Hub
connected to it 00-90-27-76-96-93

• Extra processing 10BaseT Ports (12) A


& data B
transmission 1 2 100BaseT
result Host Baran Ports

00-90-27-76-5D-FE

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Loop Prevention
• In networks that have several switches and/or
bridges, there might be physical path loops.
• Physical path loops occur when network devices
are connected to one another by two or more
physical media links.
• The physical loops are desirable for network
fault tolerance because if one path fails, another
will be available. Consider the network layout
shown in Figure 7-8 on the next slide.
Chapter 7 – Spanning-Tree Protocol
CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Logical Loop Example

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Logical Loop
• Assume that Host 1, which is attached to Switch
A, sends out a packet addressed to the MAC
address of Host 5.
• There are actually two routes the packet can
travel. The packet can be sent from Switch A to
Bridge C or Bridge D.
• From there, it can be sent to Switch B where it
can be forwarded to Host 5.

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Logical Loop cont’d


• If either Bridge C or Bridge D fails, another path
between Switch A and Switch B still exists.
• However, when switches and/or bridges are
interconnected, they might create a physical
loop.

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Logical Loop Continued


• The drawback to the previous configuration is
that endless packet looping can occur on this
network due to the existence of the physical
loop.
• For example, assume that the MAC address for
a station is not in any of the switching or bridging
tables on the network. The packet could be
forwarded endlessly around the network from
bridge to switch to bridge.
Chapter 7 – Spanning-Tree Protocol
CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Logical Loop Cont’d


• In order to prevent looping on the network,
switches and bridges utilize the Spanning Tree
Protocol (STP).

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Building One Logical Path


• The switches and bridges on a network use an
election process over STP to configure a single
logical path.
• First, a root bridge is selected. Then, the other
switches and bridges make their configurations,
using the root bridge as a point of reference.
• STP devices determine the root bridge via an
administratively set priority number; the device
with the lowest priority number becomes the root
bridge.
Chapter 7 – Spanning-Tree Protocol
CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

One Logical Path cont’d


• If the priorities between two or more devices are
the same, then the STP devices will make the
decision based on the lowest MAC address.
• Bridges use STP to transfer the information
about each bridge’s MAC address and priority
number.

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Building One Logical Path Continued


• The messages the devices send to one another
are called Bridge Protocol Data Units (BPDU) or
Configuration Bridge Protocol Data Units
(CBPDU).
• Once the STP devices on the network select a
root bridge, each bridge or switch determines
which of its own ports offers the best path to the
root bridge.
• The BPDU messages are sent between the root
bridge and the best ports on the other devices,
which are called root ports.
Chapter 7 – Spanning-Tree Protocol
CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Building One Logical Path Continued


• The BPDUs transfer status messages about the
network.
• If BPDUs are not received for a certain period of
time, the non-root bridge devices will assume
that the root bridge has failed, and a new root
bridge will be selected.

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Building One Logical Path Continued


• Once the root bridge is determined and the
switches and bridges have reconfigured their
paths to the new root bridge, the logical loop is
removed by one of the switches or bridges.
• This switch or bridge will do this by blocking the
port that creates the logical loop.
• This blocking is done by calculating costs for
each port in relation to the root bridge and then
disabling the port with the highest cost.
Chapter 7 – Spanning-Tree Protocol
CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Building One Logical Path Continued


• For example, refer back to Figure 7-8 and
assume that Switch A has been elected the root
bridge. Switch B would have to block one of its
ports to remove the logical loop from the
network.

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Spanning-Tree Protocol
• IEEE standard 802.1D
• Root bridge elected – lowest priority wins based
on bridge priority and MAC address
• 1 path to the root bridge is calculated using
lowest cost link – root port
• Cost based on bandwidth
• Other paths are blocked
• Bridge Protocol Data Units used to carry STP
information

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Elements of the Spanning Tree Protocol


– Main function of STP is to allow redundant paths in a
switched/bridged network without incurring latency
from the effects of loops.
– STP prevents loops by calculating a stable spanning-
tree network topology (similar to OSPF operation)
– Spanning-tree frames (called bridge protocol data
units--BPDUs) are sent and received by all switches
in the network and are used to determine the
spanning-tree topology

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Five STP States

– States are established by configuring each port


according to policy
– Then the STP modifies the states based on traffic
patterns and potential loops
– The default order of STP states are:
• Blocking--no frames forwarded, BPDUs heard
• Listening--no frames forwarded, listening for data frames
• Learning--no frames forwarded, learning addresses
• Forwarding--frames forwarded, learning addresses
• Disabled--no frames forwarded, no BPDUs heard

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

STP states
• Blocking
• Listening
• Learning
• Forwarding
• Disabled

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

STP Example 1
• Port marked x is 10BaseT Ports (12)

shut down – A
why? Host Kahn A
Hub 00-90-27-76-96-93

10BaseT Ports (12) A


x B
1 2 100BaseT
Host Baran Ports

00-90-27-76-5D-FE

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Port States
• The ports on a switch or bridge can be
configured for different states (stable or
transitory), depending on the configuration of the
network and the events occurring on the
network.
• Stable states are the normal operational states
of ports when the root bridge is available and all
paths are functioning as expected.

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Port States Cont’d


• STP devices use transitory states when the
network configuration is undergoing some type
of change, such as a root bridge failure.
• The transitory states prevent logical loops during
a period of transition from one root bridge to
another.

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

STP Example 2
• Why is CAT A
the root bridge?
• Why have the
links marked x
been blocked?

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Stable & Transitory States


• The stable states are as follows:
– Blocking: The port is receiving BPDUs, but it is not
forwarding frames in order to prevent logical loops in
the network.
– Forwarding: The port is forwarding frames, learning
new MAC addresses, and receiving BPDUs.
– Disabled: The port is disabled and is neither receiving
BPDUs nor forwarding frames.

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Stable & Transitory States cont’d


• The transitory states are as follows:
– Listening: The port is listening to frames only; it is not
forwarding frames and it is not learning new MAC
addresses.
– Learning: The port is learning new MAC addresses,
but it is not yet forwarding frames.

Chapter 7 – Spanning-Tree Protocol


CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Transitory States
• STP devices use the transitory states on ports
while a new root bridge is being selected.
• During the listening state, STP devices are
configured to receive only the BPDUs that inform
it of network status.
• STP devices use the learning state as a
transition once the new root has been selected,
but all the bridging or switching tables are still
being updated.
Chapter 7 – Spanning-Tree Protocol
CISCO NETWORKING ACADEMY PROGRAM

CCNA3: Switching Basics and Intermediate Routing v3.0

Transitory States cont’d


• Since the routes may have changed, the old
entries must either be timed out or replaced with
new entries.

Chapter 7 – Spanning-Tree Protocol

You might also like