Spanning Tree Protocol

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 22

SPANNING TREE

PROTOCOL
WHAT IS STP
• Spanning Tree Protocol (STP) is a Layer 2 network protocol used to
prevent looping within a network topology
• . STP was created to avoid the problems that arise when computers
exchange data on a local area network (LAN) that contains redundant
paths.
• AND SOME OF THESE PROBLEMS ARE REDUNDANT LINKS ,
BROADCAST STORMS, NETWORK CONGESTION AND DATA
REDUNDANCY
• IT IS Based on an algorithm created by American computer scientist 
Radia Perlman
Why do we need STP?

•We need STP to prevent loops in a network topology that can


cause network problems such as broadcast storms, network
congestion, and other issues.
• STP ensures a loop-free network topology by selecting a root
bridge and calculating the shortest path to the root bridge for
each network device.
• It then blocks redundant links that would create a loop and
activates them if the active link fails.
.

• STP can help prevent bridge looping on LANs that include redundant links.
Without STP, it would be difficult to implement that redundancy and still
avoid network looping. STP monitors all network links, identifies redundant
connections and disables the ports that can lead to looping.
•STP blocks some ports on switches with redundant links to prevent broadcast
storms and ensure a loop-free logical topology. With STP in place, you can
have redundant links between switches in order to provide redundancy.
•A broadcast storm is an abnormally high number of broadcast packets within
a short period of time. They can overwhelm switches and endpoints as they
struggle to keep up with processing the flood of packets.
•Network congestion occurs when a network is overrun with more data packet
•traffic than it can cope with. This backup of data traffic occurs when too many
communication and data requests are made at the same time, over a network
that doesn't have enough network bandwidth to carry it.
How a Spanning Tree Protocol (STP) works
• Spanning Tree Protocol (STP) prevents the looping of the frame by putting the
interfaces of the switch in either forwarding or blocking state.
• For us to continue we must know some terms first

• BID-is the Bridge ID. A 8 byte number unique to each switch


- It has the Priority byte (first 2bytes) and the remaining six bytes contain the
built-in MAC addresses of the switch.
• BPDU-it is the Bridge Protocol Data Unit
-It contains cost and BID.
• Path Cost – It is a numeric value given to link between two interfaces based on the
speed of the interface. The higher the link speed, the lower will be the cost.
Cont.…..
• If S1 wants to send data to S2 it can use
the direct route to S2 or it can either send
the data through S3 then S2
• STP will help S1 understand the best
route to send data through by blocking a
particular port
• STP will block the alternate root and
allow communications via the primary
route
• For example S1 will not be able to send
data directly to S2 but will have to use S3
route i.e. the Route Bridge
CRITERIA OF STP

•The Spanning Tree Protocol criteria is based around the


establishment of the Root bridge and root port
• Route Bridge
• A centralized switch which decides the best route to send data in a
network
• All switches will send data to the route bridge and the bridge will
forward the data to the destination
• In a root bridge all the ports will be opened to forwarding any
incoming data and none of the ports are blocked
Identifying Root Bridge
• Because each STP switch initially believes it's the root bridge, it sends
out STP configuration Bridge Protocol Data Units (BPDUs) with
information based on this assumption.
• The switches will then compare the Bridge ID’s and determine the
route bridge
• The Switch with the lowest Priority value will be the root bridge if and
only if the Priority values are not the same.
• If the Priority values are the same, the MAC address will be put into
consideration. Now the switch with the lowest Mac address will be
the route bridge
Root Port
• It a physical port of a switch connected to the shortest path to reach
the root bridge
• It is also called the designated port
•  The switch with the lowest path cost will become the designated
switch for that segment.
• When a tie occurs in STP, it goes on and checks the Bridge ID’s of the
switches and the port with the lowest Bridge Id will be the root port
Characterization of ports STP states

All ports of the root switch Forwarding state

Root port of the non-root switch Forwarding state

Designated ports Forwarding state

All other working ports Blocking state


Bridge Protocol Data Units
• The Bridge Protocol Data Units (BPDU) are messages that are sent between switches in a network to
detect loops in the topology and prevent network loops from occurring. BPDU messages are sent
using the Spanning Tree Protocol (STP) and its variants, such as Rapid Spanning Tree Protocol (RSTP)
and Multiple Spanning Tree Protocol (MSTP).

• BPDU messages contain information such as the switch's identity, the port on which the message was
sent, and the cost of sending data through that port. The cost is used by the STP algorithm to
determine the shortest path to the root bridge in the network and to prevent loops from forming.

• BPDU messages are also used to elect a root bridge in the network. The root bridge is the switch that
has the lowest bridge ID, and it is responsible for forwarding all traffic in the network. All other
switches in the network determine their position relative to the root bridge based on the information
in the BPDU messages they receive.

• By exchanging BPDU messages, switches in the network are able to create a loop-free topology and
ensure the efficient forwarding of traffic.
Cont…..
• In addition to detecting loops and electing a root bridge, BPDU messages also play a role in detecting
and handling failures in the network. When a switch detects a failure or a change in the network
topology, it sends out BPDU messages to inform other switches of the change. This triggers the STP
algorithm to re-calculate the shortest path to the root bridge and reconfigure the network accordingly.

• BPDU messages also help prevent network disruptions caused by the insertion of unauthorized switches
or devices into the network. When a switch receives a BPDU message from another switch, it can verify
the identity of the sending switch using the bridge ID and other information in the message. If the
sending switch is not authorized to be part of the network, the receiving switch can take action to block
its ports and prevent it from causing disruptions.

• Overall, BPDU messages are a critical component of network infrastructure that help ensure the
stability, reliability, and security of network operations. They enable switches to communicate with each
other, detect and prevent network loops, elect a root bridge, and respond to changes and failures in the
network topology.
CONT.
• BPDU is a message used by switches to exchange information
about the network topology and to negotiate which links should
be active or blocked to prevent loops. It contains information
such as the switch ID, priority, and path cost to the root bridge.
• BPDUs are a critical component of STP and are used by
switches to communicate with each other to create a loop-free
network topology.
Types of STP
There are several types of STP, including:
The original version of STP.
•Rapid Spanning Tree Protocol (RSTP): A faster version of STP that provides faster convergence
times.
•Multiple Spanning Tree Protocol (MSTP): A version of STP that allows multiple spanning trees to be
created, each with its own root bridge.
•Criteria for Spanning Tree:
•The criteria for Spanning Tree include:
•Creating a loop-free network topology.
•Selecting a root bridge as the main reference point for the network topology.
•Selecting the shortest path to the root bridge for each network device.
•Blocking redundant links that would create a loop and activating them if the active link fails.
802.1D(common spanning tree)
• It is a spanning tree standard developed by IEEE which elects only
one root bridge per whole topology. All the traffic flows over the
same path (the best path to the root bridge) but this doesn’t hold
good always as there can be scenarios in which the optimised path to
reach a VLAN is different than the path obtained on electing the root
bridge. It is very slow as it takes 32 seconds to converge.
ADVANTAGES AND DISADVANTAGES
Advantages:

• Less CPU and memory required.


Disadvantages:

• Lesser optimisation as the path calculated as the best cost to root


bridge might not be the best path to reach a network.

• No load balancing.
Per VLAN Spanning Tree + (PVST+)
• It is a spanning tree standard developed by Cisco for its devices which
finds the root bridge per VLAN. It is a Cisco default version of STP. It
finds separate 802.1d spanning tree instance for each VLAN. It also
provides backward comparability with 802.1d or CST. This is more
optimized to the IEEE because it provides optimal path selection as
separate instance of STP per VLAN is find. This is as slow as CST
ADVANTAGES AND DISADVANTAGES

• Advantages:

• PVST+ provides more optimization on the performance of a network than CST as it selects root bridges per
VLAN.

• Bandwidth consumption is lesser than CST.

• Optimum load balancing is achieved.
• Disadvantages:

• This is slow as CST i.e. convergence time is slow. By default, Cisco switches take 50 seconds for converging.
• More resources (CPU and memory) is required.
802.1w – Rapid Spanning Tree Protocol
(RSTP)
• It is a spanning standard developed by IEEE which provides faster
convergence than CST but holds the same idea of finding a single root
bridge in the topology. The bridge resources needed in RSTP is higher
than CST but less than PVST+
ADVANTAGES
Advantages:

• Prevents network loops.


• Prevents redundancy.
• Faster Convergence.
• Backward compatible with STP.
Rapid Per VLAN Spanning Tree + (RPVST+)
• This Spanning Tree standard is developed by Cisco which provides
faster convergence than PVST+ and finds separate instance of 802.1w
per VLAN. It requires much more CPU and memory than other STP
standards.
Stages of STP Protocol

•The STP Protocol has three stages:


•Blocking: Switches do not forward data frames on blocked ports.
•Listening: Switches listen for BPDUs and negotiate with other switches to determine the network
topology.
•Forwarding: Switches forward data frames on forwarding ports. 

You might also like