Networker Interview

Prepare for CCNA, CCNP, CCIE Interview !

header photo

STP Interview Questions and Answers (Spanning Tree Protocol)

What is STP and Redundant Links?
Spanning Tree Protocol (STP) is a protocol which prevents layer 2 loops. STP enables switches to become aware of each other so that they can negotiate a Loop-Free path through the network.
In practical Scenario, Redundant links are created to avoid complete network failure in an event of failure of one link.

How STP works?
STP chooses a reference point (Root Bridge) in the network and calculates all the redundant paths to that reference point. Then it picks one path which to forward frames and blocks other redundant paths. When blocking happens, Loops are prevented.

What are the different port states?
1. Disabled - A port in the disabled state does not participate in the STP.
2. Blocking - A blocked port does not forward frames. It only listens to BPDUs. The purpose of the blocking state is to prevent the use of looped paths.
3. Listening - A port in the listening state prepares to forward data frames without populating the MAC address table. The port also sends and listens to BPDUs to make sure no loops occur on the network.
4. Learning - A port in learning state populates the MAC address table but doesn’t forward data frames. The port still sends and receives BPDUs as before.
5. Forwarding - The port now can send and receive data frames, collect MAC addresses in its address table, send and receive BPDUs. The port is now a fully functioning switch port within the spanning-tree topology.

What is STP Timer and Explain different types of STP Timers?
STP uses three timers to make sure that a network converges properly before a bridging loop can form.
Hello timer - The time interval between configuration BPDUs sent by the root bridge. It is 2 seconds by default.
Forward Delay timer - The time interval that a switch port spends in both the Listening and Learning states. The default value is 15 seconds.
Max (Maximum) Age timer - Maximum length of time a BPDU can be stored without receiving an update. It can also be defined as a time interval that a switch stores a BPDU before discarding it. It is 20 seconds by default.

Explain types of STP Port Roles?
Root port - The root port is always the link directly connected to the root bridge, or the shortest path to the root bridge. It is always on Non-Root Bridge.
Designated port - A designated port is one that has been determined as having the best (lowest) cost. A designated port will be marked as a forwarding port. It can be on both the root Bridge & non-root Bridge. All ports of root bridge are designated port.
Forwarding port - A forwarding port forwards frames.
Blocked port - A blocked port is the port that is used to prevent loops. It only listens to BPDUs. Any port other than root port & designated port is a blocked port.

What is BPDU?
All the switches exchange information to select root bridge as well as for configuration of the network. This is done through the Bridge Protocol Data Unit (BPDU). Each switch compares the parameters in the BPDU that it sends to one neighbor with the one that it receives from another neighbor.

What is the destination MAC address used by Bridge Protocol Data Units (BPDUs)?
Bridge Protocol Data Units (BPDUs) frames are sent out as at multicast destination MAC address 01:80:c2:00:00:00.

What are Types of BPDU?
Two types of BPDU exist:-
Configuration BPDU - This type of  BPDU is used for spanning-tree computation.
Topology Change Notification (TCN) BPDU - This type of  BPDU is used to announce changes in the network topology.

How Root bridge is elected?
The bridge ID is used to elect the root bridge in the STP domain. This ID is 8 bytes long and includes both the priority and the MAC address of the device.
Switch with the lowest Bridge ID is elected as the root bridge which means switch with the lowest priority will become root bridge if two or more switches have same priority then switch with lowest mac address will become root Bridge.

What is Path Cost or Spanning Tree Path Cost value?
The Spanning Tree Cost Value is inversely proportional to the bandwidth of the link and therefore a path with a low cost value is preferable than a path with high cost value.
Link Bandwidth         Cost Value
10 Gbps                            2
1 Gbps                              4
100 Mbps                        19
10 Mbps                          100

What is Root Port?
Once the Root Switch is elected, every other Switch in the network must select a single port on itself to reach the Root Switch. The port with the lowest root path cost (lowest cumulative cost to reach the root switch) is elected as the root port and is placed in the forwarding state. Root bridge will never have a root port.

What is Extended System ID?
The Extended System ID is utilized by spanning-tree to include the VLAN ID information inside 16-bit STP Bridge Priority value. Extended System ID is the least significant 12-bits in 16-bit STP Bridge Priority value.


Go Back