当前位置:网站首页>1.3 Rapid Spanning Tree Protocol RSTP
1.3 Rapid Spanning Tree Protocol RSTP
2022-08-02 12:08:00 【& #36153;】
前面我们了解到,STPThe convergence rate is very slow.需要调节STP计时器参数.但是STPThe problem of slow default convergence time causes when the network topology changes,Too long waiting time seriously affects business efficiency.快速生成树协议(Rapid Spanning Tree Protocol,RSTP)The convergence time of the network is shortened,RSTPThe fastest convergence rate can be shortened to 1s之内,The connectivity of the network can be quickly restored when the topology changes.
RSTP在STP的基础上增加了2种端口角色:替代端口(Alternate)、备份端口(Backup),RSTP中共有4种端口角色:根端口、指定端口、替代端口、备份端口.
下图所示,交换机S1为根桥,对于交换机S3而言,There are two ports connected to the network, S3的G0/0/1到达根桥的RPCRoot path overhead is less,So this port is the root port of the device,其G0/0/2The port is due to receive the switchS2所发送的BPDU网桥协议数据单元,and through the switchS3After the calculation decides to block,becomes an alternate port for this port.
在交换机S3上执行 display stp brief 命令
[S3]display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 ROOT FORWARDING NONE
0 GigabitEthernet0/0/2 ALTE DISCARDING NONE
可以看到G0/0/2The port role of the interface is ALTE 即表示 Alternate(替代端口)
1、RSTP的端口状态:
STP定义了5种端口状态,而RSTPsimplifies port status in ,将STP的禁用、Blocking and listening states are simplified to discard(Discarding)状态、学习状态(Learning)、转发状态(Forwarding).
(1)Ports do not forward user traffic,也不学习MAC地址,Then the port is in the discard state.
(2)Ports do not forward user traffic,但是学习MAC地址,Then the port is the learning state.
(3)Ports are forwarding traffic,也学习MAC地址,Then the port is in forwarding state.
2、边缘端口:
运行了STP的交换机,Its port is after initial startup,会进入阻塞状态.If the port is elected as the root port or designated port,Then it needs to go through the listening and learning state,最终进入转发状态.It is necessary for the ports on the switch that are connected to the switched network to go through the above process,After all, the port is at risk of creating a loop.但是,当用户PCAfter connecting to the switch, you want to be able to connect to the network immediately,而不是等待STP的收敛.毕竟PCOr the risk of a server being connected to the switch causing a loop is very low.
在 RSTP中,The ports of the switch can be configured as edge ports(Edge Port),Edge ports do not participate in spanning tree calculations by default,When the edge port is activated,It can immediately switch to the forwarding state and start sending and receiving business traffic,Activation or deactivation of edge ports does not triggerRSTP拓扑变更.实际项目中,Ports connecting end devices are usually configured as edge ports. 下面进行实验;将交换机SW2connected to threePC的端口配置为边缘端口.
[SW2]interface ethernet 0/0/1
[SW2-Ethernet0/0/1]stp edged-port enable
[SW2]interface ethernet 0/0/2
[SW2-Ethernet0/0/2]stp edged-port enable
[SW2]interface ethernet 0/0/3
[SW2-Ethernet0/0/3]stp edged-port enable
3、BPDU保护:
Edge ports may be misconnected to switching devices,Once the switching device is connected to the edge port,A loop hazard will be introduced.When the edge port is connected to a switching device,并且收到了BPDU,The port immediately becomes a normal spanning tree port,In the process is thrown in the networkRSTP重计算.在华为交换机上,可以通过激活BPDU保护(BPDU Protection)function to solve the above problem.When the switch activates this function,如果边缘端口收到BPDU,The switch will immediately shut down the port(即置为Error-Down),Also trigger a warning.Executed in the switch system view stp bpdu-protection Can be activated on all edge portsBPDU保护功能.
[SW2]stp bpdu-protection
查看交换机的RSTP状态
[SW2]display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 DESI FORWARDING BPDU
0 GigabitEthernet0/0/2 DESI FORWARDING BPDU
0 GigabitEthernet0/0/3 DESI FORWARDING BPDU
0 GigabitEthernet0/0/24 DESI FORWARDING NONE
可以看到G0/0/1、G0/0/2、G0/0/3All ports are configured as edge ports,These ports will be activatedBPDU保护功能(Protection 列显示为BPDU),而G0/0/24Not an edge port,不会激活BPDU保护功能.
We now put the switchSW2的G0/0/3The interface is connected to a switch,看看会发生什么变化.
查看RSTP的端口状态
<SW2>display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 DESI FORWARDING BPDU
0 GigabitEthernet0/0/2 DESI FORWARDING BPDU
0 GigabitEthernet0/0/24 DESI FORWARDING NONE
可以看到SW2并没有显示G0/0/3的端口状态,This is because of the switchSW2激活了BPDU保护功能后,如果边缘端口收到BPDU,The switch will immediately shut down the port.使用命令 display curr 命令显示当前配置.可以看到交换机SW2的G0/0/3为 shutdown 关闭状态.
interface GigabitEthernet0/0/1
stp edged-port enable
#
interface GigabitEthernet0/0/2
stp edged-port enable
#
interface GigabitEthernet0/0/3
shutdown
stp edged-port enable
If the edge port is due to receiveBPDU而关闭,By default, it will not be automatically restored,It can be executed manually in the interface view undo shutdown command to restore the port.
It can also be executed in system view [SW2]error-down auto-recover cause bpdu-protection interval 30 The command configures the port auto-recovery function.interval The time specified by the keyword(30~86400s)后自动恢复.
边栏推荐
- [kali-information collection] (1.9) Metasploit + search engine tool Shodan
- JVM简介
- AQS-AbstractQueuedSynchronizer
- ASP.NET Core 6框架揭秘实例演示[31]:路由&ldquo;高阶&rdquo;用法
- npm install报错npm ERR Could not resolve dependency npm ERR peer
- CAN总线的AUTOSAR网络管理
- Swiper系列之轮播图
- 力扣58-左旋转字符串
- [kali-information collection] (1.8) ARP reconnaissance tool _Netdiscover
- 干测试这些年,去过阿里也去过小公司,给年轻测试员们一个忠告...
猜你喜欢
【kali-信息收集】(1.9)Metasploit+搜索引擎工具Shodan
NVIDIA NeMo Metrics 轻量性能采集系统
DTG-SSOD:最新半监督检测框架,Dense Teacher(附论文下载)
unique in numpy & pandas
Lexicon 27 - Remove Elements - Simple Questions
网站自动翻译-网站批量自动翻译-网站免费翻译导出
Swift中什么时候不能用 () 代替 Void 来使用
力扣58-左旋转字符串
Create a devops CI/CD process using the kubesphere GUI
Technology sharing | Description of the electronic fence function in the integrated dispatching system
随机推荐
匹配滤波(四种滤波器的幅频特性)
Leek 151 - Reverse words in a string
Thymeleaf
手撸架构,MongDB 面试50问
故障分析 | 一条 SELECT 语句跑崩了 MySQL ,怎么回事?
JSP中include指令的功能简介说明
MD5详解(校验文件完整性)
免费的中英文翻译软件-自动批量中英文翻译软件推荐大全
CAN总线的AUTOSAR网络管理
Do you really understand the business process service BPass?
喜迎八一 《社会企业开展应聘文职人员培训规范》团体标准出版发行会暨橄榄枝大课堂上线发布会在北京举行
Idea 全局搜索(idea如何全局搜索关键字)
使用kubesphere图形界面创建一个devops的CI/CD流程
numpy&pands 中的unique
excel 批量翻译-excel 批量函数公司翻译大全免费
今日睡眠质量记录85分
Swiper系列之轮播图
力扣58-左旋转字符串
【MySQL系列】- LIKE查询 以%开头一定会让索引失效吗
Crack detection technology based on deep learning