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)相关推荐

  1. 【HCIE-RS 天梯路】STP RSTP MSTP

    生成树协议 STP(Spanning Tree Protocol)用于二层破环 不使用生成树协议可能会导致:       1. 广播风暴 2. MAC地址漂移 三层口没有STP 生成树协议模式:(实例 ...

  2. STP/RSTP/MSTP的概念及特点

    STP/RSTP/MSTP的概念及特点 一.STP 1 基本概念 STP(Spanning Tree Protocol)即IEEE 802.1D,其作用主要有三个,第一是eliminate logic ...

  3. STP/RSTP/MSTP协议简介

    STP/RSTP/MSTP协议简介 STP 一.STP协议 二.为什么要有STP协议? BPDU 一.什么是BPDU? 二.BPDU的功能 三.BPDU的类型 端口 一.端口角色 二.端口状态描述 三 ...

  4. STP/RSTP/MSTP 精华详解

    STP/RSTP/MSTP 精华详解: STP 概述 : 因为二层设备的互联,并因为交换机的转发原理,会导致物理环路的产生.这时就会使用到STP协议 STP:在有环的拓扑里面形成一个无环的逻辑拓扑(从 ...

  5. 简洁版本 STP/RSTP/MSTP的区别以及各自的特点

    参考:https://blog.csdn.net/cisco_eigrp/article/details/47134357 生成树相关的几个概念STP/RSTP/MSTP STP:IEEE Std 8 ...

  6. STP/RSTP/MSTP帧格式、报文格式及字段说明

    STP(Spanning Tree Protocol,生成树协议)是一种二层(数据链路层)管理协议,它通过有选择性地阻塞网络冗余链路来达到消除网络二层环路的目的,同时具备链路的备份功能.最初被广泛应用 ...

  7. STP/RSTP/MSTP经典分析与对比

    当前和STP相关的协议有:IEEE 802.1D(STP),802.1W(RSTP),802.1(MSTP).其中802.1D是最早关于STP的标准.RSTP(Rapid Spanning Tree ...

  8. HCIE 面试资料-STP/RSTP/MSTP

    STP STP介绍 STP(Spanning Tree Protocol)生成树协议 有三个版本,协议版本标识符,STP为0,RSTP为2,MSTP为3. STP的作用是进行逻辑阻断,通过堵塞端口来消 ...

  9. 华为数通笔记--STP/RSTP/MSTP

    STP 背景:一种二层技术,在局域网中,为了提高设备可靠性,会增加冗余链路,但是也会造成环路的问题,STP技术就是经过协议计算阻塞某个端口,来打破环路. 基本概念: 根桥:STP网络的逻辑中心,通过H ...

最新文章

  1. zcmu2014(公式推导+二分)
  2. boost::mpl::always相关用法的测试程序
  3. js中select下拉框重置_如何利用CSS3制作炫酷的下拉框
  4. 视频编辑,4k播放,3D游戏, 阿里云图形工作站,了解一下?
  5. Linux中断处理:上半部和下半部
  6. js中的浅拷贝深拷贝深入理解
  7. node.js 学习
  8. Facebook是如何大幅提升TLS连接效率的?
  9. OFD在线预览方案评测
  10. css中怎么改变图片尺寸,CSS也可以改变图片幅面尺寸
  11. 基于射频技术的门禁管理系统
  12. 深度|人脸图像的技术原理及在电商业务中的应用
  13. oracle创建编号函数,oracle函数初次尝试
  14. iPhone和Android的WEB应用开发详解
  15. 设计一个动物声音模拟器,希望模拟器可以模拟许多动物的叫声
  16. matlab平衡小车数学模型PID,自平衡小车控制系统设计.doc
  17. 敏感词加解密与隐位处理
  18. Keil编译时报“extended constant initialiser used”警告
  19. MD4加密java算法
  20. 怎么使用云服务器创建一个网页

热门文章

  1. Hibernate中hbm.xml文件的inverse、cascade、fetch、outer-join、lazy
  2. oracle sql语句中有关null使用的一点理解
  3. centos web服务器---sysctl.conf调优参数
  4. ASP.NET案例--新闻模块设计
  5. 大型云原生项目在数字化企业落地过程解密 1
  6. NioEventLoopGroup 源码分析
  7. 【安全牛学习笔记】手动漏洞挖掘(二)
  8. Weblogic ./startWebLogic.sh Error 解决
  9. LNK快捷方式漏洞利用方式 exp制作教程
  10. Android学习系列(11)--App列表之拖拽ListView(下)