STP笔记

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端口
RSTP(802.1W)来自于cisco
PortFast:PC--接入层
UplinkFast:会聚层--核心层
BlackboonFast:根--根端口
发送劣质BPDU

RSTP Port States
-----------------
Discarding:
Learning:
Forwarding:

RSTP Port Roles(端口 类型)
---------------
根端口(Root Ports):非根网桥指向根的端口
指定接口(Designated Ports):根网桥上的所有端口?不指向根的处于up的端口
替代接口(Alternative Port):与指定接口不在同一个交换机上
备份接口(Backup Port):与指定接口在同一个交换机上

Edge Port = PortFast
Nonedge Port
Link Type---Shared(半双工)/P2P(全双工)

RSTP BPDU
|7|6|5|4|3|2|1|0|
7:Topolog chanage
6:Proposal(提议)
5/4:Port Role
3:Learning
2:Forwarding
1:Agreement(同意)
0:Topolpgy Change ACK
Prot Role
00:Unknown
01:Alternative/Backup
10:Root
11:Designated
Proposal and Agreement
---------------------------------------
(config)#spanning-tree mode rapid-pvst
---------------------------------------
PVST--PVST+--
默认PVST+,在VLAN1上运行802.1D
每个Vlan上一个生成树的优势在于可以实现生成树的负载均衡
(config)#spaning-tree vlan 1 root primary
优先级在原优先级上默认降2个级别
(config)#spaning-tree vlan 1 root secondary 
优先级在原优先级上默认降1个级别
(config)#spaning-tree vlan 1 priority [ID]

----------------------------------------------
802.1S=MSTP(多生成树)
作用:简化pvst
(config)#spanning-tree mode MST
(config)#spanning-tree mode configuration
(config-mst)#name cisco
(config-mst)#revision 1
(config-mst)#instance 1 vlan 5,15
(config-mst)#instance 2 vlan 10,20
(config)#spaning-tree mst 1 root primary
 

----------------------------------------------------
etherchannel      最多八条相同链路
PAgP(cisco私有)   LACP(802.3ad)
(config)#int range f0/10 - 12 channel-group 1 mode on
etherchannel mode
on  不用协议,强制
desirable PAgP 主动
auto  PAgP 被动
active  LACP 主动
parsive  LACP 被动

(config)#show int trunk
(config)#show etherchannel 1
(config)#show etherchannel sum
(config)#show etherchannel load balance
no swithport
当接口出现error-disable状态时应先shutdown protchannel然后shutdown 出现error-disable的端口 最后再no shut
3层的etherchannel 逻辑口上的配置不影响物理口
 
 

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