STP RSTP MSTP PVST+学习 (1)
BPDU? bridge protocol data units 802.1d? STP??? 802.1w? RSTP? 802.1s?? MSTP STP? spanning-tree protocol RSTP rapid spanning-tree protocol MSTP multilayer spanning-tree protocol SSTP single spanning-tree protcol RSTP 是STP擴展,其主要特點增加了端口狀態的快速切換機制,能夠實現網絡拓樸的快速轉換。 Root Bridge?根網橋? Root port? 根端口 Designated port?指定端口? Pathcost 路徑成本 目的MAC是多播地址 01-80-C2-00-00-00 SPA spanning-tree algorithm 生成樹算法 bridge priority???網橋優先級???hello time??hello時間???forward delay???轉發延時??max age?生存時間 path cost??路徑成本?? port priority??端口優先級???? disabled????關閉??? blocking??? 鎖定 listening??????偵聽????????????? learing?????????學習?????? forwarding??? 轉發 字節 字段 描述
2 協議ID 此處總為0
1 版本 STP的版本。802.1為0
1 消息類型 BPDU的類型(配置BPDU=ox00 TCN=ox80)
1 標志 TC/TCA
8 根ID 根網橋的網橋ID
4 路徑開銷 到達根網橋的STP開銷
8 網橋ID 轉發根網橋BPDU的網橋的ID
2 端口 轉發根網橋BPDU的網橋的端口ID
2 消息壽命 從根橋發出BPDU之后的秒數,每經過一網橋就減一。即為跳數
2 最大壽命 網橋交根橋看作不可用前保留根橋ID的最大時間
2 hello 時間 根橋連續發出BPDU的間隔
2 轉發延遲 網橋監聽與學習狀態所停留的時間。 算法就是為解決特定問題的一個公式或一組步驟。算法依賴與一套規則,有明確的開始和結束。 網橋ID?(BID)是 生成樹算法所使用的第一個參數。STP使用BID來決定橋接網絡的中心,稱為根網橋或根交換機。 2個字節網橋優先級。0-65535 。默認32768。0X8000 MAC地址。 24個bit的廠商ID。24個分配的。 BID中的MAC地址是交換機的一個MAC地址。每個交換機都有一個MAC地址池,每個STP實例使用一個作為VLAN生成樹實例的BID。 (s,t) (u,v) s<u s=u,且t<v 時 (s,t)<(u,v) 路徑開銷是生成樹算法所使用的第2個參數,用來決定到根交換機的路徑。 路徑開銷是用來衡量網橋之間的距離有多么近的。路徑開銷是兩個網橋之間某條路徑上所有鏈路開銷的總和。 交換機是用路徑開銷來決定到根交換機的最佳路徑。最短鏈路組合具有最小累計路徑開銷,并為到根交換機的最佳路徑。 網絡上所有交換機必須使用同樣的標準。 端口ID是生成樹算法使用的第3個參數,用來決定根交換機的路徑。 IOS 8bit? 8bit??? COS? 6bit? 10bit s<u s=u , t<v (s,t)<(u,v) 端口優先級是一個可以配置的STP參數,在IOS上交換機其值的范圍為0-255.。標準128 端口號是catalyst 交換機用來列舉端口的數字標志。IOS 為256個端口。 ? 當一個BPDU到達交換機端口時,交換機會使用上面4個參數來判斷該BPDU是否比該端口已經存儲的BPDU更好。如果新收到的BPDU(或本地生成的BPDU)更好,則替換原有的值。 當一個網橋第一被激活時,其上的所有端口每隔2秒(默認hello 時間)發送一次BPDU。 如果一個端口發現從其他網橋收到的BPDU比自己的更好,則本地端口就停止發送BPDU。如果有20秒(MAX AGE)的時間沒有從鄰居收到這個更好的BPDU,本地端口就重新開始發送BPDU。最大生存時間是最佳BPDU超時的時間。 選舉一個根交換機 選舉一個根端口 選舉指定端口 在一個穩定狀態的網絡中,BPDU從根網橋流出,沿著這些無環支路到達網絡中每一個網段。 root war 網橋戰爭 選舉根交換機 一個網橋的根端口就是按照路徑開銷最靠近根交換機的端口。每一個非根交換機都必須選舉一個根端口。網橋跟蹤根路徑開銷,它是到根交換機所經鏈路的開銷之和。 當一個端口收到BPDU時該開銷會增加,而它們發送時并不增加 ? 橋接網絡中的每個網段都必須有一個指定端口。一個網段的指定端口是連接在該網段上的一個橋接端口,它通過該網段即向根交換機發送流量也從根交換機接收流量。這一方法的背后的思路就是假如每條鏈路只有一個端口來處理流量,所有的環路就會被打破。一個網段的指定網橋就是包含該網段的指定端口的網橋。 ? 根網橋 根端口 指定交換機 指定端口 ? 接入端口在指定端口選舉中不扮演角色。中繼端口是用來連接其他交換機的。接入端口是用來連接到主機或路由器的。 STP 都是在中繼端口上交互的。 BackboneFast blocking start 阻塞狀態 bridge ID 網橋ID CST common spanning tree 公共生成樹 Edge port? 邊緣端口 EtherChannel 以太信道 forward delay 轉發延時 forwarding state 轉發狀態 link aggregation control protcol 鏈路匯聚控制協議 MST mono spanning tree 單生成樹 multiple instance of spanning tree protocol? MISTP 多實例生成樹協議 per-vlan spanning-tree PVST 每VLAN生成樹 prot aggreation protocol PagP 端口聚合協議 port number 端口號 port priority 端口優先級 uplinkfast portfast 禁用狀態是管理性的關閉STP狀態。它不是正常STP端口過程的一部分。 阻塞狀態 丟棄從所連接的網段上收到的數據幀和通過交換而來內部轉發的幀。 接收BPDU并直接傳遞給系統模塊 沒有地址數據庫 不傳遞從系統模塊收到的BPDU 接收并相應網絡管理消息,單并不傳遞他們 偵聽狀態 如果一個網橋在它啟動或者一定時間內沒有收到BPDU后就立即認為自己是根交換機,端口進入偵聽狀態。 丟棄所有連接網段收到的幀或其他端×××換來的幀 沒有地址數據庫 接收BPDU并直接傳遞給系統模塊 處理從系統模塊模塊收到的BPDU 接收并響應網絡管理消息 選舉根交換機,根端口和指定端口發生在偵聽狀態期間。在指定端口選舉中失敗的端口成為一個非指定端口,并回到阻塞狀態。剩下的指定端口或根端口在15秒后進入學習狀態 學習狀態 丟棄所連接網段上收到的幀 丟棄從其他端×××換來需要轉發的幀 將位置狀態包含進自己的地址數據庫里 接收BPDU并直接傳遞給系統模塊 接收,處理并傳遞從系統模塊收到的BPDU。 接收并響應網絡管理消息 學習狀態開始創建橋接表。收集諸如數據源幀VLAN等信息的一種STP狀態。 轉發狀態 轉發狀態是一種在端口上即接收又發送數據流量的STP狀態 轉發從所鏈接網段上收到的幀 轉發從其他端×××換來需要轉發的幀 將位置狀態信息包含到自己的地址數據庫 接收BPDU,并將其直接傳遞給系統模塊 處理從系統模塊來的BPDU 接收并響應網絡管理消息 STP Overview STP is a layer 2 link management protocol that provides path redundancy while preventing loops in the network. STP 是在數據鏈路層提供冗余并預防環路的管理協議 For? Layer 2 Ethernet network to function proerly , only one active path can exist between any two stations. STP協議使兩個站點間只有一條活躍的鏈路 Multiple active paths among end stations cause loops in the network. 如果在站點間存在多個活躍的鏈路 If a loop exists in the network,end stations might receive duplicate messages. 將可能導致站點接收到多個幀的副本 Switches might also learn end-staion MAC address on multiple Layer 2 interface. 交換機在多個接口上學習到相同終端的MAC地址 These conditions result in an unstable network. 這些情況使網絡變的不穩定 Spanning-tree operation is transparent to end stations,which cannot detect whether they are connected to a single LAN segment or a switched LAN of multiple segments. 不論你是鏈接在一個LAN 分段上還是連接在多個分段上終端都是無法察覺的。因為STP是對終端透明的。 The STP uses a spanning-tree algorithm to select one switch of a redundantly connected network as the?root of the spanning tree. STP通過算法計算出根。 The alogorithm calculates the best loop-free path through a switched Layer 2 network by assigning a role to each port based on the role of the prot in the acitve topology: 并且拓樸中每個端口都會處在下面的某種狀態 Root?? A forwarding port elected for the spanning-tree topology 根????? 選舉出的轉發端口 Designated?? A forwarding port elected for every switched LAN segement 指定???? 每個分段選舉出的轉發端口 Alternate? A blocked port providing an alternate path to root bridge in the spanning tree 預備???????? 處在監聽狀態的端口 Backup A blocked port in a loopback configuration 備份????????? 鎖定的端口 enable state??????????????????????????????????????????????????? ????? ?enable on VLAN1 spanning-tree mode?????????????????????????????????????????? ?? PVST+? (rapid PVST+? and MSTP are desabled) switch priority?????????????????????????????????????????????????????32768 spanning-tree port priority??(configurable on a per-interface basis)?????? 128 spanning-tree port cost (configurable on a per-interface basis)????????????? 1000mb/s? 4 100mb/s???19 10 mb/s??? 100 spanning-tree VLAN port priority (configurable on a per-vlan basis)??? 128 spanning-tree VLAN port cost(confgiurable on a per-vlan basis)???????????1000mb/s 4 100mb/s? 19 10mb/s??? 100 spanning-tree timers??????????????????????????????????????????????????? hello time??? 2 seconds ??????????????????????????????????????????????????????????????????????????????????? forward-delay time?? 15 seconds ??????????????????????????????????????????????????????????????????????????????????? maximum-aging time?? 20 seconds ????????????????????????????????????????????????????????????????????????????????????transmit hold count 6 BPDUS Bridge ID,? switch priority and extended system id The IEEE 802.1D standard requires that each switch has an unique birdge identifier (bridge ID). IEEE 802.1D 需要每個交換機都有唯一的橋ID controls the selection of the root swtich. 來進行根網橋的選舉 Because each VLAN is considered as a different logical bridege with PVST+ and rapid PVST+,the same switch must have a different bridge IDs for each configured VLAN. 因為 PVST+ 和 快速 PVST+ 每VLAN生成樹。就需要交換機針對每個VLAN 有不同的BID。 Each VLAN on the switch has a unique 8-byte bridge ID . 每個VLAN 都需要有唯一的8byte的橋ID The 2 most-significant byte are used for the switch priority , and the remaining 6 byte are derived from the switch MACaddress. 2 個字節來表示優先級。6格字節為交換機的MAC地址 The switch support the IEEE802.1t spanning-tree extensions, and some of the bits previously used for the switch priority are now used as the vlan identifier. 交換機支持 IEEE 802.1t ,把原來表示交換機優先級的bit用來表示vlan 號。 The result is that fewer MAC addresses are reserved for the switch.and a larger range of VLAN IDs can be supportd. all while maintaining the uniqueness of the bridge ID . 交換機優先級字段變成4bit。另外12bit來表示vlan ID。相加形成唯一的橋ID。 the 2 bytes previously used for the switch priority are reallocated into a 4-bit priority value and a 12-bit extended system ID value equal to the vlan ID. 4bit 的交換機優先級+12 bit 擴展系統ID, 12bit 擴展系統ID等于VLAN ID spanning-tree users the extended system ID, the switch priority, and the allocated spanning-tree MAC address to make the bridge ID unique for each VLAN. 生成樹使用擴展系統ID。利用優先級 vlan號 MAC 地址生成唯一的橋ID。 support for the extended system ID affects how you manually configure the root switch, the secondary root switch, and the switch priority of a VLAN. 通過擴展系統ID 你可以手動配置VLAN 的根交換機,第二根和交換機優先級。
轉載于:https://blog.51cto.com/3layer/38778
總結
以上是生活随笔為你收集整理的STP RSTP MSTP PVST+学习 (1)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: AndroidIPC通信之AIDL
- 下一篇: P4016 负载平衡问题