340 likes | 370 Views
CIT 384: Network Administration. Spanning Tree Protocol. Topics. Redundant LAN Problems 802.1d Spanning Tree. Redundant LAN Problems. Broadcast Storms Forwarding of frame repeatedly on same links, consuming most bandwidth. MAC Table Instability
E N D
CIT 384: Network Administration Spanning Tree Protocol CIT 384: Network Administration
Topics • Redundant LAN Problems • 802.1d Spanning Tree CIT 384: Network Administration
Redundant LAN Problems Broadcast Storms • Forwarding of frame repeatedly on same links, consuming most bandwidth. MAC Table Instability • Continual updating of a switch’s MAC address table with incorrect entries in reaction to looping frames, resulting in frames being sent to the wrong locations. Multiple Frame Transmission • Looping frames result in multiple copies of same frame being received by destination host, confusing some apps. CIT 384: Network Administration
Broadcast Storms • Bob sends broadcast from 0200.3333.3333. • SW3 forwards broadcast to SW1 and SW2 • SW3 learns that Bob is on port Fa 0/13 • SW2 forwards broadcast to SW1 and SW3 • SW3 forwards broadcast to SW1 and SW2 • SW3 learns that Bob is on port Gi 0/2 CIT 384: Network Administration
Blocking and Forwarding Ports STP prevents loops by placing switch ports that could cause loops in a Blocking State. Blocking State ports only process STP pkts. Forwarding State ports act normally. CIT 384: Network Administration
Spanning Tree • A tree is a type of graph, such that there is one and only one path joining any 2 vertices • A spanning tree is a tree that spans all vertices of the original graph. CIT 384: Network Administration
Forwarding Criteria • STP elects a root switch. STP puts all working interfaces on root switch in Forwarding State. • Each nonroot switch considers one of its ports to have least administrative cost between itself and root switch. STP puts this least root cost interface, called the switch’s root port, in Forwarding State. • For switch’s attached to the same Ethernet segment, the switch with the lowest admin cost is placed in Forwarding State. The lowest-cost switch on each segment is called the designated bridge and that port is the Designated Port. • All other ports are in Blocking State. CIT 384: Network Administration
Algorhyme by Radia Perlman I think that I shall never see A graph more lovely than a tree. A tree whose crucial property Is loop-free connectivity. A tree which must be sure to span So packets can reach every LAN. First the Root must be selected By ID it is elected. Least cost paths from Root are traced In the tree these paths are placed. A mesh is made by folks like me Then bridges find a spanning tree. CIT 384: Network Administration
Bridge ID and Hello BPDU Bridge ID: 8-byte value unique to switch 2 byte priority field + 6 byte MAC address Bridge Protocol Data Units (BPDU) Hello BPDU sends switch’s bridge ID and other values: CIT 384: Network Administration
Root Bridge Election Root Bridge has lowest BridgeID. • Since first digits are priority, lowest pri wins. • If priority ties, then lowest MAC address wins. Election process • Switches claim to be root, sending Hello BPDUs with their own ID as the root ID. • If switch hears a Hello with a lower root ID, then it starts forwarding that ID as root ID. • After a root is chosen, only root sends Hello BPDUs, but other switches forward them. CIT 384: Network Administration
Root Bridge Election CIT 384: Network Administration
Choosing a Root Port Root port is port with lowest STP cost to reach the root switch. Cost = Hello cost + STP port cost If multiple ports have least cost, choose: • Port with lowest configured port priority, or if that ties • Port with lowest internal port number CIT 384: Network Administration
Choosing Root Ports CIT 384: Network Administration
Choosing a Designated Port Choose a DP on each LAN segment. • DP is switch port that advertised lowest Hello on segment. • All DPs are placed into Forwarding State. Default port costs based on Ethernet speed: CIT 384: Network Administration
Final Port States CIT 384: Network Administration
Final STP State of Example CIT 384: Network Administration
Reacting to Network Changes • Root switch sends Hello BPDU every 2 sec. • Switches forward Hello BPDUs from root. • Changing root cost and sender bridge ID. • If switch does not receive Hello BPDU for Max Age, it will start changing STP topology. • Max Age is 10 times Hello timer by default. • Switch will decide if it’s the new root bridge. • If not, will recalculate RP and DPs. CIT 384: Network Administration
Reacting to Network Changes • SW3 fails to receive Hello BPDUs on Gi0/1. • SW3 decides SW1 is still root based on forwarded Hello from SW2. • SW3 re-evaluates RP, decides on Gi0/2. CIT 384: Network Administration
Intermediate STP states • Direct Block to Forward transition can temporarily cause a loop. • STP uses intermediate states. • Listening: Does not forward frames. Old, now incorrect MAC table entries timed out during state, because these entries would cause temporary loops. • Learning: Does not forward frames, but switch begins to learn MAC table entries in this state. • Remains in state for Forward Delay timer. CIT 384: Network Administration
EtherChannel • Combine parallel connections of equal speed between same pair of switches into a single link. • EtherChannel link fails only when all connections fail, avoiding STP convergence unless all fail. CIT 384: Network Administration
EtherChannel (config)# interface fa 0/3 (config-if)# channel-group 1 mode on (config)# interface fa 0/4 (config-if)# channel-group 1 mode on EtherChannel Modes on: both sides must be an EtherChannel auto: wait for other side to negotiate EtherChannel (other side must be on or desirable) desirable: attempt to negotiate EtherChannel CIT 384: Network Administration
PortFast and BPDU Guard A PortFast port is always in Forwarding State. • Bypasses any choices about STP topology. • Only safe for ports that do not connect to other bridges or switches. BPDU Guard disables port if BPDUs received. • Useful in combination with PortFast. • Prevents end-user from introducing a switch with low bridge ID that becomes root switch. CIT 384: Network Administration
Rapid STP (802.1w) • RSTP reduces convergence time • STP takes MaxAge + 2*ForwardDelay=50s • RSTP typically converges under 10s • RSTP categories physical connectivity • Link-type point-to-point • Link-type shared • Edge type • RSTP will not improve convergence in networks that use hubs (shared connections.) CIT 384: Network Administration
RSTP Link and Edge Types CIT 384: Network Administration
RSTP Port Roles Alternate: best alternative to current RP. Backup: second link to same LAN segment. CIT 384: Network Administration
RSTP Changes Edge-Type • Immediately places edge ports in Forwarding state like Cisco’s PortFast feature. Link-Type Shared • Behave identically to STP. Link-Type Point-to-Point • MaxAge = 3 * Hello timer = 6s • Does not use Listening state when changing. • Reduces time required in Learning state by sending RSTP messages to negotiate. CIT 384: Network Administration
RSTP Convergence Example • SW4 selects port on new link as root port. • SW4 temp blocks all other link-type ports to avoid loops. • SW4 negotiates with SW1 using RSTP proposal and agreement messages, allowing SW1 and SW4 to place ports in Forwarding state immediately. CIT 384: Network Administration
RSTP Convergence Example • SW4 forwards new root BPDU to SW3 • SW3 changes root port to port to SW4. • SW3 blocks all other link-type ports. CIT 384: Network Administration
RSTP Convergence Example • SW3 and SW4 negotiate. • SW4 forwards to root through SW3. • SW3 maintains blocking on port to SW2. CIT 384: Network Administration
VLANs and STP Cisco proprietary per-VLAN STP variants PVST+ for STP, PVRST for RSTP Multiple Instances of Spanning Trees (MIST) IEEE 802.1s standard supports only RSTP CIT 384: Network Administration
Bridge IDs with VLANs STP System ID extension 16-bit priority = 4-bit priority + 12-bit VLAN ID Example: priority = 8 VLAN 1 = 32,769, VLAN 2 = 32,770, etc. CIT 384: Network Administration
STP Defaults and Options CIT 384: Network Administration
STP Status Example SW1#show spanning-tree vlan 3 VLAN0003 Spanning tree enabled protocol ieee Root ID Priority 32771 Address 0019.e859.5380 Cost 19 Port 16 (FastEthernet0/16) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32771 (priority 32768 sys-id-ext 3) Address 0019.e86a.6f80 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Fa0/11 Desg FWD 19 128.11 P2p Fa0/16 Root FWD 19 128.16 P2p Fa0/17 Altn BLK 19 128.17 P2p SW1#show spanning-tree root Root Hello Max Fwd Vlan Root ID Cost Time Age Dly Root Port ---------------- -------------------- --------- ----- --- --- ------------ VLAN0001 32769 0019.e859.5380 19 2 20 15 Fa0/16 VLAN0002 32770 0019.e859.5380 19 2 20 15 Fa0/16 VLAN0003 32771 0019.e859.5380 19 2 20 15 Fa0/16 VLAN0004 32772 0019.e859.5380 19 2 20 15 Fa0/16 CIT 384: Network Administration
References • James Boney, Cisco IOS in a Nutshell, 2nd edition, O’Reilly, 2005. • Cisco, Cisco Connection Documentation, http://www.cisco.com/univercd/home/home.htm • Cisco, Internetworking Basics, http://www.cisco.com/univercd/cc/td/doc/cisintwk/ito_doc/introint.htm • Matthew Gast, 802.11 Wireless Networks: The Definitive Guide, O’Reilly, 2005. • Wendell Odom, CCNA Official Exam Certification Library, 3rd edition, Cisco Press, 2007. CIT 384: Network Administration