2.1 Spanning Tree Protocol
2.1 Spanning Tree Protocol
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
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.
Hop-to-Hop routing takes place. Query-based (data-centric routing) or location-based routing takes place.
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.
P address is used for addressing. Local unique MAC address or spatial IP is used for addressing.
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.)
Security Security protocols can be implemented Security Security protocols are critical as sensor data can be sensitive