Spanning Tree-CCNP
Spanning Tree-CCNP
Spanning Tree-CCNP
Welcome
To
Network for you
STP
Broadcast Storm:
• When switch receives broadcast frame, it continues broadcasting them.
• The Switches broadcasting them again to its other interfaces.
• Broadcasting will keep going on forever until we shut down the network.
• This Process is known as Broadcast storm of switches.
• Broadcast storm consumes the entire bandwidth of the network.
• Broadcast storm denies bandwidth for normal network traffic.
Non-Root Bridge:
• Except Root Bridge, all remaining switches of network are considered as Non-Root
Bridges.
• Non-Root Bridges receive updates from Root Bridge & update their STP databases
relatively.
Port Priority:
• Each port of a Switch has a Port Priority value associated with it, 128 by default.
• Gi0/1 128.20 P2P: Gi0/1 is the interface 128 is default value and 20 is port number.
• P2P means Point-to-point (Full Duplex) and Shr means Shared (Half Duplex) like hub.
Spanning Tree Port Roles:
Designated Port:
• A non – root port, which is forwarding away from the root switch.
• Switch can have multiple designated ports & marked as forwarding port.
• For root bridges all switch ports are designated ports.
• In Cisco Switches a Root Port can never be a designated port.
Non-Designated Port:
• Non-designated port having higher port cost than the designated port.
• Spanning Tree Protocol marks non-designated port as the blocking port.
• Non-designated port not forward any frames and used to remove loops.
• If any change in topology, the same port may become a designated port.
• The non-designated port of is a Cisco switch port that is blocked.
• A non-designated port of switch is not a root port or a designated port.
Root Port:
• The Root port is the port that directly connects to the Root Bridge
• The Root Port is the port which has least cost to reach root switch.
• The Root port is the port that is closest to the root bridge.
• Every non-root bridge must have a root port connect to root switch.
• Only one Root Port on non-root Switch and no Root Port in root bridge.
• A Root Port has the least cost from the "Switch" to the Root Bridge.
• The Root ports forward traffic toward the root bridge.
Alternate Port:
• Alternative port moves to the forwarding state if any change in topology.
• Alternate port is a best alternate path to the root bridge or Switch.
Forwarding Ports:
• It also has two type designated ports and Root ports.
Blocking Ports:
• It is also called Non-Forwarding ports
Selecting the Root Port:
• Shortest path to the root bridge (Every non root bridge looks the best way to go root
bridge) Least cost (speed).
• Typical Costs of different Ethernet networks.
Speed Cost
10Gbps 2
1Gbps 4
100Mbps 19
10Mbps 100
STP Port states
1. Listening 15 sec.
2. Learning 15 sec.
3. Blocking 20 sec.
4. Forwarding No limits
5. Disable No limits
Listening State:
• After blocking state, Root Port or Designated Port will move to listening state.
• During listening state, port discards frames received from attached network segment.
• During listening state port discards frames switched from another port for forwarding.
• After 15 seconds, the switch port moves from the listening state to the learning state.
Learning State:
• Only root port & designated ports enter into learning state from listening.
• A Cisco Switch port change to learning state after the listening state.
• During the learning state, the port is listening for and processing BPDUs.
• In the learning state, the port begins to process the user frames.
• In the learning state, the port start updating the MAC address table.
• Data or user frames are not forwarded to the destination port of switch.
• After 15 seconds, switch port moves from learning state to forwarding state.
Forwarding State:
• In this state, the switch listens and processes both BPDUs and user frames.
• Port in forwarding state forwards frames across attached network segment.
• In forwarding state, port will process BPDUs & update its MAC Address table.
• Data frames are forwarded to destination, Forwarding State is normal state.
• The Data and configuration messages are passed through the port or link.
Blocking State:
• When we power on a Switch, the switch puts all of its ports in this state.
• The Switch Ports will go into a blocking state at the time of election process.
• In Blocking state, the switch only listens and processes the BPDUs only.
• Switch port in blocking state does not participate in frame forwarding.
• Port in blocking state discards frames received from attached network segment.
• During blocking state, port only listening & processing BPDUs on its interfaces.
• After 20 seconds, switch port changes from the blocking state to listening state.
Disabled State:
• A port in the disabled state does not participate in frame forwarding.
• A port in the disabled state does not participate in operation of STP.
• A port in the disabled state is considered non-operational.
• This state applies to all ports which are either manually shut down.
• All unplugged ports or interface also remain in Disabled state.
Type of STP:
Type of STP
Protocol Standard Resources Need Convergence Numbers of Trees
Rapid PVST+ CISCO Very High Fast One for Every VLAN
MST 802.1S Medium or High Fast One for Multiple Vlans
PVST+:
• PVST+ stands for Per VLAN Spanning Tree Plus (PVST+).
• PVST+ is a CISCO Implementation of STP.
• Per-VLAN Spanning Tree+ (PVST+) is an extension of the PVST standard.
• PVST+ supports DOT1Q trucking encapsulation while PVST not support.
• PVST+ Provide each VLAN have its own Spanning Tree Protocol topology.
• PVST is usually the default spanning tree protocol on CISCO Switches.
• PVST+ takes 30 to 50 seconds to transit from blocking state to forwarding state.
RPVST+:
• RPVST+ stands for Rapid Per-VLAN Spanning Tree Plus.
• Rapid PVST+ is an enhanced version of the PVST+ version.
• Rapid PVST+ allows for faster spanning Tree calculations and convergence.
• RSTP is typically able to respond less than 10 seconds of a physical link failure.
• Rapid PVST+ defines three port states Discarding, Learning and Forwarding.
• We can enable RSTP by using command: spanning-tree mode rapid-pvst
STP RSTP
Disabled Discarding
Blocking Discarding
Listening Discarding
Learning Learning
Forwarding Forwarding
• When topology change occurs, Switch send TCN BPDU out its root port, destined for
Root.
• TCN contains no information about the change – it only indicates that a change
occurred.
• By responding with a TCN with the Topology Change Acknowledgement (TCA) flag set.
• Once Root Bridge receives the TCN, it will send out a configuration BPDU to all switches.
Forward Delay:
• Forward delay timer is time interval spent in listening & learning state.
• The Forward Delay is the length of the Listening and the Learning states.
• Default Spanning Tree Protocol (STP) forward delay timer is 15 seconds.
• STP forward delay timer can be adjust to any value between 4 & 30 seconds.
Maximum Age:
• The Spanning Tree Maximum Age timer often referenced as MaxAge.
• If the port no longer receives the BPDUs after the Max Age time has elapsed.
• Switch assumes that topology change must have occurred & BPDU is aged out.
• By default, Spanning Tree Protocol Maximum Age timer is set to 20 seconds.
• The STP max age timer can be tune to any value between 6 and 40 seconds.
Commands Description
show spanning-tree vlan 1 Display STP details
spanning-tree vlan 1 hello-time 5 Changing STP Hello time
spanning-tree vlan 1 forward-time 20 Changing STP Forward Delay time
spanning-tree vlan 1 max-age 40 Changing STP Maximum Age time
Port Fast:
• By passing the listening & learning states, go to forwarding mode.
• STP PortFast feature causes a port to enter forwarding state immediately.
• Port Fast port normally connect to end devices such as server, printer or PC.
• Do not enable portfast on an interface to another device which is hub/switch.
• If Port Fast feature port connect to a cisco switches, it may cause a loop.
• PVST+, Rapid PVST+, or MSTP Spanning tree all support Port Fast feature.
• Port Fast can be enable on interface level or globally on Cisco switch.
• When running globally it enable Portfast on interface that is edge port.
Lab Time:
PC1> sh ip
NAME : PC1[1]
IP/MASK : 192.168.1.2/24
GATEWAY : 192.168.1.1
DNS :
MAC : 00:50:79:66:68:00
LPORT : 10001
RHOST:PORT : 127.0.0.1:10002
MTU: : 1500
PC1> save
Saving startup configuration to startup.vpc
. done
Without Port Fast:
MST:
SW1 Configuration
SW1(config)#interface range e0/0-1
SW1(config-if-range)#switchport trunk encapsulation dot1q
SW1(config-if-range)#switchport mode trunk
SW1(config-if-range)#no shutdown
SW1(config)#vlan 10,20,30,40,50,60
SW2 Configuration
SW2(config)#interface range e0/0-1
SW2(config-if-range)#switchport trunk encapsulation dot1q
SW2(config-if-range)#switchport mode trunk
SW2(config-if-range)#no shutdown
SW2(config-if-range)#vlan 10,20,30,40,50,60