Implementing Spanning Tree Protocol

Slides:



Advertisements
Similar presentations
© 2008 Cisco Systems, Inc. All rights reserved.Cisco ConfidentialPresentation_ID 1 Chapter 2: LAN Redundancy Scaling Networks.
Advertisements

Communication Networks Recitation 3 Bridges & Spanning trees.
Part 2: Preventing Loops in the Network
Spanning Tree Protocol
Switching & Operations. Address learning Forward/filter decision Loop avoidance Three Switch Functions.
1 CCNA 3 v3.1 Module 7. 2 CCNA 3 Module 7 Spanning Tree Protocol (STP)
STP Spanning tree protocol. Trunk port : A trunk port is a port that is assigned to carry traffic for all the VLANs that are accessible by a specific.
Spanning Tree protocol- Chapter 5
Ch. 8 – Spanning Tree Protocol
© 2009 Cisco Systems, Inc. All rights reserved. SWITCH v1.0—3-1 Implementing Spanning Tree Spanning Tree Protocol Enhancements.
Spanning Tree Protocol
LOGO Local Area Network (LAN) Layer 2 Switching and Virtual LANs (VLANs) Local Area Network (LAN) Layer 2 Switching and Virtual LANs (VLANs) Chapter 6.
Layer 2 Switch  Layer 2 Switching is hardware based.  Uses the host's Media Access Control (MAC) address.  Uses Application Specific Integrated Circuits.
© 2008 Cisco Systems, Inc. All rights reserved.Cisco ConfidentialPresentation_ID 1 Chapter 2: LAN Redundancy Scaling Networks.
© 2008 Cisco Systems, Inc. All rights reserved.Cisco ConfidentialPresentation_ID 1 Chapter 2: LAN Redundancy Scaling Networks.
1 © 2004, Cisco Systems, Inc. All rights reserved. CCNA 3 v3.1 Module 7 Spanning Tree Protocol.
© 2008 Cisco Systems, Inc. All rights reserved.Cisco ConfidentialPresentation_ID 1 Lecture 12: LAN Redundancy Switched Networks Assistant Professor Pongpisit.
1 CS 4396 Computer Networks Lab LAN Switching and Bridges.
1 © 2003, Cisco Systems, Inc. All rights reserved. CCNA 3 v3.0 Module 7 Spanning-Tree Protocol Cisco Networking Academy.
© 2006 Cisco Systems, Inc. All rights reserved.Cisco PublicITE I Chapter 6 1 Implement Spanning Tree Protocols LAN Switching and Wireless – Chapter 5.
Saeed Darvish Pazoki – MCSE, CCNA Abstracted From: Cisco Press – ICND 2 – Chapter 2 Spanning tree Protocol 1.
© 2006 Cisco Systems, Inc. All rights reserved.Cisco PublicITE I Chapter 6 1 Implement Spanning Tree Protocols LAN Switching and Wireless – Chapter 5 Part.
Example STP runs on bridges and switches that are 802.1D-compliant. There are different flavors of STP, but 802.1D is the most popular and widely implemented.
Spanning Tree Protocol Cisco Networking Academy Program © Cisco Systems, Inc Spanning Tree Protocol.
© 2006 Cisco Systems, Inc. All rights reserved.Cisco PublicITE I Chapter 6 1 LAN Switching and Wireless Implement Spanning Tree Protocols (STP) Chapter.
Ch. 18/Mod. 7 Spanning Tree Protocol CCNA 3 version 3.0.
Cisco 3 – Switching STP Perrine. J Page 110/19/2015 Chapter 8 Spanning Tree Protocol (STP) Having redundancy in a network is important, and allows the.
LOGO Local Area Network (LAN) Layer 2 Switching and Virtual LANs (VLANs) Local Area Network (LAN) Layer 2 Switching and Virtual LANs (VLANs) Chapter 6.
Configuring Cisco Switches Chapter 13 powered by DJ 1.
S7C5 – Spanning Tree Protocol And other topics. Switch Port Aggregation Bundling –Combining 2 to 8 links of FE (Fast Ethernet) or GE (Gigabit) Full duplex.
Instructor & Todd Lammle
Spanning Tree V1.2 Slide 1 of 1 Purpose:
STP LAN Redundancy Introduction Network redundancy is a key to maintaining network reliability. Multiple physical links between devices provide redundant.
1 Data Link Layer Lecture 23 Imran Ahmed University of Management & Technology.
Switching Topic 6 Rapid spanning tree protocol. Agenda RSTP features – Port states – Port roles – BPDU format – Edge ports and link types – Proposals.
1 © 2003, Cisco Systems, Inc. All rights reserved. CCNA 3 v3.0 Module 7 Spanning Tree Protocol.
1 Version 3.0 Module 7 Spanning Tree Protocol. 2 Version 3.0 Redundancy Redundancy in a network is needed in case there is loss of connectivity in one.
CCNP 3: Chapter 3 Implementing Spanning Tree. Overview Basics of implementing STP Election of Root Bridge and Backup Enhancing STP RSTP MSTP EtherChannels.
Spanning Tree protocol
Topic 5 Spanning tree protocol
CO5023 LAN Redundancy.
Lecture3 Secured Network Design W.Lilakiatsakun.  Spanning Tree Protocol (STP)  Attack on Spanning Tree Protocol Topics.
© 2006 Cisco Systems, Inc. All rights reserved.Cisco PublicITE I Chapter 6 1 Implement Spanning Tree Protocols (STP) LAN Switching and Wireless – Chapter.
Chapter-5 STP. Introduction Examine a redundant design In a hierarchical design, redundancy is achieved at the distribution and core layers through additional.
Exploration 3 Chapter 5. Redundancy in Switched Networks Switches learn the MAC addresses of devices on their ports so that data can be properly forwarded.
Instructor Materials Chapter 3: STP
Spanning Tree Protocol
Spanning Tree Protocol
CIT 384: Network Administration
Implement Spanning Tree Protocols-PART-I
Spanning Tree Algorithm
Topic: Spanning Tree Protocol
Spanning Tree Protocols
Instructor & Todd Lammle
Lecture#10: LAN Redundancy
Configuring Catalyst Switch Operations
Spanning Tree Protocol
© 2002, Cisco Systems, Inc. All rights reserved.
Spanning Tree Protocol
Spanning Tree.
LAN switching and Bridges
CS 4700 / CS 5700 Network Fundamentals
NT2640 Unit 9 Activity 1 Handout
STP – Spanning Tree Protocol A closer look
CCNA Routing and Switching Scaling Networks v6.0
Spanning Tree Protocol (STP)
LAN switching and Bridges
CS 4700 / CS 5700 Network Fundamentals
Cisco networking CNET-448
LAN switching and Bridges
Presentation transcript:

Implementing Spanning Tree Protocol

Transparent Bridging A switch has the same characteristics as a transparent bridge.

Redundant Topology Server/host X Router Y Segment 1 Segment 2 Slide 1 of 1 Purpose: Emphasize: Layer 2 has no mechanism (like a TTL) to stop loops. Redundant topology eliminates single points of failure Redundant topology causes broadcast storms, multiple frame copies, and MAC address table instability problems

Host X sends a Broadcast Broadcast Storms Server/host X Router Y Segment 1 Broadcast Switch A Switch B Slide 1 of 3 Purpose: Emphasize: Broadcast frames are flooded. Segment 2 Host X sends a Broadcast

Host X sends a Broadcast Broadcast Storms Server/host X Router Y Segment 1 Broadcast Switch A Switch B Slide 2 of 3 Purpose: Emphasize: Segment 2 Host X sends a Broadcast

Broadcast Storms Server/host X Router Y Segment 1 Switch A Broadcast Switch B Slide 3 of 3 Purpose: Emphasize: Layer 2 has no TTL mechanism to stop looping frames. Segment 2 Switches continue to propagate broadcast traffic over and over

Multiple Frame Copies Host X sends an unicast frame to router Y Server/host X Router Y Segment 1 Switch A Switch B Slide 1 of 2 Purpose: Emphasize: This slide assumes Router Y Mac address has not been learned by Switch A and Switch B yet so the unknown unicast frame to Router Y will be flooded. Segment 2 Host X sends an unicast frame to router Y Router Y MAC address has not been learned by either switch yet

Multiple Frame Copies Host X sends an unicast frame to Router Y Server/host X Router Y Segment 1 Unicast Unicast Switch B Switch A Slide 2 of 2 Purpose: Emphasize: Segment 2 Host X sends an unicast frame to Router Y Router Y MAC Address has not been learned by either Switch yet Router Y will receive two copies of the same frame

MAC Database Instability Server/host X Router Y Segment 1 Unicast Unicast Port 0 Port 0 Switch A Switch B Port 1 Port 1 Slide 1 of 2 Purpose: Emphasize: This slide assumes Router Y Mac address has not been learned by Switch A and Switch B yet so the unknown unicast frame to Router Y will be flooded. Segment 2 Host X sends an unicast frame to Router Y Router Y MAC Address has not been learned by either Switch yet Switch A and B learn Host X MAC address on port 0

MAC Database Instability Server/host X Router Y Segment 1 Unicast Unicast Port 0 Port 0 Switch A Switch B Port 1 Port 1 Slide 2 of 2 Purpose: Emphasize: Segment 2 Host X sends an unicast frame to Router Y Router Y MAC Address has not been learned by either Switch yet Switch A and B learn Host X MAC address on port 0 Frame to Router Y is flooded Switch A and B incorrectly learn Host X MAC address on port 1

Preventing Bridging Loops Bridging loops can be prevented by disabling the redundant path.

Spanning Tree Algorithm (STA) Part of 802.1d standard Simple principle: Build a loop-free tree from some identified point known as the root. Redundant paths allowed, but only one active path. Developed by Radia Perlman

The Spanning Tree 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 that 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.

Bridge Protocol Data Unit BPDUs provide for the exchange of information between switches.

Root Bridge Selection

The STP Root Bridge Reference point One root per VLAN Maintains topology Propagates timers

Extended System ID in Bridge ID Field Bridge ID Without the Extended System ID Bridge ID with the Extended System ID

Bridge ID (BID) Each switch has a unique BID. Original 802.1D standard, the BID = Priority Field +MAC address of the switch. All VLANs were represented by a CST – one spanning tree for all vlans (later). PVST requires that a separate instance of spanning tree run for each VLAN BID field is required to carry VLAN ID (VID). Extended system ID to carry a VID.

802.1D 16-bit Bridge Priority Field Using the Extended System ID Only four high-order bits of the 16-bit Bridge Priority field carry actual priority. Therefore, priority can be incremented only in steps of 4096, onto which will be added the VLAN number. Example: For VLAN 11: If the priority is left at default, the 16-bit Priority field will hold 32768 + 11 = 32779. 4 bits 12 bits Priority VLAN Number 20 215 Priority Values (Hex) Priority Values (Dec) 0 0 1 4096 2 8192 . . . . 8 (default) 32768 . . F 61440

What is the Priority of Access1?

Spanning Tree Protocol Root Bridge Selection Which switch has the lowest bridge ID?

Spanning-Tree Operation One root bridge per network One root port per nonroot bridge One designated port per segment Nondesignated ports are blocked

Four-Step Spanning-Tree Decision Process Lowest root BID Lowest path cost to root bridge Lowest sender BID Lowest port ID

Spanning Tree Port States Spanning tree transitions each port through several different states.

STP Timers

STP Timers Hello Time IEEE specifies default of 2 seconds. The interval between Configuration BPDUs. The Hello Time value configured at the root bridge determines the Hello Time for all nonroot switches. Locally configured Hello Time is used for the TCN BPDU.

STP Timers Forward Delay Timer The default value of the forward delay (15 seconds) Originally derived assuming a maximum network size of seven bridge hops A maximum of three lost BPDUs, and a hello-time interval of 2 seconds. See LAN Switching, by Clark, or other resources for this calculation Forward delay is used to determine the length of: Listening state Learning state

STP Timers Max Age Timer Max Age is the time that a bridge stores a BPDU before discarding it. Each port saves a copy of the best BPDU it has received. If the device sending this best BPDU fails, it may take 20 seconds before a switch transitions the connected port to Listening.

STP Timers Modifying Timers Do not change the default timer values without careful consideration. Cisco recommends to modify the STP timers only on the root bridge The BPDUs pass these values from the root bridge to all other bridges in the network. It can take 30-50 seconds for a switch to adjust to a change in topology. Switch(config)# spanning-tree vlan vlan-id [forward-time seconds | hello-time hello-time | max-age seconds | priority priority | protocol protocol | {root {primary | secondary} [diameter net-diameter [hello-time hello-time]]}]

Local Switch Root Port Election

Spanning-Tree Path Cost

Spanning Tree Protocol Root Port Selection Fast Ethernet RP Ethernet SW X is the root bridge SW Y needs to elect a root port Which port is the root port on SW Y? FastEthernet total cost = 0 + 19 Ethernet total cost = 0 + 100

Spanning Tree Protocol Designated Port Selection Fast Ethernet RP DP DP Ethernet Switch X is the root bridge. All ports on the root bridge are designated ports. Do all segments have a designated port?

STP Root Bridge Selection Example Which bridge will be the root bridge?

STP Root Port Selection Example Which ports will be root ports?

STP Designated Port Selection Example Which port becomes the designated port on segment 3?

Example: Layer 2 Topology Negotiation

FYI: BPDU key concepts BPDU key concepts: Bridges save a copy of only the best BPDU seen on every port. When making this evaluation, it considers all of the BPDUs received on the port, as well as the BPDU that would be sent on that port. As every BPDU arrives, it is checked against this five-step sequence to see if it is more attractive (lower in value) than the existing BPDU saved for that port. Only the lowest value BPDU is saved. Bridges send configuration BPDUs until a more attractive BPDU is received. Okay, lets see how this is used... BPDU key concepts: Bridges save a copy of only the best BPDU seen on every port. When making this evaluation, it considers all of the BPDUs received on the port, as well as the BPDU that would be sent on that port. As every BPDU arrives, it is checked against this five-step sequence to see if it is more attractive (lower in value) than the existing BPDU saved for that port. Only the lowest value BPDU is saved. Bridges send configuration BPDUs until a more attractive BPDU is received. Okay, lets see how this is used...

Case Study

Elect one Root Bridge Lowest BID wins! Who wins?

What is the BID of this switch? Who is the Root? Use this command to view the information on the other four switch.

What is the BID of this switch? Who is the Root?

What is the BID of this switch? Who is the Root?

What is the BID of this switch? Who is the Root?

What is the BID of this switch? Who is the Root?

Elect one Root Bridge Lowest BID wins! My BID is 32768.0001.C945.A573 Who wins? My BID is 32768.0005.5E0D.9315 My BID is 32768.0060.47B0.5850 My BID is 32768.0001.964E.7EBB I win! My BID is 32768.0003.E461.46EC

Elect one Root Bridge Lowest BID wins! Its all done with BPDUs! BPDU 802.3 Header Destination: 01:80:C2:00:00:00 Mcast 802.1d Bridge group Source: 00:D0:C0:F5:18:D1 LLC Length: 38 802.2 Logical Link Control (LLC) Header Dest. SAP: 0x42 802.1 Bridge Spanning Tree Source SAP: 0x42 802.1 Bridge Spanning Tree Command: 0x03 Unnumbered Information 802.1 - Bridge Spanning Tree Protocol Identifier: 0 Protocol Version ID: 0 Message Type: 0 Configuration Message Flags: %00000000 Root Priority/ID: 0x8000/ 00:D0:C0:F5:18:C0 Cost Of Path To Root: 0x00000000 (0) Bridge Priority/ID: 0x8000/ 00:D0:C0:F5:18:C0 Port Priority/ID: 0x80/ 0x1D Message Age: 0/256 seconds (exactly 0 seconds) Maximum Age: 5120/256 seconds (exactly 20 seconds) Hello Time: 512/256 seconds (exactly 2 seconds) Forward Delay: 3840/256 seconds (exactly 15 seconds)

BPDUs BPDUs sent/relayed every two seconds. BPDU BPDU BPDU BPDU BPDU

Root Bridge Selection Criteria My BID is 32768.0001.C945.A573 I’m the root! Who wins? My BID is 32768.0060.47B0.5850 I’m the root! My BID is 32768.0005.5E0D.9315 I’m the root! My BID is 32768.0003.E461.46EC I’m the root! My BID is 32768.0001.964E.7EBB I’m the root! I win! At the beginning, all bridges assume and declare themselves as the Root Bridge, by placing its own BID in the Root BID field of the BPDU.

Elect one Root Bridge Lowest BID wins!

Once all of the switches see that Access2 has the lowest BID, they are all in agreement that Access2 is the Root Bridge. Root Bridge

Elect Root Ports STP Convergence Step 1 Elect one Root Bridge Step 2 Elect Root Ports Step 3 Elect Designated Ports Now that the Root War has been won, switches move on to selecting Root Ports. A bridge’s Root Port is the port closest to the Root Bridge. Bridges use the cost to determine closeness. Every non-Root Bridge will select one Root Port! Specifically, bridges track the Root Path Cost, the cumulative cost of all links to the Root Bridge. I will select one Root Port that is closest, best path to the root bridge.

Determining (Electing) the Root Port

Root Bridge, Access2 sends out BPDUs, containing a Root Path Cost of 0. Access1, Distribution1, and Distribution2 receives these BPDUs and adds the Path Cost of the FastEthernet interface to the Root Path Cost contained in the BPDU. Access1, Distribution1, and Distribution2 add Root Path Cost 0 PLUS its Path (port) cost of 19 = 19. This value is used internally and used in BPDUs to other switches. Path Cost BPDU Cost=0+19=19 BPDU Cost=0+19=19 19 19 Root Bridge 19 BPDU Cost=0 BPDU Cost=0+19=19

Root Bridge Difference b/t Path Cost and Root Path Cost Path Cost: The value assigned to each port. Added to BPDUs received on that port to calculate Root Path Cost. Root Path Cost Cumulative cost to the Root Bridge. This is the value transmitted in the BPDU. Calculated by adding the receiving port’s Path Cost to the valued contained in the BPDU. BPDU Cost=0+19=19 BPDU Cost=0+19=19 19 19 Root Bridge 19 BPDU Cost=0 BPDU Cost=0+19=19

What are the Path Costs for Root Bridge Access2? Access2# show spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 32769 Address 0001.964E.7EBB This bridge is the root Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Aging Time 20 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- ----------------------- Fa0/1 Desg FWD 19 128.1 P2p Fa0/3 Desg FWD 19 128.3 P2p Fa0/5 Desg FWD 19 128.5 P2p

What are the Path Costs for Distribution1? Distribution1# show spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 32769 Address 0001.964E.7EBB Cost 19 Port 3(FastEthernet0/3) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 0005.5E0D.9315 Aging Time 20 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- ---------------------- Gi0/1 Desg FWD 4 128.25 P2p Gi0/2 Altn BLK 4 128.26 P2p Fa0/3 Root FWD 19 128.3 P2p Fa0/5 Desg FWD 19 128.5 P2p

What are the Path Costs for Access1? Access1# show spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 32769 Address 0001.964E.7EBB Cost 19 Port 5(FastEthernet0/5) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 0003.E461.46EC Aging Time 20 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------- Fa0/5 Root FWD 19 128.5 P2p Gi1/1 Desg FWD 4 128.25 P2p Gi1/2 Desg FWD 4 128.26 P2p

What are the Path Costs for Distribution2? Distribution2# show spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 32769 Address 0001.964E.7EBB Cost 19 Port 3(FastEthernet0/3) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 0060.47B0.5850 Aging Time 20 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------- Fa0/3 Root FWD 19 128.3 P2p Fa0/5 Altn BLK 19 128.5 P2p Gi0/1 Altn BLK 4 128.25 P2p Gi0/2 Desg FWD 4 128.26 P2p

show spanning-tree detail Use this command to view the Path Cost of an interface. Distribution1# show spanning-tree detail VLAN0001 is executing the ieee compatible Spanning Tree Protocol Bridge Identifier has priority of 32768, sysid 1, 0005.5E0D.9315 Configured hello time 2, max age 20, forward delay 15 Current root has priority 32769 Root port is 3 (FastEthernet0/3), cost of root path is 19 Topology change flag not set, detected flag not set Number of topology changes 0 last change occurred 00:00:00 ago from FastEthernet0/1 Times: hold 1, topology change 35, notification 2 hello 2, max age 20, forward delay 15 Timers: hello 0, topology change 0, notification 0, aging 300

show spanning-tree detail Use this command to view the Path Cost of an interface. Access1# show spanning-tree detail VLAN0001 is executing the ieee compatible Spanning Tree Protocol Bridge Identifier has priority of 32768, sysid 1, 0003.E461.46EC Configured hello time 2, max age 20, forward delay 15 Current root has priority 32769 Root port is 5 (FastEthernet0/5), cost of root path is 19 Topology change flag not set, detected flag not set Number of topology changes 0 last change occurred 00:00:00 ago from FastEthernet0/1 Times: hold 1, topology change 35, notification 2 hello 2, max age 20, forward delay 15 Timers: hello 0, topology change 0, notification 0, aging 300

show spanning-tree detail Use this command to view the Path Cost of an interface. Distribution2# show spanning-tree detail VLAN0001 is executing the ieee compatible Spanning Tree Protocol Bridge Identifier has priority of 32768, sysid 1, 0060.47B0.5850 Configured hello time 2, max age 20, forward delay 15 Current root has priority 32769 Root port is 3 (FastEthernet0/3), cost of root path is 19 Topology change flag not set, detected flag not set Number of topology changes 0 last change occurred 00:00:00 ago from FastEthernet0/1 Times: hold 1, topology change 35, notification 2 hello 2, max age 20, forward delay 15 Timers: hello 0, topology change 0, notification 0, aging 300

show spanning-tree detail Use this command to view the Path Cost of an interface. Access2# show spanning-tree detail VLAN0001 is executing the ieee compatible Spanning Tree Protocol Bridge Identifier has priority of 32768, sysid 1, 0001.964E.7EBB Configured hello time 2, max age 20, forward delay 15 Current root has priority 32769 Topology change flag not set, detected flag not set Number of topology changes 0 last change occurred 00:00:00 ago from FastEthernet0/1 Times: hold 1, topology change 35, notification 2 hello 2, max age 20, forward delay 15 Timers: hello 0, topology change 0, notification 0, aging 300 No Root port – This switch is the Root Bridge!

Switches now send BPDUs with their Root Path Cost out other interfaces. Access 1 uses this value of 19 internally and sends BPDUs with a Root Path Cost of 19 out all other ports. (For simplicity we will not include BPDU to root.) Switches receive BPDU and add their path cost. Note: STP costs are incremented as BPDUs are received on a port, not as they are sent out a port. BPDU Cost=4+19=23 BPDU Cost=4+19=23 19 19 BPDU Cost=19 BPDU Cost=19 19 Root Bridge

Distribution 1 and Distribution 2 receive the BPDUs from Access 1, and adds the Path Cost of 4 to those interfaces, giving a Root Path Cost of 23. However, both of these switches already have an “internal” Root Path Cost of 19 that was received on another interface. (Fa0/3 for each with a Root Path Cost of 19.) Distribution 1 and Distribution 2 use the better BPDU of 19 when sending out their BPDUs to other switches. BPDU Cost=4+19=23 BPDU Cost=4+19=23 19 19 BPDU Cost=19 BPDU Cost=19 19 Root Bridge

Distribution 1 now sends BPDUs with its Root Path Cost out other interfaces. Again, STP costs are incremented as BPDUs are received on a port, not as they are sent out a port. BPDU Cost=4+19=23 BPDU Cost=19+19=38 BPDU Cost=19 19 23 23 19 19 19 Root Bridge BPDU Cost=4+19=23

Root Bridge Final Results Ports show BPDU Received Root Path Cost + Path Cost = Root Path Cost of Interface, after the “best” BPDU is received on that port from the neighboring switch. This is the cost of reaching the Root Bridge from this interface towards the neighboring switch. Now let’s see how this is used! 19+4=23 19+4=23 23+4=27 23+4=27 19+19=38 19+19=38 19 19+4=23 19 19+4=23 19+4=23 19+4=23 19 Root Bridge

show spanning-tree Which port is the Root Port? Core# show spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 32769 Address 0001.964E.7EBB Cost 4 Port 25(GigabitEthernet0/1) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 0001.C945.A573 Aging Time 20 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Gi0/1 Root FWD 4 128.25 P2p Gi0/2 Altn BLK 4 128.26 P2p

show spanning-tree detail Path Cost Which port is the Root Port? Core# show spanning-tree detail VLAN0001 is executing the ieee compatible Spanning Tree Protocol Bridge Identifier has priority of 32768, sysid 1, 0001.C945.A573 Configured hello time 2, max age 20, forward delay 15 Current root has priority 32769 Root port is 25 (GigabitEthernet0/1), cost of root path is 4 Topology change flag not set, detected flag not set Number of topology changes 0 last change occurred 00:00:00 ago from FastEthernet0/1 Times: hold 1, topology change 35, notification 2 hello 2, max age 20, forward delay 15 Timers: hello 0, topology change 0, notification 0, aging 300

Distribution 1 “thought process” Elect Root Ports: This is from the switch’s perspective. Switch, “What is my cost to the Root Bridge?” Later we will look at Designated Ports, which is from the Segment’s perspective. Distribution 1 “thought process” If I go through Core it costs 27. If I go through D2 it costs 38. If I go through A1 it costs 23. If I go through A2 it costs 19. This is the best path to the Root!

? ? Root Bridge Elect Root Ports Every non-Root bridge must select one Root Port. A bridge’s Root Port is the port closest to the Root Bridge. Bridges use the Root Path Cost to determine closeness. ? ? 23 23 27 27 38 38 23 19 19 RP 23 RP 23 23 19 RP Root Bridge

? ? Root Bridge Elect Root Ports Core switch has two equal Root Path Costs to the Root Bridge. In this case we need to look at the five-step decision process. Five-Step decision Sequence Step 1 - Lowest BID Step 2 - Lowest Path Cost to Root Bridge Step 3 - Lowest Sender BID Step 4 - Lowest Port Priority Step 5 - Lowest Port ID ? ? 23 23 27 27 38 38 23 19 19 RP 23 RP 23 23 19 RP Root Bridge

? ? Lower BID Root Bridge My BID is 32768.0005.5E0D.9315 Elect Root Ports Distribution 1 switch has a lower Sender BID than Distribution 2. Core chooses the Root Port of G 0/1. Five-Step decision Sequence Step 1 - Lowest BID Step 2 - Lowest Path Cost to Root Bridge Step 3 - Lowest Sender BID Step 4 - Lowest Port Priority Step 5 - Lowest Port ID ? ? RP 23 My BID is 32768.0005.5E0D.9315 23 My BID is 32768.0060.47B0.5850 Lower BID 27 27 38 38 23 19 19 RP 23 RP 23 23 19 RP Root Bridge

Elect Designated Ports STP Convergence Step 1 Elect one Root Bridge Step 2 Elect Root Ports Step 3 Elect Designated Ports The loop prevention part of STP becomes evident during this step, electing designated ports. A Designated Port functions as the single bridge port that both sends and receives traffic to and from that segment and the Root Bridge. Each segment in a bridged network has one Designated Port, chosen based on cumulative Root Path Cost to the Root Bridge. The switch containing the Designated Port is referred to as the Designated Bridge for that segment. To locate Designated Ports, lets take a look at each segment. Segment’s perspective: From a device on this segment, “Which switch should I go through to reach the Root Bridge?” Root Path Cost, the cumulative cost of all links to the Root Bridge. Obviously, the segment has not ability to make this decision, so the perspective and the decision is that of the switches on that segment.

Root Bridge A Designated Port is elected for every segment. The Designated Port is the only port that sends and receives traffic to/from that segment to the Root Bridge, the best port towards the root bridge. Note: The Root Path Cost shows the Sent Root Path Cost. This is the advertised cost in the BPDU, by this switch out that interface, i.e. this is the cost of reaching the Root Bridge through me! RP 23 23 19 19 19 19 19 19 19 RP 19 RP 19 19 19 RP Root Bridge

A Designated Port is elected for every segment. Segment’s perspective: From a device on this segment, “Which switch should I go through to reach the Root Bridge?” “I’ll decide using the advertised Root Path Cost from each switch!” RP 23 23 ? ? 19 19 ? 19 19 19 19 ? ? 19 RP 19 RP ? ? 19 19 ? 19 RP Root Bridge

? Root Bridge Segment’s perspective: Access 2 has a Root Path Cost = 0 (after all it is the Root Bridge) and Access 1 has a Root Path Cost = 19. Because Access 2 has the lower Root Path Cost it becomes the Designated Port for that segment. RP 23 23 19 19 My designated port will be 0 via Access 2 (Fa0/5). It’s the best path, lowest Root Path, to the Root Bridge. What is my best path to the Root Bridge, 19 via Access 1 or 0 via Access 2? 19 19 19 19 19 RP 19 RP 19 19 ? 19 RP DP Root Bridge

? ? Root Bridge Segment’s perspective: The same occurs between Access 2 and Distribution ,1 and Access 2 and Distribution 2 switches. Because Access 2 has the lower Root Path Cost it becomes the Designated Port for those segments. RP 23 23 19 19 19 19 19 19 ? RP 19 RP 19 ? 19 DP 19 DP 19 RP DP Root Bridge

? Root Bridge Lower BID Segment’s perspective: Segment between Distribution 1 and Access 1 has two equal Root Path Costs of 19. Using the Lowest Sender ID (first two steps are equal), Access 1 becomes the best path and the Designated Port. Five-Step decision Sequence Step 1 - Lowest BID Step 2 - Lowest Path Cost to Root Bridge Step 3 - Lowest Sender BID Step 4 - Lowest Port Priority Step 5 - Lowest Port ID RP 23 23 32768.0005.5E0D.9315 19 19 What is my best path to the Root Bridge, 19 via Distribution 1 or 19 via Access 1? They are the same! Who has the lowest BID? 19 19 19 19 RP 19 RP 19 ? DP 19 DP 19 DP 32768.0003.E461.46EC 19 RP DP Root Bridge Lower BID

Access 1 has Lower Sender BID

? Lower BID Root Bridge 32768.0060.47B0.5850 32768.0005.5E0D.9315 RP 23 23 32768.0060.47B0.5850 32768.0005.5E0D.9315 ? 19 Lower BID 19 DP 19 19 19 19 RP 19 RP 19 19 DP 19 DP 19 RP DP Root Bridge

Five-Step decision Sequence Step 1 - Lowest BID Step 2 - Lowest Path Cost to Root Bridge Step 3 - Lowest Sender BID Step 4 - Lowest Port Priority Step 5 - Lowest Port ID Port Cost/Port ID 0/2 0/1 Assume path cost and port priorities are default (32). Port ID used in this case. Port 0/1 would forward because it’s the lowest. If the path cost and bridge IDs are equal (as in the case of parallel links), the switch goes to the port priority as a tiebreaker. Lowest port priority wins (all ports set to 32). You can set the priority from 0 – 63. If all ports have the same priority, the port with the lowest port number forwards frames.

Port Cost/Port ID Distribution1# show spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 32769 Address 0009.7c0b.e7c0 Cost 19 Port 3 (FastEthernet0/3) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 000b.fd13.9080 Aging Time 300 Interface Port ID Designated Port ID Name Prio.Nbr Cost Sts Cost Bridge ID Prio.Nbr ---------------- -------- --------- --- --------- -------------------- -------- Fa0/1 128.1 19 BLK 19 32769 000b.befa.eec0 128.1 Fa0/2 128.2 19 BLK 19 32769 000b.befa.eec0 128.2 Fa0/3 128.3 19 FWD 0 32769 0009.7c0b.e7c0 128.1 Fa0/4 128.4 19 BLK 0 32769 0009.7c0b.e7c0 128.2 Fa0/5 128.5 19 FWD 19 32769 000b.fd13.9080 128.5 Gi0/1 128.25 4 FWD 19 32769 000b.fd13.9080 128.25

PVST+ (More later) Per VLAN Spanning Tree Plus (PVST+) maintains a separate spanning-tree instance for each VLAN. PVST Only over ISL PVST+ Includes ISL and 802.1Q Provides for load balancing on a per-VLAN basis. Switches maintain one instance of spanning tree for each VLAN allowed on the trunks. Non-Cisco 802.1Q switches maintain only one instance of spanning tree for all VLANs allowed on the trunks. Distribution1(config)# spanning-tree vlan 1, 10 root primary Distribution2(config)# spanning-tree vlan 20 root primary

Distribution1 is the Root for VLAN1 and 10 Root VLANs 1,10

Distribution2 is the Root for VLAN 20 Root VLAN 20

Load Balancing with 2 Root Switches Notice that more links are being used! Root VLANs 1,10 Root VLAN 20

STP Convergence: Summary Recall that switches go through three steps for their initial convergence: STP Convergence Step 1 Elect one Root Bridge Step 2 Elect Root Ports Step 3 Elect Designated Ports Also, all STP decisions are based on a the following predetermined sequence: Five-Step decision Sequence Step 1 - Lowest BID Step 2 - Lowest Path Cost to Root Bridge Step 3 - Lowest Sender BID Step 4 – Lowest Port Priority Step 5 - Lowest Port ID

STP Convergence: Summary Example: A network that contains 15 switches and 146 segments (every switchport is a unique segment) would result in: 1 Root Bridge 14 Root Ports 146 Designated Ports

Configuring the Root Bridge Switch(config)#spanning-tree vlan 1 root primary This command forces this switch to be the root. Switch(config)#spanning-tree vlan 1 root secondary This command configures this switch to be the secondary root. Or Switch(config)#spanning-tree vlan 1 priority priority This command statically configures the priority (in increments of 4096).

Configuring the Root Bridge Switch(config)# spanning-tree vlan 1 priority priority This command statically configures the priority (in multiples of 4096). Valid values are from 0 to 61,440. Default is 32768. Lowest values becomes Root Bridge.

Configuring the Root Bridge Switch(config)# spanning-tree vlan 1 root primary This command forces this switch to be the root. The spanning-tree root primary command alters this switch's bridge priority to 24,576. If the current root has bridge priority which is more than 24,576, then the current is changed to 4,096 less than of the current root bridge.

Configuring the Root Bridge Switch(config)# spanning-tree vlan 1 root secondary This command configures this switch to be the secondary root in case the root bridge fails. The spanning-tree root secondary command alters this switch's bridge priority to 28,672. If the root switch should fail, this switch becomes the next root switch.

Change the root bridge Current Root Bridge Modify the topology so that the Core switch is the root bridge and Distribution1 is the secondary root bridge for VLAN 1.

Change the root bridge Before After Notice the change…. Core(config)# spanning-tree vlan 1-30 root primary Distribution1(config)# spanning-tree vlan 1-30 root secondary Notice the change…. Before After

Verify changes Core# show spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 24577 Address 0001.C945.A573 This bridge is the root Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 24577 (priority 24576 sys-id-ext 1) Aging Time 20 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- ---------------------- Gi0/1 Desg FWD 4 128.25 P2p Gi0/2 Desg FWD 4 128.26 P2p

Verify changes Distribution2# show spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 24577 Address 0001.C945.A573 Cost 4 Port 26(GigabitEthernet0/2) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 0060.47B0.5850 Aging Time 20 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Fa0/3 Desg FWD 19 128.3 P2p Fa0/5 Altn BLK 19 128.5 P2p Gi0/1 Desg FWD 4 128.25 P2p Gi0/2 Root FWD 4 128.26 P2p

Topology Change Notification BPDUs Direct Topology Changes Is a change that can be detected on a switch interface. Insignificant Topology Changes A users PC causes the link to go up or down (normal booting or shutdown process).

TCNs: Direct Topology Change When a bridge needs to signal a topology change, it starts to send TCNs on its root port. Switch A detects link down. Removes “best BPDU” from Root Port (this port is the best path to the Root Bridge) Can’t send TCN out root port to Root bridge. Without Uplinkfast (coming) Switch A not aware of another path to root. Switch C is aware of down link and sends TCN message out RP to Root Bridge. Root Bridge sends Configuration BPDU with TCN bit set to let switches know of configuration change. All switches: Shorten MAC address tables aging time to Forward Delay (15 seconds). This flushes idle entries. Switch A waits to hear from Root Bridge. Receives Config BPDU on previously blocked port, new “best BPDU”, this becomes new RP. This new RP will go through listening, learning and forwarding states. TCN does not start a STP recalculation. Config BPDU Root Idle MAC entries are flushed TCN C D X RP B A E NDP (Blocking) New RP (Blocking, Listening, Learning, Forwarding)

TCNs Idle MAC entries are flushed Idle MAC entries are flushed Direct Topology Change: Is a change that can be detected on a switch interface. Can can take about 30 seconds on the affected switch (two times forward delay). All switches flush idle entries in MAC table. Solutions: Uplinkfast Insignificant Topology Change: A users PC causes the link to go up or down (normal booting or shutdown process). No significant impact but given enough hosts switches could be in a constant state of flushing MAC address tables. Causes unknown unicast floods. Solution PortFast Config BPDU Root Idle MAC entries are flushed C D TCN RP Idle MAC entries are flushed B A E Idle MAC entries are flushed Idle MAC entries are flushed

TCN BPDUs Understanding Spanning-Tree Protocol Topology Changes http://www.cisco.com/warp/public/473/17.html Remember that a TCN does not start a STP recalculation. This fear comes from the fact that TCNs are often associated with unstable STP environments; TCNs are a consequence of this, not a cause. The TCN only has an impact on the aging time; it will not change the topology nor create a loop.

Example

Example

Exercise

Exercise

Homework#2

Homework#2 โหลดไฟล์ PT-Topology-STP.pkt มารันใน Packet Tracer ให้อธิบายว่ามีกี่ VLAN ในเครือข่าย อะไรบ้าง ในแต่ละ VLAN มี SW ใดเป็น ROOT ให้แก้ไข โดยกำหนดให้ Distribution1 เป็น Root ของ VLAN 10 และ Distribution2 เป็น Root ของ VLAN 20 ให้แสดง Config ที่เปลี่ยนแปลงไป และอธิบายการเปลี่ยนแปลงที่เกิดขึ้น

Implementing Spanning Tree Protocol The End