《路由交换第十七章STP.ppt》由会员分享,可在线阅读,更多相关《路由交换第十七章STP.ppt(26页珍藏版)》请在金锄头文库上搜索。
1、1 2006, Shenzhen Polytechnic. All rights reserved.生成树生成树协议协议Spanning Tree Protocol2 2 2 2006, Shewzhen Polytechnic. All rights reserved.教学目标(教学目标( Objectives )1. IP地址概念(地址概念( Concept of IP Address )2. IP地址分类地址分类 (Class of IP Address)3. 保留和私有地址(保留和私有地址( Reserved and Private IP Address)4. 网络掩码和子网划分(网络
2、掩码和子网划分(Network Mask and Subnetting ) 5. 可变长度子网掩码(可变长度子网掩码( VLSM )6. 汇总和汇总和CIDR( Summarization and CIDR)3 3 3 2006, Shewzhen Polytechnic. All rights reserved.ObjectivesRedundant topologiesSpanning Tree Protocol4 4 4 2006, Shewzhen Polytechnic. All rights reserved.冗余(冗余(Redundancy)冗余网络拓扑确保网络持续工作,避免单点
3、故障冗余网络拓扑确保网络持续工作,避免单点故障Redundant networking topologies are designed to ensure that networks continue to function in the presence of single points of failure. 5 5 5 2006, Shewzhen Polytechnic. All rights reserved.冗余拓扑(冗余拓扑(Redundant Topologies)6 6 6 2006, Shewzhen Polytechnic. All rights reserved.冗余拓
4、扑(冗余拓扑(Redundant Topologies)1.冗余拓扑的目标是为了避免网络出现单点故障冗余拓扑的目标是为了避免网络出现单点故障A goal of redundant topologies is to eliminate network outages caused by a single point of failure. 2.所有的网络需要冗余来提高可靠性所有的网络需要冗余来提高可靠性All networks need redundancy for enhanced reliability.7 7 7 2006, Shewzhen Polytechnic. All rights
5、 reserved.简单的冗余交换拓扑简单的冗余交换拓扑(Simple Redundant Switched Topology)8 8 8 2006, Shewzhen Polytechnic. All rights reserved.简单的冗余交换拓扑简单的冗余交换拓扑(Simple Redundant Switched Topology)1.冗余拓扑消除了单点故障冗余拓扑消除了单点故障Redundant topologies eliminate single points of failure. 2. 交换机对不知道地址的帧进行泛洪交换机对不知道地址的帧进行泛洪Switches will
6、flood frames for unknown destinations. 3.交换机对广播和组播也进行泛洪。交换机对广播和组播也进行泛洪。 Broadcasts and multicasts are also flooded. 4.冗余交换拓扑或许会带来广播风暴、多帧拷贝以及冗余交换拓扑或许会带来广播风暴、多帧拷贝以及MAC地址表不稳地址表不稳定的问题定的问题A redundant switched topology may cause broadcast storms, multiple frame copies, and MAC address table instability pr
7、oblems.9 9 9 2006, Shewzhen Polytechnic. All rights reserved.广播风暴(广播风暴(Broadcast Storm)101010 2006, Shewzhen Polytechnic. All rights reserved.多帧传输(多帧传输(Multiple Frame Transmissions)在冗余交换网络中,对终端设备来讲,收到多帧相同数据是可能的。在冗余交换网络中,对终端设备来讲,收到多帧相同数据是可能的。In a redundant switched network it is possible for an end d
8、evice to receive multiple frames. 111111 2006, Shewzhen Polytechnic. All rights reserved.MAC地址表不稳定(地址表不稳定(MAC Database Instability)交换机从错误的接口学到交换机从错误的接口学到MAC地址。地址。A switch can learn that a MAC address is on a port when it is not.121212 2006, Shewzhen Polytechnic. All rights reserved.创建逻辑无环路拓扑创建逻辑无环路拓
9、扑(Creating a logical loop free topology)1.冗余增加了可靠性,但是同时将物理环路带进网络。冗余增加了可靠性,但是同时将物理环路带进网络。Reliability is increased by redundancy. redundancy connections introduce physical loops into the network. 2. 解决办法就是创建逻辑无环路拓扑,同时保留物理环存在解决办法就是创建逻辑无环路拓扑,同时保留物理环存在The solution is to allow physical loops, but create a
10、 loop free logical topology. 3.无环路拓扑称为树,并且是可扩展的树。无环路拓扑称为树,并且是可扩展的树。The loop free logical topology created is called a tree. It is a spanning tree because all devices in the network are reachable or spanned. 4.创建无环路拓扑的算法称为生成树算法。创建无环路拓扑的算法称为生成树算法。The algorithm used to create this loop free logical top
11、ology is the spanning-tree algorithm. 131313 2006, Shewzhen Polytechnic. All rights reserved.STP术语(术语(STP Terms)1. 桥桥ID (Bridge ID)2. 开销(开销(Cost)3. 桥协议数据单元(桥协议数据单元(BPDU)141414 2006, Shewzhen Polytechnic. All rights reserved.桥桥ID (Bridge ID)1.BID用来识别每一个交换机用来识别每一个交换机/网桥。网桥。2.BID用来确定网络的中心,在用来确定网络的中心,在S
12、TP中称为根桥。中称为根桥。3.优先级默认为优先级默认为32768The BID consists of a bridge priority that defaults to 32768151515 2006, Shewzhen Polytechnic. All rights reserved.开销(开销(Cost)最短路径是最短路径是cost累加,而累加,而cost是基于链路的速率的。是基于链路的速率的。Shortest path is based on cumulative link costs. Link costs are based on the speed of the link.
13、 161616 2006, Shewzhen Polytechnic. All rights reserved.桥协议数据单元(桥协议数据单元(BPDU)1.交换机发送的创建逻辑无环路的数据包称为交换机发送的创建逻辑无环路的数据包称为BPDUThe message that a switch sends, allowing the formation of a loop free logical topology, is called a Bridge Protocol Data Unit (BPDU). 2.BPDU在阻塞的接口上也可以接收,这确保如果链路在阻塞的接口上也可以接收,这确保如果
14、链路或设备出现问题,新的生成树会被计算或设备出现问题,新的生成树会被计算 BPDUs continue to be received on blocked ports. This ensures that if an active path or device fails, a new spanning tree can be calculated. 3.默认,默认,BPDU 2秒发送一次秒发送一次By default BPDUs are sent every two seconds.171717 2006, Shewzhen Polytechnic. All rights reserved.
15、Spanning-Tree Protocol181818 2006, Shewzhen Polytechnic. All rights reserved.生成树操作(生成树操作(Spanning-Tree Operation)191919 2006, Shewzhen Polytechnic. All rights reserved.Spanning-Tree Operation(cont.)1.选举根桥,选举根桥,BID最小即是最小即是Select a single switch that will act as the root of the spanning tree 2.计算自己到根桥
16、距离计算自己到根桥距离Calculate the shortest path from itself to the root switch 3.选择根端口,距离根桥最近的接口选择根端口,距离根桥最近的接口Choose one of its ports as its root port, for each non-root switch. This is the interface that gives the best path to the root switch. 4.选指定端口和非指定端口,非指定端口被阻塞。选指定端口和非指定端口,非指定端口被阻塞。Select ports that a
17、re part of the spanning tree, the designated ports. Non-designated ports are blocked. 202020 2006, Shewzhen Polytechnic. All rights reserved.生成树操作规则(生成树操作规则(Spanning-Tree Operation Rules)1.每个网络只有一个根桥每个网络只有一个根桥One root bridge per network. 2.每个非根桥只有一个根端口每个非根桥只有一个根端口One root port per nonroot bridge.3.每
18、个段只有一个指定端口每个段只有一个指定端口One designated port per segment.4.非指定端口不被使用非指定端口不被使用Nondesignated ports are unused.212121 2006, Shewzhen Polytechnic. All rights reserved.STP实例(实例(STP Example)222222 2006, Shewzhen Polytechnic. All rights reserved.生成树端口状态(生成树端口状态(Spanning-Tree Port States)232323 2006, Shewzhen P
19、olytechnic. All rights reserved.生成树端口状态(生成树端口状态(Spanning-Tree Port States)1.在阻塞状态,端口仅能接收在阻塞状态,端口仅能接收BPDU,需要需要20秒改变这种秒改变这种状态状态In the blocking state, ports can only receive BPDUs. It may take up to 20 seconds to change from this state. 2.在侦听状态,交换机确定是否有到根桥的其它路径。在侦听状态,交换机确定是否有到根桥的其它路径。该状态持续该状态持续15秒。在该状态
20、,用户的数据不能转发,也秒。在该状态,用户的数据不能转发,也不能学习不能学习MAC地址。地址。In listening state, switches determine if there are any other paths to the root bridge. the forward delay and lasts for 15 seconds. In the listening state, user data is not being forwarded and MAC addresses are not being learned. 242424 2006, Shewzhen P
21、olytechnic. All rights reserved.生成树端口状态(生成树端口状态(Spanning-Tree Port States)3.在学习状态,用户的数据不能转发,但是可以学习在学习状态,用户的数据不能转发,但是可以学习MAC地址,该状态持续地址,该状态持续15秒。秒。In learning state user data is not forwarded, but MAC addresses are learned from any traffic that is seen. The learning state lasts for 15 seconds and is a
22、lso called the forward delay. 4.在转发状态,用户数据被转发,在转发状态,用户数据被转发,MAC地址继续学习,地址继续学习,BPDU仍然工作。仍然工作。In forwarding state user data is forwarded and MAC addresses continue to be learned. BPDUs are still processed. 252525 2006, Shewzhen Polytechnic. All rights reserved.Case StudyRefer to the exhibit. All switch
23、es have the default STP configuration and all links are Fast Ethernet. Which port on which switch will Spanning Tree place in blockingmode?262626 2006, Shewzhen Polytechnic. All rights reserved.思考题(思考题(Questions)1.环路的存在,会导致环路的存在,会导致 、 和和 问题。问题。2.交换机的交换机的ID由由 和和 组成。组成。3.选举根桥时,具有较选举根桥时,具有较 值的桥值的桥ID的交换机会成为根桥。的交换机会成为根桥。4.100M链路的新链路的新STP Cost为为 。5.STP收敛后收敛后 口和口和 口是处于转发状态的。口是处于转发状态的。6.决定指定口时,会按顺序考虑决定指定口时,会按顺序考虑 、 、 和和 因素。因素。7.缺省时,转发延时为缺省时,转发延时为 秒,秒,Hello时间为时间为 秒,秒,BPDU的存活时间为的存活时间为 秒。秒。8.STP中,交换机的端口有中,交换机的端口有 、 、 和和 状态。状态。