Spanning Tree Protocol
Spanning Tree Protocol
Spanning Tree Protocol (STP) - For a network topology multiple links are may be required between
switches to provide better fault tolerance and redundancy. But, when we create a closed connection
using switches or we use multiple links between switches, we face problems like -
1. Broadcast storm
Apparently, we can overcome this by removing all redundant links between switches but again that will
remove the advantage of fault tolerance.
So, instead of physically removing all redundant links it is better to logically block these links and if
required when main communication links goes down, we use these redundant links which are blocked
normally. This is achieved by a protocol named STP or spanning tree protocol. The IEEE standard for STP
is IEEE802.1d.
STP operation:
There are three steps that STP takes to make a network topology connected by switches loop free.
STP uses its own data frame for every communication and election process. This is known as BPDU
(Bridge Protocol Data Unit). This is sent in every 2 sec and whenever there is a topology change.
Root bridge is the switch based on which STP takes its decision. A switch in the topology must be elected
as the root bridge by STP.
If every switch has equal bridge priority, then switch with the lowest MAC address is elected as the 'root
bridge'.
All connected ports of a root bridge are designated and remain in forwarding state. They cannot be
blocked.
All other switches except the root bridge are termed as 'non-root bridge'.
All non-root bridges must have a port that provides the best path or lowest cost path to reach the root
bridge. This port is termed as 'root port'. A root port cannot be blocked.
There can be other ports which are not root ports but can provide the best path for a network segment.
They are termed as 'designated ports' and they are not blocked. All other port or ports that are neither
root port nor designated port are put in blocking state. A port remains in the blocking state unless there
is any change in topology like a root port or designated port goes down. A blocking port cannot send or
receive data frame. It cannot send any BPDU but it can receive BPDU on this port.
Ports must wait for new topology information to propagate through the switched LAN before starting to
forward frames. They must allow the frame lifetime to expire for frames that are forwarded using the
old topology. Each Layer 2 interface on a switch using Spanning Tree Protocol (STP) exists in one of the
following states:
• Disabled—The Layer 2 interface does not participate in spanning tree and is not forwarding frames.
• Listening—First transitional state after the blocking state when spanning tree determines that the
Layer 2 interface must participate in frame forwarding.
PortFast: This feature is generally enabled on the access ports so that the port directly goes to the
forwarding state from blocking state.
We can use,
When we use this command , all access ports will get portfast enabled.
Switch(config-if)#spanning-tree portfast
Along with the portfast feature we must enable the bpduguard feature, so that if by mistake the port is
connected to a switch and it receives any bpdu, it goes into err-disable state.
CST: Defined in IEEE 802.1D, this is the original standard that provided a loop-free topology in a
network with redundant links. Also called Common Spanning Tree (CST), it assumed one
spanning-tree instance for the entire bridged network, regardless of the number of VLANs.
Per-VLAN Spanning Tree (PVST+)—PVST+ is a Cisco enhancement of STP that provides a
separate 802.1D spanning-tree instance for each VLAN configured in the network.
RSTP(Rapid Spanning Tree Protocol):IEEE802.1w
PVST+(Per VLAN Spanning-Tree Plus): This is the default STP mode of every cisco switch. In this mode,
switch will build an STP table for every single configured VLAN .
We can modify the bridge priority for a Vlan or a group of VLANs to elect the root bridge as per our
choice. There are two methods,
Method 1:
Method 2:
For succesful, ether-channel negotiation, we use two protocols - PAgp(Port Aggregation protocol)- cisco
propreitary
Desirable or active : when the side is in this mode, it will initiate the ether-channel formation process by
sending proposal to other end.
Auto or passive: The side with passive mode will response to the proposal to participate in ether-channel
formation, but it will not initiate the process or send any proposal.
I - stand-alone s - suspended
R - Layer3 S - Layer2
w - waiting to be aggregated
d - default port
Number of aggregators: 1
------+-------------+-----------+----------------------------------------------