490 likes | 828 Views
Any Questions?. Chapter 2 Spanning Tree Protocol. Spanning Tree Protocol (IEEE 802.1d) Rapid STP (IEEE 802.1w) STP Configuration and Verification STP Troubleshooting. Spanning Tree Protocol. Dynamically Manages redundant links between switches STP Original Spanning Tree Protocol 802.1d
E N D
Chapter 2 Spanning Tree Protocol • Spanning Tree Protocol (IEEE 802.1d) • Rapid STP (IEEE 802.1w) • STP Configuration and Verification • STP Troubleshooting
Spanning Tree Protocol • Dynamically Manages redundant links between switches • STP • Original Spanning Tree Protocol • 802.1d • RSTP • Newer Rapid Spanning Tree Protocol • 802.1w Pg 61
STP-802.1d • Eliminate broadcast storms • Switches flood broadcasts and redundant links would let broadcasts continue to circle • Unknown unicast storm is the same • MAC table instability • As frames come in from more than one port, MAC address table needs to be updated • Multiple copies of Frames Pg 61-63
Broadcast Storm Pg 62
STP fixes Pg 63
Spanning-Tree Protocol (STP) Terms • STP • Used to prevent loops and storms by dynamically closing redundant ports • Root Bridge • Bridge with best bridge ID. Ports are measured from here • BPDU • Packet with bridge information used for STP • Bridge ID • Bridge Prioirity and MAC address. Lowest MAC address wins • Nonroot Bridge • Other bridges in network that are not root bridge • Root Port • Port closest to root bridge
Spanning-Tree Protocol (STP) Terms • Designated port • Port with best cost, will forward • Port cost • Based on bandwidth • Nondesignated port • Higher cost port will be put in blocking mode • Forwarding port • In use • Blocked port • Will not forward frame, but will receive
STP-what is does • STP will block a port • Blocking state • Stops the loop Pg 64
How STP works • STP elects a root switch. STP puts all working interfaces on the root switch in Forwarding State. • Each nonroot switch considers one of its ports to have the least administrative cost between itself and the root switch. STP places this least-root-cost interface, called that switch’s root port (RP), in Forwarding State. • Many switches can attach to the same Ethernet segment. The switch with the lowest administrative cost from itself to the root bridge, as compared with the other switches attached to the same segment, is placed in Forwarding State. The lowest-cost switch on each segment is called the designated bridge, and that bridge’s interface, attached to that segment, is called the designated port (DP). Pg 65
Spanning-Tree Process • Elect Root Bridge • Find Root ports on all bridges/switches • Figure cost of non-root ports • Find designated port • Block non-designated ports • only where there are redundant connections that can cause loop
STP Messages • STP Bridge ID (BID) • 8 byte value unique to switch • 2 byte priority • 6 byte MAC address • Hello BPDU • Helps elect bridges and close ports Pg 66
Hello BPDU Pg 67
Electing the root Bridge • All switches send out HELLO BPDU • Switch with lowest Bridge ID is root bridge • Priority and MAC address • If a tie occurs, lowest MAC address • Default priorities are the same • After election, only root bridge sends out HELLO BPDU Pg 67
Choosing the root port • All nonroot Bridges need to find the root port • Closest/fastest link to root • Adds cost in BPDU to cost of port it was received • Root port always forwards! Pg 70-71
Calculating costs Pg 70
Choosing designated port • Lowest cost port on segment • Non root switch with lowest cost will have designated port • SW2 Gi0/1 has port cost 4-DP Pg 71
STP Normal Operations 1. The root creates and sends a Hello BPDU, with a cost of 0, out all its working interfaces (those in a Forwarding State). 2. The nonroot switches receive the Hello on their root ports. After changing the Hello to list their own bridge ID as the sender’s BID, and listing that switch’s root cost, the switch forwards the Hello out all designated ports. 3. Steps 1 and 2 repeat until something changes. Pg 72
When STP changes • If HELLO isn’t received after MAX Age • Switches will re-elect root and root ports and Designated ports • When changes occur, port states change • Transition states • Listening: Like the Blocking State, the interface does not forward frames. Old, now- incorrect MAC table entries are timed out during this state, because the old incorrect MAC table entries would be the root cause of the temporary loops. • Learning: Interfaces in this state still do not forward frames, but the switch begins to learn the MAC addresses of frames received on the interface. • STP changes can cause delays Pg 73-75
STP Port States Pg 75
Optional Features • Etherchannel • Bind multiple connections together so STP doesn’t see them as redundant connections • Portfast • Go straight to Forwarding state • Used on ports that always connect to hosts • No bridges, switches or STP devices • STP Security • BPDU Guard • Will disable port if BPDU are received • Root Guard • Will disable port if better HELLO is received Pg 76-78
RTSP (802.1w) ■ It elects the root switch using the same parameters and tiebreakers. ■ It elects the root port on nonroot switches with the same rules. ■ It elects designated ports on each LAN segment with the same rules. ■ It places each port in either Forwarding or Blocking State, although RSTP calls the Blocking State the Discarding State. Pg 78
RSTP • Faster convergence times • Reduces time to wait when there are changes • Instead of MAX Age-Hello * 3 • Instead of Forward Delay-No delay Pg 78
RSTP Link and Edge Types • Link-Type point-to-point • Between two switches • Link-Type shared • Switch to hub • Edge-Type • Switch to PC Pg 79
RSTP Port States Pg 80
RSTP Port Roles Pg 82
RSTP Convergence • All switches send out HELLOs • Not just forwarding root HELLO BPDU • Edge-Type connections • Immediate portfast • Link type shared • No change • Link Type point-to-point • Faster to recognize lost path • No listening state and reduced time for learning Pg 83
RSTP 1 and 2 Pg 84
RSTP Convergence end Pg 86
Multiple Instances of STP • Each VLAN has STP • Default switch uses STP and Per-VLAN STP + • PVSTP+ can load balance Pg 87
STP and VLANS Pg 88
STP Options • Cisco Devices use a custom BID format Pg 89
Config options Pg 90
Verifying STP • Show spanning-tree/Show spanning-tree vlan 3 • Lets you see your BID and root bridge ID • Show spanning-tree root • Lets you see details about the root bridge in each instance of STP Pg 90-92
Configuring Port Costs and Priority • Debug spanning-tree events • See details as they come in • On an interface use spanning-tree vlan 3 cost 3 • Change the port cost from the defaults-see page 90 • Spanning-tree vlan ID root primary • Will change the priority of the Switch so it will become root bridge • Spanning-tree vlan ID root secondary • Will change the priority of the Switch so it will become root bridge if root fails Pg 94
Portfast, BPDU guard • On an interface • Spanning-tree portfast • Spanning-tree bpduguard enable Pg 95
Etherchannel • On interfaces that you want in etherchannel • channel-group 1 mode on • Too see details • Show etherchannle 1 summary Pg96
Config RSTP • Spanning-tree mode rapid-pvst Pg97
STP Troubleshooting • Which interfaces will forward or block • Review port costs and rules • Steps • Step 1 Determine the root switch. • Step 2 For each nonroot switch, determine its one root port (RP) and cost to reach the root switch through that RP. • Step 3 For each segment, determine the designated port (DP) and the cost advertised by the DP onto that segment. Pg 98
Root Switch • Show spanning-tree or show spanning-tree vlan id • If not root, find Root Port and use CDP to see what is connected • Telnet to next switch • Follow till you get to root Pg 99
Determining Root Port Pg 101-102
Designated Port • One DP in each segment • Each connection between switch and device is a segment Pg 102-103