STP Summrize ١
STP Summrize ١
••
The bridge is a networking device in a computer network that is used to
connect multiple LANs to a larger LAN. In computer networks, we have
multiple networking devices such as bridges, hubs, routers, switches, etc,
each device has its own specification and is used for a particular purpose.
The bridge is a networking device that connects the larger LAN networks
with the group of smaller LAN networks.
In this article, we are going to discuss everything about the bridge including
what exactly a bridge is, and the type of bridges we have in computer
networks including transparent bridges, source routing bridges, and
translational bridges, which will be followed by advantages and
disadvantages of the bridge in networking. then how the bridge is different
from the gateway and last we will look into the applications and functions
of the bridge in the network.
Bridge in Computer Network
A bridge in a computer network is a device used to connect multiple LANs
together with a larger Local Area Network (LAN). The mechanism of
network aggregation is known as bridging. The bridge is a physical or
hardware device but operates at the OSI model’s data link layer and is also
known as a layer of two switches.
The primary responsibility of a switch is to examine the incoming traffic and
determine whether to filter or forward it. Basically, a bridge in computer
networks is used to divide network connections into sections, now each
section has a separate bandwidth and a separate collision domain. Here
bridge is used to improve network performance.
Types of Bridges
There are three types of bridges in computer networks, which are as
follows:
• Transparent Bridge: Transparent bridges are invisible to other
devices on the network. This bridge doesn’t reconfigure the
network on the addition or deletion of any station. The prime
function of the transparent bridge is to block or forward the data
according to the MAC address.
• Source Routing Bridge: Source routing bridges were developed
and designed by IBM specifically for token ring networks. The
frame’s entire route is embedded with the data frames by the
source station to perform the routing operation so that once the
frame is forwarded it must follow a specific defined path/route.
• Translational Bridge: Translational bridges convert the
received data from one networking system to another. Or it is
used to communicate or transmit data between two different
types of networking systems. Like if we are sending data from a
token ring to an Ethernet cable, the translational cable will be
used to connect both the networking system and transmit data.
Working of Bridges
Let’s see the step-by-step working of the bridge in computer networks:
• Receiving Data: The bridge gets data packets (or frames) from
both network segments A and B.
• Building a Table: It creates a table of MAC addresses by looking
at where the data is coming from to know which device is on
which segment.
• Filtering Data: If the data from network A is meant for a device
also on network A, the bridge stops it from going further.
• Forwarding Data: If the data from network A is meant for a
device on network B, the bridge sends it to the correct place on
network B.
• Repeating for Both Sides: The bridge does the same thing for
data coming from network B.
Working of Bridge
Models of Bridge in Computer Networks
There are two main models of bridging in computer network: Local
bridging and remote bridging. Let us learn about them in detail.
• Local Bridging Local bridging connects LAN switches using local
cables. This allows computers on the same Ethernet segment,
whether they’re connected to virtual hubs or physical LANs, to
communicate freely. It’s used when LANs within the same area
need to talk to each other directly at the link layer.
• Remote Bridging Remote bridging connects two bridges over a
Wide Area Network (WAN). This model is used when LANs are
located in different geographical areas and need to communicate
with each other at the link layer.
Uses of Bridge in Computer Network
• Bridges are used to increase the network capacity as they can
integrate multiple LANs together.
• On receiving a data frame, databases use the bridge to decide
whether to accept or reject the data.
• In the OSI model, it can be used to transmit the data to multiple
nodes of the network.
• Used to broadcast the data even if the MAC address or
destination address is unavailable.
• It forwards data packets despite faulty nodes.
• The data packet can be forwarded or discarded by the bridge
when the MAC address is available.
Functions of Bridges in the Network
• The bridge is used to divide LANs into multiple segments.
• To control the traffic in the network.
• It can interconnect two LANs with a similar protocols.
• It can filter the data based on destination/MAC address.
Advantages
• Bridges can be used as a network extension like they can connect
two network topologies together.
• It has a separate collision domain, which results in increased
bandwidth.
• It can create a buffer when different MAC protocols are there for
different segments.
• Highly reliable and maintainable. The network can be divided
into multiple LAN segments.
• Simple installation, no requirement of any extra hardware or
software except the bridge itself.
• Protocol transparency is higher as compared to other protocols.
Disadvantages
• Expensive as compared to hubs and repeaters.
• Slow in speed.
• Poor performance as additional processing is required to view
the MAC address of the device on the network.
• As the traffic received is in bulk or is broadcasted traffic,
individual filtering of data is not possible.
• During the broadcasting of data, the network has high broadcast
traffic and broadcast storms can be formed.
Conclusion
In computer networking, a bridge connects multiple network segments,
allowing them to function as a single network. There are several types,
including transparent, source-routing, and translation bridges, each serving
different purposes. Bridges are used to improve network performance,
reduce traffic, and extend the reach of networks. They function by filtering
traffic and forwarding data based on MAC addresses. In essence, bridges help
manage data flow in complex networks, ensuring efficient communication
and connectivity between different network sections.
••
Spanning Tree Protocol (STP) prevents the looping of the frame by putting
the interfaces of the switch in either forwarding or blocking state. How
Switch is able to decide which interface should be in forwarding or blocking
state. We’ll learn the answer to this question in this article. Before we
further proceed, we must know some terms.
• BID – It stands for Bridge ID. It is an 8-byte value unique to each
switch. The first two bytes are priority bytes and the remaining six
bytes contain the built-in MAC addresses of the switch.
• 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.
• BPDU –Bridge protocol data unitis a message that switches
exchange b/w them. Commonly used BPDU is Hello. It contains
cost and BID.
Note – We use the word “Bridge” although switches are involved because
STP was introduced before switches. Bridges were the first device to use
STP. Hence, various terms include the word “Bridge”.
In Order to choose an interface for forwarding and blocking states, STP uses
three criteria:
• Selection of root switch. All of its interfaces are in a forwarding
state.
• All other non-root switches make a root port. And root port is the
port whose path cost to the root switch is minimum. All root ports
are placed in a forwarding state.
• The least path cost from each switch to the root switch is called
that switch’s root cost. And among all switches, the switch whose
root cost is minimum becomes the designated switch. The Port of
the designated switch from which root cost is calculated becomes
the designated port(DP). DP is placed in a forwarding state.
••
Redundant links are used to provide a backup path when one link goes
down but a Redundant link can sometimes cause switching loops. The
main purpose of Spanning Tree Protocol (STP) is to ensure that you do
not create loops when you have redundant paths in your network.
Spanning Tree Protocol (STP) –
As IEEE STP is used to make a loop-free network by monitoring the
network to track all the links and shut down the redundant ones. These
are some important terms related to Spanning Tree Protocol:
10 Mbps 100
100 Mbps 19
1 Gbps 4
10 Gbps 2
Designated port – The port which sends the best BPDU i.e ports on the
root bridge will be in a forwarding state.
Root port – The port which receives the best BPDU on a non-root
bridge. Criteria for selecting root port:
••
Spanning tree protocol is a type of communication protocol that
functions to build a loop-free topology, which means the arrangement of
elements in a computer network. STP commonly works for layer-
2 bridges and switches. It also provides a backup link for the network
system if the active link fails. Layer-2 devices send the data in the form of
frames.
The root port of each bridge forms a part of the spanning tree. The ports
selected by the spanning tree are the best ports to reach the root bridge,
which is also known as the destination port. It means that every switch
or bridge has only one root port. If any other switch does not have any
root port, it selects one designated port and the other as non-designated
ports. The designated port will be considered as the ports in forwarding
state, while others in blocking state.
STP enables a single port of a node and disables all other ports. It means
that it allows only one active path for transmission between the two
nodes. The port selected by the STP is named the root port, which sends
data to the root bridge. The root bridge receives all the data from
different bridges.
The cost of the port, port priority, and switch ID determines the path
for the destination. If the cost of the port and the switch ID is the lowest,
it becomes the path for the destination.
••
Prerequisite – Spanning Tree Protocol
Spanning Tree Protocol (STP) is used to make a loop free network by
monitoring the network to track all the links and shut down the least
redundant ones.
Root bridge is a switch in a single VLAN or whole topology (according to
the type of STP standard used) which is responsible for distributing BPDUs
and block the least redundant port.
Election procedure (root bridge) –
All the switches in the network declare themselves as root bridge and start
exchanging their own BPDUs. The BPDU with the lowest bridge I’d will be
considered as superior. Now the switch receiving the superior BPDU make
changes in its own BPDU and carry forward to its neighbour switches. It
changes the value of root Bridge I’d with its superior BPDU bridge I’d. This
process goes on until all the switches are satisfied with which bridge have
the lowest bridge I’d and hence that switch will be declared as root bridge.
Types of Spanning Tree Protocol (STP) –
1. 802.1D – This is also known as CST (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:
• 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.
••
RSTP is the more improved and advanced version of STP which is a layer 2
protocol that prevents bridge loops and broadcast storms in local
networks with redundant connections. Rapid spanning tree protocol has
faster convergence and it is also backward-compatible with STP. To make
sure a loop-free topology, the Rapid Spanning Tree Protocol (RSTP)
precludes some of the connections which permit only a single active path
between any two devices. All these disabled connections can be used as
backup paths in case an active connection fails. The IEEE standard for
Rapid spanning tree protocol is 802.1w.
Similarities between STP and RSTP:
• In both STP and RSTP bridge with the lowest Bridge ID is elected
as Root Bridge.
• BPDUs in both STP and RSTP are forwarded between switches.
• Roots and designated ports are elected in the same manner as
they are elected in STP and their functionality is also identical to
that of STP.
Working of RSTP
RSTP follows a strict set of rules by which the switches decide the best
way to forward the traffic on the network free from any redundancy.
When RSPT is enabled on a network, the spanning tree algorithm decides
the configuration of the spanning tree automatically.
The topmost bridge of the spanning tree is the Root bridge in RSTP and it
is in charge of sending all the network topology information to other
switches present in the network. This plays an important role when
hardware failures occur, or some other topology changes occur. So, the
most efficient alternate paths are established without any delay.
Port Roles in RSTP
There are four-port roles in RSTP
1. Root Port: The port with the best path cost is elected as the root
port. A non-root bridge can only have one root port. Root ports
forward data to the bridge.
2. Designated Port: It is a non-root port that is used as a
forwarding port for every LAN segment.
3. Backup Port: It is a backup path to a segment where another
bridge port is already connected. These ports receive BPDUs
from their switches but they remain in a blocked state.
4. Alternate Port: It is a Backup port with a less desirable path
cost. All such ports remain in a blocked state.
Port States in RSTP
Rapid spanning tree protocol supports three port states.
1. Discarding: In the discarding state, no user data is sent over the
port.
2. Learning: In the learning state the ports learn about the MAC
address but it doesn’t forward any frames.
3. Forwarding: In the forwarding state the ports can send data and
are fully operational.
Working of Port States:
At first, a switch port starts in a discarding state, a discarding port does not
forward any frames nor does it learn MAC addresses, and it also listens for
BPDUs. Backup and alternate ports remain discarding.
In RSTP if a port is elected as a Root port or Designated port, the transition
will directly take place from a discarding state to a learning state. Hence,
RSTP doesn’t need a listening state. A learning port adds MAC addresses
into the Content addressable memory table; However, it can not forward
frames.
In the next phase, a learning port transitions into a forwarding state. A
forwarding port is completely functional i.e., it learns MAC addresses,
sends and listens for BPDUs, and forwards frames.
Benefits of RSTP:
• Prevents network loops.
• Prevents redundancy.
• Faster Convergence.
• Backward compatible with STP.
• Every switch generates BPDU and sends them out at the hello
interval.
• Switches don’t need artificial forward delay timers.
In STP BPDUs are generated only by the root bridge. If a non-root bridge
receives a BPDU from the root bridge on its root port, it will pass on the
BPDU downstream to its neighbors. This Convergence process is slower
and STP relies on forwarding delay timers to make sure a loop-free
environment, this takes a lot of time.
In RSTP, switches just handshake directly with their neighboring switches,
this allows quick synchronization in the topology. This lets ports promptly
change from a discarding state to a forwarding state without a delay timer.
Types of ports in RSTP
There are three types of ports in RSTP
1. Edge: It is a port that connects to a host.
2. Root: It is a port that connects to another switch, and it has the
best path cost to the root bridge.
3. Point-to-point: It is a port that connects to another switch and it
has the potential of becoming the designated port for a segment.
RSTP algorithm
RSTP algorithm follows some general steps:
• Determining root bridge: The switch with the lowest bridge
priority is elected as the root bridge. In the case of a tie, a
tiebreaker based on the MAC address is used to decide the root
bridge i.e., the switch with the lowest MAC address is elected as
the root bridge.
• All root bridge interfaces are put in forwarding state: In the
forwarding state, all the ports learn MAC addresses, and also
send and receive data.
• All non-root switches select a root port: Based on root cost the
root port is the best path to the root bridge. There is only one
root port in a non-root switch.
• Selecting designated port: these ports are allowed to forward
traffic and they are selected based on port cost. All leftover root
bridge ports are designated ports.
• Rest of the ports in blocking state: these ports do not pass any
data to other switches and they also don’t learn MAC addresses.
Configuring Spanning Tree Protocol Portfast
Last Updated : 31 Mar, 2022
••
Spanning Tree Protocol is a data link layer or layer-2 protocol whose prime
objective is to prevent loops in the different network configurations or
network topologies. It tracks all the links and closes the redundant ones. It
uses the spanning tree algorithm(STA) to create a topology database and
then search out the redundant links to disable them.
Election of Root Bridge, Root Port, and Forwarding Port (After STP)
In the above topology, the first root bridge is elected. Since all bridges
have the same priority, the MAC address is the tiebreaker to elect the root
bridge. Since Switch1 has the lowest bridge ID, it is elected as Root
Bridge. Now, apart from the root bridge rest, all bridges have to find the
root port. Looking at the cost of each link it’s clear that Switch2 and
Switch3 use directly connected links as root ports (mentioned as RP). If
Switch2 chooses a path via Switch3 to Root Bridge then the total cost
would be 4 + 4 = 8. Hence it is rejected. Every port on the root bridge is a
forwarding port(mentioned as F).
Now the only thing left is to choose the one forwarding port on the
segment between Switch2 and Switch3. So based on the bridge ID, the
port with the best and lowest(here Switch2) would become the only
bridge forwarding on that segment, with the one having the highest
Bridge ID (here Switch3) put into blocking mode (mentioned with a
cross).
Port Fast:
For STP to converge it takes about 50 seconds i.e. to identify root bridge,
root ports, blocking the port, and transition of designated to forwarding
port, all these things take about 50 seconds. Now if you don’t wish to wait
that long and you are absolutely sure that your topology is loop-free(and
will be) you may use the feature of PortFast which is a Cisco proprietary
extension to the 802.1d standard. By using PortFast the ports will
transition from blocking to the forwarding state immediately. If you have
a server or other devices connected to a port, you may take the help of
this feature.
Access Port: Any switch port that allows traffic of only a single VLAN is
known as an access port and it belongs to that VLAN. e.g. Consider a port
f0/0 that is connected to the finance department then it will be
configured in such a way that only traffic belonging to the finance
department will flow through that port.
Trunk Port: This term trunk port is inspired by the telephone system
trunks wherein multiple telephone conversations are carried out at a
time. Similarly, trunk ports in switches carry traffic of multiple VLANs at
a time. Hence the bandwidth of any trunk port is usually far more than
any access port – mostly in 100s, 1000s, or even 10000s of Mbps!
Resetting PortFast: