You are on page 1of 6

 Learning – The port is adding MAC

NETWORK addresses to the MAC address table


ADMINISTRATION (learning MAC addresses), but still not
forwarding frames yet.

Chapter 3: STP  Forwarding – The spanning tree


calculation has run and if the port is a
root port or designated port, the port
 When data travels between switches, there is no
turns green and can send and receive
TTL-equivalent in the Ethernet Layer 2 header.
data.
Frames that are sent that never reach their
destination could theoretically travel between the  Blocking – The spanning tree calculation
switches forever. has run and because the port is not a
root or designated port, the port turns
 Steps of STP
amber, does not send or receive data,
1.) Elect a root bridge. but it still listens for BPDU messages.
In the beginning, the bridge ID Note that when a switch first turns on, all
had two parts, the MAC address ports are in the blocking state by default.
and the bridge priority. By
 Rapid Spanning Tree Protocol port states
default, all switches come with
the same bridge priority (even  Discarding – no data frames are being
non-Cisco switches) so the sent out the port
deciding factor is MAC address
and by default, the lowest MAC  Learning – The port is adding MAC
address wins. addresses to the MAC address table
2.) Determine the root port (RP) on each (learning MAC addresses), but still not
non-root bridge switch. forwarding frames yet.
The LOWEST path cost back to
root switch wins.  Forwarding – The spanning tree
3.) Determine the designated port (DP) for calculation has run and if the port is a
each link between switches. root port or designated port, the port
The DP is the “talker” for the turns green and can send and receive
link. The DP port is selected data.
based on the lowest path cost
for a segment.  Spanning tree issues include slow traffic flow,
 All tie-breaking STP decisions are based on 4 slow remote connectivity to a switch in the
conditions: affected area, and increase of dropped frames.
o Lowest root Bridge ID
o Lowest Root Path Cost to Root Bridge  Techniques to fix STP issues:
o Lowest Sender Bridge ID
 Identify the VLAN or set of switches
o Lowest Sender Port ID
affected by the problem.
 With RSTP, there are two new port states.  Ensure the affected topology is known
(what specific ports are used between
 Alternate port is the backup for the two switches).
designated port when the other side is
not a root port.  Disconnect redundant links or shut the
redundant ports down, if possible.
 The backup port is the backup port for
the root port.  Restore disconnected redundant links
one by one to monitor effects on
 Spanning tree port states: spanning tree.
 Disabled – spanning tree is not enabled
3.1 STP Operation
 Listening – The port is listening to the
spanning tree messages that come Redundancy at OSI Layers 1 and 2
across as bridge protocol data units
(BPDUs). The port is NOT forwarding  Switched networks commonly have redundant
frames. paths and even redundant links between the
same two devices.
o Redundant paths eliminate a single  Backup port – (RSTP only) backup port for the
point of failure in order to improve root port.
reliability and availability.
o Redundant paths can cause physical
and logical Layer 2 Spanning Tree Algorithm: Root Path Cost
loops.
 Spanning Tree Protocol (STP) is a Layer 2  Root path cost is used to determine the role of
protocol that helps especially when there are the port and whether or not traffic is blocked. It
redundant links. can be modified with the spanning-tree cost
 Layer 2 loop issues interface command.
o Mac database instability – copies of the
same frame being received on different 802.1D BPDU Frame Format
ports.
o Broadcast storms – broadcasts are Field Description
flooded endlessly causing network Protocol Type of protocol being used; set to 0
disruption. Many broadcast frames in a ID
Layer 2 loop that use all available Version Protocol version; set to 0
bandwidth and make the network Message Type of message; set to 0
unreachable for legitimate network type
traffic. It causes a denial of service Flags Topology change (TC) bit signals a
(DoS). It can develop in seconds and topology a change; topology change
bring the network down. acknowledgment (TCA) bit used when
o Multiple frame transmission – An a configuration message with the TC bit
unknown unicast frame is when the set has been received
switch does not have the destination Root ID Root bridge information
MAC address in its MAC address table
Root path Cost of the path from the switch
and has to broadcast the frame out all
cost sending the configuration message to
ports except the port the frame was
the root bridge
received on (the ingress port) resulting
Bridge ID Includes priority, extended system ID,
to multiple copies of unicast frames
and MAC address ID of the bridge
delivered to the same destination.
sending the message
Spanning Tree Algorithm: Introduction Port ID Port number from which the BPDU was
 The Spanning Tree Protocol (STP) creates one sent
logical path through the switch network (all Message Amount of time since the root bridge
destinations on the network) that blocks age sent the configuration message
redundant paths that could cause a loop. Also, Max age When the current configuration
STP sends bridge protocol data units (BPDUs) message will be deleted
between Layer 2 devices in order to create the Hello time Time between root bridge messages
one logical path. Forward Time the bridges should wait before
delay going to a new state
Spanning Tree Algorithm: Port Roles
 Root bridge – one Layer 2 device in a switched
network.
o Lowest bridge ID (BID) becomes 802.1D BPDU Propagation and Process
root bridge
o Originally BID had two fields: bridge 1. When a switch is powered on, it assumes it is
priority and MAC address the root bridge until BPDUs are sent and STP
o Bridge priority default is 32,768 (can calculations are performed. S2 sends out
change) BPDUs.
o Lowest MAC address (if bridge
2. S3 compares its root ID with the BPDU from S2.
priority is not changed) becomes S2 is lower so S3 updates its root ID.
determinant for root bridge.
 Root port – one port on a switch that has the 3. S1 receives the same information from S2 and
lowest cost to reach the root bridge. because S1 has a lower BID, it ignores the
 Designated port – selected on a per-segment information from S2.
(each link) basis, based on the cost to get back
to root bridge for either side of the link. 4. S3 sends BPDUs out all ports indicating that S2
 Alternate port – (RSTP only) backup port for the is root bridge.
designated port when the other side is not a root
port.
5. S2 compares the info from S3 so S2 still thinks it
is root bridge.

6. S1 gets the same information from S3 (that S2 is


root bridge), but because S1 has a lower BID,
the switch ignores the information in the BPDU.

7. S1 now sends out BPDUs out all ports. The


BPDU contains information designated S1 as Characteristics of Spanning Tree Protocols
root bridge.

8. S3 compares the info from S1 so S3 now sees


that the BID from S1 is lower than its stored root STP Standard Resource Convergence Tree
bridge information which is currently showing Type s Needed Calculation
that S2 is root bridge. S3 changes the root ID to STP 802.1D Low Slow All VLANs
the information received from S1.

9. S2 compares the info from S1 so S2 now sees PVST+ Cisco High Slow Per VLAN
the BID from S1 is lower than its own BID. S2
now updates its own information showing S1 as
root bridge. RSTP 802.1w Medium Fast All VLANs

NOTE: Remember that after root bridge has


been determined, the other port roles can be Rapid Cisco Very high Fast Per VLAN
determined because those roles are determined PVST+
by total path cost back to root bridge.
MSTP 802.1s Medium or Fast Per
Extended System ID
high instance
 If priorities are all set to the default, lowest MAC
address is the determining factor in lowest BID.
Overview of PVST+
The priority value can be modified to influence
root bridge elections.
 Original 802.1D defines a common spanning
3.2 Types of Spanning Tree Protocols tree
o One spanning tree instance for the
Types of Spanning Tree Protocols switched network (no matter how many
VLANs)
STP Type Description o No load sharing
802.1D 1998 - Original STP standard o One uplink must block for all VLANs
o Low CPU utilization because only one
CST One spanning-tree instance instance of STP is used/calculated
PVST+ Cisco update to 802.1D; each VLAN  Cisco PVST+ - each VLAN has its own spanning
has its own spanning-tree instance tree instance
802.1D 2004 – Updated bridging and STP o One port can be blocking for one VLAN
standard and forwarding for another VLAN
o Can load balance
802.1w Improves convergence by adding
o Can stress the CPU if a large number of
(RSTP) new roles to ports and enhancing
BPDU exchange VLANs are used
Rapid PVST+ Cisco enhancement of RSTP using
PVST+
802.1s Multiple VLANs can have the same
(MSTP) spanning-tree instance
Port States and PVST+ Operation

Operation Blocking Listening Learnin Forwarding Disabled


Extended System ID and PVST+ Operation allowed g
 The extended system ID field ensures each
switch has a unique BID for each VLAN. Can Yes Yes Yes Yes No
 The VLAN number is added to the priority receive/proces
value. Can modify the priority number to s BPDUs
influence the root bridge decision process Can forward No No No Yes No
 Reasons to select a particular switch as root data frames
bridge received on an
o Switch is positioned such that most interface
traffic patterns flow toward this Can forward No No No Yes No
data frames
particular switch
switched from
o Switch has more processing power another
(better CPU) interface
o Switch is easier to access and Can learn MAC No No Yes Yes No
manage remotely addresses

Overview of Rapid PVST+

 Rapid PVST+ speeds up STP recalculations and


converges quicker 3.3 Spanning Tree Configuration
 Independent instance of RSTP runs for each
VLAN Catalyst 2960 Default Configuration

Feature Default Setting


RSTP BPDUs Enable state Enabled on VLAN 1
 RSTP uses type 2, version 2 BPDUs Spanning-tree mode PVST+ (Rapid PVST+ and
 A switch using RSTP can work with and MSTP are disabled)
communicate with a switch running the original Switch priority 32768
802.1D version
 BPDUs are used as a keepalive mechanism Spanning-tree port priority 128
o 3 missed BPDUs indicates lost (configurable on a per-interface basis)
connectivity
Edge Ports Spanning-tree port cost (configurable 1000 Mb/s: 4
 Has an end device connected – NEVER another on a per-interface basis) 100 Mb/s: 19
switch 10 Mb/s: 100
 Immediately goes to the forwarding state Spanning-tree VLAN port priority 128
 Use the spanning-tree portfast command (configurable on a per-VLAN basis)

Link Types Spanning-tree VLAN port cost 1000 Mb/s: 4


(configurable on a per-VLAN basis) 100 Mb/s: 19
 Point-to-Point – a port in full-duplex mode
10 Mb/s: 100
connecting from one switch to another switch or Spanning-tree timers Hello time: 2 seconds
from a device to a switch Forward-delay time: 15
 Shared – a port in half-duplex mode connecting seconds
a hub to a switch Maximum-aging time: 20
seconds
Transmit hold count: 6
BPDUs

Configuring and Verifying the Bridge ID


 Two ways to influence the root bridge
election process
o Use the spanning-tree vlan x root
primary or secondary command.
o Change the priority value by using
the spanning-tree vlan x priority x
command.
 Verify the bridge ID and root bridge election
by using the show spanning-tree command.

PortFast and BPDU Guard


 PortFast is used on ports that have end devices
attached.
o Puts a port in the forwarding state
o Allows DHCP to work properly
 BPDU Guard disables a port that has PortFast
configured on it if a BPDU is received

PVST+ Load Balancing


Expected Topology Versus Actual Topology
 Ensure that the spanning-tree topology
matches what is expected.
 Use show commands to verify STP. Do not
forget to verify load balancing.

Overview of STP Status


 Use the show spanning-tree and show
spanning-tree vlan x commands to verify the
STP status.

Spanning Tree Failure Consequences


 NEVER turn STP off; this can cause a
switched network to be unusable.

Repairing a Spanning Tree Problem


 Manually remove redundant links (physically
remove the cable OR through configuration, if
possible).
Spanning Tree Mode
o Determine and repair the cause of the
 Rapid PVST+ supports RSTP on a per-VLAN
spanning tree failure.
basis.
o If unable to determine the problem,
 The spanning-tree mode rapid-pvst puts a
switch into Rapid PVST+ mode. reinstall cables one at a time (or re-
 The spanning-tree link-type point-to-point enable the ports) to locate the issue.
interface command designates a particular port
as a point-to-point link (does not have a hub
attached). Switch Stacking Concepts
 The clear spanning-tree detected-protocols  Can connect up to nine 3750 switches
privileged mode command is used to clear STP.  One switch (the stack master) controls the
operation of the stack. If this switch goes down,
Analyzing the STP Topology a new stack master is elected
 Appears as one entity to the network. Stack is
assigned one IP address
 Each switch has a unique stack member number
o Can configure a priority value to
determine which switch is stack master
o Highest stack member priority value is
stack master
 The stack master has the saved and running
configuration files for the entire stack.
o Only one configuration file to manage
and maintain

Spanning Tree and Switch Stacks


 Each stack appears as one spanning tree
instance
 Can add switches without affecting the STP
diameter (the maximum number of switches
data must cross to connect between any two
switches)

• IEEE recommends a maximum diameter


of 7 switches for default STP timers

• Default STP timers are hello – 2


seconds, max age – 20
seconds, forward delay timer –
15 seconds

You might also like