DIT | Spanning Tree Protocol (STP)


5.1   # UNDERSTAND AND EXPLAINED OF SPANNING TREE PROTOCOL

By default, a switch will forward a broadcast or multicast out all ports, excluding the port to broadcast/multicast was sent from. When a loop is introduced into the network, a highly destructive broadcast storm can develop within second. The main motto is: it avoids the loop and it is enabled by default on all VLANs on Catalyst switches. STP switches send the BPDU to out all ports every two second are forwarded to a specific MAC multicast address.
Note: If the multiple loops exist in the switching environment, multiple ports will be placed in a blocking state.


# Define Spanning tree

• A tree (extended star) topology
A tree has no loops
• Spanning all devices
All devices are connected


# STP algorithm

The switches use this algorithm to decide which port should be shut down.
• Choose one switch to be “root bridge”.
• Choose a “root port” on each other switch.
• Choose a “designated port” on each segment.
• Close down all other ports.


# Root bridge

• Each switch has a bridge ID (BID) of priority value followed by MAC address.
• Switches exchange BPDUs to compare bridge IDs.
• The switch with the lowest bridge ID to becomes the root bridge.
• Administrator can set the priority to fix the selection.


# Bridge ID

• The bridge ID consists of bridge priority extended system ID and MAC address.
• By default the priority is 32786 and lowest priority wins.
• Extended system ID identifies VLAN.
• MAC address used if priority is the same but better not to rely on MAC address.


# Electing the root bridge of stp

The root bridge is determined by a switch priority is 32,768 and the lowest priority wins. In case of a tie in priority, the switch with lowest MAC address will be elected root bridge. The combination of a switch priority and MAC address make-up that switches bridge ID.


# Identifying the root port of stp

The port on each switch has the lowest path cast to get to the route port. Each switch has only one root port but Root Bridge can’t have a root port. Path cost is a cumulative cost based on the bandwidth of the links.


Bandwidth Cost
4 Mbps (Megabit per second) 250
10 Mbps (Megabit per second) 100
16 Mbps (Megabit per second) 62
100 Mbps (Megabit per second) 19
1 Gbps (Gigabit per second) 4


# Identifying the designation port of stp

Path cost is used to determine which port is blocked. Each network segment requires a single designation port, which has the lowest path cost leading to the root bridge. This port will be placed in a blocking state. A port can’t be both a designation port and a root port.


# Port ID

If the bandwidth of both links are equal, then both of switch interface have an equal path cost to the root bridge. Which interface will become the root port? The tie-breaker should be the lowest bridge ID but the port ID will be used as the tie-breaker. An interface port ID consists of two port a 6 – bit port priority and MAC address for that port. Whichever interface has the lowest port ID will become to the root port. By default, the port priority of an interface is 128.
Switch (config) #interface fastethernet 0/1
Switch (config-if) #spanning-tree port-priority 50
Switch (config-if) #exit


# Extended system ID’s

Normally a switches bridge ID is a 64 – bit value that consists of a 16 – bit (4 – bit priority value + 12 – bit VLAN ID) bridge priority value and a 48 – bit MAC address. However, it is possible to include a VLAN ID called an extended system ID and a bridge ID. Instead of adding bits to the existing bridge ID, 12 bits of the bridge priority value are used for this system ID, which identifies the VLAN to this STP process.




5.2   # STP PORT STATES

Switch port participating in STP progress through five port states have mentioned below: -

  1. Blocking state is the default state of an STP port when a switch is powered and when a port is shutdown to eliminate a loop. Port in a blocking state doesn’t forward frames. It will still listen for BPDU value from other switches to learn about changes to the switching topology.
  2. Listening state port will progress from a blocking to the listening state only if the switch believes that the port will not be shutdown to eliminate a loop. The port will listen for BPDU’s to participate in the election of a root bridge. Root port and Designation port also not will forward the frames.
  3. Learning state after a brief period of time, a port in a last state will be elected either a root port or designated port and placed in a learning state. Port in a learning state listen for BPDU and also begin to learn MAC address but ports in a learning state will still not forward frames. Note: “If a port in the listening state is not kept as a root or designated port, it will be placed into a block state and not a learning state.”
  4. Forwarding state port can send & receives all data frames and continuous to build the MAC address table.
  5. Disabled state port in disabled state has been administratively shutdown and frames at all. On average, a port in a blocking state will take 30 to 50 second to reach a forward state.



5.3   # TO ADJUST THE THREE STP TIMERS FOR VLAN ID

Switch (config) #spanning-tree vlan 10 hello-time 10
Switch (config) #spanning-tree vlan 10 forward-time 20
Switch (config) #spanning-tree vlan 10 max-age 40




5.4   # STATEMENT AND CONFIGURATION OF STP

Q. How to disable the STP for a specific VLAN?
Switch (config) #no spanning-tree vlan 10

Q. How to set the priority for a specific VLAN?
To default the bridge priority of a switch is 32,768 to increase its chances of being elected root bridge of a vlan.
Switch (config) #spanning-tree vlan 10 priority 150

Q. How to change an interface path cost from its default?
Switch (config) #interface fastethernet 0/24
Switch (config) #spanning-tree vlan 10 cost 42

Q. How to force to become the root bridge?
Switch (config) #spanning-tree vlan 10 root priority

Q. How to force to becomes the second root bridge?
It is possible to assign a second root bridge for redundancy to become the second root bridge (priority: 28672).
Switch (config) #spanning-tree vlan 10

Q. How to specify the diameter of the switching topology?
The diameter command to indicates the length of the STP topology (No. of switches). By default, diameter value is 7.
Switch (config) #spanning-tree vlan 10 root primary diameter 7

Q. How to configure port-fast on an interface?
Port-fast allows the interface to move from a blocking state to a forwarding state immediately and normally eliminates the normal 30 second STP delay. Port-fast does reduce the unnecessary BPDU traffic.
Switch (config) #spanning-tree portfast

Q. How to enable the port-fast globally on all interfaces?
Switch (config) #spanning-tree portfast default

Q. How to uplinkfast is configuring globally for all VLAN’s on the switch?
IF a multiple port is blocked state, whichever port has the lowest root path cost will become unblocked. The root-bridge can’t have unlinkfast enabled.
Switch (config) #spanning-tree uplinkedfast

Q. How to configure the root guard?
It will prevent the switch from accepting a new root bridge “off” of the fastethernet 0/10 interface. If the root-bridge advertises itself to this port, the port will enter a root-inconsistent state.
Switch (config) #spanning-tree guard root
Switch (config) #show spanning-tree inconsistent port




5.5   # STATEMNT OF THE UNIDIRECTIONAL LINK DETECTION (UDLD)

By default, UDLD sends out ID frames every 15 seconds and must be enable on both sides of a link can run in two mode: -
1) Normal mode: If a unidirectional link is detected, the port is not shutdown but merely flagged as being in an undetermined state.
2) Aggressive mode: If a unidirectional link is detected, the port is placed in an errdisable state. UDLD can be enabled globally (but only for fiber port on the switch)
Switch (config) #udld enable message time 20
Switch (config) #udld aggressive message time 20


Q. How to view the UDLD status on ports, re-enable UDLD errdisabled port?
Switch# show udld & Switch# udld reset

Q. How to view STP information of specific vlan?
Switch# show spanning-tree vlan ID

Q. How to view STP information of specific vlan?
Switch# show spanning-tree

Q. How to view the detail of STP interface information?
Switch# show spanning-tree detail



5.6   # CONFIGURATION OF THE ROOT BRIDGE (How to become Root Bridge Switch)

There are two types method to acts as a Root bridge switch:-

• Root configuration:
Switch (config) #show spanning-tree
Switch (config-if) #spanning-tree vlan 1 root primary
Note: Now, you will see the status of ports in Role Sts Cost

• Priority configuration:
Switch (config) #show spanning-tree
Switch (config-if) #spanning-tree vlan 1 priority 4096
Note: Now, you will see the status of ports in Role Sts Cost




5.7 # CONFIGURATION OF THE RSTP (How to act as a RSTP)

Something has been changed such as blocking state to alternative state and data transfer within six seconds.
• RSTP configuration:
Switch (config) #show spanning-tree
Switch (config-if) #spanning-tree mode rapid-pvst

Note:
• Now, you will see the status of ports in Role StsCost
• To backbone fast is configured globally and should be implemented on all switches in the network when used
Switch (config) #spanning-tree backbone fast





Be updated into yourself and improve lives through DIT

Post a Comment

0 Comments