Enhance your Career in Networking With IPinBits!!!​

Switching – STP (Spanning Tree Protocol) overview

Why we use the STP- to avoid the loop on L2 networks. L2 networks works based on the Ethernet headers and Ethernet headers do not have any TTL value. So loop in L2 layer is can cause so much damage than the L3 loop.
Today we will discuss about the STP, which was designed to prevent loop by blocking some port in network. Although classic STP is not used in today’s networks, still it is foundation for the basic switching understanding.
So lets discuss about the STP features :-
STP Termonology :-

  • STP selects a MASTER switch in entire network and this switch is known as ROOT BRIDGE.
  • Then STP selects the port roles, the port roles are – Designated Ports, Root Ports and Blocked Ports.
  • Root bridge selection is based on BRIDGE ID = MAC + Priority (32768), Lower the BRIDGE ID, better it is.
  • STP ports has to go through some transition states before handling the traffic. These states are StateTime BPDU Tx  BPDU Rx MAC Learning Forwarding Frames DISABLE
     NA NO NO NO NO BLOCKING 20 NO YES NO NO LISTENING 15 YES YES NO NO LEARNING 15 YES YES YES NO FORWARDING NA YES YES YES YES 

STP Timers :-

  • Hello – 2 seconds (BPDU HELLO)
  • Forwarding Delay – 15 Seconds
  • Max age – 20 seconds

BPDU :-
STP uses BPDU as hello protocol. By default HELLO are exchanged every 2 seconds between switches. BPDU has 12 fields by which ROOT BRIDGE ELECTION and PORT ELECTION happens.These Fields are as below :-

 Sr no Field Value
 1             Protocol Identification0x000
 2 VERSION0x00 
 3 MSG TYPE CONFIG BPDU OR TCN BPDU
 4 FLAGS STP USES ONLY TC AND TCA FLAG
 5 ROOT BRIDGE ID BRIDGE ID OF ROOT SWITCH
 6 DESIGNATED BRIDGE ID BRIDGE ID OF SENDING SWITCH
 7 DESIGNATED PORT ID PORT ID OF SENDING PORT
 8 COST COST TO ROOT BRIDGE
 9 MESSAGE AGE TTL OF BPDU = 7
10   MAX AGE BPDU EXPIRY TIME
 11 FORWARDING DELAY 15 SECONDS
 12 HELLO 2 SECONDS
  • ROOT bridge always generates the ZERO COST BPDU.
  • COST is always added in the INGRESS DIRECTION.

Related blog posts