exploration lan switching chapter5-updated
TRANSCRIPT
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
1/71
Chapter 5
CCNA 3
STP Spanning Tree Protocol
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
2/71
More detail than you need to know
2
In this presentation we will discussmuch of the detail of STP.
Much of the detail is not needed forCCNA, however we will discuss it toget a better understanding of how
STP operates.
I am not concerned that youcompletely understand orremember the detail, but rather getan appreciation for what STP is
doing.
Even with the added detail, muchmore detail has been intentionallyleft out and will be discussed inCCNP 3
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
3/71
Configuring STP
3
By default, STP is enabled for every port on theswitch.
If for some reason STP has been disabled, youcan reenable it.
To re-enable STP, use the
Switch(config)#spanning-tree vlanvlan-id
To disable STP, on a per-VLAN basis:
Switch(config)#no spanning-tree vlanvlan-id
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
4/71
Spanning Tree Protocol (STP)
4
STP is a loop-preventionprotocol
Uses the Spanning TreeAlogithm
STP allows L2 devices tocommunicate with each otherto discover physical loops inthe network.
STP specifies an algorithmthat L2 devices can use tocreate a loop-free logicaltopology.
STP creates a tree structure ofloop-free leaves and branchesthat spans the entire Layer 2
network.
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
5/71
Redundancy Creates Loops
5
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
6/71
Spanning Tree Only for Loops
Rick Graziani [email protected]
6
Loops may occur in yournetwork as part of a adesign strategy forredundancy.
STP is not needed ifthere are no loops inyour network.
However, DO NOT
disable STP! Loops can occur
accidentally fromnetwork staff or even
users!
Two users interconnecting theswitches in their cubicles.
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
7/71
L2 Loops
Rick Graziani [email protected]
7
Broadcasts and Layer 2loops can be a dangerouscombination.
Ethernet frames have noTTL field
After an Ethernet framestarts to loop, it will probablycontinue until someoneshuts off one of the switchesor breaks a link.
IP Packet
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
8/71
L2 Loops - Flooded unicast frames
Rick Graziani [email protected]
8
Bridge loops can occur any
time there is a redundantpath or loop in the bridgenetwork.
The switches will flip flop thebridging table entry for
Station A (creating extremelyhigh CPU utilization).
Bridge Loops can cause:
Broadcast storms
Multiple copies of Ethernetframes
MAC address tableinstability in switches
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
9/71
STP Prevents Loops
17
The purpose of STP is to avoid and eliminate loops in the network by
negotiating a loop-free path through a root bridge. STP determines where the are loops and blocks links that are redundant.
Ensures that there will be only one active path to every destination.
X
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
10/71
Spanning Tree Algorithm
18
STP executes an algorithmcalled Spanning TreeAlgorithm.
STA chooses a referencepoint, called a root bridge,and then determines the
available paths to thatreference point.
If more than two pathsexists, STA picks the bestpath and blocks the rest
X
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
11/71
Two-key STP Concepts
19
STP calculations make extensive use of two key concepts
in creating a loop-free topology: Bridge ID
Path Cost
Link SpeedCost (Revised IEEESpec)
Cost (Previous IEEESpec)
10 Gbps 2 11 Gbps 4 1
100 Mbps 19 10
10 Mbps 100 100
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
12/71
Bridge ID (BID)
20
Bridge ID (BID) is used to identify each bridge/switch.
The BID is used in determining the center of the network, in respect toSTP, known as the root bridge.
Consists of two components:
A 2-byte Bridge Priority: Cisco switch defaults to 32,768 or0x8000.
A 6-byte MAC address Bridge Priority is usually expressed in decimalformat and the MAC
address in the BID is usually expressed in hexadecimalformat.
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
13/71
Priority = Priority (Default 32,768) +VLAN
21
Access2#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 24577
Address 000f.2490.1380
Cost 23
Port 1 (FastEthernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 0009.7c0b.e7c0
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300
VLAN0010
Spanning tree enabled protocol ieee
Root ID Priority 4106
Address 000b.fd13.9080
Cost 19
Port 1 (FastEthernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32778 (priority 32768 sys-id-ext 10)
Address 0009.7c0b.e7c0
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
14/71
Bridge ID (BID)
Rick Graziani [email protected]
22
Used to elect a root bridge (coming) Lowest Bridge ID is the root.
If all devices have the same priority, the bridge with the lowest MACaddress becomes the root bridge. (Yikes)
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
15/71
Five-Step STP Decision Sequence
23
When creating a loop-free topology, STP always uses the samefive-step decision 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
Bridges use Configuration BPDUs during this four-step process.
We will assume all BPDUs are configuration BPDUs untilotherwise noted.
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
16/71
Five-Step STP Decision Sequence
24
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 BPDUsreceived on the port, as well as the BPDU that would be sent onthat port.
As every BPDU arrives, it is checked against this five-stepsequence to see if it is more attractive (lower in value) than theexisting 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...
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
17/71
Elect one Root Bridge
25
The STP algorithm uses three simple steps to converge on a loop-free topology:
STP ConvergenceStep 1 Elect one Root BridgeStep 2 Elect Root PortsStep 3 Elect Designated Ports
When the network first starts, all bridges are announcing achaotic mix of BPDUs.
All bridges immediately begin applying the five-step sequencedecision process.
Switches need to elect a single Root Bridge. Switch with the lowest BID wins!
Note: Many texts refer to the term highest priority which is thelowest BID value.
This is known as the Root War.
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
18/71
Elect one Root BridgeLowest BID wins!
26
32768-000f.2490.1380
32768-000b.fd13.9080 32768-000b.fd13.cd80
32768-000b.befa.eec0 32768-0009.7c0b.e7c0
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
19/71
Elect one Root BridgeLowest BID wins!
27
32768-000f.2490.1380
32768-000b.fd13.9080 32768-000b.fd13.cd80
32768-000b.befa.eec0 32768-0009.7c0b.e7c0
Root Bridge
El t R t B id
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
20/71
Its all done with BPDUs!
Sent every 2 seconds!
28
Elect one Root BridgeLowest BID wins!
Determines shortest path to Root Bridge
Determines which ports will forward frames.
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
21/71
Root Bridge Selection Criteria
29
At the beginning, all bridges assume they are the center of theuniverse and declare themselves as the Root Bridge, by placingits own BID in the Root BID field of the BPDU.
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
22/71
30
Once all of the switches see that Access2 has the lowest BID, they areall in agreement that Access2 is the Root Bridge.
32768-000f.2490.1380
32768-000b.fd13.9080 32768-000b.fd13.cd80
32768-000b.befa.eec0 32768-0009.7c0b.e7c0
Root Bridge
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
23/71
Rigging the Root Bridge Election
31
The switch with the lowest BID becomes the root. The root switch can be determined by lowering the priority on that
switch, below the default of 32768.
There are two ways to lower the priority on Switch-2 to make it theRoot Bridge
Switch-2(config)#spanning-tree vlan 1 root primary
or
Switch-2(config)#spanning-tree vlan 1 priority 4096
The spanning-tree vlan 1 priority 4096 command lowers thepriority from 32768 to 4096, thus making it the root switch.
The spanning-tree vlan 1 root primary command lowers thepriority to 24576 (on a 2950 switch), thus making it the root switch.
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
24/71
Elect Root Ports
32
STP ConvergenceStep 1 Elect one Root BridgeStep 2 Elect Root PortsStep 3 Elect Designated Ports
Now that the Root War has been won, switches move on toselecting Root Ports.
A bridges 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 cumulativecost of all links to the Root Bridge.
Difference b/t Path Cost and Root Path Cost Root Path Cost
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
25/71
34
Difference b/t Path Cost and Root Path Cost
Path Cost:
The value assigned to each port.
Added to BPDUs received on that port tocalculate Root Path Cost.
32768-000b.fd13.9080 32768-000b.fd13.cd80
32768-000b.befa.eec0 32768-0009.7c0b.e7c0
Root BridgeBPDU
Cost=0
BPDU
Cost=0+19=19
BPDU
Cost=0+19=19
BPDU
Cost=0+19=19
0
0
0
19
19
19
Root Path Cost Cumulative cost to the Root Bridge. This is the value transmitted in the BPDU. Calculated by adding the receiving ports
Path Cost to the valued contained in theBPDU.
19
19
19
32768-000f.2490.1380
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
26/71
show spanning-tree
35
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
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
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.5Gi0/1 128.25 4 FWD 19 32769 000b.fd13.9080 128.25
Interface Port ID Designated Port ID
Name Prio.Nbr Cost Sts Cost Bridge ID Prio.Nbr
---------------- -------- --------- --- --------- -------------------- --------
Gi0/2 128.26 4 BLK 19 32769 000b.befa.eec0 128.26
Switches now send BPDUs with their Root Path Cost out other interfaces.
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
27/71
36
Switches now send BPDUs with their Root Path Cost out other interfaces.
Note: STP costs are incremented as BPDUs are received on a port, not as they are sentout a port.
Access 1 uses this value of 19 internally and sends BPDUs with a Root Path Cost of 19out all other ports.
32768-000b.fd13.9080 32768-000b.fd13.cd80
32768-000b.befa.eec0 32768-0009.7c0b.e7c0
Root Bridge
BPDU
Cost=4+19=23
BPDU
Cost=4+19=23
19
19
0
0
019
19
19
BPDU
Cost=19
BPDU
Cost=19
32768-000f.2490.1380
Final Results
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
28/71
39
Ports show ReceivedRoot Path Cost = BPDU Root Path Cost + 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 neighboringswitch.
Now lets see how this is used!
32768-000b.fd13.9080 32768-000b.fd13.cd80
32768-000b.befa.eec0 32768-0009.7c0b.e7c0
Root Bridge
19
19
0
0
0
32768-000f.2490.1380
19+4=23
23+4=27
19+19=38
19+4=23
19+4=23
19+4=23
19+4=23
19+4=2319
23+4=27
19+19=38
Next: Elect Root Ports
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
29/71
40
Next:
Elect Root Ports
Elect Designated Ports
Non-Designated Ports: All other ports
32768-000b.fd13.9080 32768-000b.fd13.cd80
32768-000b.befa.eec0 32768-0009.7c0b.e7c0
Root Bridge
19
19
19
23
0
0
023
32768-000f.2490.1380
23
23
23
27
23
27
3838
Every non-Root bridge must select one Root Port. A bridges Root Port is the port closest to the Root
Bridge.
Bridges use the cost to determine closeness.
Elect Root Ports: (Review)
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
30/71
41
( )
Ports show ReceivedRoot Path Cost = BPDU Root Path Cost + 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 neighboringswitch.
32768-000b.fd13.9080 32768-000b.fd13.cd80
32768-000b.befa.eec0 32768-0009.7c0b.e7c0
Root Bridge
19
19
19
23
0
0
023
32768-000f.2490.1380
23
23
23
27
23
27
3838If I go
through D2it costs 38.
If I gothrough
Core it costs27.
If I gothrough A1 it
costs 23.
If I go throughA2 it costs 19.
This is the bestpath to the
Root!
Distribution 1 thought process
Elect Root Ports
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
31/71
42
Elect Root Ports
Every non-Root bridge must select one Root Port.
A bridges Root Port is the port closest to the Root Bridge.
Bridges use the cost to determine closeness.
32768-000b.fd13.9080 32768-000b.fd13.cd80
32768-000b.befa.eec0 32768-0009.7c0b.e7c0
Root Bridge
19
19
19
23
0
0
023
32768-000f.2490.1380
23
23
23
27
23
27
3838
Root PortRoot Port
Root Port
? ?
Elect Root Ports Five-Step decision Sequence
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
32/71
43
Core switch has two equal Root Path Costs tothe Root Bridge.
In this case we need to look at the five-stepdecision process.
32768-000b.fd13.9080 32768-000b.fd13.cd80
32768-000b.befa.eec0 32768-0009.7c0b.e7c0
Root Bridge
19
19
19
23
0
0
023
32768-000f.2490.1380
23
23
23
27
23
27
3838
Root PortRoot Port
Root Port
? ?
p qStep 1 - Lowest BIDStep 2 - Lowest Path Cost to Root BridgeStep 3 - Lowest Sender BIDStep 4 - Lowest Port PriorityStep 5 - Lowest Port ID
Elect Root Ports Five-Step decision Sequence
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
33/71
44
Distribution 1 switch has a lower Sender BIDthan Distribution 2.
Core chooses the Root Port of G 0/1.
32768-000b.fd13.9080 32768-000b.fd13.cd80
32768-000b.befa.eec0 32768-0009.7c0b.e7c0
Root Bridge
19
19
19
23
0
0
023
32768-000f.2490.1380
23
23
23
27
23
27
3838
Root PortRoot Port
Root Port
Step 1 - Lowest BIDStep 2 - Lowest Path Cost to Root BridgeStep 3 - Lowest Sender BIDStep 4 - Lowest Port PriorityStep 5 - Lowest Port ID
Lower BID Root Port
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
34/71
Elect Designated Ports
45
STP Convergence
Step 1 Elect one Root BridgeStep 2 Elect Root PortsStep 3 Elect Designated Ports
The loop prevention part of STP becomes evident during this step, electingdesignated ports.
A Designated Port functions as the single bridge port that both sends andreceives traffic to and from that segment and the Root Bridge.
Each segment in a bridged network has one Designated Port, chosenbased 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. Segments 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.
A Designated Portis elected for every segment.
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
35/71
46
32768-000b.fd13.9080 32768-000b.fd13.cd80
32768-000b.befa.eec0 32768-0009.7c0b.e7c0
Root Bridge
19
19
19
19
0
0
019
32768-000f.2490.1380
19
19
23
19
23
19
1919
RP
RP
RP
RP
g y g 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 SentRoot 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!
Segments perspective:
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
36/71
47
32768-000b.fd13.9080 32768-000b.fd13.cd80
32768-000b.befa.eec0 32768-0009.7c0b.e7c0
Root Bridge
19
19
19
19
0
0
019
32768-000f.2490.1380
19
19
23
19
23
19
1919
RP
RP
RP
RP
Access 2 has a Root Path Cost = 0 (after all it is the Root Bridge) and Access 1 has a RootPath Cost = 19.
Because Access 2 has the lower Root Path Cost it becomes the Designated Portfor thatsegment.
? DP
What is my best pathto the Root Bridge, 19via Access 1 or 0 via
Access 2?
Segments perspective:
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
37/71
48
32768-000b.fd13.9080 32768-000b.fd13.cd80
32768-000b.befa.eec0 32768-0009.7c0b.e7c0
Root Bridge
19
19
19
19
0
0
019
32768-000f.2490.1380
19
19
23
19
23
19
1919
RP
RP
RP
RP
The same occurs between Access 2 and Distribution 1 and Distribution 2 switches. Because Access 2 has the lower Root Path Cost it becomes the Designated Portfor those
segments.
?
DP
?DP
DP
Segments perspective: Five-Step decision SequenceSt 1 L t BID
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
38/71
49
32768-000b.fd13.9080 32768-000b.fd13.cd80
32768-000b.befa.eec0 32768-0009.7c0b.e7c0
Root Bridge
19
19
19
19
0
0
019
32768-000f.2490.1380
19
19
23
19
23
19
1919
RP
RP
RP
RP
Segment between Distribution 1 and Access1 has two equal Root Path Costs of 19.
Using the Lowest Sender ID (first two stepsare equal), Access 1 becomes the best pathand the Designated Port.
?
DP
DP
DP
Step 1 - Lowest BIDStep 2 - Lowest Path Cost to Root BridgeStep 3 - Lowest Sender BIDStep 4 - Lowest Port PriorityStep 5 - Lowest Port ID
DP
What is my best pathto the Root Bridge, 19via Distribution 1 or 19via Access 1? Theyare the same! Who
has the lowest BID?
Segments perspective:
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
39/71
Rick Graziani [email protected]
32768-000b.fd13.9080 32768-000b.fd13.cd80
32768-000b.befa.eec0 32768-0009.7c0b.e7c0
Root Bridge
19
19
19
19
0
0
019
32768-000f.2490.1380
19
19
23
19
23
19
1919
RP
RP
RP
RP
All other ports, those ports that are not Root Ports or Designated Ports, become Non-Designated Ports.
Non-Designated Ports are put in blocking mode. (Coming)
This is the loop prevention part of STP.
DP
DP
DPDP
DP
DP
DP
NDP
NDP
NDP
X
X
XX
DP
NDP
Port Cost/Port ID
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
40/71
Port Cost/Port ID
57
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 numberforwards frames.
Port 0/2 would forward because its the lowest.
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
41/71
Port Cost/Port ID
58
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
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
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
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
42/71
Spanning-Tree Port States
59
STP Timers
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
43/71
STP Timers
60
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
44/71
Spanning Tree Port States
61
Spanning tree transitions each port through severaldifferent states.
From Blocking to Forwarding:
20 sec + 15 sec + 15 sec = 50 seconds
Spanning-Tree Port States
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
45/71
Spanning-Tree Port States
62
Blocked: All ports start in blocked mode
in order to prevent the bridgefrom creating a bridging loop.
Port are listening (receiving)
BPDUs. No user data is being passed.
The port stays in a blocked stateif Spanning Tree determinesthat there is a better path to
the root bridge.
May take a port up to 20seconds to transition out of thisstate (max age). - coming soon.
BPDUs sent and received
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
46/71
Spanning Tree Port States
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
47/71
Spanning-Tree Port States
64
Learn: The learn state is very similar
to the listen state, except thatthe port can add informationit has learned to its address
table. Adds addresses to MAC
Address Table
Still not allowed to send orreceive user data
Learns for a period of timecalled the forward delay(default 15 seconds)
BPDUs sent and received
S i T P S
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
48/71
Spanning-Tree Port States
65
Forward: The port can send and
receive user data.
A port is placed in theforwarding state if:
There are no redundantlinks
or
It is determined that it hasthe best path to the root
BPDUs sent and received
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
49/71
Spanning-Tree Port States
66
Disabled: The port isshutdown.
Spanning Tree Port States
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
50/71
Spanning-Tree Port States
67
Non-Designated Ports
Designated Ports & Root Ports
Spanning Tree Port States
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
51/71
Spanning-Tree Port States
68
32768-000b.fd13.9080 32768-000b.fd13.cd80
32768-000b.befa.eec0 32768-0009.7c0b.e7c0
Root Bridge
19
19
19
19
0
0
019
32768-000f.2490.1380
19
19
23
19
23
19
1919
RP
RP
RP
RP
DP
DP
DPDP
DP
DP DP
NDP
NDP
NDPX
X
XX
Active links
DP
NDP
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
52/71
Topology Change
69
Much of the detail has been omitted. If there is a change in the topology, a link is
added or removed:
User traffic will be disrupted until the switch
recalculates paths using the Spanning TreeAlgorithm.
A delay of up to 50 seconds may occur beforeswitches start forwarding frames.
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
53/71
PVST, RSTP & Rapid PVST+(More flavours of STP)
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
54/71
71
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
55/71
PVST+
72
In the figure, switch S3 is the root bridge for VLAN 20, and switch S1 is the rootbridge for VLAN 10. Creating different STP root switches per VLAN creates a
more redundant network.
C fi i PVST
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
56/71
Configuring PVST+
73
Step 1. Select the switches you want for the primary and secondary root bridges for
each VLAN.
Step 2. Configure the switch to be a primary bridge for one VLAN, for example
switch S3 is a primary bridge for VLAN 20.
Step 3. Configure the switch to be a secondary bridge for the other VLAN, for
example, switch S3 is a secondary bridge for VLAN 10.
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
57/71
Rapid Spanning Tree Protocol
74
The immediate hindrance of STP is convergence. Depending on the type of failure, it takes
anywhere from 30 to 50 seconds, to convergethe network.
RSTP helps with convergence issues thatplague legacy STP.
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
58/71
RSTP vs STP
76
RSTP is based on IEEE 802.1w standard. Numerous differences exist between RSTP and STP.
RSTPrequires full-duplex point-to-point connectionbetween adjacent switchesto achieve fast convergence.
Half duplex, denotes a shared medium, multiple devices.
As a result, RSTP cannot achieve fast convergence in half-duplex mode.
STP and RSTP also have port designation differences.
RSTP has alternateport and backupport designations.
Ports not participating in spanning treeare known as edgeports.
The edge port becomes a nonedgeport immediately if aBPDU is heard on the port.
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
59/71
RSTP vs STP
77
RSTP is proactive and therefore negates the need forthe 802.1D delay timers.
RSTP (802.1w) supersedes 802.1D, while stillremaining backward compatible.
RSTP BPDU format is the same as the IEEE 802.1DBPDU format, except that the Version field is set to 2to indicate RSTP.
The RSTP spanning tree algorithm (STA) elects a rootbridge in exactly the same way as 802.1D elects a
root. Critical differences that make RSTP the preferred
protocol for preventing Layer 2 loops in a switchednetwork environment.
Many of the differences stem from the Ciscoproprietary enhancements. (CCNP 3)
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
60/71
RSTP Port States
78
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
61/71
RSTP Port States
79
Port State Description
Discarding This state isseen in both a stable active topology and duringtopology synchronization and changes.The discarding state prevents the forwarding of data frames, thusbreaking the continuity of a Layer 2 loop.
Learning This state isseen in both a stable active topology and duringtopology synchronization and changes.The learning state accepts data frames to populate the MAC table inan effort to limit flooding of unknown unicast frames.
Forwarding This state isseen only in stable active topologies.The forwarding switch ports determine the topology. Following a topology change, or during synchronization, the forwardingof data frames occurs only after a proposal and agreement process.
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
62/71
Port States
80
The table describes STP and RSTP port states.
Operational PortState
STP Port State RSTP Port State
Enabled Blocking Discarding
Enabled Listening Discarding
Enabled Learning Learning
Enabled Forwarding Forwarding
Disabled Disabled Discarding
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
63/71
Port Roles
81
Port Role Description
Root port(Same as STP)
The root port is the switch port on every nonroot bridge that is thechosen path to the root bridge. There can be only one root port onevery switch. The root port assumes the forwarding state in astable active topology.
Designated port(Same as STP)
Each segment has at least one switch port as the designated portfor that segment. In a stable, active topology, the switch with thedesignated port receives frames on the segment that are destined
for the root bridge. There can be only one designated port persegment. The designated port assumes the forwarding state. Allswitches connected to a given segment listen to all BPDUs anddetermine the switch that will be the designated switch for aparticular segment.
Alternative port(Non-Designated Port in STP)
The alternative port is a switch port that offers an alternative pathtoward the root bridge. The alternative port assumes a discarding
state in a stable, active topology. An alternative port is present onnondesignated switches and makes a transition to a designatedport if the current designated path fails.
Backup port The backup port is an additional switch port on the designatedswitch with a redundant link to the segment for which the switch isdesignated. A backup port has a higher port ID than the designatedport on the designated switch. The backup port assumes the
discarding state in a stable, active topology.
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
64/71
RSTP Link Types
82
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
65/71
83
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
66/71
Summary
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
67/71
STP: Summary
85
Recall that switches go through three steps for their initial
convergence:STP Convergence
Step 1 Elect one Root Bridge: Lowest BID
Step 2 Elect Root Ports: Closest port to Root Bridge
Step 3 Elect Designated Ports: Best switch to Root Bridge
Also, all STP decisions are based on a the following predeterminedsequence:
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
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
68/71
STP: Summary
Rick Graziani [email protected]
86
BID = Priority + MAC Address One Root Bridge is elected per network
Every non-Root Bridge will select one Root Port!
Switches Perspective: Port closest to Root Bridge
Smallest Root Path Cost, the cumulative cost of all links to
the Root Bridge. Each segment in a bridged network has one Designated Port
Segments perspective: From a device on this segment,Which switch should I go through to reach the Root Bridge?
Chosen based on cumulative Root Path Cost to the RootBridge.
The switch containing the Designated Port is referred to as theDesignated Bridge for that segment.
BPDUs are sent every 2 seconds by a switch
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
69/71
STP: Summary
87
50 Seconds from Blocking to Forwarding: Blocking: Max Age 20 seconds
Listening: Forward Delay 15 seconds
Learning: Forward Delay 15 seconds
Forwarding
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
70/71
RSTP
88
Port States Discarding
Learning
Forwarding
Port Roles Root
Designated
Alternate (NDP)
Backup
Link Types Point-to-point (Switch-to-Switch or Host-to-Switch)
Shared (Hub)
Slides Adapted from Rick
-
8/3/2019 Exploration LAN Switching Chapter5-Updated
71/71
Slides Adapted from Rick
Graziani
Rick Graziani [email protected] Thanks for the help