Portfast,Uplinkfast與Backbonefast詳解

概述:
    backbonefast是用於增強生成樹的,因爲傳統的生成樹協議,如果要由block狀態轉換到forwarding狀態需要50s。這對於一個大型網絡來說,時間太長了。所以,cisco發明了三個對生成樹增強的協議。就是portfast,uplinkfast,backbonefast。protfast是對於接入端口來說的,也就是使用了portfast的端口直接就進入傳輸狀態,而不需要經過中間的其他狀態。uplinkfast一般是用在接入層的。也就是說當有兩條上行鏈路連向上層的時候,傳統的生成樹會把其中一條置爲block狀態,如果一條鏈路實效了,另一條也要經過50秒才能變爲傳輸狀態,而使用uplinkfast不需要經過block狀態。
: L* Y0 j4 x% i3 v1 q* cCCNAbackbonefast和uplinkfast的作用是一樣的,只不過用於不同的情況。而且backbonefast是要配置在所有的交換機上。backbonefast是可以快速診斷非直連鏈路的故障,並且使生成樹快速收斂。對backbonefast工作方式舉個例子:假設有A,B,C三個交換機。B與A相連,C也與A相連,C與B也相連,也就是說三臺交換機兩兩相連。A是根橋,所以B和C相連的兩個端口要有一個端口是block狀態的。他們之間是不通的(你可以用紙畫一下,不然很抽象)。這個時候A和B之間的鏈路down掉了。那麼B就和根橋失去了聯繫,所以B就開始發出BPDU,宣佈自己是根橋。這個BPDU只能是發到C(因爲和A的鏈路down掉了)。C接收到這個BPDU,發現和自己之前的根橋不同,C就會發出一個“root link query”的查詢,查詢以前的根橋是否還是有效的。A收到了這個查詢包就會回覆給C一個應答,說自己仍然有效。C收到這個應答後,就會通知B根橋仍然還在,並且打開B和C相連的兩個端口中的那個block狀態的端口。B就開始從C到達根橋了。整個過程也省略了由block狀態到listen狀態的20秒時間。
Portfast:
$ x7 M3 A8 A/ Q4 s- ]) o  . |7 A  X7 S+ s3 v( S  P. n* `, P8 T+ _
Portfast是用在access layer中的交換機上的而且用在有阻斷端口的交換機上,當RP失效,馬上啓動阻斷端口保持通信。這樣收斂時間很快,不用從新進行STP運算,直接從blocking跳到fowarding。CCNA9 F. s$ V  @; U- x) }; a3 m
 ) N; U! O5 ?. p" C3 e
缺省情況下,假定交換機的所有端口都將與交換機或者網橋連接,所以所有端口都運行STP算法,即如果網絡發生了變化,在端口發送數據之前要等待50s,而事實上許多端口會直接連接工作站或者服務器。所以我們採用PortFast可以讓這些端口節省Listening和Learning狀態的時間,立即進入Forwarding狀態。需要注意的是:PortFast僅僅讓端口在網絡環境變化的情況下直接進入Forwarding狀態。而端口仍然運行STP協議,所以如果檢測到環路,端口仍將由Forwarding狀態變成Blocking狀態。
; g# u2 }; i0 P& Q Portfast快速端口是一個Catalyst的一個特性,能使交換機或中繼端口跳過偵聽學習狀態而進入STP轉發狀態,在基於IOS交換機上,PortFast 只能用於連接到終端工作站的接入端口上。
( n5 t' H$ Y( w# n8 Z
  ~' @0 @6 E: t% S2 _4 jCCNA當一個設備連接到一個端口上時,端口通常進入偵聽狀態。當轉發延遲定時器超時後,進入學習狀態,當轉發延遲定時器第二次超時,端口進入到轉發或者阻塞狀態,當一個交換機或中繼端口啓用PortFast後,端口立即進入轉發狀態,但交換機檢測到鏈路,端口就進入轉發狀態(插電纜後的2s) 。如果端口檢測到一個環路同時又啓用了PortFast 功能。它就進入阻塞狀態。重要的是要注意到PortFast 值在端口初始化的時候才生效。如果端口由於某種原因又被迫進入阻塞狀態,隨後又需要回到轉發狀態,仍然要經過正常的偵聽 。
' y0 D) Q! M3 C, A5 o# D& u 
( Z# j% Y: A1 c6 H. h 啓用PortFast的主要原因是防止啓動週期小於30s的PC需要和交換機端口從未連接狀態進入到轉發狀態,一些網卡直到 MAC 層軟件驅動被實際加載之後纔會啓動鏈路。這種情況下就會導致一些故障,例如DHCP環境下,這可能會出現一些問題。
! ^9 ~( ~2 p0 g# i9 ]3 i5 s  * Z* H2 e; k! y
命令:在SW1的F0/1端口上啓用PortfastCCNA" O2 k, s2 S7 N
sw1(config)#int f 0/1bbs.spoto.net4 J7 K7 J9 v7 Z2 l  ], w8 h; T
       sw1(config)#no shut
2 C4 q1 F$ s3 SCCNA       sw1(config-if)#spanning-tree portfast9 |4 ^) q2 G: O
     CCNA7 F- A0 h/ D6 ^; _% r; ?+ i
Uplinkfast:
3 v: K, L3 ^- |$ D  6 }9 m! k: j2 J+ [
背景資料:STP確保了在拓撲變化的情況下沒有環路產生,但收斂速度慢。一些實時以及對帶寬敏感的網絡應用是不能接受的。STP收斂速度慢的原因是收斂算法需要化時間確定一條可替代的鏈路,缺省時間是50s,即20s(Blocking→Listening)+15s(Listening→Learning)+15s(Learning→Forwarding)。解決的方法是一旦發現了線路down,馬上把Blocking的port切換到Forwarding,不要經過Listening和Learning階段。這就是UplinkFast,切換時間可以在2s~4s。UplinkFast被設計應用在接入層交換機。一般應用兩條上行鏈路連接到分佈層,一條是冗餘鏈路。
) G$ M/ e  C( x& g+ I- JUplinkFast激活一個快速重新配置的條件:
6 l- w: X+ H& H, GA.    在交換機上必須啓動了UplinkFast功能;
4 o7 O3 b( Z& F) S. G4 Q) b% g4 }. t B.    至少有一個處於Blocking的端口(即有冗餘鏈路);
& X( N. y+ _' @C.    鏈路失效必須發生在Root Port上。
3 X2 w9 I" q+ k" ]) Rbbs.spoto.net交換機啓動了UplinkFast後,由於提高了交換機上所有端口的路徑開銷,所以不適合作爲根橋。The spanning tree port cost and port-VLAN cost of all ports on the switch is increased by 3000.The spanning tree bridge priority for all VLANs is set to 49152. This makes it unlikely that the switch will become the root switch.
) b  \/ |: q; M; } 具體來說,一個上行鏈路組由根端口和除自環端口之外的一組阻斷端口組成,上行速鏈路使交換機上的一個阻斷端口幾乎立刻進行轉發。很重要的一點就是:上行鏈路只能配置在接入層交換機上,因爲從根端口到其非指定備份端口的快速轉發只能在生成樹拓撲結構的根端口上被確定性的完成。5 l9 `5 U: H9 t" [
命令:在SW1上啓用PortfastCCNA# C6 \& N- i0 T* S+ x3 ~
sw1(config)#spanning-tree uplinkfast
" n, ~  K% i9 v! Pbbs.spoto.netBackbonefast:
, X: o" O9 J7 Kbbs.spoto.net
  O' S0 _9 e3 z+ ~: o  W8 zbbs.spoto.netbackbonefast用在distribution layer中的交換機上。而且要求所有交換機都得啓動backbonefast。當一臺交換機的RP壞掉的時候,失去了和RB的連接,它向他的其他端口,包括阻塞端口(如果有的話)發送下級BPDU。收到下級BPDU的交換機有3種情況:1,如果收到下級BPDU的端口是阻塞端口,那麼阻塞端口和根端口都作爲候選端口(用來到達根橋用的);2,如果收到下級BPDU的端口是根端口,那麼阻塞端口被作爲候選端口,因爲只能通過它到達根橋了;3,如果收到下級BPDU的端口是根端口,並且這個交換機上沒有阻塞端口,那麼證明這臺交換機失去了到根橋的連接,需要從新進行STP運算。交換機中只要有一臺處於第三種狀態,就要從新進行STP運算。除此之外,只需花去max age delay的時間(就是最初的20s)就可以收斂完畢。
) u& {" ]2 x+ ACCNA
. C% V6 E7 {. S6 F4 m: F 642-811的英文原版書說:BackboneFast能使交換機在收到inferior BPDU後,根據接收該BPDU端口的狀態,來決定通向Root Bridge的alternate Path,並通過Blocking端口來發送Root Link Query,根據應答,判斷哪個端口爲Newly Current Root Bridge Port,並將其馬上進行狀態轉換,無需等待Max Age Timer計時器到時。CCNA6 z) O4 ~% H4 e
 / M' f% g5 H& B$ l* x& h
原文如下:
$ k8 n2 O: j) b* K# O, k8 Z& \2 }CCNA
8 }. k) L) L% C5 |4 l% ^, g --------------------------! g- c- Y/ L& R, ^4 A) p1 r& Q: s; V
原文開始
; }6 A& D% Y* L- ?0 G* ubbs.spoto.net--------------------------
2 o" x# I0 u* I BackboneFast: Redundant Backbone Paths
' ^) @( q! A$ B5 j* l' t' ~. TIn the network backbone, or core layer, a different method is used to shorten STP convergence. BackboneFast works by having a switch actively determine if alternate paths exist to the Root Bridge in the event that the switch detects an indirect link failure. Indirect link failures occur when a link not directly connected to a switch fails. A switch detects an indirect link failure when it receives inferior BPDUs ** its Designated Bridge on either its Root Port or a Blocked Port. (Inferior BPDUs are sent ** a Designated Bridge that has lost its connection to the Root Bridge, making it announce itself as the new Root.)
, ?, S9 V* x/ G3 u, r8 K Normally, a switch must wait for the Max Age timer to expire before responding to the inferior BPDUs. However, BackboneFast begins to determine if other alternate paths to the Root Bridge exist according to the type of port that received the inferior BPDU. If the inferior BPDU arrives on a port in the Blocking state, the switch considers the Root Port and all other blocked ports to be alternate paths to the Root Bridge. If the inferior BPDU arrives on the Root Port itself, the switch considers all blocked ports to be alternate paths to the Root Bridge. If the inferior BPDU arrives on the Root Port and no ports are blocked, however, the switch assumes it has lost connectivity with the Root Bridge. In this case, the switch assumes that it has become the Root Bridge and, BackboneFast allows it to do so before the Max Age timer expires.
+ l! L: a* s- x2 n; v) uDetecting alternate paths to the Root Bridge also involves an interactive process with other bridges. If the local switch has blocked ports, BackboneFast begins to use the Root Link Query (RLQ) protocol to see if upstream switches have stable connections to the Root Bridge. RLQ Requests are sent out. If a switch receives an RLQ Request and is either the Root Bridge or has lost connection to the Root, it sends an RLQ Reply. Otherwise, the RLQ Request is propagated on to other switches until an RLQ Reply can be generated. On the local switch, if an RLQ Reply is received on its current Root Port, the path to the Root Bridge is intact and stable. If it is received on a non-Root Port, an alternate Root Path must be chosen. The Max Age Timer is immediately expired so that a new Root Port can be found.CCNA4 u% c- x# e- \8 F
BackboneFast is simple to configure and operates by short-circuiting the Max Age Timer when needed. Although this function shortens the time a switch waits to detect a Root Path failure, ports still must go through full-length Forward Delay Timer intervals during the Listening and Learning states. Where PortFast and UplinkFast enable immediate transitions, BackboneFast can only reduce the maximum convergence delay ** 50 to 30 seconds.
' B- _( l6 F* ZCCNATo configure BackboneFast, use the following global configuration command:
' J  L9 m3 o$ f$ ^5 O* m: i: `bbs.spoto.netSwitch(config)# spanning-tree backbonefastCCNA! M$ x# ~& I& _. D" A1 I
When used, BackboneFast should be enabled on all switches in the network because BackboneFast requires the use of the RLQ Request and Reply mechanism to inform switches of Root Path stability. The RLQ protocol is active only when BackboneFast is enabled on a switch. By default, BackboneFast is disabled.
, G. X4 l- d+ J! }, t( o --------------------------CCNA9 _/ ]& y$ l/ G) p- D3 _  \5 C0 c
原文結束
/ h. K+ K4 Y6 J+ _/ w6 K. ~3 ]1 U9 L --------------------------
1 e" i7 ?  K9 L, |# _$ O 命令:在SW1上啓用Backbonefast
9 Y( C  S! }8 p2 w: Dbbs.spoto.net       SW1(config)# spanning-tree backbonefast
 
BackboneFast使用環境:主要在網絡骨幹上用來偵測間接的連接失敗優化方法:當RP停止接收Hello時,不需要等待Maxage時間,而是交換機直接查詢相連的鄰居交換機(使用RLQ (根查詢)請求BPDU、RLQ (根查詢)應答BPDU)。
      這個BPDU一直會傳遞到根網橋,之後根會發送應答BPDU。如果收到應答BPDU的端口是根端口,說明本交換機沒有失去與根的聯繫,如果收到BPDU的端口是非根端口說明去往根的路徑不完整,必須選擇新的根路徑Maxage時間立即過期,這樣就能發現新的根端口。
      我們分析發現BackboneFast只能省去端口Maxage時間(20秒),而兩個轉發延遲時間是不能省去的,所以我們的網絡只能將延遲從50秒減少到30秒。與PortFast,UplinkFast立即轉發還有一定的差距。配置命令:全局啓用spanning-tree backbonefast
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章