0% found this document useful (0 votes)
62 views

Spanning Tree Protocol

Spanning Tree Protocol (STP) is used to prevent switching loops from forming when there are multiple active paths between switches. It works by selecting one switch as the root bridge and designating the shortest path from each switch to the root as the root port. STP then selects designated ports and blocks all other ports to prevent redundant links from causing loops. The root bridge is elected based on priority and MAC address, with the switch having the lowest priority and MAC address becoming the root. STP assigns port states including blocking, listening, learning, and forwarding to manage traffic flow and convergence when the network topology changes.

Uploaded by

Vijay Goswami
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Spanning Tree Protocol

Spanning Tree Protocol (STP) is used to prevent switching loops from forming when there are multiple active paths between switches. It works by selecting one switch as the root bridge and designating the shortest path from each switch to the root as the root port. STP then selects designated ports and blocks all other ports to prevent redundant links from causing loops. The root bridge is elected based on priority and MAC address, with the switch having the lowest priority and MAC address becoming the root. STP assigns port states including blocking, listening, learning, and forwarding to manage traffic flow and convergence when the network topology changes.

Uploaded by

Vijay Goswami
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Spanning Tree Protocol Document Ver 1 00

1. WHAT IS NEED OF SPANNING TREE PROTOCOL?

For backup purposes, we usually create redundant links. A redundant link


is an additional link that we create as the backup link of the primary link.
If the primary link fails, the redundant link prevents the network from
getting down due to the primary link failure.

The redundant or backup link is helpful only when the primary link fails.
Until the primary link is functioning, the backup link should be disabled. If
both the primary and backup links are active at the same time, they will
create a switching loop.

1.1 How Does Switch works

Generally when Switch is started MAC address Table is empty. If any


device wants to send data to other device then it sends frame to switch.
Switch then checks its source address and confirms whether MAC table
has source address or not? If it’s not there then it makes entry of address
with port detail this is known as learning address. After that it checks if
destination port address is there in MAC table or not if it’s not there then
switch floods that frame to all the ports saying which port has this
address so that port have destination MAC address device may receive the
same.

But if any broadcast message it sent by any device to the switch then
switch broadcasts same to all ports except the port from which frame is
sent. In this way other switch connected to it receives broadcast message
and then they also broadcast the same which creates an endless loop and
hence it creates Broadcast Storm. This may consume lots of network
bandwidth which may disturb whole network. But id instead of redundant
link only single link between switches are there then this storm will not
be created.

To overcome this problem protocol like Spanning Tree protocol is used.


Spanning Tree Protocol (STP) is a Layer 2 protocol that runs on bridges
and switches. The specification for STP is IEEE 802.1D. The main purpose
of STP is to ensure that you do not create loops when you have redundant
paths in your network.
Spanning Tree Protocol Document Ver 1 00

2. HOW DOES STP WORKS

Spanning Tree Protocol will take 3 Basic steps:


1. It selects one Switch as Root Bridge.
2. It chooses the shortest path from switch to the root bridge as Root
port.
3. After that designated ports are selected and then all remaining port
will be selected as blocking port.
4. It blocks links which can cause loops while maintain these links as
backup

As shown in above example four switches A, B, C & D are inter connected


in a network. A is elected Root Bridge on the basis of lowest Bridge ID.
Election of Root Bridge will be explained separately.

On the basis of link Type connectivity between devices path cost is


assigned. For how much bandwidth what value to be given, its chart is
mentioned below.

Path Cost
Spanning Tree Protocol Document Ver 1 00

Post Root Bridge election, as shown in below diag. port status will be
updated and that will be done on the basis of shortest path (on the basis
of cost) to the Root Bridge for each switch, these will be root port. Next is
to assign designated ports and then remaining all ports will be as blocking
ports.
 Root Port(RP): Shortest Path to the Root Bridge and forwards all
packet
 Designated Port (DP): The designated port is a port that is sending
lowest cost path onto a segment, it forwards all Packet
 Blocked Port (BP): Does not send and receive packet

Once port status is updated then it blocks the redundant link towards
Root Bridge. Hence Redundant Link is logically inactive which avoids
loop.
Spanning Tree Protocol Document Ver 1 00

But suppose after some time any link gets damaged as shown in
below diag. then again STP will run and blocked port may get
active and data may start transferring from other route.
Spanning Tree Protocol Document Ver 1 00

3. ROOT BRIDGE ELECTION


The first step in the STP convergence process is electing a Root Bridge,
which is the central reference point for the STP topology.

All switches keep on sending BPDU packet which contains information


regarding switch at every 2 sec. A Root Bridge is elected based on its
Bridge ID (below fig), comprised of two components in the original
802.1D standard:
 16-bit Bridge priority
 48-bit MAC address

The default priority of switch is 32,768, and the lowest priority wins. If
there is a tie in priority, the lowest MAC address is used as the tie-breaker.
In this way Root Bridge is selected.

Below image shows how if priority of all switches are same then on the
basis of lowest MAC ID Root Bridge is decided. In below fig A has the
lowest MAC ID hence it is selected as Root Bridge.

.
Spanning Tree Protocol Document Ver 1 00

Once Root Bridge is elected, Root port will be assigned then designated
ports will be assigned after that all other ports will be assigned as
Blocking ports.
Spanning Tree Protocol Document Ver 1 00

4. PORT SATES IN STP


1. Blocking State (20 sec)
2. Listening State (15 sec)
3. Learning State (15 sec)
4. Forwarding State
5. Disable State

4.1 In Blocking State:

 Discards frames received from the attached network segment.


 Discards frames switched from another port for forwarding.
 Does not incorporate a host location into its address database;
because there is no learning at this point, there is no address
database to update.
 Receives BPDUs from the network segment and directs them to the
switch system module for processing.
 Unlike ports in the listening, learning, and forwarding state, a port
in the blocking state does not process BPDUs received from the
switch system module.
 Receives and responds to network management messages, such as
a network administrator disabling the port.

After 20 seconds, the switch port moves from the blocking


state to the listening state.

4.2 Listening State

 Discards frames received from the attached network segment.


 Discards frames switched from another port for forwarding.
 Receives BPDUs from the network segment and directs them to
the switch system module for processing.
 Processes BPDUs received from the switch system module.
 Receives and responds to network management messages,
such as a network administrator disabling the port.

After 15 seconds, the switch port moves from the listening


state to the learning state.

4.3 Learning State

 Discards frames received from the attached network segment.


 Discards frames switched from another port for forwarding.
Spanning Tree Protocol Document Ver 1 00

 Incorporates LAN host location information into its address


database.
 Receives BPDUs from the network segment and directs them to
the switch system module for processing.
 Receives, processes, and transmits BPDUs received from the
system module.
 Receives and responds to network management messages,
such as a network administrator disabling the port.

After 15 seconds, the switch port moves from the learning


state to the forwarding state.

4.4 Forwarding state

 Forwards frames received from the attached network segment.


 Forwards frames switched from another port for forwarding.
 Incorporates LAN host location information into its address
database.
 Receives BPDUs from the network segment and directs them to
the switch system module for processing.
 Processes BPDUs received from the switch system module.
 Receives and responds to network management messages,
such as a network administrator disabling the port.

A port stays in the forwarding state until a change occurs in the


network topology, such as the addition of a new bridge or switch, a
new bridge or switch port, or the failure of a bridge, switch, or port.
When a change in the topology is detected, all switches recomputed
the network topology; this process is called convergence.

Conclusion: This STP is used in CCTV for ring topology for fault
tolerance, when single device fails other route converges and
network does not fail.

You might also like