Presentation is loading. Please wait.

Presentation is loading. Please wait.

Implementing Spanning Tree Protocol

Similar presentations


Presentation on theme: "Implementing Spanning Tree Protocol"— Presentation transcript:

1 Implementing Spanning Tree Protocol

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

3 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

4 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

5 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

6 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

7 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

8 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

9 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

10 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

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

12 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

13 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.

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

15 Root Bridge Selection

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

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

18 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.

19 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 = 4 bits 12 bits Priority VLAN Number 20 215 Priority Values (Hex) Priority Values (Dec) 8 (default) F

20 What is the Priority of Access1?

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

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

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

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

25 STP Timers

26 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.

27 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

28 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.

29 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 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]]}]

30 Local Switch Root Port Election

31 Spanning-Tree Path Cost

32 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 = Ethernet total cost =

33 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?

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

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

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

37 Example: Layer 2 Topology Negotiation

38 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...

39 Case Study

40 Elect one Root Bridge Lowest BID wins!
Who wins?

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

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

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

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

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

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

47 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: :D0:C0:F5:18:D1 LLC Length: 38 802.2 Logical Link Control (LLC) Header Dest. SAP: 0x Bridge Spanning Tree Source SAP: 0x Bridge Spanning Tree Command: x03 Unnumbered Information Bridge Spanning Tree Protocol Identifier: 0 Protocol Version ID: 0 Message Type: Configuration Message Flags: % Root Priority/ID: 0x8000/ 00:D0:C0:F5:18:C0 Cost Of Path To Root: 0x (0) Bridge Priority/ID: 0x8000/ 00:D0:C0:F5:18:C0 Port Priority/ID: 0x80/ 0x1D Message Age: /256 seconds (exactly 0 seconds) Maximum Age: /256 seconds (exactly 20 seconds) Hello Time: /256 seconds (exactly 2 seconds) Forward Delay: /256 seconds (exactly 15 seconds)

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

49 Root Bridge Selection Criteria
My BID is C945.A573 I’m the root! Who wins? My BID is B I’m the root! My BID is E0D.9315 I’m the root! My BID is E461.46EC I’m the root! My BID is E.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.

50 Elect one Root Bridge Lowest BID wins!

51 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

52 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.

53 Determining (Electing) the Root Port

54 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

55 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

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

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

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

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

60 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, E0D.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

61 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

62 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, B0.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

63 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, E.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!

64 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

65 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

66 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

67 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

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

69 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

70

71

72 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!

73 ? ? 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

74 ? ? 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

75 ? ? 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 E0D.9315 23 My BID is B0.5850 Lower BID 27 27 38 38 23 19 19 RP 23 RP 23 23 19 RP Root Bridge

76 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.

77 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

78 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

79 ? 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

80 ? ? 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

81 ? 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 E0D.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 E461.46EC 19 RP DP Root Bridge Lower BID

82 Access 1 has Lower Sender BID

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

84

85

86

87

88

89

90 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.

91

92 Port Cost/Port ID Distribution1# show spanning-tree VLAN0001
Spanning tree enabled protocol ieee Root ID Priority Address c0b.e7c0 Cost Port (FastEthernet0/3) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority (priority sys-id-ext 1) Address b.fd Aging Time 300 Interface Port ID Designated Port ID Name Prio.Nbr Cost Sts Cost Bridge ID Prio.Nbr Fa0/ BLK b.befa.eec Fa0/ BLK b.befa.eec Fa0/ FWD c0b.e7c Fa0/ BLK c0b.e7c Fa0/ FWD b.fd Gi0/ FWD b.fd

93 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

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

95 Distribution2 is the Root for VLAN 20
Root VLAN 20

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

97 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

98 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

99 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).

100 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 Lowest values becomes Root Bridge.

101 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.

102 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.

103 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.

104 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

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

106 Verify changes Distribution2# show spanning-tree VLAN0001
Spanning tree enabled protocol ieee Root ID Priority Address C945.A573 Cost Port (GigabitEthernet0/2) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority (priority sys-id-ext 1) Address B0.5850 Aging Time 20 Interface Role Sts Cost Prio.Nbr Type Fa0/ Desg FWD P2p Fa0/ Altn BLK P2p Gi0/ Desg FWD P2p Gi0/ Root FWD P2p

107 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).

108 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)

109 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

110 TCN BPDUs Understanding Spanning-Tree Protocol Topology Changes 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.

111 Example

112 Example

113 Exercise

114 Exercise

115 Homework#2

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

117 Implementing Spanning Tree Protocol
The End


Download ppt "Implementing Spanning Tree Protocol"

Similar presentations


Ads by Google