spanning-tree protocol

802.1D STP
sun
Enhancements to STP
--------------------
PortFast
PVST+  (Per VLAN Spanning Tree+)
RSTP   (Rapid Spanning tree protocal)
MSTP   (Multiple spanning tree protocol)
PVRST  (Per vlan rapid spanning tree)
 
BPDU--桥接协议数据单元
configration BPDU
TCN(拓扑变更通告)BPDU

byte  Field
----------------------
2 Protocol ID
1 Version
1 Message type
1 Flags
8 Root ID
4 Cost of path
8 Bridge ID
2 Port Id
2 Message Age
2 Max age
2 Hellotime
2 Forward Delay
 
cisco pvst
它与标准生成树(802.1D)的最大区别在于pvst是基于vlan的
Bridge ID Field
--------802.1D 8byte----------
|Bridge priority|MAC address|
2byte+6byte
------------PVST-------------
|bridgePriority | ExtendSystemID | MAC add|
4bit+12bit+48bits
Bridge priority最大65535 cisco=23768
优先级比小 小为树根
pvst=BridgePriority+VlanID
BP以4096递增
例:
vlan1=32769
vlan2=32770
span vlan 1 priority 61440
每台交换机取mac地址表中最小的一个
show mac-address-table
个交换机之间mac同样比小
 
802.1D Port Roles
---------
指定接口(DP):根网桥上的所有端口+up的没有指向root的处于up的端口
根端口(rp):非根网桥指向根的端口
非指定端口(ndp):相对rp的另外的个端口

根端口的选择:ToRootCost--SenderBridgeID--SenderPortID
802.1D Port status
-------
disable:interface shutdown
Blocking(20s):阻塞,不转发
Listenting(15s):监听,不转发,学习BPDU
Learning(15s):学习,不转发,构建MAC地址表
Forwarding:转发
由listenting到Forwarding=30s
如果20s受不到BLK则进入listenting
例:
///////////////////////////////////
mac access-list extended stp
deny any any
exit
int f0/23
mac access-group stp in
//////////////////////////////////
Path cost
--------------------------
LinkSpeed       cost
10Gbps  2
1Gbps  4
100mbps  19
10mbps  100
(config-if)#bandwidth 10000(k)
Port ID
--------
端口优先级别+端口编号(发送方)
优先级:0-240 默认128
(config-if)#span vlan 1 prot-priority
以16递增
debug spanning-tree events
PortFast:当下面连接的是pc时开启,可以不不用等待实现快  速转发
(config-if)#spanning-tree portfast
---当下面连接的不是pc是会引起临时性的桥接环路
---而且端口要为非trunk端口

本文出自 “非常安全” 博客,转载请与作者联系!

你可能感兴趣的:(职场,休闲,STP)