0% found this document useful (0 votes)
29 views42 pages

2.1 Spanning Tree Protocol

The document discusses how Spanning Tree Protocol (STP) prevents network loops by placing switch ports in forwarding or blocking states. It explains that STP elects a root switch and designates root ports and designated ports to be in the forwarding state while blocking other ports.
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)
29 views42 pages

2.1 Spanning Tree Protocol

The document discusses how Spanning Tree Protocol (STP) prevents network loops by placing switch ports in forwarding or blocking states. It explains that STP elects a root switch and designates root ports and designated ports to be in the forwarding state while blocking other ports.
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/ 42

Introduction of Spanning Tree

Protocol (STP)
Why STP?
• In a LAN, redundant links are added to improve the network
availability of LAN.
• Due to redundant links it may cause the frame to loop in the network
for an infinite time until some action is taken, e.g, some links are
taken down.
• To cope with the problem of frame looping, Spanning Tree Protocol
(STP) comes into play.
Need for Spanning Tree:
• Arvind sends a broadcast frame to LAN and as nature of switch frame
are send out from other ports (Gi0/1 & Gi0/2) except receiving port
(Fa0/3). Now, this frame goes to SW2, SW2 also broadcast frame out
of Gi0/2 and Fa0/2 ports. SW1 receives frame in its Gi0/1 ports. SW1
also broadcast frame then this frame goes to SW3 and frame
broadcasting goes on.
• Remember that this frame broadcast also occurs in other direction
from SW3 out of Gi0/1 port. Above discussed frame looping was from
SW3’s Gi0/2 ports. You can imagine the frame flooding in that small
LAN. This forever looping of frames around LAN is called Broadcast
storm.
This Looping of frames causes three problems
as stated below:
• MAC table instability – Due to looping of frame around LAN, MAC-
Table of switch get changed frequently. Looping causes incorrect
MAC-table entries resulting in incorrect frame delivery.
• Broadcast Storm – Repeated forwarding of frames around links in
LAN causes the inefficient use of links.
• Multiple Frame Transmission – A very serious negative effect of
looping is that multiple copies of same frame are delivered to host.
This process left host with confusion.
How Spanning Tree Protocol Helps?
• Spanning tree protocol prevent looping of frames around LAN by
placing ports of switch in either forwarding or blocking state.
• Interfaces (ports of switch) which are in forwarding state act as
normally but Interfaces in blocking state doesn’t process any frame
received except STP messages and other important overheads
• Blocking Interfaces doesn’t learn MAC addresses, don’t forward
frames and don’t process received frames. Now if we again consider
the above discussed scenario with SW3’s Gi0/2 interface in blocking
state.
Working of STP
• Arvind sends the frame to SW3.
• SW3 forwards frame only to Gi0/1 port as Gi0/2 port is in blocking
state.
• Now SW1 receives frame and forward to Fa0/1 and Gi0/1 interfaces.
• SW2 receives frame and forward to Fa0/2 and Gi0/1 interfaces.
• SW3 will receive the frame on Gi0/2 interface but ignores the frame
as it is in blocking state.
Working of 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 unit is a message that switches exchange
b/w them. Commonly used BPDU is Hello. It contains cost and BID
• 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.
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


Electing Root Switch :
• All switches in a LAN exchange Hello BPDU with each other. Firstly all
switches consider themselves root switches but the root switch is
selected based on the BID of a switch. A switch having a lower priority
bit in BID is a selected root switch. If the priority bit gets tied, then
the switch has a lower MAC address in Hello BPDU is the selected
root switch. In the diagram shown below, SW1 becomes the Root
switch after comparing BID from each switch in LAN
Choosing Root port on Non-root Switches :
• The ports in each switch having minimum path cost to the root switch
are chosen as the root port for that switch. In the diagram shown
below, the Gi0/1 port of both SW2 and SW3 is chosen as the Root
port (RP)
Choosing Root port on Non-root Switches :
Topology Changes in Spanning Tree Protocol
(STP)
• Spanning Tree Protocol (STP) is used to prevent loops in the network
due to redundant connections between switches in the network. It
determines an efficient path from non-root switches to root switches
with the help of Bridge Protocol Data Unit (BPDUs).
• BPDU carries information regarding topology changes within the
network to notify all the switches about the change.
BPDU
• There are two types of BPDUs that are involved in the topology
change mechanism in STP:
• Configuration BPDU: Root switch sends configuration BPDUs with set
TC (topology change) and TCA (topology change acknowledgment) bit
in flags field to notify all the switches about the topology change.
• Topology Change Notification (TCN) BPDUs: Non-root switch that
encounters topology change in the network transmits TCN BPDU to
notify root switch about topology change along with regulating the
currently used topology by the network.
Reasons for Topology Change:
• Spanning Tree Protocol activated network can encounter topology
change due to the following reasons:
1. Link failure
2. Switch failure
3. Port transitioning to the forwarding state
Topology Change Mechanism:
• Switch encounters a topology change whenever it detects link status
change on one of its interfaces due to a link or another switch failure.
After detecting topology change within the network it generates a
Topology Change Notification BPDU with all the information about
the topology that is currently being used and sends it towards the
root switch through its root port.
• Upstream switch connected with a switch that sent the TCN BPDU
through its root port will receive the BPDU and responds back sender
with Topology Change Acknowledgment (TCA) BPDU. Now, the
upstream switch that received the TCN BPDU generates its own TCN
BPDU and transmits it towards the root switch through its root port.
This process is continued until the root bridge receives TCN BPDU.
• Once, root bridge is notified about topology change, it generates a
configuration BPDU with set topology change bit and topology change
acknowledgment bit and broadcast this BPDU to the entire network so that
all the switches are notified about topology change within the network.
• TC bit in configuration BPDU sent by root instructs the non-root switches to
delete MAC address entries which increase network convergence speed
and the TCA bit informs them that the root switch is informed about
topology change and hence instructs them to stop sending TCN BPDUs.
Switches ensure no traffic is sent to host that is no longer reachable via
port by updating MAC address entries by lowering the aging time to the
same as the forward delay time and devices which communicate within
this time period are retained in the MAC address table while others are
flushed out.
What happens if a large number of Topology
Changes occur in the Network?
• Topology Change Notification BPDUs are used to notify about
topology changes in the network. So, if the topology of the network is
changed frequently then it will generate a large amount of TCN
BPDUs in the network which will lead to frequent deletion
of ARP entries and MAC entries by the devices.
• It will lead to high CPU usage and will cause instability in network
traffic. Also, frequent change in port status during topology change
cause network flapping which interrupts user traffic and reduce
network convergence.
Example -Following figure shows an STP-
activated LAN network that encounters a topology
change at one of its interfaces at switch 4.
• Switch 4 generates a TCN BPDU with information about topology
change and sends it upstream towards switch 1 (root switch) via
switch 2. Switch 2 on receiving TCN BPDU sent by switch 4 responds
with TCA BPDU and generates its own TCN BPDU and sends it to
switch 1. Switch 1 is informed about topology change as soon as it
receives TCN BPDU.
• Once, switch 1 is notified about topology change it generates a
configuration BPDU with set TC and TCA bits and floods it to all the
switches to inform them about topology change.
• Problems associated with topology change:
• If a device receives too many TCN BPDUs then its CPU usage becomes
high and the network becomes unstable due to repeated deletion of
MAC address entries.
• Frequent port status changes may lead to network flapping.
How Spanning Tree Protocol (STP) Select
Designated 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.
Steps of selecting the designated port
• The process to select the designated port is listed below:
• Select the switch with the lowest path cost: We need to select the switch
that has the lowest path cost.
• Select the designated port in the switch based on the lowest cost: There
are two ports to reach the destination. We need to select one port with the
lowest cost as the designated port and another port as the non-designated
port.
Or
Select the designated port in the switch based on the bridge ID: If the
lowest cost on two switches is the same, it selects the designated port
based on the Bridge ID. The designated port works in a forwarding state. It
forwards the data.
• Specify the other port as the Non-designated port: The root port of
the other switches is specified as NDP (Non-designated port), which is
in a non-forwarding or blocking state. It is done to avoid any loops
during the data transmission.
• Data transfer in the above diagram will be from switch3 to switch2.
• Explanation: It is because of the lowest cost. The switch2 has the
lowest Bridge ID and is thus selected as the root bridge. Among the
switches, switch3, and switch1, one needs to be selected as the
designated port and the other is selected as the non-designated port.
Since, switch3 has the lowest cost (10<18), it is selected as the
designated port made in the forwarding state. Switch1 is selected as
the non-designated port made in the blocking state.
Differences between Wireless Adhoc Networks
and Wireless Sensor Networks are as follows:
Wireless Adhoc Network Wireless Sensor Network

The medium used in wireless sensor networks is radio waves, infrared, and
The medium used in wireless ad-hoc networks is radio waves.
optical media.

Application independent network is used. The application-dependent network is used.

Hop-to-Hop routing takes place. Query-based (data-centric routing) or location-based routing takes place.

It is heterogeneous in type. It is homogeneous in type.

The traffic pattern is point-to-point. The traffic pattern is any-to-any, many-to-one, many-to-few, and one-to-many.

Wireless router is used as an inter-connecting device. Application level gateway is used as an interconnecting device.

The data rate is high. The data rate is low.

Supports common services. Supports specific applications.

Traffic triggering depends on application needs. Triggered by sensing events.


Differences between Wireless Adhoc Networks
and Wireless Sensor Networks are as follows:
Wireless Adhoc Network Wireless Sensor Network

P address is used for addressing. Local unique MAC address or spatial IP is used for addressing.

Network Type Peer-to-Peer Network type Hierarchical or Mesh

Nodes Can be any wireless device Nodes Limited to sensor nodes

Communication Range Variable depends on node placement Communication Range Limited by the sensor node’s transmission power

Communication Range Customized protocols for efficient data transfer and low
Communication Range Standard network protocols (TCP/IP)
energy consumption

Data Type General data (voice, video, files, etc.) Data Type Sensor data (temperature, humidity, light, etc.)

Power Consumption Designed to minimize energy consumption to extend


Power Consumption Can be high due to constant communication
network lifetime

Security Security protocols can be implemented Security Security protocols are critical as sensor data can be sensitive

Applications Environmental monitoring, industrial automation, home


Applications General wireless communication
automation, etc.

Deployment Typically deployed in remote or hard-to-reach locations, such as


Deployment Can be deployed in any environment
forests, oceans, or industrial sites.
Polling Mechanism In Wireless Network and
ISMA
• Polling is strictly centralized. If one terminal in wireless
communication can be heard by all others, this central terminal also
known as Base Terminal(BS) can poll all other terminals according to
some schemes like the round-robin scheme, random address scheme,
and as per reservation scheme.
Randomly Addressed Polling
• 1. The first step is the Base Station signals readiness to all mobile terminals
if not busy.
• 2. The terminals ready to send can now transmit a random number without
collision with the help of CDMA or FDMA. The random number can be seen
as a dynamic address.
• 3. The Base Station now chooses one address for polling from the list of all
random numbers. But collision occurs if two terminals choose the same
address.
• 4. The Base Station acknowledges correct packets and continues polling
the next terminal.
• 5. The cycle from step 1 to step 4 starts again after polling all terminals of
the list.
• Advantages
• Unlike in TDMA or CSMA, no slot is ever wasted.
• It provides maximum efficiency and bandwidth utilization.
• Disadvantages
• Time is wasted during polling as we have to wait for the medium to
be free to start transmission.
• Link sharing is not fair since each station has an equal probability of
winning in each round.
• Few stations might starve for sending the data.
Inhibit Sense Multiple Access(ISMA)
• ISMA is used for packet data transmission in AMPS mobile phone systems.
it is also known as Digital sense multiple Access. (DSMA)
• Working
• 1. Here the current state of the medium is signaled via a busy tone.
• 2. Base Station signals on the downlink from the base station to terminals if
the medium is free or not.
• 3. Terminals must not send if the medium is busy.
• 4. Terminals can access the medium as soon as the busy tone stops.
• 5. If collision occurs, the base station signals collision via the busy tone.
• 6. If the data has been transmitted successfully, the base station signals the
successful transmission via acknowledgments. Media access is not
coordinated within this approach.

You might also like