Thursday, 24 December 2020

SPANNING TREE PROTOCOL INTERVIEW Q&A

Question 1 –What is Spanning Tree Protocol (STP) and the use of STP ??

Answer-

Spanning Tree Protocol is a open standard LAYER 2 protocol - IEEE 802.1D which runs on Switches .

On all Cisco Switches it is enabled by default.

In layer 2 network whenever you go for redundancy; layer 2 loops can be created

STP avoids such L2 loops by blocking a port on the loop.

Question 2 –How STP Works OR Explain STP Operations ?

Answer-

Out of all the switches one switch will be elected as Root Bridge(RB) and all other switches will act as  Non Root Bridge (NRB)

All the switches will send BPDUs i.e hellos on all ports after every 2 secs.

NRB will always listen for BPDUs from the RB.

If NRB receives BPDUs from RB from more than one port it will came to know that there is a loop & it will block all ports except one port through which the cost is less i.e Root Port.

Eliminate the loop in the network.
 

Question 3 – What is the Spanning tree path cost value?

Answer-

This cost value is inversely proportional to the bandwith .
     Bandwidth     Cost
      10 Mbps   -    100
      100 Mbps -    19
      1 Gbps   -         4
      10 Gbps  -        2

Question 4 –How is the election of the Root Bridge done ?

Answer-


Election of the Root Bridge is based on Bridge ID .

The switch with lowest Bridge ID will be elected as Root Bridge.

Bridge ID is 8 Bytes .

Bridge ID = Bridge Priority + Bridge MAC

Bridge Priority = 2 Bytes , Default Bridge Priority is 32768

Bridge MAC ie. Mac address is 6 Bytes .

Question 5a –In this scenario if Switch 1 is root bridge and all the ports of all the switches have bandwidth of 100 Mbps then which port will be blocked
 - switch 2 fa0/2 or switch 3 fa0/2 ?




Answer-


Switch 3 Fa0/2  

Question 5b –In this scenario if Switch 1 is root bridge and all
the ports of all the switches have bandwidth of 100 Mbps then on Switch 4 which port will be blocked ?



Answer -

Switch 4 Fa0/2 

Question 5c –In this scenario if Switch 1 is root bridge and all the
 ports of all the switches have bandwidth of 100 Mbps then on Switch 2 which port will be blocked ?



Answer -

Switch 2 Fa0/7

Root Port Selection

lower cost

Forwarding switch (i.e upstream switch) bridge id

Port Priority of the upstream switch (not local port number)

Port number of the upstream switch (not local port number)

 

Question 6 – What are the different port states in STP?

Answer -


Disabled – A port in the disabled state does not take part in the STP.

Listening – A port in listening state prepares to forward data frames without populating the MAC address table. The port sends and listens  to BPDUs to make sure no loops occurs on the network

Learning– A port in the learning state populates the MAC address table but doesn’t forward data frames. The port still sends and receives BPDU messages as  in the listening state.

Forwarding – The port in the forwarding state can now send and receive data frames, collect MAC addresses in its address table, send and receive BPDU messages.
     This port is now a fully functioning switch port within the spanning-tree topology.

Blocking – A port in the blocking state does not forward frames.
      It only listens to BPDU messages. The function of the blocking      state is to prevent the use of looped paths.
 

Question 7 – What is the default time a port takes to transit from the blocking state to forwarding state ?

Answer -


The default time a port takes to transit from the blocking state to forwarding state is 50 seconds.

Max Age = 20 secs
Listening = 15 secs
Learning = 15 secs 

Question 8 – Explain Root Guard ?

Answer -


Root guard is used to protect root bridge .

Root guard stops a new switch introduced in the network with a lower bridge ID to become a root bridge.

If a port with root guard feature enabled receives a superior BPDU ,it moves the port into root-inconsistent state (which is somewhat similar to listening state)

Thus the current Root Bridge retains its status.

Configuration
        SW(config)#int fa0/24
        SW(config-if)#spanning-tree guard root
 

Question 9 –Explain Spanning tree Portfast ?

Answer -


Portfast is a enhancement feature of STP which speed up the STP convergence on access ports.
 It actually causes the spanning-tree forwarding state immediately bypassing the listening and learning states.
It is used on access port only where single workstation is connected .
Configuration
       SW(config)# int fa0/24
       SW(config-if)# spanning-tree portfast
        OR
       SW(config)#spanning-tree portfast default   this will enable
                                                                                all the access port in portfast

Question 10 –Explain BPDU Guard ?

Answer -


When we enable portfast on a port , we do not expect BPDUs on that port.

Incase a switch is connected by mistake on the port where portfast is enabled a loop can form (since when we configure portfast we disable STP on that port)

So to protect from such scenario we can enable BPDU guard on the port so that once a BPDU is received on the portfast port the port moves into err-disable mode i.e shutdown and it will not move the traffic . 

Thanks for Reading 

amartechstuff

4 comments:

  1. Sir in your utube channel can upls explain 5a 5b 5c these questions pls

    ReplyDelete
  2. please check youtubue channel amartechstuff i have uploaded the video on spanning tree interview

    ReplyDelete