How STP Works
• Elect one Root Bridge
• Elect one Root Port per bridge
• Elect Designated Ports
Root Bridge Election
• Switch with lowest Bridge ID in the network becomes Root Bridge
• Bridge ID contains…
– Bridge Priority
• 0 -61440 in increments of 4096
– System ID Extension
• 0 -4095
– MAC Address
Bridge Priority(0-61440) + System ID Extension(VLAN ID 1-4095) + MAC Address
Changingthe Root Bridge Election
• Manually change BID priority
– spanning-tree vlan [vlan] priority
– Lower is better
• Use root bridge macro
– spanning-tree vlan [vlan] root [primary | secondary]
– Sets local priority based on current Root Bridge
• Verification
– show spanning-tree vlan [vlan]
– show spanning-tree root
在下root bridge macro時,
SW會自動降低STP Vlan priority...SW會自動降的比原本的root SW priority還要低
Root Port Election
• RP is upstream facing towards Root Bridge
• Elected based on lowest Root Path Cost
– Cumulative cost of all links to get to the root
• Cost based on inverse bandwidth
– i.e. higher bandwidth, lower cost
• Not linear
• If tie in cost…相同cost情況之下
– Choose lowest upstream BID
– Choose lowest upstream Port ID
Designated Port Election
• DPs are downstream facing away from Root Bridge
• Like Root Port, elected based on…
– Lowest Root Path Cost
– Lowest BID
– Lowest Port ID
• All other ports go into blocking mode
– Receive BPDUs
– Discard all other traffic
– Cannot send traffic
Changing the Port’s Role
• Modify the port’s cost
– spanning-tree [vlan] cost
– bandwidth [bps]
• Modify the Bridge ID
– spanning-tree vlan [vlan] priority
• Modify the Port ID
– spanning-tree vlan [vlan] port-priority
• Verification
– show spanning-tree interface [int] detail
– show spanning-tree vlan [vlan] detail
-----------------------------------------------------------------------------------------------
STP Port-Priority筆記...請詳細看一下囉...
Rack1SW4# show spanning-tree vlan 5 detail
Port 19 (FastEthernet1/0/17) of VLAN0005 is designated forwarding
Port path cost 19, Port priority 128, Port Identifier 128.19.
Designated root has priority 32773, address 000f.34f7.b880
Designated bridge has priority 32773, address 000f.34fc.6c80
Designated port id is 128.19, designated path cost 58
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
Link type is point-to-point by default
BPDU: sent 7811752, received 318
第一個Port path 19是我們Local Port Cost.....
designated path cost 58是從Root SW到我們之間的Cost為58
所以我們到Root的Cost為19+58=77
Designated root has priority 32773, address 000f.34f7.b880 為root SW的priority及System MAC
Designated bridge has priority 32773, address 000f.34fc.6c80 為對點SW的priority及System MAC
Port priority 128, Port Identifier 128.19
Port priority 128為SW自己的Port priority...Port Identifier就是自己的Port priority + Port Number
Port number不會變動...固定值
設定自己SW本身的Port priority所造成的結果Port Identifier會advertisement到對點SW
對點SW可以確認Designated port id is 128.19
舉例來說
(root)SW1-----------SW2----------SW3===========SW4
SW3與SW4之間用fa0/20 & fa0/21互接
正常情況因為要先推舉RP....fa0/20為RP.......於是乎fa0/21就是BLK
若是我想改變SW4 fa0/20為BLK.....fa0/21為FWD
我們通常會改變SW4 fa0/20 cost增加比fa0/21大....或是將fa0/21的cost減少比fa0/20小
就可以達成此結果
另外一種方式為.......不異動SW4的設定
直接變動SW3的fa0/20(128.20)將spanning-tree vlan [vlan] port-priority預設為128變大
或是變動SW3的fa0/21(128.21)將spanning-tree vlan [vlan] port-priority預設為128變小
也可以達成相同結果
沒有留言:
張貼留言