2014年11月17日 星期一

CCNP-BCMSN Module 03 Implementing Spanning Tree

CCNP-BCMSN Module 03 Implementing Spanning Tree

Filed under: CCNP-BCMSN Module 03 — nkongkimo @ 13:29:31
Transparent Bridging
內容
1透明的,其他設備不知道他的存在。
2.不更改Packet的內容,只負責轉送Packets。
3.MAC的學習並建立CAM Table。(經由Source Addr.欄位學習)
4.轉送Multicast/ Broadcast/ Unknow Unicast資料
5.介面的轉換。ex:enthernet介面轉換成FastEthernet介面。
note:早期的SW類型
Bridge Loop的種類
名稱定義
1.Broadcast Storm1.廣播風暴
2.L2 沒有TTL限制所以廣播風暴不會停止
3.會造成設備CPU升高,網路中斷
2.Multiple Frame Transmission
(duplicated Frme copies)
1.同一個封包會在每個介面上重復轉送
2.浪費頻寬
3.MAC-Addr.-Fable Instabilty
(Instable CAM Table)
1.MAC table不穩定
802.1D STP(Spanning Tree Protocol)
1.目的:
建立一個Loop-Frame的Switching Path具有Redundant的優點。
2.方法:
(1)選出一個Reference Point決定Switchport的"重要性",將較不重要的port(造成Loop Path的port) Disable。
*Port的重要性,可以把效能較好的port視為重要的Switchport。
(2)使用BPDU的Packet來比較Switchport的重要性。
3.STP Algorithm Rule
(1)Root Bridge(根橋接器): One Root Bridge Per Switched Network
    -以Bbride ID最小的為Root Bridge
    -Root Bridge上所有的Port都是Designated Port(DP)
(2)Root Port: One Root Port Per Non-Root Bridge
    -Lowest Root Path cost Wins(BW大的WIN)
    -在每一個Non-Root Bridge上有一個Root Port
(3)Designated Port(委任port): One Designated Port Per Segment
    -委任Port:Lowest Root Path cost Wins(BW大的WIN)
(4)Non-Designated are blocked
沒有擔任角色的介面就會被Blocked
4.STP的缺點:
1.收斂時間過久(30~50秒)
2.Topology Change通知的機制不好,較不即時。
3.當有多個VLAN時,資源沒有有效利用。(因只有一個Instance)

802.1D STP 競選規則

規則定義
1.One Root Bridge Per L2 switched Network1.Reference Point: Root Bridge
2.Lowest BID WINs!!
可以用spanning-tree vlan X priority  調整
2.One “Root Port”Per “Non-Root”Bridge1.Lowest Root “Path Cost ”WINs!!
2.”Cost ”與”介面Speed”有關(default=19)
可以用spanning-tree vlan X cost   調整
3.One Designated Port Per “Segment”1.Lowest Root Path Cost WINs!! 2.All Port in Root Bridge are “D.P”
3.每一個segment都會有DP
4.Non-Designated Port are “Blocked”1.Non D.P or R.P are Blocked
備註Root Bridge 送出的bpdu cost是0
BPDU (Bridge Protocol Data Unit)欄位解說
*利用BPDU去做STP的角色決定(比大小)
*每2sec交換BPDU,使用Multucast的方式傳送,MAC為0180:c200:0000
欄位長度bytes功能
1Protocol ID2告知為STP的BPDU資料
表示法:0×00
2Version1目前的版本
表示法:00
3Message Type1有2種訊息
(1)TC(Configuartion BPDU):一般的BPDU Packet
(2)TCN(Topology Change Notification):當Topology Change時才會傳送。
4.Flags1與TC有關
5.Root ID81.可以稱為Root Bridge ID
2.一開始Root ID與Bridge ID的數值相同,等到收斂結束,且沒有成為Root Bridge時才會不同。
6.Cost of Path41.可以稱為Cost of Root Path
由我的設備到Root Bridge的加總成本
7.Bridge ID8
1.可以稱為Seeder Bridge ID
假定自己為Root Bridge的ID
2.早期SW預設Priority=32768
3.目前SW預設值為Bridge Priority+VLAN-ID。
ex: Bridge prioity=32768 VLAN-ID=11  所以Priority=32768+11=32779。
4.MAC Address=機器本身網卡
可用show version可以看到
8.Port ID21.預設port Prioity=128
2.競選Root Port時可能會用到
9.Message Age2可以傳送給幾顆sw的數量 如同TTL值
10.Max Age220秒
11.Hellotime2每2秒
12.Forward Delay2有2個狀態
1.Listening=15sec
2.Learing=15sec
STP Port State
狀態定義
1.Blocking1.只能收BPDU
2.最終狀態
3.一開始的狀況,直接進入Listning狀態。
4.當收歛結束,topology有改變時,由Blocking狀態到listening要20sec(max  age)
5.由blocking進入listening的狀況:
(1)link UP會進入Listening的狀態
(2)當一段時間沒有收到bpdu時會進入Listening的狀態(Max Age 20sec)
2.Listening1.只能收/送BPDU
2.過度狀態
3.到learning要15sec
3.Learning1.只能收/送BPDU+MAC的學習
2.過度狀態
3.到Forwarding要15sec
4.Forwarding1.可以收/送BPDU+Data Frame
2.最終狀態
STP的整理
STP Port Role
角色定義
Root Port1.Losest Root Path Cost
2.Forwarding
Designated Port1.Losest Root Path Cost
2.Forwarding
Non-Designated PortBlocking
STP Timer
*STP的缺點等待時間過久,約要30-50sec。
種類定義
Hellodefault 2 sec
Forward Delaydefault 15 sec
Max Agedefault 20 sec
STP Tie-Breaker*當競選的條件都相同時
比較順序定義
1.Rot Bridge ID較小的win
2.Root Path ID較小的win
3.Seeder Bridge ID較小的win
4.Port ID較小的win
*使用Port ID的時機為:
Configuare Root Bridge
*建議使用Desbutriation SW的設備當作Root Bridge。
*建議使用設定的方式,不要使用Primart及Secondary的方式設定。
*Priority越小越容易成為Root Bridge。
Spanning Tree Path Cost
Spanning Tree Protocol Topology Change
Step 1.
SW B會送出TCN的訊息給Root Bridge告知架構已改變,Root Bridge會回應TCA的訊息,表示已經知道了。
Step 2.
Root Bridge以廣播TC的方式告知整個Domain的SW,架構已改變。

STP 802.1d TC(Topology change)

1.”CAM table”預設300sec Aging time
2.利用STP TC機制加送收斂

STP Topology Change 定義

1.Port state 由Forwarding 狀態到Blocking的狀態
2.Port state變成Forwarding state,該sw有Disgnated Port
表示port UP/Down就會產生TC,Spanning-tree 重算
Spanning Tree Protocol Enhancements
*Cisco專屬的功能
*最後變成IEEE 802.1W使用。(PSVT)
功能定義
1.PortFast1.減少重新計算時間,不用等Listen及Learn的時間,減少30秒。
2.建議設定在Access SW的Access Port(Edge Port)介面上,不行設定在Trunk Prot上。
3.若在SW的Portfast介面被接上SW會被Block。
4.可以搭配BPDU Guard使用,當收到BPDU時Port會進入Error-Disable的狀態。
5.在介面下設定:
2.UplinkFast1.當Uplink的其中一條Link斷線,由另一條接手。
2.減少Listen及Learn的時間,減少30秒。
3.利用Dummy Frame去偵測,每秒150個Frame。
3.在一般模式下設定:

3.BackboneFast1.針對非直連的介面,從Root Port送出Root Link Quary詢問。
2.減少Max Age的時間,減少20秒。
3.必須全部SW都需要啟動。
4.在一般模式下設定:
LAB 3-1 Show的觀察
1.Show spann summary
2.Show spann root
 
3.Show spann vlan X
4.Show spann (vlan X) blockport
5.Show spann int fa X/X cost
6.Show spann int fa X/X root cost
 
STP的演進
RSTP(Rapid Spanning Tree Protocol) 整理
種類內容
Port State
狀態定義
1.Discarding1.Discarding=Blocking & Listening
2.只能收送BPDU
2.Learning1.傳送/接收BPDU+建立CAM Table
3.Forwarding1.傳送/接收BPDU+建立CAM Table+傳送Data Frame
Port Role
角色定義
1.Root Port
1.最終成為Forwarding
2.不使用Link Type參數
3.Best Path to Root 到Root Bridge最低的port
2.Designated Port
1.最終成為Forwarding
2.使用Link Type參數,分為P2P及Shared
3.在segment裡面Best Path to Root
3.Alternate Port
1.最終被Blocking
2.不使用Link Type參數
3.成為Root Port備援
4.與UplinkFast相同
5.Alternate Path to Root
6.到Root Bridge被援路徑
7.不參考link type
4.Backup Port
1.最終被Blocking
2.不使用Link Type參數
3.Designated Port的備援
4.Alternate Path to Root in same sagment
5.Desgnate sw有多個port 接到同一個segment時,DP的被援路徑
6.不參考link typr
Port Type
類型定義
1.Edge Port1.立即進入Forwarding的狀態(UP/Down不影響STP)
2.接末端設備的port,如同PortFast的功能。
3..當收到BPDU會喪失Edge Port的功能。
4.設定方式:
2.Non-Edge Port1.接SW設備的Port。
2.當收到T.C BPDU時,將CAM table Age Time由300sec改為Max Age Time
3.要參考link type的角色
Link Type
種類定義
1.P2P1.預設看全雙工或半雙工,若全雙工為P2P。
2.可用設定的方式更改。
3.可以直接Forwareding
2.Shared1.預設看全雙工或半雙工,若半雙工的介面為Shared
2.可用設定的方式更改。
3.在同一個Segment有多個SW / HUB 屬於shared
RSTP運作邏輯
1.Edge Port 是P2P Link:立即Forwarding。
2.Non-Edge Port,使用"Llink Type"的參數,但會先參考"Port Role。
(1).Root Port:不參與Link 只要"in sync"立即Forwarding。
(2).Alternative Port / Back Port:不參考Link-Type參數
(3).Designated Port::參考Link-Type參數
    -P2P:立即Forwarding
    -Shared:Proposal / Agreement。
RSTP欄位解說
欄位定義
0Topology Change ACK
通報已知道Topology Change的欄位
1Agreement
用來加速收斂的欄位
2Forwarding
介面的狀態
3Learning
介面的狀態
4-5Port Role
6Proposal
用來加速收斂的欄位
7Topology Change
通報Topology Change的欄位
Proposal & Agreement Process
Proposal / Agreement運作順序:
1.當建立連線時P0和P1會先進入Designated Port的角色及Discarding的狀態
2.Root Bridge P0送出BPDU(Proposal欄位=1)到SW A的P1(Proposal的行為)
3.SW A收到BPDU先Block P3(Disignate Port),以確保不會造成Loop
4.SW A再送出BPDU(Agreement欄位=1)給Root Bridge到P0(Agreement的行為)
5.1~2sec就可以收斂完成,P0及P1立即成為Forwarding的狀態。
補充:
(1)SW A的P2 及P4為Edge Port所以不會參與Proposal / Ageeement的行為。
(2)Root Port & Designated Port會短暫進入Discarding的狀態,但最終會Forwarding。
(3)當non-edge port由blocking/down 進入forwarding的狀態,才會運作Proposal/Agreement。
STP BPDU V.S RSTP BPDU
STP BPDUPVST BPDU
1.由Root Bridge的DP定期每2sec送出BPDU
2.在Non-Root Bridge的RP會收到再往下傳送
3.全部的BPDU由Root Bridge送出。
4.若設備有問題需要等待Max Age的時間,才會告知Root Bridge。
1.每一台SW都會送出BPDU,類似Keeplive的概念。
2.3次BPDU沒收到就會認為鄰居SW有問題,送出Topology Change的訊息。
3.大幅縮短Max Age的時間
STP Topology Change V.S RSTP Topology Change
STPRSTP
1.只要有狀態改變就會認為Topolpogy Change。
2.縮短CAM table Ageout的時間,由300sec改為Max Age。
3.Flush CAM Table(除了Edge Port)
1.在Non-Edge Port由Down進入Forwarding的狀態,才稱為Topology Change。
2.啟動T.C-While Timer(Hello*2)
3.在T.C-While 時間內,送出的BPDU均有"T.C Flage",通知鄰居。
4.Flush CAM Table(除了Edge Port)
Config RSTP
MSTP V.S RSTP
RSTP多個VLAN,各自獨立一個Spanning-tree
STP多個VLAN共用一個Spannig-tree
MSTP的重點
1.MST相容全部的Spanning-Tree Protocol
2.MST最高支援到16個Instance
MSTP運作的方式
1.建立MST Regions
2.由BPDU去判別邊界,若相同表示同一個Region,不同表示不同Region。
3.BPDU是一個Hash後的Summary資訊。
4.BASE跑RSTP,使用Proposal/Agreement的機制加速收斂
MSTP的要求
1.MST中,每一個Instance裡的設定都需要相同。
2.每一台SW都需要手動設定,沒有類似VTP的Protocol。
3.多個Instance的BPDU只在一個BPDU裡面傳送,不會像RSTP在每一個Instance都要傳送BPDU,減少BPDU的訊息。
MSTP Regions
MSTP Regions設定都要相同
1.MSTP NameMST名稱(32Bytes)
2.MSTP Revision NumberMST版本編號(2Bytes)
不會自動更新
3.VLAN Association TableVLAN對應Instance的Table
MSTP Instance (MSTI)
1.MSTI 0:Internal Spanning-Tree Instance(IST)
(1)一定會存在,自動產生。
(2)透過IST與其他跑Spanning-Tree Protocol的SW溝通。
(3)預設所有VLAN使用IST。
(4)MST的BPDU在IST上面傳送,用hash過的BPD溝通。
Confing MST
1.設定成為MST模式
2.設定MST的參數 
3.設定Root

MSTP設定範例:

 

config)# spanning-tree mode mst           #切換到MSTP
config)#spanning-tree max-hops 255       #定義MSTP範圍
config)#spanning-tree mst 1 priority 4096   定義instance 1 的priority (競選Root Bridge)
config)#spanning-tree mst 2 priority 8192
config)#spanning-tree mst configuration       #進入mst設定模式
config-mst)#name BUILDING5       #定義MST名稱
config-mst)#revision 1                        #設定revision的編號(所有的sw都需要相同)
config-mst)#instance 1 vlan 51, 54         #把vlan 51 54 99 綁到instance 1裡面
config-mst)#instance 2 vlan 52-53          #把vlan 52 53綁到instance 2裡面
Show的觀察
1.Show spanning-tree mst X 
2.Show spann mst X detail
3.Show spanning-tree mst
4.Show spann mst config
Link Aggregation(EtherChannel)
1.Frame Distribuation(分流的方式):
(1)Round-Robin(cisco不採用)
(2)X-OR的方式:運算by IP、MAC、TCP/UDP Port…等,建議使用Source & Des IP來運算。
2.Management of EtherChannel:
(1)手動設定:ON(不使用協商,強迫啟動)
(2)協商啟動:
-PAaP(Port Aggregation Protocol):
(1)Cisco專屬協定
(2)PAgP 封包每30sec傳送一次
(3)Dest MAC為0010:0CCC:CCCC(Multicast MAC)
(4)Ether Type:0X0104
(5)PAgP Mode:
    -Auto:被動協商(default值)
    -Besirable:主動協商
(6)最多8條Link
-LACP(Link Aggregation Control Protocol):
(1)IEEE 802.3ad標準
(2)LACP Mode:
    -Active:主動協商
    -Passive:被動協商,僅回應協商
(3)LACP Parameters:
    -System ID:System Priority+MAC Addr.
    -Port Priority:當超過8條Active Link時,以Port Priority決定誰是Standby
    -Administrative Key:PHY Interface上面的設定都需要相同
(4)最多8條Active Link+2條Redundant Link
3.Logical Port Interface:
(1)L2 EtherChannel
(2)L3 EtherChannel
補充:
(1)沒有規定要連續的介面,可以跨設備做。
(2)建議使用range的方式設定。
(3)Port-Channel起來後只要是介面的相關設定,都要在Port-Channel上變更。
(4)EtherChannel無法使用在與IDS的介接上。
(5)EtherChannel啟動後,任何介面的調整都需要在邏輯介面上修改。
Config L2/L3 EtherChannel
Layer 2 EtherChannel
L2設定建議事項1.使用Interface Range挑選實體介面。
2.Shutdown介面
3.設定L2 Switchport的相關參數
4.使用Channel-Group X mode X,產生Interface Port-Channel
5.No Shutdown
6.後續Switchport設定修改,請於Port-channel上修改。
Layer 3 EtherChannel
L3設定建議事項1.產生Interface Port-channel X的介面
2.使用Interface Range挑選實體介面。
3.Shutdown介面。
4.設定為挑選的介面為L3介面。
5.使用Channel-group X 宣告為Etherchannel NO.,讓Channel-group X與Port-channel X關聯在一起
6.No Shutdown
7.後續的Switchport設定修改,請於Port-channel上修改。
Show的觀察
1.Show run int port-channel X

2.Show int fa X/X etherchannel
3.Show etherchannel summary
4.Show ether protocol
5.Show ether load-blance
6.show run
*檢查設定是否一致

EtherChannel Load Balancing
設定方式/查看的方法
文章來源轉貼:http://nkongkimo.wordpress.com/category/ccnp-bcmsn-module-03/

沒有留言:

張貼留言