0% found this document useful (0 votes)
25 views7 pages

13 - STP

The document explains the Spanning Tree Protocol (STP), which is used to prevent loops in redundant network topologies that can cause broadcast storms. STP operates by electing a root bridge, selecting root ports for non-root bridges, and designating ports for traffic forwarding, ensuring only one active path exists at a time. It also outlines various STP types, port roles, states, and the PortFast feature to optimize network performance by allowing immediate forwarding for certain connections.

Uploaded by

almaansaleem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views7 pages

13 - STP

The document explains the Spanning Tree Protocol (STP), which is used to prevent loops in redundant network topologies that can cause broadcast storms. STP operates by electing a root bridge, selecting root ports for non-root bridges, and designating ports for traffic forwarding, ensuring only one active path exists at a time. It also outlines various STP types, port roles, states, and the PortFast feature to optimize network performance by allowing immediate forwarding for certain connections.

Uploaded by

almaansaleem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

STP (Spanning tree protocol)

Single point of failure network doesn’t provide redundancy. If cable is cut entire network will down.

To resolve this Single point of failure network problem, we need to connect one more cable
between switches. Now we have redundancy in our network, but the problem is loop in our
network. Redundant network brings loops in our switched network.

Issues in redundant topologies-

1- Continuous frame duplicate


2- Multiple frame transmission
3- MAC database instability

These problems occur broadcast storm in network. Broadcast can consume bandwidth and block
transmission of other packets. This situation results in a broadcast storm.
The solution to prevent layer 2 loops is STP (Spanning tree protocol).

• It is enabled by default on cisco catalyst switches


• It is open standard protocol known by 802.1D
• It uses BPDU (Bridge protocol data unite) between switches
• It sends BPDU in every 2 seconds

STP behaves in the following way:

• STP uses bridge protocol data units (BPDUs) for communication between switches.
• STP forces certain ports into a blocked state so that they do not listen to, forward, or flood
data frames. The overall effect is that only one path to each network segment is active at
any time.
• If there is a connectivity problem with any active network segment, STP activates a
previously inactive path, if one exists (changing the blocked port to the forwarding state).

How Spanning Tree Protocol (STP) works

STP must perform three steps to provide a loop-free network topology:

1. Elects one root bridge


2. Select one root port per nonroot bridge
3. Select one designated port on each network segment

1. Elects one root bridge

In redundant topology all switches send BPDU (Bridge protocol data unit) and elect root bridge.

BPDU (Bridge protocol data unit)- BPDU is just type of data send to elect Root bridge between
switches.
Switches compares Priority and MAC address Lowest priority elect Root bridge if priority tie lowest
MAC address elect root bridge.

Note- By default Priority is 32768

Root Bridge- The root bridge is the logical centre of the spanning tree topology.

In this topology switch 1 has lowest MAC address won the election and elected as root bridge. Other
switches elected as a non-root bridge.
Root bridge is having Designated port and non-root switches is having root ports or designated port.
To block one port switches does election again between non-root switches if switches cost is equal.
Lowest priority and lowest MAC address win the election and the other switches block the port.

In my example switch B and Switch C is having same interfaces that’s why switch B has won this
battle and put designated port. Switch C block its one port. Block port doesn’t forward frame and
doesn’t manipulate MAC address table. Whenever physical topology changes block (alternate port)
up and forward frame.

The root path cost is used to elect root port. There are by default interfaces cost. Lower cost
becomes the root port.

Link Cost (Revised IEEE Cost (Previous IEEE


Speed Specification) Specification)

10 Gbps 2 1

1 Gbps 4 1

100 Mbps 19 10
10 Mbps 100 100

2. Select one root port per nonroot bridge

Root port is the port that is closest to the root bridge, which means it is the port that
receiving the lowest-cost BPDU from the root.

Every non-root bridge must have a root port. All root ports are placed in forwarding state.

In the below example, if we suppose the upper link (between two fa0/0 interfaces) are 10Mbps
and the lower link (between two fa0/1 interfaces) is 100Mbps link then fa0/1 of SwA will become
root port as it has lower cost than fa0/0 (cost 19 < cost 100).

3. Select one designated port on each network segment

STP selects one designated port per segment to forward traffic. Other switch ports on the segment
typically become nondesignated ports and are blocked. Therefore, interface fa0/0 of SwA will
become nondesignated port (blocking state). In blocking state, although switches cannot send
data traffic but can still receive BPDUs.

STP ports roles-

Port role Description

Root port This port exists on non-root switches, best path to root bridge, forward data
traffic toward root bridge and populate the MAC address table.

Designated This port exists on root bridge, root bridges, all ports are Designated port, data
port traffic receive and forward, populate the MAC address table.

Non- This port is in blocking state doesn’t receive and transmit data frame and
Designated doesn’t populate the MAC address but still receive BPDU.
port

Disable port The disable port is a switchport that is shut down.

STP ports states-

When STP is enabled, every switch in the network goes through the blocking state and the
transitory states of listening and learning. The ports then stabilize to the forwarding or blocking
state.
State Can forward data? Learn MAC? Timer

Blocking No No Max Age (20 sec)

Listening No No Forward Delay (15 sec)

Learning No Yes Forward Delay (15 sec)

Forwarding Yes Yes

Types of Spanning tree protocols

Several varieties of spanning tree protocol given below

STP Description
flavours

CST Common spanning tree protocol is legacy protocol that provides loop free network in
802.1D VLAN 1

PVSTP+ Per VLAN spanning tree protocol 802.1D, that provides separate VLANs Root bridge
for each VLAN.

RSTP Rapid fast spanning tree protocol is open standard that provides fast convergence of
802.1w STP

Rapid Rapid PVSTP+ 801.1w, that provides separate VLANs root bridge for each VLANs
PVSTP+

802.1w

MSTP Multiple Spanning tree protocol. MSTP maps multiple VLANs into the same spanning tree
instance.

Note- STP and RSTP is compatible to each protocol.

Comparison of Spanning tree protocols

Protocol Standard Resources Needed Convergence Number of Trees

STP 802.1D Low Slow One


PVST+ Cisco High Slow One for every VLAN
RSTP 802.1w Medium Fast One
Rapid PVST+ 802.1w Very high Fast One for every VLAN
MSTP 802.1s Medium or high Fast One for multiple
VLANs

PortFast-

Switches sends BPDU every 2 seconds and takes 50 seconds. That is not good for real network.
Whenever switches are connected with PCs, servers we don’t need BPDU we need port mode must
be forward mode.
PortFast is a command that set switch port immediately in forward mode and skip listening and
learning mode.

Note- If a switch's port is enabled as a PortFast and it receives BPDU Frame, The BPDU effectively
disable that port PortFast configuration and topology occurs a loop network.

You might also like