Title: Switching Basics and Intermediate Routing CCNA 3 Chapter 7
1Switching Basics and Intermediate Routing CCNA
3Chapter 7
2Spanning Tree ProtocolIntroduction
- Redundancy is desirable in a network
- Helps minimize network downtime
- Downside increased likelihood of Layer 2 or
Layer 3 loops - Spanning Tree Protocol (STP) was invented to
address issues caused by physical redundancy in a
switched topology - Two major solutions
- IEEE 802.1d original standard, five states
- IEEE 802.1w enhancements, becoming the standard
3Redundant Topologies Introduction
- Redundancy is critical in a network
- Allows a network to be fault tolerant
- A network without redundancy can suffer downtime
from the failure of a single link, port, or
device - Goal is to balance the cost of redundancy with
the need for network availability - Switched networks have some drawbacks
- Broadcast storms
- Multiple frame transmissions
- MAC address database instability
4Redundant Topologies Introduction
- Switched networks have benefits
- Smaller collision domains
- Microsegmentation
- Full duplex operation
- Better network performance
- Redundancy protects against lost connectivity
because of a failed individual component - Can result in physical topologies with loops
- Physical layer loops can cause serious problems
in switched networks
5Redundant Topologies Redundancy
- If the network is down, productivity and customer
satisfaction decline - Companies require continuous network
availability, or uptime - 100 uptime is nearly impossible
- Five nines uptime (99.999) is the goal of many
organizations - Means one hour of downtime for every 4000 days
(5.25 minutes of downtime a year)
6Redundant Topologies Redundancy
- Network reliability is achieved through reliable
equipment and network designs that are tolerant
to failures and faults - Networks should reconverge rapidly to bypass the
fault - Goal of redundant topologies is to eliminate
outages caused by a single point of failure
7Redundant Topologies Redundant Switched
Topologies
- Problems that can occur with redundant links and
devices in switched or bridged networks - Broadcast storms without a loop-avoidance
process in place, each switch or bridge
broadcasts endlessly - Multiple frame transmission multiple copies of
unicast frames can be delivered to destination
stations can cause unrecoverable errors - MAC address instability results from copies of
the same frame being received on different ports
of the switch data forwarding can be impaired
8Redundant Topologies Redundant Switched
Topologies
- A Redundant Switched Topology Can Be a Source of
Layer 2 Problems
9Redundant Topologies Redundant Switched
Topologies
- Layer 2 LAN protocols, such as Ethernet, lack a
mechanism to recognize and eliminate endlessly
looping frames - Some Layer 3 protocols utilize a Time to Live
(TTL) mechanism that limits how many times a
packet can be retransmitted by a Layer 3
networking device - Layer 2 devices lack such a capability, so a
loop-avoidance mechanism is required
10Redundant Topologies Broadcast Storms
- Broadcasts and multicasts can cause problems in a
switched network - Without specialized switch configurations,
switches treat multicasts the same as broadcasts - Broadcast and multicast frames are flooded out
all ports except the one on which the frame was
received - Broadcast storms are not as prevalent due to the
move to Layer 3 switching
11Redundant Topologies Broadcast Storms
12Redundant Topologies Broadcast Storms
- How a broadcast storm can occur in the previous
slide - Host X sends a broadcast frame, such as an ARP
Switch A receives the frame - Switch A examines the Destination Address field
in the frame and determines the frame must be
flooded to segment 2 - When the copy of the frame arrives at Switch B,
the process repeats and a copy of the frame is
transmitted to the Ethernet, segment 1 near
Switch B - Because the original copy of the frame also
arrives at Switch B via the top Ethernet, the
frames travel around the loop in both directions,
even after the destination has received a copy of
the frame
13Redundant Topologies Broadcast Storms
- A broadcast storm can disrupt normal traffic flow
- Every device on the switched or bridged network
must process the frames because they are
broadcasts - Takes CPU cycles
- A loop-avoidance mechanism (spanning tree)
eliminates this problem by preventing one of the
four interfaces from transmitting frames during
normal operation, thus breaking the loop
14Redundant Topologies Multiple Frame Transmissions
- Multiple copies of the same frame can arrive at
the intended host - Can cause problems with the receiving protocol as
most protocols do not cope with or recognize
duplicate transmissions - Protocols that use a sequence numbering mechanism
assume that many transmissions have failed and
that the protocol is recycling numbers - Other protocols attempt to hand the duplicate
transmission to the appropriate upper-layer
protocol, with unpredictable results
15Redundant Topologies Multiple Frame Transmissions
- Multiple Frame Transmissions Can Occur in a
Redundant Switched Network
16Redundant Topologies Multiple Frame Transmissions
- How multiple copies of frames can arrive at the
intended host in previous slide - Host X sends a unicast frame to Router Y one
copy is received over Ethernet segment 1 at the
same time Switch A receives a copy of the frame - Switch A examines the Destination Address field
in the frame, finds no entry in its table, and
floods the frame - Switch B receives the frame and forwards it to
segment 1 if the table has no entry for Router Y - Router Y receives a second copy of the frame
17Redundant Topologies MAC Database Instability
- MAC database instability results when multiple
copies of a frame arrive on different ports of a
switch - Depending on the internal architecture of the
switch, it might or might not cope well with
rapid changes in its MAC database - STP eliminates this problem by preventing one of
the interfaces from transmitting frames during
normal operation
18Redundant Topologies MAC Database Instability
- MAC Database Instability Can Also Occur in
Redundant Switched Networks
19Spanning Tree ProtocolSTP Background
- Spanning Tree Protocol (STP) was originally
developed by Digital Equipment Corporation - The IEEE 802 committee revised the DEC
spanning-tree algorithm in the IEEE 802.1d
specification - IEEE 802.1d is used by Cisco switches
- STP is enabled by default on Catalyst switches
- Purpose of STP is to maintain a loop-free network
topology - STP continually probes the network so in can
detect the addition or failure of a link
20Spanning Tree ProtocolSTP Background
- STP Intelligently Blocks Selected Ports to
Logically Solve Problems That Physical Loops Cause
21Spanning Tree ProtocolSpanning Tree Operation
- Convergence in STP is a state in which all switch
and bridge ports have transitioned into a
forwarding or blocking state - Necessary for normal network operations
- Amount of time for convergence is a key issue
fast convergence time is desirable - 30 to 50 seconds with IEEE 802.1d
- STP uses two key concepts when converging a
loop-free logical topology - Bridge ID
- Path cost
22Spanning Tree ProtocolSpanning Tree Operation
- Spanning-tree path cost based on cumulative link
costs - Link costs are based on the speed of the link
- Spanning-Tree Path Costs for the Revised and
Previous IEEE Specification
23Spanning Tree ProtocolSpanning Tree Operation
- Various Spanning-Tree Parameters Include
Designated Ports, Nondesignated Ports, and Root
Ports
24Spanning Tree ProtocolSpanning Tree Operation
- STP performs three steps when it initially
converges on a logically loop-free topology - Elects one root bridge on the root bridge, all
ports are designated ports that are normally in
the forwarding state that can send and receive
traffic - Selects the root port on the nonroot bridge STP
establishes one root port on the nonroot bridge
(any bridge that is not the root bridge) - Root ports are normally in the forwarding state
25Spanning Tree ProtocolSpanning Tree Operation
- STP performs three steps when it initially
converges on a logically loop-free topology
(continued) - Selects the designated port on each segment only
one designated port is selected on each segment - The designated port has the lowest-cost path to
the root bridge - Designated ports are normally in the forwarding
state - Nondesignated ports are normally in the blocking
state to logically break the loop topology
26Spanning Tree ProtocolSpanning Tree Operation
- As a result, for every switched network, these
elements exist - One root bridge per network
- One root port per nonroot bridge
- One designated port per segment
- Unused, or nondesignated ports
- Root ports and designated ports are used for
forwarding data traffic - Nondesignated ports discard all data traffic and
are called blocking or discarding ports
27Spanning Tree ProtocolSelecting the Root Bridge
- The root bridge is the bridge with the lowest
bridge ID - The bridge ID (BID) includes the priority and MAC
address of the bridge - Switches and bridges that run the spanning-tree
algorithm exchange configuration messages every 2
seconds by default - They use a multicast frame called the bridge
protocol data unit (BPDU)
28Spanning Tree ProtocolSelecting the Root Bridge
- Bridge ID Determines the Root Bridge
29Spanning Tree ProtocolSelecting the Root Bridge
- Each bridge must have a unique BID assigned
- The default in IEEE 802.1d is 32,768
- Binary 1000 0000 0000 0000 hex 0x8000
- Is the midrange value
- The root bridge is the bridge with the lowest
BID it is a combination of bridge priority and
MAC address values - Setting the switch priority smaller makes the BID
smaller
30Spanning Tree ProtocolSelecting the Root Bridge
- Root Bridge Selection Relies on BPDUs
31Spanning Tree ProtocolSpanning Tree Port States
- With STP, ports transition through four states at
power-up - Blocking
- Listening
- Learning
- Forwarding
- Ports then stabilize to forwarding or blocking
states - Forwarding ports provide the lowest cost path to
the root bridge - During a topology change, ports temporarily go
through listening and learning states
32Spanning Tree ProtocolSpanning Tree Port States
33Spanning Tree ProtocolSpanning Tree Port States
- Initially, all bridge ports start in the blocking
state, listening for BPDUs - When a bridge first boots up, it thinks it is the
root bridge, so it transitions to the listening
state - An absence of BPDUs for a certain period of time
is called the max_age - Default setting of 20 seconds
- If a port is in the blocking state and does not
receive a BPDU within the max_age, it transitions
from the blocking state to the listening state - When in the listening state, it can determine the
active topology
34Spanning Tree ProtocolSpanning Tree Port States
- During the listening state, no user data is
passed through the switch port - The bridge selects the root bridge
- The bridge selects the root ports on the nonroot
bridges - The bridge selects designated ports on each
segment - The time it takes for a port to transition from
listening to learning or learning to forwarding
is called the forward delay has a default value
of 15 seconds
35Spanning Tree ProtocolSpanning Tree Port States
- The learning state reduces the amount of flooding
required when data forwarding begins - If a port is still a designated or root port at
the end of the learning state, the port
transitions to the forwarding state - It can send and receive user data
- Ports that are not designated or root ports
transition back to the blocking state
36Spanning Tree ProtocolSpanning Tree Port States
- A port normally transitions from the learning
state to the forwarding state in 30 to 50 seconds - If a Cisco switch port is connected only to
end-user stations (not to another switch or
bridge), a feature called PortFast can be enabled - Automatically transitions from blocking to
forwarding
37Spanning Tree ProtocolSpanning Tree Port States
- Nondesignated Ports Are Blocking and Others Are
Forwarding
38Spanning Tree ProtocolSpanning Tree Port States
- Spanning-Tree Operation with Three Switches
39Spanning Tree ProtocolSpanning-Tree Recalculation
- When a network topology changes, switches must
recompute STP - Disrupts user traffic
- A switched network has converged when all switch
and bridge ports are in either forwarding or
blocking states - Forwarding ports send and receive data traffic
and BPDUs - Blocking ports receive only BPDUs
40Spanning Tree ProtocolSpanning-Tree Recalculation
41Spanning Tree ProtocolSpanning-Tree Recalculation
- Port 1/2 Fails, Resulting in STP Recalculation
42Spanning Tree ProtocolSpanning-Tree Recalculation
43Spanning Tree ProtocolRapid Spanning-Tree
Protocol
- Rapid Spanning Tree Protocol (RSTP) significantly
reduces the time to reconverge the active
topology when physical or configuration changes
occur - Defines additional port RSTP port roles
- Alternate
- Backup
- Defines port states as discarding, learning, or
forwarding
44Spanning Tree ProtocolRapid Spanning-Tree
Protocol
- RSTP Defines Five Port Roles (Backup Not Shown)
45Spanning Tree ProtocolRapid Spanning-Tree
Protocol
- RSTP provides rapid connectivity following the
failure of a switch, a switch port, or a LAN - A new root port and the designated port on the
other side of the bridge transition to forwarding
through an explicit handshake - RSTP allows switch port configuration so that the
ports can transition to forwarding directly when
the switch reinitializes
46Spanning Tree ProtocolRapid Spanning-Tree
Protocol
- RSTP (IEEE 802.1w) supercedes STP while remaining
compatible with STP - RSTP port roles
- Root a forwarding port elected for the spanning
tree topology - Designated a forwarding port elected on every
LAN segment - Alternate an alternate path to the root bridge
- Backup a backup path that provides a redundant
but less desirable path - Disabled a port with no role in spanning tree
47Spanning Tree ProtocolRapid Spanning-Tree
Protocol
- RSTP has a different set of port states
- The RSTP port state controls the forwarding and
learning processes and provides the values of
discarding, learning and forwarding - RSTP Port States
48Spanning Tree ProtocolRapid Spanning-Tree
Protocol
- In a stable topology, RSTP ensures that every
root port and designated port transitions to
forwarding - All alternate and backup ports are always in the
discarding state - STP waits passively for topology changes to
occur RSTP actively confirms a port can
transition safely without relying on a timer
configuration, uses edge ports and point-to-point
links - Results in faster convergence
49Spanning Tree ProtocolRapid Spanning-Tree
Protocol
- RSTP Incorporates the Concepts of Edge Ports and
Point-to-Point Links
50Spanning Tree ProtocolRapid Spanning-Tree
Protocol
- With edge ports, no ports directly connected to
end stations can create bridging loops - Edge ports go directly to forwarding, skipping
listening and learning states - RSTP can achieve rapid transition to forwarding
only on edge ports, new root ports and
point-to-point links - Edge ports immediately transitions to
forwarding, same as a PortFast port - Root ports if RSTP elects a new root port, it
blocks the old one and transitions the new one to
forwarding - Point-to-point links if one port connects to
another through a p-to-p link and it becomes a
designated port, a rapid transition is negotiated
with the other port
51Spanning Tree ProtocolRapid Spanning-Tree
Protocol
- The link-type variable is automatically derived
from the duplex mode of the port - A port operating in full-duplex mode is
point-to-point - A port operating in half-duplex mode is
considered shared by default - The automatic link-type setting can be overridden
with an explicit configuration
52Spanning Tree ProtocolSummary
- Redundancy is the duplication of components that
allows continued functionality despite the
failure of an individual component - In a network, this means having a backup method
to connect all devices - Network downtime is decreased because single
points of failure are reduced or eliminated
53Spanning Tree ProtocolSummary
- A redundant switched topology might cause
- Broadcast storms
- Caused by multiple hosts sending and receiving
broadcast messages - Network appears to be down or extremely slow
- Multiple frame transmission
- A router receives multiple copies of a frame from
multiple switches because of an unknown MAC
address - MAC address table instability
- If a switch incorrectly learns the MAC address of
a device on a port, it can cause a loop situation
54Spanning Tree ProtocolSummary
- Switches operate at OSI Layer 2
- Decisions are made at this level
- No TTL value is decremented
- Physical network topologies need switching or
bridging loops to provide reliability, but a
switched network cannot have loops - Solution allow physical loops but create a
loop-free logical topology
55Spanning Tree ProtocolSummary
- The loop-free topology is called a spanning tree
- Star or extended star that spans the network
- All devices are reachable
- The algorithm that creates the loop-free logical
topology is the spanning-tree algorithm - STP establishes a root node, called the root
bridge
56Spanning Tree ProtocolSummary
- STP constructs a topology that has one node for
every device on the network - Results in a tree that originates from the root
bridge - Redundant links that are not part of the shortest
path tree are blocked - A loop-free logical topology is possible because
certain paths are blocked - Data frames received on blocked links are dropped
57Spanning Tree ProtocolSummary
- Switches send messages called bridge protocol
data units (BPDUs) - Allow a loop-free logical topology to be formed
- Blocked ports continue to receive BPDUs
- BPDUs contain information that allows switches
to - Select a single switch that will act as the root
- Calculate the shortest path to the root switch
- Designate one of the switches as the designated
switch - Choose one of its ports as the root port, for
each nonroot switch - Select the ports (designated ports) that are part
of the spanning tree
58Spanning Tree ProtocolSummary
- The IEEE 802.1w standard defines RSTP
- Clarifies port states and roles
- Defines a set of link types
- Allows switches in a converged network to
generate BPDUs rather than use the root bridges
BPDUs - The STP blocking state of a port is renamed as
the discarding state - The role of a discarding port is that of an
alternate port - The discarding port can become the designated
port if the designated port of the segment fails