Cis187 Switch 3 STP
Cis187 Switch 3 STP
Configuring STP
Switch(config)# spanning-tree vlan vlan-id
Switch(config)# no spanning-tree vlan vlan-id
IEEE 802.1D
A loop-prevention protocol
Allows L2 devices to
communicate with each
other to discover physical
loops in the network.
Algorithm that creates a
loop-free logical topology.
STP creates a tree
structure of loop-free
leaves and branches that
spans the entire Layer 2
network.
Rick Graziani [email protected]
L2 Loops
IP Packet
L2 Loops
10
Link Speed
10 Gbps
1 Gbps
100 Mbps
19
10
10 Mbps
100
100
11
Bridge ID (BID)
Bridge ID (BID) is used to identify each bridge/switch.
The BID is used in determining the center of the network, in respect to
STP, known as the root bridge.
Bridge ID
Without the
Extended
System ID
Bridge ID with
the Extended
System ID
Rick Graziani [email protected]
12
Bridge ID (BID)
13
Bridge ID (BID)
14
VLAN0010
PVST coming
Spanning tree enabled protocol ieee
later
Root ID
Priority
32778
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
32778 (priority 32768 sys-id-ext 10)
Address
0003.E461.46EC
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
15
Priority
Address
Hello Time
Aging Time
16
Bridge ID (BID)
17
10 Gbps
1 Gbps
100 Mbps
19
10
10 Mbps
100
100
Bridges use the concept of cost to evaluate how close they are to
other bridges.
Used to create the loop-free topology .
Originally, 802.1D defined cost as 1 billion/bandwidth of the link in
Mbps.
Cost of 10 Mbps link = 100
Cost of 100 Mbps link = 10
Cost of 1 Gbps link = 1
Running out of room for faster switches including 10 Gbps Ethernet
18
10 Gbps
1 Gbps
100 Mbps
19
10
10 Mbps
100
100
IEEE modified the most to use a non-linear scale with the new values of:
4 Mbps
10 Mbps
16 Mbps
45 Mbps
100 Mbps
155 Mbps
622 Mbps
1 Gbps
10 Gbps
250
100
62
39
19
14
6
4
2
(cost)
(cost)
(cost)
(cost)
(cost)
(cost)
(cost)
(cost)
(cost)
19
20
21
22
23
Priority
Address
Hello Time
Aging Time
Use this command to view the information on the other four switches.
24
Priority
Address
Hello Time
Aging Time
Priority
Address
Hello Time
Aging Time
26
Priority
Address
Hello Time
Aging Time
27
Priority
Address
Hello Time
Aging Time
28
Who wins?
My BID is
32769.0005.5E0D.9315
My BID is
32769.0060.47B0.5850
My BID is
32769.0003.E461.46EC
My BID is
32769.0001.964E.7EBB
I win!
29
Bridge IDs
32769.0001.C945.A573
32769.0005.5E0D.9315
32769.0060.47B0.5850
32769.0003.E461.46EC
32769.0001.964E.7EBB
30
31
BPDUs
BPDUs
sent/relayed
every two
seconds.
BPDU
BPDU
BPDU
BPDU
BPDU
32
My BID is
32768.0003.E461.46EC
Im the root!
Who wins?
My BID is
32768.0060.47B0.5850
Im the root!
My BID is
32768.0001.964E.7EBB
Im the root! I win!
33
34
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
35
I will select
one Root
Port that is
closest,
best path to
the root
bridge.
Now that the Root War has been won, switches move on to
36
37
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
BPDU
Cost=0+19=19
Cost=0+19=19
19
19
Root Bridge
0
BPDU
Cost=0+19=19
19
0
BPDU
Cost=0
38
BPDU
BPDU
Cost=0+19=19
Cost=0+19=19
19
19
Root Bridge
0
BPDU
Cost=0+19=19
19
0
BPDU
Cost=0
39
Priority
Address
Hello Time
Aging Time
Interface
---------------Fa0/1
Fa0/3
Fa0/5
Role
---Desg
Desg
Desg
Path Cost
Sts
--FWD
FWD
FWD
Cost
--------19
19
19
Prio.Nbr
-------128.1
128.3
128.5
Type
----------------------P2p
P2p
P2p
40
Priority
Address
Hello Time
Aging Time
Interface
---------------Gi0/1
Gi0/2
Fa0/3
Fa0/5
Role
---Desg
Altn
Root
Desg
Sts
--FWD
BLK
FWD
FWD
Cost
--------4
4
19
19
Prio.Nbr
-------128.25
128.26
128.3
128.5
Type
---------------------P2p
P2p
P2p
P2p
41
Priority
Address
Hello Time
Aging Time
Interface
---------------Fa0/5
Gi1/1
Gi1/2
Role
---Root
Desg
Desg
Path Cost
Sts
--FWD
FWD
FWD
Cost
--------19
4
4
Prio.Nbr
-------128.5
128.25
128.26
Type
---------------------P2p
P2p
P2p
42
Priority
Address
Hello Time
Aging Time
Interface
---------------Fa0/3
Fa0/5
Gi0/1
Gi0/2
Role
---Root
Altn
Altn
Desg
Path Cost
Sts
--FWD
BLK
BLK
FWD
Cost
--------19
19
4
4
Prio.Nbr
-------128.3
128.5
128.25
128.26
Type
---------------------P2p
P2p
P2p
P2p
43
44
45
46
47
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.
Path Cost
BPDU
BPDU
Cost=4+19=23
Cost=4+19=23
19
19
BPDU
BPDU
Cost=19
Cost=19
0
19
Root Bridge
48
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
BPDU
Cost=4+19=23
Cost=4+19=23
19
19
BPDU
BPDU
Cost=19
Cost=19
0
19
Root Bridge
49
Distribution 1 now sends BPDUs with its Root Path Cost out other interfaces (Best BPDU).
Again, STP costs are incremented as BPDUs are received on a port, not as they are sent
out a port.
Path Cost
BPDU
Cost=4+19=23
BPDU
BPDU
Cost=19+19=38
Cost=19
19
23
23
19
0
19
BPDU
Cost=4+19=23
19
Root Bridge
0
0
50
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 lets see how this is used!
Path Cost
19+4=23
23+4=27
19+19=38
19
19+4=23
23+4=27
19+19=38
19+4=23
19
19+4=23
19+4=23
19+4=23
0
0
19
0
Root Bridge
51
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
Address
Hello Time
Aging Time
Interface
---------------Gi0/1
Gi0/2
Role
---Root
Altn
Sts
--FWD
BLK
Cost
--------4
4
Prio.Nbr
-------128.25
128.26
Type
-------------------------------Path Cost
P2p
P2p
52
53
Next:
Elect Root Ports
Every non-Root bridge must select one Root Port.
Elect Root Ports
A bridges Root Port is the port closest to the Root
Elect Designated Ports
Bridge.
Non-Designated Ports: All other ports
Bridges use the cost to determine closeness.
Path Cost
These values
would be the
Root Path
Cost if this
interface was
used to reach
the Root
Bridge.
23
27
38
19
23
27
38
23
19
23
23
23
0
19
0
Root Bridge
54
Path Cost
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!
55
Path Cost
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!
56
19
23
23
19
23
23
38
23
38
RP
27
27
23
19
0
0
RP
0
RP
Root Bridge
57
19
23
23
19
23
23
38
23
38
RP
27
27
23
19
0
0
RP
0
RP
Root Bridge
58
RP
My BID is
32769.0005.5E0D.9315
Lower BID
19
23
23
19
23
23
My BID is
32769.0060.47B0.5850
38
23
38
RP
27
27
23
19
0
0
RP
0
RP
Root Bridge
59
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.
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.
60
RP
19
19
19
19
RP
19
19
19
23
19
19
19
23
19
0
0
RP
0
RP
Root Bridge
61
RP
23
23
?
19
19
19
19
?
19
19
19
? ?
RP
RP
19
19
19
19
RP
?
0
0
0
Root Bridge
62
Segments 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
19
19
My
What is my
port
best
willpath
be 19
0
19 designated
via Access
to the2Root
(Fa0/5).
Bridge,
Its 19
the
19
19
best path,
via Access
lowest Root
1 or 0Path,
via
to the Root
Access
Bridge.
2?
RP
19
19 RP
19 RP
0
DP 0
0
Root Bridge
63
Segments 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
19
19
19
19
19
RP
19
19
19 RP
23
19
19
19 RP
?
DP
DP 0
0
0 DP
Root Bridge
64
Segments 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.
RP 23
23
32769.0005.5E0D.9315
19
19
19
19
RP
?
DP 19
32769.0003.E461.46EC
Lower BID
Rick Graziani [email protected]
19
19 RP
19
0 DP
Root Bridge
65
Note:
PT does not show proper BID
Rick Graziani [email protected]
66
Segments perspective:
Segment between Distrib. 1 and Distrib. 2
has two equal Root Path Costs of 19.
Using the Lowest Sender ID (first two steps
are equal), Distribution 1 becomes the best
path and the Designated Port.
RP 23
23
32769.0060.47B0.5850
32769.0005.5E0D.9315
Lower BID
19
DP
19
19
DP
19
19
RP
19
19 RP
19
19
19
19 RP
DP
DP 0
0
0 DP
Root Bridge
67
68
Segments perspective:
Segment between Access 1 and Distrib. 2
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.
RP 23
23
32769.0060.47B0.5850
19
19
DP
19
19
19
RP
19
19
19 RP
32769.0003.E461.46EC DP
19
Lower BID
DP 19
19 RP
DP
DP 0
0
0 DP
Root Bridge
69
70
Segments perspective:
Because Distribution 1 has the lower Root Path Cost it becomes the Designated Port
for that segment.
Because Distribution 2 has the lower Root Path Cost it becomes the Designated Port
for that segment.
RP 23
23
?
DP
DP
19
DP
19
19
RP
19
DP
19
DP
19
19 RP
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
19
19
19
19 RP
DP
DP 0
0
0 DP
Root Bridge
71
Segments perspective:
All other ports, those ports that are not Root Ports or Designated Ports, become NonDesignated Ports.
Non-Designated Ports are put in blocking mode.
This is the loop prevention part of STP.
RP 23
23
NDP
DP
19
DP
NDP
19
DP
19
DP
19
19
RP
19
19 RP
19
NDP
DP
X
X
19
19
NDP
19 RP
DP
0 DP
DP 0
0
Root Bridge
72
Prio.Nbr
-------128.25
128.26
Type
-------------------------------P2p
P2p
Prio.Nbr
-------128.3
128.5
128.25
128.26
Type
-------------------------------P2p
P2p
P2p
P2p
Prio.Nbr
-------128.3
128.5
128.25
128.26
Type
-------------------------------P2p
P2p
P2p
P2p
Prio.Nbr
-------128.5
128.25
128.26
Type
-------------------------------P2p
P2p
P2p
Prio.Nbr
-------128.1
128.3
128.5
Type
-------------------------------P2p
P2p
P2p
73
74
Port Cost/Port ID
0/2
0/1
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.
75
Port Cost/Port ID
Fa 0/3 has a lower Port ID than Fa 04.
More later (Fast EtherChannel)
RP
19
NDP
19
DP
DP
76
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
Hello Time
2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300
Interface
Port ID
Designated
Name
Prio.Nbr
Cost Sts
Cost Bridge ID
---------------- -------- --------- --- --------- -------------------Fa0/1
128.1
19 BLK
19 32769 000b.befa.eec0
Fa0/2
128.2
19 BLK
19 32769 000b.befa.eec0
Fa0/3
128.3
19 FWD
0 32769 0009.7c0b.e7c0
Fa0/4
128.4
19 BLK
0 32769 0009.7c0b.e7c0
Fa0/5
128.5
19 FWD
19 32769 000b.fd13.9080
Gi0/1
128.25
4 FWD
19 32769 000b.fd13.9080
Port ID
Prio.Nbr
-------128.1
128.2
128.1
128.2
128.5
128.25
77
78
79
Root VLAN 20
80
Root VLAN 20
81
82
83
Disabled
Blocking
Listening
Learning
Forwarding
BPDUs
Updating
Data
Port State
BPDU
MAC-Add Table
Data frames
Duration
Disabled
None sent/received
No update
None sent/received
Until no shutdown
Receive only
No update
None sent/received
Continuous if loop
detected
None sent/received
No update
Building active topology. Thinks port can be selected root or designated port.
Returns to blocking (NDP) if cannot become root or designated port.
Learning
Updating Table
None sent/received
Building bridging table. Switch can now learn source MAC Addresses but is not
formally receiving frames in order to forward them.
Forwarding Receive and send
Updating Table
Continuous if up and no
loop detected
L is te n in g
D is a b le d o r
Down
B lo c k in g
L e a r n in g
2
7
4
6
2
F o r w a r d in g
S ta n d a rd S ta te s
( 1 ) P o r t e n a b le d o r in it ia liz e d
( 2 ) P o r t d is a b le d o r f a ile d
( 3 ) P o r t s e le c t e d a s R o o t o r D e s ig n a t e d P o r t
( 4 ) P o r t c e a s e s to b e a R o o t o r D e s ig n a te d P o r t
( 5 ) F o r w a r d in g tim e r e x p ir e s
Rick Graziani [email protected]
C is c o S p e c ific S ta te s
(6 ) P o rtF a s t
( 7 ) U p lin k F a s t
86
STP Timers
87
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.
88
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
89
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.
90
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.
91
Configuring the
Root Bridge
92
Configuring the
Root Bridge
93
Configuring the
Root Bridge
94
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.
95
Root
After
Root
96
Verify changes
After
Priority
Address
Hello Time
Aging Time
Interface
---------------Gi0/1
Gi0/2
Role
---Desg
Desg
Root
Sts
--FWD
FWD
Cost
--------4
4
Prio.Nbr
-------128.25
128.26
Type
---------------------P2p
P2p
97
Verify changes
After
Root
Priority
Address
Hello Time
Aging Time
Interface
Role Sts
---------------- ---- --Fa0/3
Desg FWD
Fa0/5
Altn BLK
Gi0/1
Desg FWD
Gi0/2Rick Graziani [email protected]
Root FWD
Cost
--------19
19
4
4
Prio.Nbr
-------128.3
128.5
128.25
128.26
Type
-------------------------------P2p
P2p
P2p
P2p
98
99
TCN
X RP
NDPRP
(Blocking)
New
(Blocking,
Listening, Learning,
Forwarding)
100
TCNs
Idle MAC
entries are
flushed
Idle MAC
entries are
flushed
TCN
RP
Idle MAC
entries are
flushed
E
Idle MAC
entries are
flushed
101
TCN BPDUs
The TCN only has an impact on the aging time; it will not
change the topology nor create a loop.
This fear comes from the fact that TCNs are often
associated with unstable STP environments; TCNs are a
consequence of this, not a cause.
102
Additional Notes
104
Download: PT-Topology-STP2.pkt
105
106
IEEE Documents
IEEE 802.1D
IEEE 802.1Q
IEEE 802.1w
802.1D)
IEEE 802.1s
802.1Q)
107
Enhancements to STP
STP
PortFast
BPDU Guard
Root Guard
UplinkFast
BackboneFast
Per VLAN Spanning Tree (PVST+)
Rapid Spanning Tree Protocol (RSTP)
Multiple Spanning Tree Protocol (MST)
MST is also known as Multiple Instance Spanning Tree
Protocol (MISTP) on Cisco Catalyst 6500 switches and
above
108
How long
until switch
link light
turns
green?
110
PortFast
Powered
On
Forwarding
Learning
Listening
BlockingState
State
State
Im adding
any
addresses on
this port to
my MAC
Address
Table.
111
Forwarding
Learning
Listening
BlockingState
State
State
DHCP Discovery
Timeout
IP Address = 169.x.x.x
112
PortFast
Powered
On
Forwarding
Portfast enabled
State
DHCP Discovery
DHCP Offer
The purpose of PortFast is to minimize the time that access ports wait for
STP to converge.
When a port comes up, the port immediately moves into Forwarding state.
The advantage of enabling PortFast is to prevent DHCP timeouts.
Host sends DHCP Discovery
Host can now can IP addressing information.
113
Configuring Portfast
Access2(config)#interface range fa 0/10 - 24
Access2(config-if-range)#switchport mode access
<Previously configured>
Access2(config-if-range)#spanning-tree portfast
OR
Access2(config)#spanning-tree portfast default
114
How long
until switch
link light
turns
green?
115
Configuring Portfast
Switch(config)#interface range fa 0/10 - 24
Switch(config-if-range)#switchport mode access
<Previously configured>
Switch(config-if-range)#spanning-tree portfast
116
Verifying Portfast
Switch(config)# show spanning-tree inteface type mod/num portfast
117
UplinkFast
Uplinkfast allows access layer switches that have redundant links to multiple
distribution switches the ability to converge quickly when a link has failed.
For Leafs (end nodes) of the spanning tree.
Not for use within backbone or distribution switches (BackboneFast).
118
UplinkFast
Root
UplinkFast must have direct knowledge of the link failure in order to move a
119
UplinkFast
Access1(config)#spanning-tree uplinkfast
120
BackboneFast
Root
Switch(config)#spanning-tree backbonefast
Backbone fast is a Cisco proprietary feature that, once enabled on all switches can
save a switch up to 20 seconds (Max Age) when it recovers from an indirect link
failure.
Configured in global configuration mode and should be enabled on all switches in
the network.
Requires the use of RLQ (Root Link Query) requests and replies.
Disabled
by default.
Rick Graziani
[email protected]
121
My link to the
Root has
gone
Thanks
down.
for I
telling
have no
me
alternate
Core is the
path
toRoot.
it. So,
I will
Im
the
change
new root
my
RP
andtosend
Fa 0/5.
out
my BPDUs
on all ports.
Root
RP
RP
Inferior BPDU
Forwarding
Blocking
Listening
I just
Thisheard
new BPDU
from
Core
is inferior
that they
to the
are still
onethe
it had
Root.
I will:
stored for this
Send
portBPDU
so I will
to
D1 ignore it.
After 20 seconds
Transition
Let me send
port
this port will now
immediately
my current
to
go into
listening
Root state
a query
Forwarding state.
saving (RLQ).
20
seconds (Max
Age)
122
BackboneFast
Normal BPDU
= Core
= Dist1
Inferior BPDU
= Dist1
= Dist1
Root Guard
BPDU Guard
Loop Guard
Coast Guard
124
BPDU
Blocking and
now listening
to BPDUs
X
Portfast
Forwards
BPDUs to
other
switches.
STP Reconvergence?
Err-Disable,
Shutdown
No BPDUs sent
Portfast &
BPDU Guard
enabled interfaces that receive BPDUs instead of putting them into a blocking state.
Errdisable: Port must be manually re-enabled or automatically recovered via timers.
BPDU guard will also keep switches added outside the wiring closet by users from
impacting and possibly violating Spanning Tree Protocol.
126
Root Guard
Protect
Protect
Potential Root
Potential Root
127
Root Guard
UplinkFast must
be disabled
because it
cannot be used
with root guard.
Distribution1(config)#interface fa 0/3
Distribution1(config-if-range)#spanning-tree
root
Distribution1(config)#interface gig 0/2
Distribution2(config)#interface
fa 0/3
Distribution1(config-if-range)#spanning-tree
Distribution2(config-if-range)#spanning-tree
root
root
Distribution2(config)#interface gig 0/1
Distribution2(config-if-range)#spanning-tree
Access2(config)#no
spanning-tree uplinkfast
root
Rick Graziani [email protected]
guard
guard
guard
guard
128
Root Guard
Root
Guard
I STP
will now
Inconsistent
transition to
listening
State no
sate,
traffic
then
is learning
state,
passed.
then forwarding sate.
Superior
BPDU
I no longer
want to be
root. I have
I want
beento
reconfigured
be root
to
be a nonbridge!
root bridge.
129
Designated Port
Blocked Port
130
ULDP
BPDU
Loop!
BPDU
BPDU
BPDU
BPDU
BPDU
No BPDUs Received
Change to Forwarding State
131
ULDP
BPDU
No BPDUs Received
Change to Forwarding State
RFC 5171: Issues arise when, due to mis-wirings or to hardware faults, the
communication path behaves abnormally and generates forwarding anomalies.
Link fails in the direction of SwitchC.
SwitchC stops receiving traffic from SwitchB.
However, SwitchB still receives traffic from C.
UDLD is a Layer 2 (L2) protocol that works with the Layer 1 (L1) mechanisms
to determine the physical status of a link.
132
ULDP
My device/port
ID & your
device port ID
My device/port
ID & your
device port ID
Layer 1: Autonegotiation
configured
(speed/duplex)
Layer 2: UDLD
configured
133
ULDP
My device/port
ID & your
device port ID
My device/port
ID & your
device port ID
UDLD-3-DISABLE: Unidirectional
link detected on port 1/2. Port
disabled
Port disabled
134
Configuring ULDL
Loopguard
Loop!
No Loopguard Configured
BPDU
No BPDUs Received
Change to Forwarding State
136
Loopguard
BPDU
BPDU
Loopguard Configured
%SPANTREE-2-LOOPGUARD_BLOCK:
Loop guard blocking port
FastEthernet1/0 on VLAN0010
137
Configuring Loopguard
Switch(config)# spanning-tree loopguard default
or
Switch(config)# interface fa 1/2
Switch(config-if)# spanning-tree guard loop
138
140
141
142
STP vs RSTP
802.1D
802.1w
vs
143
RSTP
144
802.1D
Ports
Root Port
Designated Port
Blocking Port
Non Designated Port and Non Root Port
Ciscos proprietary UplinkFast has a hidden Alternative Port
offering parallel paths, but in Blocking state.
States
Disabled (Not 802.1D state)
Blocking
Listening
Learning
Forwarding
Only state that sends/receives data.
145
RSTP
Root Bridge: Same election process as 802.1D (lowest BID)
Ports
Root Port (802.1D Root Port)
The one switch port on each switch that has the best
root path cost to the root.
Designated Port (802.1D Designated Port)
The switch port on a network segment that has the
best root path cost to the root.
Alternate Port (802.1D Blocking Port)
A port with an alternate path the root.
An alternate port receives more useful BPDUs from
another switch and is a port blocked.
Similar to how Cisco UplinkFast works.
Backup Port (802.1D Blocking Port)
A port that provides a redundant (but less desirable)
connection to a segment where another switch port
already connects.
A backup port receives more useful BPDUs from the
same switch it is on and is a port blocked.
Rick Graziani [email protected]
146
Disabled
Disabled
Discarding
Enabled
Blocking
Discarding
Enabled
Listening
Discarding
Enabled
Learning
Learning
Enabled
Forwarding
Forwarding
RSTP defines port states based on what it does with incoming data frames.
Discarding
Incoming frames are dropped
No MAC Addresses learned
Combination of 802.1D (Disabled), Blocking and Listening
Learning
Incoming frames are dropped
MAC Addresses learned
Forwarding
Incoming frames are forward.
147
RSTP BPDUs
STP Port State
STP BPDUs
RSTP BPDUs
Disabled
Not Sent/Received
Discarding
Not Sent/Received
Blocking
Receive only
Discarding
Sent/Received
Listening
Sent/Received
Discarding
Sent/Received
Learning
Sent/Received
Learning
Sent/Received
Forwarding
Sent/Received
Forwarding
Sent/Received
148
RSTP Convergence
http://www.cisco.com/en/US/docs/switches/lan/catalyst2950/software/releas
e/12.1_9_ea1/configuration/guide/swmstp.html#wp1048403
Convergence is a two step process:
1. Elect a Root Bridge
2. Examine all switch ports which by default are in Blocking state and
advance to the appropriate state to prevent loops.
STP requires the expiration of several timers before switch ports can be
moved to Forwarding state.
RSTP takes a different approach:
When a switch joins the topology (powered-up) or detects a failure in the
existing topology
Determines its forwarding decisions based on the type of port.
Edge Port
Root Port
Point-to-Point Port
149
Edge Ports
150
Non-Edge Ports
Root Port
The one switch port on each switch that has the best root path cost to
the root.
Point-to-Point Port (Link Type)
Port operating in full-duplex mode.
Connects to another switch and becomes a Designated Port.
Uses a quick handshake with neighboring switch rather than timers to
decide port state.
Shared Medium Port (Link Type)
Port operating in half-duplex mode.
Rick Graziani [email protected]
151
Proposal
DP
RP
Agreement
152
Root
Proposal
DP
RP
Agreement
Proposal
Root
DP
DP
DP
RP
Agreement
Proposal
Root A
DP
RP
DP
RP
DP
RP
Agreement
153
802.1D
802.1D
Switch detects a state change (up or down), it sends the Root Bridge a TCN
BPDU.
The Root Bridge sends out a Configuration BPDU (TCN bit set) to all switches to
tell them about the change. (30 seconds before Forwarding)
RSTP
Detects a topology change only when a nonedge port transitions to the
Forwarding State.
RSTP uses its convergence mechanisms (Edge Ports, Point-to-Point ports,
handshaking, etc.) to prevent bridging loops.
Therefore, topology changes are detected only so MAC address tables can be
updated and corrected.
This means that a loss of connectivity is not considered as a topology change any
more, contrary to 802.1D (that is, a port that moves to blocking no longer generates
a TC).
154
155
156
157
Priority
Address
Hello Time
Aging Time
158
159
160
Multiple Spanning Tree (MST) extends the IEEE 802.1w RST algorithm to multiple
spanning trees.
The main purpose of MST is to:
Reduce the total number of spanning-tree instances to match the physical topology
of the network
Thus reduce the CPU cycles of a switch.
Allows the network administrator to configure the exact number of instances.
PVST+ runs a single instance of STP for each VLAN and does not take into
consideration the physical topology.
May have 1,000 VLANs but only 2 different topologies (2 different Root Bridges).
PVST+ will still create 1,000 instances of STP
MST, on the other hand, uses a minimum number of STP instances to match the
number of physical topologies present.
May have 1,000 VLANs but only 2 different topologies (2 different Root Bridges).
MST will let you specify only 2 instances of STP.
161
802.1D
MST Regions
802.1D
MST
Region
MST Region is a group of switches placed under a common administration (like an AS).
In most networks a single MST region is sufficient.
A single MST Region can handle 15 STP instances (topologies).
Within a region, all switches must run the instance of MST as defined by:
MST configuration name (32 characters)
MST configuration revision number ( 0 to 65,535)
MST instance-to-VLAN mapping table (4,096 entries)
MST was designed to work with all forms of STP.
IST (Internal Spanning Tree) instance runs to work out a loop-free topology inside the
MST Region.
IST presents the entire MST region as a single virtual switch (bridge) to the CST (802.1D)
outside.
162
MST
163
MST
Enables MST
Distribution1(config)# spanning-tree mode mst
Distribution1(config)# spanning-tree mst configuration
Configure Region
Distribution1(config-mst)# name region1
and MST instances
Distribution1(config-mst)# revision 10
Distribution1(config-mst)# instance 1 vlan 10, 30, 100
Distribution1(config-mst)# instance 2 vlan 20, 40, 200
Distribution1(config-mst)# exit
Configure Root Bridge
Distribution1(config)# spanning-tree mst 0-1 root primary
Distribution1(config)# spanning-tree mst 2 root secondary
Rick Graziani [email protected]
164
MST
Enables MST
Distribution2(config)# spanning-tree mode mst
Distribution2(config)# spanning-tree mst configuration
Configure Region
Distribution2(config-mst)# name region1
and MST instances
Distribution2(config-mst)# revision 10
Distribution2(config-mst)# instance 1 vlan 10, 30, 100
Distribution2(config-mst)# instance 2 vlan 20, 40, 200
Distribution2(config-mst)# exit
Configure Root Bridge
Distribution2(config)# spanning-tree mst 2 root primary
Distribution2(config)# spanning-tree mst 0-1 root secondary
Rick Graziani [email protected]
165
MST
166
MST
Switch# show spanning-tree
MST00
Spanning tree enabled protocol mstp
Root ID
Priority
24577
Address
0001.C945.A573
Cost
4
Port
26(GigabitEthernet1/2)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID
Priority
Address
Hello Time
Aging Time
167