Cisco Spanning Tree Protocol Discussion

1,399 views

Published on

Cisco Spanning Tree Protocol Discussion

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,399
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
80
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Cisco Spanning Tree Protocol Discussion

  1. 1. Cisco Spanning Tree Protocol DiscussionSpanning Tree Protocol (STP) ensures a loop-free topology in a local area network(LAN) made up of switches. It is desirable to have redundant links in a switched LANso that a single link failure cannot interrupt normal operation of the network. Butredundant links may also introduce physical switching loops that are undesirable. STPallows having physical redundancy while preventing loops and associated drawbacks.Spanning Tree Protocol is standardized as IEEE 802.1D. Cisco introduced severalenhancements to the standard STP operation that were later incorporated in RapidSpanning Tree Protocol (RSTP) defined as IEEE 802.1w.We will focus on Spanning Tree Protocol (STP) configuration and verificationcommands in this tutorial, as implemented on Cisco switches. Figure 1 shows thetopology with three Cisco Catalyst 3550 switches that have been used.Figure 1 Spanning Tree Protocol on Cisco SwitchesThere are three trunk links as shown in Figure 1:SW1 Fa0/1 – SW2 Fa0/1SW2 Fa0/2 – SW3 Fa0/1SW3 Fa0/2 – SW1 Fa0/2The three switches were interconnected and turned on and without any additionalconfiguration the three trunks were negotiated dynamically by Dynamic TrunkingProtocol (DTP). Let’s verify the trunks are successfully established on SW1.SW1#show interfaces trunkPort Mode Encapsulation Status Native vlanFa0/1 desirable n-isl trunking 1Fa0/2 desirable n-isl trunking 1<Output omitted for brevity>
  2. 2. You can use similar commands on SW2 and SW3 to verify successful trunkestablishment. Three spanning tree modes can be configured on Cisco switches asshown in the output below.SW1(config)#spanning-tree mode ?mst Multiple spanning tree modepvst Per-Vlan spanning tree moderapid-pvst Per-Vlan rapid spanning tree modeBy default, Cisco Catalyst 3550 switches used to build this scenario have spanningtree enabled in pvst mode. PVST stands for Per-VLAN Spanning Tree Protocol and thismode runs an instance of IEEE 802.1d STP for each VLAN.The output of show spanning-tree summary command below shows that spanningtree is running in pvst mode on SW1.SW3#show spanning-tree summarySwitch is in pvst modeRoot bridge for: noneExtended system ID is enabledPortfast Default is disabledPortFast BPDU Guard Default is disabledPortfast BPDU Filter Default is disabledLoopguard Default is disabledEtherChannelmisconfig guard is enabledUplinkFast is disabledBackboneFast is disabledConfigured Pathcost method used is short<Output omitted for brevity>The first step in spanning tree convergence involves electing the root switch. Theswitch with the lowest bridge ID wins the election. The standard bridge ID is an8-byte value made up of a 2-byte priority and a 6-byte MAC address unique to thatswitch. You can use show spanning-tree bridge id command to find out the bridge IDof a switch.SW1#show spanning-tree bridge idVLAN0001 8001.0016.c831.9000SW2#show spanning-tree bridge idVLAN0001 8001.000f.24b7.1400SW3#show spanning-tree bridge idVLAN0001 8001.000f.233b.8a80
  3. 3. The switch with the lowest bridge ID wins the root election. In our scenario, SW3happens to have the lowest bridge ID so it should become the root switch. You caninfluence the root switch election for a VLAN by manipulating the priority as shownbelow, however we are sticking to the default priority in this scenario.SW3(config)#spanning-tree vlan 1 priSW3(config)#spanning-tree vlan 1 priority ?<0-61440> bridge priority in increments of 4096You can see by running command show spanning-tree root that the root ID matchesthe bridge ID of SW3 indicating that it is the root switch. Please note in the commandoutput below that the priority is shown as a decimal value 32769 that equalshexadecimal 8001 shown as part of all bridge IDs earlier.SW3#show spanning-tree rootRoot Hello Max FwdVlan Root ID RootCost HelloTime MaxAge FwdDly Root Port———- ——————– —- ——- — —– ———VLAN0001 32769 000f.233b.8a80 0 2 20 15The next step in STP convergence is for each switch to determine its root port (RP)which is the one port with the least cost path back to the root. Path cost is calculatedby simply adding the spanning tree cost of all outgoing interfaces on the path to theroot switch. Fast Ethernet interfaces used in this scenario have a default cost of 19each.The root switch does not have a root port because it is itself the root; all the ports onthe root switch are designated ports. SW1 settles with having Fa0/2 as its root portwhile SW2 also has its Fa0/2 as root port.The last major step invloves determining the desginated port (DP) for each segment.When multiple switches connect to the same segment, this is the switch interfacethat provides the least cost path back to the root for that segment. Our scenario hasthree segments and a single designated port has been determined for each as shownin the figure. The show spanning-tree command executed on SW1, SW2, and SW3validates these facts.SW1#show spanning-treeVLAN0001Spanning tree enabled protocol ieeeRoot ID Priority 32769Address 000f.233b.8a80Cost 19Port 2 (FastEthernet0/2)Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
  4. 4. Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)Address 0016.c831.9000Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 300Interface Role Sts Cost Prio.Nbr Type——————- —- — ——— ——– —————–Fa0/1 Altn BLK 19 128.1 P2pFa0/2 Root FWD 19 128.2 P2pSW2#show spanning-treeVLAN0001Spanning tree enabled protocol ieeeRoot ID Priority 32769Address 000f.233b.8a80Cost 19Port 2 (FastEthernet0/2)Hello Time 2 sec Max Age 20 sec Forward Delay 15 secBridge ID Priority 32769 (priority 32768 sys-id-ext 1)Address 000f.24b7.1400Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 300Interface Role Sts Cost Prio.Nbr Type——————- —- — ——— ——– —————–Fa0/1 Desg FWD 19 128.1 P2pFa0/2 Root FWD 19 128.2 P2pSW3#show spanning-treeVLAN0001Spanning tree enabled protocol ieeeRoot ID Priority 32769Address 000f.233b.8a80This bridge is the rootHello Time 2 sec Max Age 20 sec Forward Delay 15 secBridge ID Priority 32769 (priority 32768 sys-id-ext 1)Address 000f.233b.8a80Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 300Interface Role Sts Cost Prio.Nbr Type——————- —- — ——— ——– —————–Fa0/1 Desg FWD 19 128.1 P2pFa0/2 Desg FWD 19 128.2 P2pLet’s change the port cost on Fa0/2 of SW2 from default of 19 to 39 and see how portroles change. At the moment Fa0/2 is the root port on SW2 providing the lease cost
  5. 5. path to the root switch SW3.SW2>enableSW2#configure terminalEnter configuration commands, one per line. End with CNTL/Z.SW2(config)#interface FastEthernet0/2SW2(config-if)#spanning-tree cost 39SW2(config-if)#endSW2#After this change, spanning tree would re-converge, having SW2 choose the indirectpath through SW1 to reach the root switch SW3 because it now happens to be theleast cost path with cost 38. The direct path SW2 has to the root switch SW3 viaFa0/2 has now cost 39 and is not the best cost path. SW2 would put Fa0/1 inforwarding state as root port while Fa0/2 would be put in the blocking state asshown here.SW2#show spanning-treeVLAN0001Spanning tree enabled protocol ieeeRoot ID Priority 32769Address 000f.233b.8a80Cost 38Port 1 (FastEthernet0/1)Hello Time 2 sec Max Age 20 sec Forward Delay 15 secBridge ID Priority 32769 (priority 32768 sys-id-ext 1)Address 000f.24b7.1400Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 300Interface Role Sts Cost Prio.Nbr Type——————- —- — ——— ——– —————–Fa0/1 Root FWD 19 128.1 P2pFa0/2 Altn BLK 39 128.2 P2pYou should proceed and run show spanning-tree command on SW1 and SW3 as wellto find out how the spanning tree topology changed after re-convergence.More Related Cisco STP Tips:How to Configure Spanning Tree Protocol (STP) on Catalyst Switches?STP (Spanning Tree Protocol) Path Selection

×