Академический Документы
Профессиональный Документы
Культура Документы
Cisco Public
SWIC! v" Ch#$ter %
1
Ch#$ter %&
Im$lementing S$#nning
ree
CCNP SWITCH: Implementing IP Switching
Ch#$ter %
2 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
Chapter 3 Objectives
'escribe s$#nning tree $rotocols.
'escribe #nd con(igure )SP.
'escribe #nd con(igure *S.
Con(igure SP (e#tures to enh#nce resiliency #nd $revent
(or+#rding loo$s.
,-$l#in recommended SP con(igur#tions #nd $r#ctices.
roubleshoot s$#nning tree issues.
Ch#$ter %
% 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
Spanning Tree
Protocol Basics
Ch#$ter %
. 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
Spanning Tree History
SP +#s invented in 1/01 by )#di# Perlm#n #t the 'igit#l
,2ui$ment Cor$or#tion.
In 1//0, I,,, $ublished the (irst st#nd#rd (or the $rotocol #s
002.1'.
Common S$#nning ree 3CS4 56 Cisco P7S8 56 )#$id SP
3)SP4 or I,,, 002.1+ 56 Cisco P7)S8 56 *ulti$le S$#nning
ree 3*S4 or I,,, 002.1s 56 SP security enh#ncements
Ch#$ter %
1 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
STP Operation !"eview #rom CCN$%
Ch#$ter %
" 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
STP Operation & !"eview #rom CCN$%
$ll lin's are (( )b*s+
Ch#$ter %
7 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
"api, Spanning
Tree Protocol
Ch#$ter %
0 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
"STP Operation - Port States
Port State .escription
'isc#rding
his st#te is seen in both # st#ble #ctive to$ology #nd during to$ology
synchroni9#tion #nd ch#nges. he disc#rding st#te $revents the (or+#rding o(
d#t# (r#mes, thus :bre#;ing< the continuity o( # =#yer 2 loo$.
=e#rning
his st#te is seen in both # st#ble #ctive to$ology #nd during to$ology
synchroni9#tion #nd ch#nges. he le#rning st#te #cce$ts d#t# (r#mes to
$o$ul#te the *AC t#ble to limit (looding o( un;no+n unic#st (r#mes.
>or+#rding
his st#te is seen only in st#ble #ctive to$ologies. he (or+#rding s+itch $orts
determine the to$ology. >ollo+ing # to$ology ch#nge, or during
synchroni9#tion, the (or+#rding o( d#t# (r#mes occurs only #(ter # $ro$os#l
#nd #greement $rocess.
Operational
Stat/s
STP Port State "STP Port State Port Incl/,e, in
$ctive Topology
,n#bled ?loc;ing 'isc#rding @o
,n#bled =istening 'isc#rding @o
,n#bled =e#rning =e#rning Aes
,n#bled >or+#rding >or+#rding Aes
'is#bled 'is#bled 'isc#rding @o
Ch#$ter %
/ 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
"STP Operation - Port "oles
STP Port "ole "STP Port
"ole
STP Port
State
"STP Port
State
)oot $ort )oot $ort >or+#rding >or+#rding
'esign#ted $ort 'esign#ted
$ort
>or+#rding >or+#rding
@ondesign#ted
$ort
Altern#te or
b#c;u$ $ort
?loc;ing 'isc#rding
'is#bled 'is#bled 5 'isc#rding
r#nsition r#nsition =istening
=e#rning
=e#rning
Ch#$ter %
10 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
"STP Operation - "api, Transition to
0orwar,ing - 1in' Type
1in'
Type
.escription
Point5to5
$oint
Port o$er#ting in (ull5
du$le- mode. It is
#ssumed th#t the $ort is
connected to # single
s+itch device #t the other
end o( the lin;.
Sh#red Port o$er#ting in h#l(5
du$le- mode. It is
#ssumed th#t the $ort is
connected to sh#red
medi# +here multi$le
s+itches might e-ist.
Ch#$ter %
11 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
"STP Operation - "api, Transition to
0orwar,ing - 2,ge Ports
An )SP edge $ort is # s+itch $ort
th#t is never intended to be
connected to #nother s+itch device.
It immedi#tely tr#nsitions to the
(or+#rding st#te +hen en#bled.
@either edge $orts nor Port>#st5
en#bled $orts gener#te to$ology
ch#nges +hen the $ort tr#nsitions
to dis#bled or en#bled st#tus.
Bnli;e Port>#st, #n edge $ort th#t
receives # ?P'B immedi#tely loses
its edge $ort st#tus #nd becomes #
norm#l s$#nning5tree $ort. When #n
edge $ort receives # ?P'B, it
gener#tes # to$ology ch#nge
noti(ic#tion 3C@4.
Ch#$ter %
12 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
"STP Operation - Proposal an, $greement
Ch#$ter %
1% 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
"STP Operation - Topology Change !TC%
)echanism
Cnly non5edge $orts th#t #re moving to the (or+#rding st#te
c#use # to$ology ch#nge. A $ort th#t is moving to bloc;ing does
not c#use the res$ective bridge to gener#te # C ?P'B.
Ch#$ter %
1. 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
"STP Operation - Bri,ge I,enti#ier #or P3"ST4
Cnly (our high5order bits o( the 1"5bit ?ridge Priority (ield
#((ect the $riority. here(ore, $riority c#n be incremented
only in ste$s o( .0/", onto +hich #re #dded the 7=A@
number. >or e-#m$le, (or 7=A@ 11& I( the $riority is le(t #t
de(#ult, the 1"5bit Priority (ield +ill hold %27"0 8 11 D %277/.
Ch#$ter %
11 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
"STP an, 5(&+. STP Compatibility
)SP c#n o$er#te +ith 002.1' SP. !o+ever, 002.1+Es
(#st5convergence bene(its #re lost +hen inter#cting +ith
002.1' bridges.
,#ch $ort m#int#ins # v#ri#ble th#t de(ines the $rotocol to
run on the corres$onding segment. I( the $ort receives
?P'Bs th#t do not corres$ond to its current o$er#ting mode
(or t+o times the hello time, it s+itches to the other SP
mode.
Ch#$ter %
1" 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
.e#a/lt STP Con#ig/ration on Cisco Switch
P7S8
?ridge $riority %2,7"0 (or e#ch 7=A@
Ch#$ter %
17 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
Spanning Tree Port0ast
?y$#ss 002.1' SP listening #nd le#rning st#tes 3bloc;ing
st#te (or+#rding st#te4
Ports connected to end st#tions
Prevents '!CP timeouts
*#y cre#te bridging loo$s i( en#bled on trun; $ort
Ch#$ter %
10 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
Con#ig/ring Port0ast on $ccess Ports
Bse the spanning-tree portfast inter(#ce comm#nd
to en#ble the Port>#st (e#ture.
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface FastEthernet 3/27
Switch(configif)# spanning-tree portfast
!"arning# portfast should onl$ %e ena%led on ports connected to a
single
host. Connecting hu%s, concentrators, switches, %ridges, etc... to
this
interface when portfast is ena%led, can cause temporar$ %ridging
loops.
&se with C'&T()N
!*ortfast has %een configured on +astEthernet,/-. %ut will onl$
ha/e effect when the interface is in a nontrun0ing mode.
Switch(configif)# end
Switch#
Switch# show spanning-tree interface FastEthernet 3/27 portfast
1L'N2223 ena%led
Ch#$ter %
1/ 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
Con#ig/ring Port0ast 6lobally
Bse the spanning-tree portfast de(#ult glob#l
con(igur#tion mode comm#nd to en#ble the Port>#st
(e#ture on #ll nontrun;ing inter(#ces.
Switch(config)# spanning-tree portfast default
Ch#$ter %
20 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
Con#ig/ring Port0ast on Tr/n' Ports
Bse the spanning-tree portfast trunk inter(#ce
comm#nd to en#ble the Port>#st (e#ture on # trun; $ort.
Switch(config)# spanning-tree portfast trunk
Ch#$ter %
21 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
Con#ig/ring $ccess Port )acro
Bse the switchport host m#cro comm#nd on #n
inter(#ce connecting to #n end st#tion.
Switch(configif)# switchport host
switchport mode will %e set to access
spanningtree portfast will %e ena%led
channel group will %e disa%led
Switch(configif)# end
Switch#
Ch#$ter %
22 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
Implementing P3"ST4
1. ,n#ble P7)S8 glob#lly. P7)S8 should be con(igured on #ll
s+itches in the bro#dc#st dom#in.
2. 'esign#te #nd con(igure # s+itch to be the root bridge.
%. 'esign#te #nd con(igure # s+itch to be the second#ry 3b#c;u$4 root
bridge.
.. ,nsure lo#d sh#ring on u$lin;s using $riority #nd cost $#r#meters.
1. 7eri(y the con(igur#tion.
Ch#$ter %
2% 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
3eri#ying P3"ST4
he out$ut belo+ illustr#tes ho+ to veri(y the )SP
con(igur#tion (or 7=A@2 on # nonroot s+itch in # to$ology.
Switch# show spanningtree /lan -
1L'N222-
Spanning tree ena%led protocol rstp
4oot (5 *riorit$ ,-.67
'ddress 222%.fc%8.dac2
Cost ,7
*ort . (+astEthernet2/.)
9ello Time - sec :a; 'ge -2 sec +orward 5ela$ 38 sec
<ridge (5 *riorit$ ,-..2 (priorit$ ,-.67 s$side;t -)
'ddress 223,.8f3c.e3c2
9ello Time - sec :a; 'ge -2 sec +orward 5ela$ 38 sec
'ging Time ,22
(nterface 4ole Sts Cost *rio.N%r T$pe
E;piration time# ,7
5e/ice (5# 3
Current neigh%or state# <idirectional
5e/ice name# +)B26,324"3
*ort (5# Di3/3
Neigh%or echo 3 de/ice# +)B26-.'223
Neigh%or echo 3 port# Di8/3
:essage inter/al# 38
Time out inter/al# 8
C5* 5e/ice name# Switch<
Ch#$ter %
"% 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
1oop 6/ar, vers/s $ggressive )o,e 7.1.
1oop 6/ar, $ggressive )o,e 7.1.
Con(igur#tion Per $ort Per $ort
Action gr#nul#rity Per 7=A@ Per $ort
Auto5recovery Aes Aes, +ith err5dis#ble timeout
(e#ture
Protection #g#inst SP
(#ilures c#used by
unidirection#l lin;s
Aes, +hen en#bled on
#ll root $orts #nd
#ltern#te $orts in
redund#nt to$ology
Aes, +hen en#bled on #ll
lin;s in redund#nt to$ology
Protection #g#inst SP
(#ilures c#used by
$roblem in so(t+#re in
design#ted bridge not
sending ?P'Bs
Aes @o
Protection #g#inst
mis+iring
@o Aes
Ch#$ter %
". 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
0le8 1in's
>le- =in;s is # =#yer 2 #v#il#bility (e#ture
th#t $rovides #n #ltern#tive solution to SP
#nd #llo+s users to turn o(( SP #nd still
$rovide b#sic lin; redund#ncy.
>le- =in;s c#n coe-ist +ith s$#nning tree on
the distribution l#yer s+itchesJ ho+ever, the
distribution l#yer s+itches #re un#+#re o( the
>le- =in;s (e#ture.
>le- =in;s en#bles # convergence time o(
less th#n 10 milliseconds. In #ddition, this
convergence time rem#ins consistent
reg#rdless o( the number o( 7=A@s or *AC
#ddresses con(igured on s+itch u$lin; $orts.
>le- =in;s is b#sed on de(ining #n
#ctiveKst#ndby lin; $#ir on # common #ccess
s+itch. >le- =in;s #re # $#ir o( =#yer 2
inter(#ces, either s+itch$orts or $ort
ch#nnels, th#t #re con(igured to #ct #s
b#c;u$ to other =#yer 2 inter(#ces.
Ch#$ter %
"1 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
0le8 1in's Con#ig/ration Consi,erations
A >le- =in; is con(igured on one =#yer 2 inter(#ce 3the #ctive lin;4 by
#ssigning #nother =#yer 2 inter(#ce #s the >le- =in; or b#c;u$ lin;. When
one o( the lin;s is u$ #nd (or+#rding tr#((ic, the other lin; is in st#ndby
mode, re#dy to begin (or+#rding tr#((ic i( the other lin; shuts do+n. At #ny
given time, only one o( the inter(#ces is in the lin; u$ st#te #nd (or+#rding
tr#((ic. I( the $rim#ry lin; shuts do+n, the st#ndby lin; st#rts (or+#rding
tr#((ic. When the #ctive lin; comes b#c; u$, it goes into st#ndby mode #nd
does not (or+#rd tr#((ic.
>le- =in;s #re su$$orted only on =#yer 2 $orts #nd $ort ch#nnels, not on
7=A@s or on =#yer % $orts.
Cnly one >le- =in; b#c;u$ lin; c#n be con(igured (or #ny #ctive lin;.
An inter(#ce c#n belong to only one >le- =in; $#ir. An inter(#ce c#n be #
b#c;u$ lin; (or only one #ctive lin;. An #ctive lin; c#nnot belong to #nother
>le- =in; $#ir.
SP is dis#bled on >le- =in; $orts. A >le- =in; $ort does not $#rtici$#te in
SP, even i( the 7=A@s $resent on the $ort #re con(igured (or SP.
Ch#$ter %
"" 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
0le8 1in's Con#ig/ration an, 3eri#ication
>le-=in;s #re con(igured #t the inter(#ce level +ith the
comm#nd switchport $ackup interface.
!ere +e con(igure #n inter(#ce +ith # b#c;u$ inter(#ce #nd
veri(y the con(igur#tion.
Switch(config)# interface fastethernet1/"/1
Switch(configif)# switchport $ackup interface fastethernet1/"/2
Switch(configif)# end
Switch# show interface switchport $ackup
Switch <ac0up (nterface *airs#
'cti/e (nterface <ac0up (nterface State
+astEthernet3/2/3 +astEthernet3/2/- 'cti/e &p/<ac0up Stand%$
Ch#$ter %
"7 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
STP Best
Practices an,
Tro/bleshooting
Ch#$ter %
"0 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
Switching .esign Best Practices
Bse =#yer % connectivity #t the
distribution #nd core l#yers.
Bse P7)S8 or *S. 'o not dis#ble
SP #t the #ccess l#yer. Isol#te
di((erent SP dom#ins in #
multivendor environment.
Bse =oo$ Iu#rd on =#yer 2 $orts
bet+een distribution s+itches #nd on
u$lin; $orts (rom #ccess to
distribution s+itches.
Bse )oot Iu#rd on distribution
s+itches (#cing #ccess s+itches.
Bse Port security, Port>#st, ?P'B
Iu#rd, #nd )oot Iu#rd on #ccess
s+itch $orts (#cing end st#tions.
Bse #ggressive mode B'=' on $orts
lin;ing s+itches.
Ch#$ter %
"/ 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
Potential STP Problems
'u$le- mism#tch
Bnidirection#l lin; (#ilure
>r#me corru$tion
)esource errors
Port>#st con(igur#tion error
Ch#$ter %
70 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
./ple8 )ismatch
Point5to5$oint lin;.
Cne side o( the lin; is m#nu#lly con(igured #s (ull du$le-.
Cther side is using the de(#ult con(igur#tion (or #uto5
negoti#tion.
Ch#$ter %
71 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
7ni,irectional 1in' 0ail/re
>re2uent c#use o( bridge loo$s.
Bndetected (#ilure on # (iber lin; or # $roblem +ith #
tr#nsceiver.
Ch#$ter %
72 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
0rame Corr/ption
I( #n inter(#ce is e-$eriencing # high r#te o( $hysic#l errors,
the result m#y be lost ?P'Bs, +hich m#y le#d to #n
inter(#ce in the bloc;ing st#te moving to the (or+#rding
st#te.
Bncommon scen#rio due to conserv#tive de(#ult SP
$#r#meters.
>r#me corru$tion is gener#lly # result o( # du$le- mism#tch,
b#d c#ble, or incorrect c#ble length.
Ch#$ter %
7% 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
"eso/rce 2rrors
SP is $er(ormed by the CPB 3so(t+#re5b#sed4. his
me#ns th#t i( the CPB o( the bridge is over5utili9ed (or #ny
re#son, it might l#c; the resources to send out ?P'Bs.
SP is gener#lly not # $rocessor5intensive #$$lic#tion #nd
h#s $riority over other $rocessesJ there(ore, # resource
$roblem is unli;ely to #rise.
,-ercise c#ution +hen multi$le 7=A@s in P7S8 or
P7)S8 mode e-ist. Consult the $roduct document#tion (or
the recommended number o( 7=A@s #nd SP inst#nces on
#ny s$eci(ic s+itch to #void e-h#usting resources.
Ch#$ter %
7. 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
Port0ast Con#ig/ration 2rror
S+itch A h#s Port $1 in the (or+#rding st#te #nd Port $2 con(igured (or
Port>#st. 'evice ? is # hub. Port $2 goes to (or+#rding #nd cre#tes # loo$
bet+een $1 #nd $2 #s soon #s the second c#ble $lugs in to S+itch A. he loo$
ce#ses #s soon #s $1 or $2 receives # ?P'B th#t tr#nsitions one o( these t+o
$orts into bloc;ing mode.
he $roblem +ith this ty$e o( tr#nsient loo$ condition is th#t i( the loo$ing tr#((ic
is intensive, the bridge might h#ve trouble success(ully sending the ?P'B th#t
sto$s the loo$. ?P'B gu#rd $revents this ty$e o( event (rom occurring.
Ch#$ter %
71 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
Tro/bleshooting )etho,ology
roubleshooting SP issues c#n be di((icult i( logic#l
troubleshooting $rocedures #re not de$loyed in #dv#nce.
Ccc#sion#lly, rebooting o( the s+itches might resolve the
$roblem tem$or#rily, but +ithout determining the underlying
c#use o( the $roblem, the $roblem is li;ely to return. he
(ollo+ing ste$s $rovide # gener#l overvie+ o( #
methodology (or troubleshooting SP&
Ste$ 1. 'evelo$ # $l#n.
Ste$ 2. Isol#te the c#use #nd correct #n SP $roblem.
Ste$ %. 'ocument (indings.
Ch#$ter %
7" 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
Chapter 3 S/mmary !%
S$#nning ree Protocol is # (und#ment#l $rotocol to
$revent =#yer 2 loo$s #nd #t the s#me time $rovide
redund#ncy in the net+or;. his ch#$ter covered the b#sic
o$er#tion #nd con(igur#tion o( )SP #nd *S.
,nh#ncements no+ en#ble SP to converge more 2uic;ly
#nd run more e((iciently.
F )SP $rovides (#ster convergence th#n 002.1' +hen to$ology
ch#nges occur.
F )SP en#bles sever#l #ddition#l $ort roles to incre#se the over#ll
mech#nismEs e((iciency.
F show spanning-tree is the m#in (#mily o( comm#nds used to
veri(y )SP o$er#tions.
F *S reduces the encumbr#nce o( P7)S8 by #llo+ing # single
inst#nce o( s$#nning tree to run (or multi$le 7=A@s.
Ch#$ter %
77 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
Chapter 3 S/mmary !&%
he Cisco SP enh#ncements $rovide robustness #nd resiliency to the
$rotocol. hese enh#ncements #dd #v#il#bility to the multil#yer s+itched
net+or;. hese enh#ncements not only isol#te bridging loo$s but #lso
$revent bridging loo$s (rom occurring. o $rotect SP o$er#tions, sever#l
(e#tures #re #v#il#ble th#t control the +#y ?P'Bs #re sent #nd received&
F ?P'B gu#rd $rotects the o$er#tion o( SP on Port>#st5con(igured $orts.
F ?P'B (iltering $revents ?P'Bs (rom being sent #nd ignores received ?P'Bs +hile
le#ving the $ort in (or+#rding st#te.
F )oot gu#rd $revents root s+itch being elected vi# ?P'Bs received on # root5gu#rd
con(igured $ort.
F =oo$ gu#rd detects #nd dis#bles #n inter(#ce +ith =#yer 2 unidirection#l connectivity,
$rotecting the net+or; (rom #nom#lous SP conditions.
F B'=' detects #nd dis#bles #n inter(#ce +ith unidirection#l connectivity, $rotecting the
net+or; (rom #nom#lous SP conditions.
F In most im$lement#tions, the SP tool;it should be used in combin#tion +ith #ddition#l
(e#tures such #s >le- =in;s.
Ch#$ter %
70 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
1ab 39 Spanning Tree Protocol !STP% .e#a/lt Behavior
1ab 39& )o,i#ying .e#a/lt Spanning Tree Behavior
1ab 393 Per931$N Spanning Tree Behavior
1ab 39: )/ltiple Spanning Tree
Chapter 3 1abs
Ch#$ter %
7/ 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public
"eso/rces
Cisco S$#nning ree Protocol Con(igur#tion Iuide&
+++.cisco.comKenKBSKdocsKs+itchesKl#nKc#t#lyst%1"0Kso(t+#reKrele#s
eK12.2L12LseKcomm#ndKre(erenceK%1"0cr.html
Con(iguring *S Con(igur#tion Iuide&
+++.cisco.comKenKBSKdocsKs+itchesKl#nKc#t#lyst%1"0Kso(t+#reKrele#s
eK12.2L12LseKcon(igur#tionKguideKs+st$.html
Cisco C$tion#l S$#nning5ree >e#tures Con(igur#tion
Iuide&
+++.cisco.comKenKBSKdocsKs+itchesKl#nKc#t#lyst%1"0Kso(t+#reKrele#s
eK12.2L12LseKcon(igur#tionKguideKs+mst$.html
+++.cisco.comKenKBSKdocsKs+itchesKl#nKc#t#lyst%1"0Kso(t+#reKrele#s
eK12.2L12LseKcon(igur#tionKguideKs+st$o$t.html
Ch#$ter %
00 2007 2010, Cisco Systems, Inc. All rights reserved. Cisco Public