stp基本内容有哪些(STP的基本内容)

导读:今天主要向大家介绍有关STP的内容,有需要的朋友可以收藏一下!

STP的基本要素

局域网中为了实现链路的冗余,通常在两台二层交换机上互联两条物理链路来实现。冗余的链路产生了物理环路,出现广播风暴、mac地址表不稳定等危害。

通过阻断冗余链路来消除桥接网络中可能存在的物理环路,计算出逻辑上的无环拓扑。

当前路径发生故障时,激活冗余备份链路,恢复网络连通性。

stp基本内容有哪些(STP的基本内容)(1)

stp基本内容有哪些(STP的基本内容)(2)

三要素选举:

从环形网络拓扑结构到树形结构,总体来说有三个要素:根桥、根端口和指定端口。

1、根桥 RB(Root Bridge)

根桥就是网桥 ID 最小的桥,通过交互配置 BPDU 协议报文选出最小的 BID。

2、根端口 RP(Root Port)

所谓根端口就是去往根桥路径开销最小的端口,根端口负责向根桥方向转发数据,这个端口的选择标准是依据根路径开销判定。在一台设备上所有使能 STP 的端口中,根路径开销最小者,就是根端口。

很显然,在一个运行 STP 协议的设备上根端口有且只有一个,根桥上没有根端口。

3、指定端口 DP(Designated Port)

与本机直接相连并且负责向本机转发配置消息的设备为指定桥,指定桥向本机转发配置消息的端口为指定端口。

stp基本内容有哪些(STP的基本内容)(3)

stp基本内容有哪些(STP的基本内容)(4)

STP的端口状态

stp基本内容有哪些(STP的基本内容)(5)

MSTP

MSTP 把一个交换网络划分成多个域,每个域内形成多棵生成树,生成树之间彼此独立。每棵生成树叫做一个多生成树实例 MSTI(Multiple Spanning Tree Instance),每个域叫做一个 MST域(MST Region:Multiple Spanning Tree Region)。

所谓实例就是多个 VLAN 的一个集合。通过将多个 Vlan 捆绑到一个实例,可以节省通信开销和资源占用率。MSTP 各个实例拓扑的计算相互独立,在这些实例上可以实现负载均衡。可以把多个相同拓扑结构的 VLAN 映射到一个实例里,这些 VLAN 在端口上的转发状态取决于端口在对应MSTP 实例的状态。

stp基本内容有哪些(STP的基本内容)(6)

实验

stp基本内容有哪些(STP的基本内容)(7)

STP:

组网说明:为网络中的三台设备配置STP协议,以保证网络中不存在环路问题。

组网图:

stp基本内容有哪些(STP的基本内容)(8)

stp基本内容有哪些(STP的基本内容)(9)

STP配置步骤

1、SWA:

Switch(config)#spanning-tree #全局模式下开启生成树协议

switch(config)#spanning-tree mode stp #开启STP的生成树

switch(config)#spanning-tree priority 4096#生成树的优先级为4096

2、SWB:

switch(config)#spanning-tree #全局模式下开启生成树协议

switch(config)#spanning-tree mode stp#开启STP的生成树

3、SWC:

switch(config)#spanning-tree#全局模式下开启生成树协议

switch(config)#spanning-tree mode stp #开启STP的生成树

switch(config)#spanning-tree priority 8192#生成树的优先级为8192

Switch(config)#interface ethernet 1/0/3 #进入端口三

Switch(Config-If-Ethernet0/0/3)#spanning-tree portfast bpdufilter #把该端口设置为边缘端口,不接收bpdu报文。

注意:在设置STP的优先级的时候,优先级的数值为4096的倍数。

stp基本内容有哪些(STP的基本内容)(10)

MSTP:

组网说明:网络中的4台交换机运行MSTP。其中SW A做为Vlan 10,20的根桥,SW B做为Vlan 30,40的根桥。

组网图:

stp基本内容有哪些(STP的基本内容)(11)

stp基本内容有哪些(STP的基本内容)(12)

MSTP的配置步骤

1、SWA的配置

switch(config)#spanning-tree

switch(config)#spanning-tree mst configurtaion#配置MSTP,并创建MSTP多实例

switch(config-Mstp-Region)#name test #mstp的名字

switch(config-Mstp-Region)#instance 0 vlan 10;20 #创建实例0,并且关联vlan 10;20

switch(config-Mstp-Region)#instance 1 vlan 30;40#创建实例1,并且关联vlan 30;40

switch(config-Mstp-Region)#exitswitch(config)#spanning-tree mst 0 priority 4096 # 设置实例0的优先级为4096

switch(config)#spanning-tree mst 1 priority 8192# 设置实例1的优先级为8192 #配置端口模式和透传的Vlan信息略

stp基本内容有哪些(STP的基本内容)(13)

2、SWB的配置

switch(config)#spanning-treeswitch(config)#spanning-tree mst configurtaion #配置MSTP,并创建MSTP多实例

switch(config-Mstp-Region)#name test#mstp的名字

switch(config-Mstp-Region)#instance 0 vlan 10;20#创建实例0,并且关联vlan 10;20

switch(config-Mstp-Region)#instance 1 vlan 30;40#创建实例1,并且关联vlan 30;40

switch(config-Mstp-Region)#exitswitch(config)#spanning-tree mst 0 priority 8192#设置实例0的优先级为8192

switch(config)#spanning-tree mst 1 priority 4096#设置实例1的优先级为4096 #配置端口模式和透传的Vlan信息

stp基本内容有哪些(STP的基本内容)(14)

3、SWC的配置

switch(config)#spanning-treeswitch(config)#spanning-tree mst configurtaion#配置MSTP,并创建MSTP多实例

switch(config-Mstp-Region)#name test#mstp的名字

switch(config-Mstp-Region)#instance 0 vlan 10;20#创建实例0,并且关联vlan 10;20

switch(config-Mstp-Region)#instance 1 vlan 30;40#创建实例1,并且关联vlan 30;40

switch(config-Mstp-Region)#exit #配置端口模式和透传的Vlan信息略

stp基本内容有哪些(STP的基本内容)(15)

4、SWD的配置

switch(config)#spanning-treeswitch(config)#spanning-tree mst configurtaion#配置MSTP,并创建MSTP多实例

switch(config-Mstp-Region)#name test#mstp的名字

switch(config-Mstp-Region)#instance 0 vlan 10;20#创建实例0,并且关联vlan 10;20

switch(config-Mstp-Region)#instance 1 vlan 30;40#创建实例1,并且关联vlan 30;40

switch(config-Mstp-Region)#exit #配置端口模式和透传的Vlan信息略

关注安徽思恒信息科技有限公司,了解更多技术内容……

,

免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com

    分享
    投诉
    首页