Q1. What is Spanning Tree Protocol and the use of STP ?
Ans. 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 reduancy; layer 2 loop can be created.
--> STP avoids such L2 loops blocking a port on the loop.
Q2. How STP works OR Explain STP Operations ?
Ans. 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 sec.
---> 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.
Q3. What is the Spanning tree path cost value ?
Ans. This cost value is inversely proportional to the bandwith.
BRANDWIDTH COST
--> 10 Mbps - 100
--> 100 Mbps - 19
--> 1 Gbps - 4
--> 10 Gbps - 2
Q4. What is Loop ?
Ans. Redundancy is the cause of Loop Formation.
Q5. How do we get to to know that a loop has formed ?
Ans. Whenever a single MAC Address is learnt over more than 1 interface of the same
switch.
--->This is also known as MAC Flapping.
--->****Switch has a behaviour to learn a single MAC Address on a single Interface.
Q6. How do we select a Root Bridge ?
Ans. Election of a Root Bridge take palce, initially all the switches would recall
themselves as a root Bridge, but a common Root Bridge is elected on the bases of
the lowest Bridge ID.
----> The switch that send a BPDU with lowest Bridge ID, has the superior BPDU.
-----> Root Bridge elected switch would be sending configuration BPDU to the
switches in every 2 seconds.
----> Bridge ID is 8 Bytes.
2 + 6
----> Bridge ID = Bridge Priority + Bridge MAC
----> Bridge Priority = 2 Bytes, Default Bridge Priority is 32768.
----> Bridge MAC i.e MAC address is 6 Bytes.
Q7(a). In this scenario if the swtich 1 is root bridge and all the ports of all
switches have bandwidth of 100 Mbps then which port will be bocked- switch 3 fa0/2
or switch 3 fa0/2 ?
Ans Switch 3 fa0/2
Q7(b). 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 ?
Ans. Switch 3
Q7(C). In the scenario if switch 1 is root bridge and all the ports of all the
switches have bandwidth of 100 Mbps then on swith 2 which port will be blocked ?
Ans. nehce vle port block honge ... Upstream port does not blocked.
Q8. What are the different port states in STP ?
Ans. 1. DISABLE:- A port in the disabled state does not take part in the STP.
---> Connectivity Issue.
2. BLOCKING:- It is the state in which STP intentionally stop forwarding data,
so that if any loop exists in the Topology may be dropped.
--> Port remains in this state for 20 seconds.
--> It allows Receiving of BPDUS.
3. LISTENING:- It is the state in which election process of Port Roles & Root
Bridge takes place.
---> A port remians in this state for 15 seconds.
---> BPDUs could be exchange, but data forwarding is not allowed.
---> No MAC Address learing is done.
4. LEARNING:- It re-checks the taken decisions about Port Roles & Root bridges.
--->It can share (excahnge BPDUs, but not user data)
--> Port remains in this state for 15 seconds.
5. 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 message.
---> This port is now a fully functioning switch port within the spanning-
tree topology.
Q9. What is the default time a port takes to transit from the blocking state to
forwarding state ?
Ans. 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
20 15 15
DISABLE----BLOCKING--------LISTENING--------LEARNING--------FORWARDING..
Q10. Explain Root Guard ?
Ans. 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 similer to listening
state)
--> Thus the current root Bridge retains its status.
--> CONFIGURATION
SW(confi)#int fa0/24
SW(confi-it)#spanning-tree guard root
Q11. Expalin Spanning tree portfast ?
Ans. 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
0R
SW(config)#spanning-tree portfast default--> This will enable all access
port in portfast.
Q12. Explain BPDU Guard ?
Ans. When we enable portfast on a port, we do not expect BPDU on that port.
--> In case 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.