网络设计生成树协议

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

如何确定根桥(4)
I’m the Root Switch
Root Switch =0001
Switch A BID =0001
Root Switch = 0001
Switch B BID =0050
Switch C BID =1045
Switch D BID =0030 11
I’m the Root Switch
Cost to Root =15
DP
Cost to Root =3 DP Switch C BID =1045
Cost to Root =11
Cost to Root =22
Cost to Root =21 Switch D BID =0030
19
Root Switch = 0001 Lowest Cost to Root = 21
BPDU交换过程
I’m the Root Switch Lowest Cost to Root = 0
Root Switch is 0001 Lowest Cost to Root = 7
Switch A BID =0001
Root Switch is 0001 Lowest Cost to Root = 3
Cost to Root =18 Switch B BID =0050 Cost to Root =7
Cost to Root =3 Switch C BID =1045
Cost to Root =11
8
如何确定根桥(2)
I’m the Root Switch
I’m the Root Switch
Switch A BID =0001
I’m the Root Switch
Switch B BID =0050
Switch C BID =1045
Switch D BID =0030 9
I’m the Root Switch
22
确定网桥端口角色
Root Switch is 0001 Lowest Cost to Root = 7
Cost to Root =18 Switch B BID =0050
Cost to Root =15
Cost to Root =7
23
确定阻断端口
I’m the Root Switch Lowest Cost to Root = 0
4
STP协议简介
常用概念
根桥(Root Bridge)—桥ID最小的网桥。其中桥ID是由网桥的优先级 和网桥的MAC组成。
根端口(Root Port)—这个端口到达根桥的路径是该端口所在网桥到 达根桥的最佳路径。全网中只有根桥是没有根端口的。
指定端口(Designated Port)—每一个网段选择到根桥最近的网桥作 为指定网桥,该网桥到这一网段的端口为指定端口。
Root Switch is 0001 Lowest Cost to Root = 18
Switch A BID =0001
Root Switch is 0001 Lowest Cost to Root = 3
Cost to Root =18 Switch B BID =0050
Cost to Root =3 Switch C BID =1045
如何确定根桥(6)
I’m the Root Switch
Root Switch =0001
Switch A BID =0001
Root Switch = 0001
Switch B BID =0050
Switch C BID =1045
Switch D BID =0030 13
Root Switch = 0001
Root Switch is 0001Leabharlann BaiduLowest Cost to Root = 7
Switch A BID =0001
DP
DP
Root Switch is 0001 Lowest Cost to Root = 3
Cost to Root =18
Switch B BID =0050 Cost to Root =7
Switch B BID =0050
1 Gig Path Cost = 4
Switch C BID =1045
1 Gig Path Cost = 4
100M Path Cost = 18
Switch D BID =0030
16
BPDU交换过程
I’m the Root Switch
I’m the Root Switch
越小越优。 RID/Path Cost/DBID相同,比较指定端口的ID (Designated Port
ID),越小越优。
BPDU
哪边更优?
15
BPDU
BPDU交换过程
Switch A BID =0001
100M Path cost = 18
2 Gig Aggregated Path cost = 3
Payload
DMA:目的MAC地址 目的地址是一个固定的桥的组播地 址(0x0180c2000000)
SMA:源MAC地址 即发送该配置消息的桥MAC地址
L/T:帧长 LLC Header:固定的链路头 Payload:BPDU数据
值域
占用字节
协议ID
2
协议版本
1
BPDU类型
Switch A BID =0001
I’m the Root Switch
Switch B BID =0050
Switch C BID =1045
Switch D BID =0030 17
I’m the Root Switch
BPDU交换过程
I’m the Root Switch Lowest Cost to Root = 0
根端口:网桥各个端口中到根桥最近的端口。 指定端口:网桥的端口发送的BPDU配置消息较接收的BPDU配置
消息更优,则端口为指定端口。 (BPDU配置消息更优,表明该端 口距离根更近,即网段通过该端口距离根更近,所以选为指定端 口) 可选端口:网桥的端口发送的BPDU配置消息较接收的BPDU配置 消息更差,则端口为可选端口。
份状态。 4. 检测拓扑结构的变化并根据情况计算新的生成树。
3
STP协议简介
STP协议的结果是什么?
阻断了冗余链路,形成了以根桥为树根的树状拓扑结构。
Switch A BID =0001
DP
AP
Switch B BID =0050
DP
DP
DP Switch C BID =1045
Switch D BID =0030
2
STP协议简介
STP都做了些什么??? 1. STP在二层交换网络中选择一个根桥作为全部二层交换网络
的逻辑中心(Root Bridge)。 2. STP为全网中每一个参与STP运算的交换机计算到达根桥的
最短距离(Path Cost)。 3. 检测二层交换网络中存在的冗余链路,并把他们置于阻断/备
BPDU报文的目标MAC地址为:01-80-C2-00-00-00. BPDU报文在直连的两个网桥或多个网桥内交换,不能被转发。
没有运行STP协议的网桥将把BPDU报文当作普通业务报文转 发。
Switch B
Switch C
6
BPDU报文结构(2)
DMA SMA L/T LLC Header
可选端口(Alternated Port)—既不是指定端口,也不是根端口的端
口。
Switch A
BID =0001
DP
DP
Switch B BID =0050
DP
DP Switch C BID =1045
Switch D BID =0030
5
BPDU报文结构(1)
STP通过BPDU(Bridge Protocol Data Unit)报文来学习网络拓 扑结构。
1
标志位
1
根桥ID
8
根路径开销
4
指定桥ID
8
指定端口ID
2
Message Age
2
Max Age
2
Hello Time
2
Forward Delay
2
7
如何确定根桥(1)
根桥—BID(网桥ID)最小的网桥定为根桥。 BID—网桥的优先级+网桥MAC。 网桥的优先级为可配置,缺省值为32768。 在缺省情况下,根桥将由MAC地址最小的网桥担任。
Switch A BID =0001
Root Switch is 0001 Lowest Cost to Root = 3
Cost to Root =18 Switch B BID =0050 Cost to Root =7
Cost to Root =15
Cost to Root =3 Switch C BID =1045
如何确定根桥(5)
I’m the Root Switch
Root Switch =0001
Switch A BID =0001
Root Switch = 0001
Switch B BID =0050
Switch C BID =1045
Switch D BID =0030 12
I’m the Root Switch
生成树协议
STP(802.1D)协议原理 RSTP(802.1W)协议原理 MSTP(802.1S)协议原理 STP的相关配置 STP的保护措施
1
STP协议原理
STP协议简介 BPDU报文结构 如何确定根桥 如何计算STP Path Cost 如何确定端口角色 端口的状态迁移及定时器 MAC地址学习的生存周期 STP的不足
Switch D BID =0030 18
I’m the Root Switch Lowest Cost to Root = 0
BPDU交换过程
I’m the Root Switch Lowest Cost to Root = 0
Root Switch is 0001 Lowest Cost to Root = 7
Cost to Root =11
Cost to Root =21 Switch D BID =0030
20
Root Switch = 0001 Lowest Cost to Root = 11
BPDU交换过程
I’m the Root Switch Lowest Cost to Root = 0
Root Switch is 0001 Lowest Cost to Root = 7
如何计算STP Path Cost
Path Cost的两种定义标准
Speed
10Mbps
100Mbps
1000Mbps
Link type
Half Duplex Full Duplex Aggregated link Half Duplex Full Duplex Aggregated Link Full Duplex Aggregated Link
Cost to Root =22
Cost to Root =29
Cost to Root =11
Cost to Root =21 Switch D BID =0030
21
Root Switch = 0001 Lowest Cost to Root = 11
确定网桥端口角色
BPDU报文中总是携带网桥到根桥的最优值。 通过BPDU配置消息来决定端口的角色:
802.1D cost
100 95 90 19 18 15 4 3
802.1t cost
2,000,000 1,999,999 1,000,000 200,000 199,999 100,000 20,000 10,000
14
如何决定BPDU配置消息的优劣
比较RID(Root Bridge ID),确定网络同步。 RID相同,比较Path Cost(到根桥距离),越小越优。 RID/Path Cost相同,比较指定桥的BID (Designated Bridge ID),
如何确定根桥(3)
I’m the Root Switch
I’m the Root Switch
Switch A BID =0001
I’m the Root Switch
Switch B BID =0050
Switch C BID =1045
Switch D BID =0030 10
I’m the Root Switch
Switch A BID =0001
Root Switch is 0001 Lowest Cost to Root = 3
Cost to Root =18 Switch B BID =0050 Cost to Root =7
Cost to Root =3 Switch C BID =1045
Cost to Root =22
相关文档
最新文档