2.5 STP
2.5 STP
STP Terms
1. BPDU (Bridge Protocol Data Unit)
- It is a message exchanged between switches to share topology information and to elect root bridge.
- Hello Time = 2sec & Maximum Age = 20sec
- Destination is defined as the multicast address 0180.c200.0000
2. Bridge ID
- It is an unique identity of a switch in network.
- BID (8 Byte) = MAC Add (6 Byte) + Bridge Priority (2 Byte)
- By default bridge priority is 32768 & Range = 0 to 65535
- Priority is change in increment of 4096
3. Path Cost Bandwidth Cost
10 mbps 100
- It is a value assigned to each interface according to their speed.
100 mbps 19
- Higher the bandwidth lower the cost is.
1000 mbps 4
- It is used to select best route to reach root bridge.
10,000 mbps 2
20+ gbps 1
4. Root Bridge
- The Root bridge (switch) is a special bridge at the top of the Spanning Tree (inverted tree).
- Bridge having lower priority become Root Bridge.
- If priority match, then lower mac address win.
- If you want one particular switch to be the Root Bridge (Switch), change the priority to a lower value
than 32,768
5. Root Port
- Every non root bridge have one RP.
- Port having lower cost to reach root bridge become RP.
- If cost match, port which receive lower BID from its neighbor.
- If BID match, then the port which receive lower port ID become RP.
PID = Priority + Port No.
- Default Port Priority = 128 & Range = 0 to 240
- If PID match, then local port ID win.
- Port priority is changed in the increment of 16.
- If you want one particular switchport to be the RP, change the priority.
6. Designated Port
- Every segment have on DP.
- All ports of RB are DP.
- Port opposite to RP always DP.
- Port which transmit superior BPDU.
7. Non-designated Port (NDP)
- Port which are neither RP nor DP.
- NDP ports are always put into blocking mode.
Configuration BPDU
- Originated by Root Bridge
- Message Type = 0x00
Disabled No No No No No
Blocking Yes No No No No
Port Role
- Root Port
- Designated Port
- Alternate Port
STP Timers
1. Hello Timer
- It indicate how often a switch send BPDU.
- Default = 2sec & Range = 1sec to 10sec
2. Forward Delay
- It indicate delay between listening and learning a port.
- Default = 15sec & Range = 4sec to 30sec
3. Maximum Age
- It indicate how long a switch keep BPDU information from a
neghboring switch before discarding it.
- Default = 20sec & Range = 6sec to 40sec
STP Topology Change
It happens :
- If port transitioning to forwarding state.
- If any link fail
- If switch fail
1. Portfast
- Only interface connected to end device act as portfast.
- Interface immediately move into forwarding mode.
- Do not generate TCN BPDU
- Can be configured in two ways.
Globally
SW(config)#spanning-tree portfast edge default
Interface Basis
SW(config)#interface fa0/0
#spanning-tree portfast
Verification
#show spanning-tree
2. Uplinkfast
- It is used to make blocked link into forwarding state when a direct link to
the root bridge goes down.
- Root bridge can not have uplinkfast enabled.
- It is configured globally for all vlan on switch.
- When a switch is configured for UplinkFast,
- Bridge Priority is changed to become 49,152 (default is 32768)
- All of its port costs are increased by 3000.
Configuration
SW(config)#spanning-tree uplinkfast
3. Backbonefast
Configuration
sw(config)#spanning-tree backbonefast
STP Security
1. Root Guard
- It prevent an unauthorized switch from advertising
as a root bridge.
- If receive superior BPDU, port goes into
root-inconsistent state.
Configuration
sw(config)#interface fa0/1
#spanning-tree guard root
2. BPDU Guard
2. Interface Mode
- Works on all interface (Portfast feature need not to be configured)
- If receives any BPDU, port goes into err-disable state
Switch(config)#interface fa0/0
#spanning-tree bpduguard enable
3. BPDU Filter
2. Interface Mode
- Works on all interface (Portfast feature need not to be configured)
- If receives any BPDU, port goes into err-disable state
Switch(config)#interface fa0/0
spanning-tree bpduguard enable
Types of STP