Jan 30, 2010

Spanning tree protocol

  • Most of the industries depend on the performance of the Ethernet networks.
  • What would happen if the network failures?
  • Reasons of the failure?
  • Cable redundancy is tried by configuring the network in either ring or parallel branches.
  • Redundancy networks.


  • If first cable fails second cable will take over. smile_regular

Fault tolerance through Redundancy

Switch is used to connect two networks or segments


Disadvantages of the Redundancy networks.

-- Broadcast storms

-- Multi frame copies

-- MAC address table instability

-- Loops

Switch MAC address table building

Switches/Bridges will learn the hosts location based on the Source address in the receiving frames.

Switches will broadcast

-- Unknown unicast frames

-- Broadcast frames

-- Multi cast frames

MAC address database instability

In a redundant switched N/W it is possible for switches to learn wrong information.

Host X sends a frame direct to router Y.

Initially switches will learn the MAC address of host X on their port 0.


Multi Frame copies

Host X sends a unicast frame to Router Y.


The solution is “to allow physical loops” but “to create a logical loop free topology”.

The idea of connecting networks in redundant way is ?

The only disadvantage is Loops, how it would be if we can disable the loops??

How to disable the loops???

Note: Redundancy eliminates a single point of hardware failure in a network. Whenever switch redundancy is present in a network, there is a loop. smile_regular

Spanning tree protocol
  • STP is a link management protocol for MAC bridges.
  • It is defined in IEEE 802.1D standard.
  • STP provides path redundancy while preventing undesired active loops in a N/W.
  • STP allows only one active path at a time between any two network devices (this prevents the loops) but establishes the redundant links as a backup if the initial link fails.
  • The logical loop free topology created is called a tree.
  • This tree is called a spanning tree because all the switches in the network are reachable or spanned.
  • The algorithm used to create this loop free topology is “spanning tree algorithm”.

How does STP works?

  • In a STP bridged environment, the switches exchange information amongst themselves using a layer 2 frame called bridge protocol data units (BPDU).
  • STP software will elect a root bridge.
  • Once the root bridge is delegated, it will then calculate all redundant paths from the lower bridges back to itself.
  • Each port on every bridge in the STP tree will be assigned a weighted metric called a path cost.
  • The path cost is used to determine which port provides the best path for data flow.

STP Algorithm

  • STP establishes a root node called root bridge.
  • STP constructs a topology that has one path to reach every network node.
  • Resulting tree originates from the root bridge.
  • Redundant links that are not part of the shortest path tree are blocked.
  • As certain paths are blocked loop free topology is possible.
  • Basically links that will cause a loop are put into a blocking state. BPDU continue to be received on blocked ports.
  • STA chooses a reference point called root bridge and then determines the available paths to that reference point.
  • If more than one path exists, STA picks up the best path and blocks the rest.
  • Loop free topology calculations makes extensive use of two components.
    • Bridge ID
    • Path cost
  • STP Loop free topology Convergence sequence.
    • Step 1: Elect one root bridge
    • Step 2: Elect root ports
    • Step 3: Elect designated ports

Loop Free Topology

  • STA always uses the 4 step decision sequence to find out loop free topology.
    • Step 1 : Lowest BID
    • Step 2: Lowest path cost to root bridge.
    • Step 3: Lowest sender BID
    • Step 4: Lowest Port ID

Bridges use the configuration BPDU in this four step sequence.

Bridge ID

  • BID is used identify each bridge.


  • BID is used to elect the root bridge, lowest BID is the root bridge.
  • Bridges use the concept of cost to evaluate how close they are to other bridges.

image image


image image

Step 1: Elect one root bridge

  • At the beginning all the bridges assume they are at the center and declare them selves as the root bridge.

Step 2: Elect root ports

  • Root port is the port closest to the root bridge. Bridges use the path cost to determine the closeness.
  • Every non root bridge will select one root port.


Step 3: Elect Designated ports

  • Loop preventions part of the STP becomes evident in this step.
  • A designated port functions as the single bridge port that both sends and receive traffic to and from that segment and the root bridge.
  • Switch containing the designated port is considered as the designated bridge for that segment.
  • STP always go through the 4 step sequence to elect designated ports.
  • Non designated ports will be blocked to avoid loops.
  • Loop free topology is re configured again whenever there is topology change in the network or any failure.
  • If one network segment in the Spanning-Tree Protocol becomes unreachable, or if Spanning-Tree Protocol costs change, the spanning-tree algorithm reconfigures the spanning-tree topology and reestablishes the link by activating the standby path.
  • While re configuring loop free topology STA uses port states.

STP port statesimage

1. Disabled

2. Blocked

3. Listening

4. Learning

5. Forwarding

Blocked state

  • Data frames are discarded and no addresses are learned.
  • It may take up to 20 seconds to change from this state.
  • If there are no other shorter paths to the root bridge will change to the listening state.

Listening state

  • Path that is not the least cost path to the root bridge goes back to the blocked state.
  • Listening period is called the forward delay and lasts for 15 seconds.
  • In this state user data is not being processed and MAC addresses are not being learned but BPDU are processed.
  • User data is not learned, but MAC addresses are learned from any traffic that is seen.
  • Learning state lasts for 15 seconds and is also called the forward delay.
  • BPDUs are still processed.

Forwarding state

  • A switch port is allowed to transition to the forwarding state only if no redundant links are detected and if the port has the best path to the root bridge as the root port or designated port.
  • User data is forwarded and MAC addresses continue to be learned.
  • BPDUs are still processed.

Rapid spanning tree protocol

  • Clarifications of port states and roles.
  • Definition of link types that can go to forwarding state rapidly.
  • Link types have been defined as point to point, edge type and shared.
  • Point to point and edge type links can go to the forwarding state immediately.
  • The new states defined in this are only discarded, learning and forwarding.


rafis said...

sangat membantu
kunjungi juga gan

rian yolanra said...

makasih gan sangat membantu
kunjungi jg blog saya gan

Shandy Ferial said...

Blog ini sangat membantu saya.
kunjungi juga blog saya.

ali said...

thanks infonya
kunjungi juga http://jaketkuning.unsri.ac.id/alihanafiah/blog/1090/

ali said...

thanks infonya kunjungi juga ke http://jaketkuning.unsri.ac.id/alihanafiah/blog/1090/

harialfa said...

misi gan tlng komet ya blog saya maklum baru belajar

yanti said...

terima kasih atas artikelnya, mari belajar bersama :)

Text Widget

Copyright © Vinay's Blog | Powered by Blogger

Design by | Blogger Theme by