-交换和生成树协议.ppt

上传人:本田雅阁 文档编号:2569825 上传时间:2019-04-10 格式:PPT 页数:46 大小:622.51KB
返回 下载 相关 举报
-交换和生成树协议.ppt_第1页
第1页 / 共46页
-交换和生成树协议.ppt_第2页
第2页 / 共46页
-交换和生成树协议.ppt_第3页
第3页 / 共46页
亲,该文档总共46页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《-交换和生成树协议.ppt》由会员分享,可在线阅读,更多相关《-交换和生成树协议.ppt(46页珍藏版)》请在三一文库上搜索。

1、交换和生成树协议 Switching and STP,熊金波 福建师范大学软件学院,问题的提出 (Bring forward some problems),I want to send a frame to host Y.,服务器/主机Y,问题1:交换的方式有哪些?交换由什么实现?交换机的功能有哪些?,问题2:为了提高网络性能,可以采取冗余拓扑结构,其主要优点是什么?但却给网路带来物理环路,环路能导致哪些问题?如何解决?,教学目标( Objectives ),5.1 第2层交换 (The Layer 2 Switching) 5.2 生成树协议 (Spanning Tree Protocol

2、),5.1 第2层交换 (The Layer 2 Switching),5.1.1 交换基础 (Basic of Switching) 5.1.2 第2层交换的优越性和局限性 (The advantage and disadvantage of the layer 2 switching) 5.1.3 两种交换方法 (Two Switching Methods) 5.1.4 交换机三种交换功能 (Three Switch Functions),5.1.1 交换基础 (Basic of Switching),1 第2层交换是在LAN上使用设备硬件地址对网络进行分段的过程 The layer 2

3、switching is a process which use MAC address to subnet in LAN. 2 交换技术能将大的冲突域分隔为小的冲突域 Switching technology can separate the major conflict domain into small separate conflict domain. 3 生成树协议可以防止在第2层交换式网络中产生环路 Spanning-Tree Protocol can prevent loop in The layer 2 switching network. 4 交换机实现第2层交换 Switc

4、hes implement the layer 2 switching.,5.1.2 第2层交换的优越性 (The advantage of the layer 2 switching),基于硬件的桥接 (Application Specific Integrated Circuits, ASIC) 线速 (Wire speed) 低延迟 (Low-latency) 低成本 (Low-cost),5.1.2 第2层交换的局限性 (The disadvantage of the layer 2 switching),1 默认不能分隔广播域 (cannot separate broadcast d

5、omain) 2 广播、组播、以及生成树协议的慢收敛,降低了网络性能,因此,第2层交换机不能完全取代路由器 (broadcast、multicast and STP s slow convergence, reducing the network performance, so, switches can not completely replace the routers),5.1.3 两种交换方法 (Two Switching Methods),5.1.3 存储转发特征 (Store-and-forward Feature),1. 在转发之前整个帧被接收 The entire frame

6、is received before any forwarding takes place. 2. 由于交换开始之前要接收完整个帧,较大的数据帧延迟会较大 Latency is greater with larger frames because the entire frame must be received before the switching process begins.,5.1.3 直通特征 (Cut-through Feature),1. 在接收完整帧之前,帧就被转发。 The frame is forwarded through the switch before the

7、entire frame is received. 2. 最快的是只要读到目的地址就转发。 At a minimum the frame destination address must be read before the frame can be forwarded. 3. 这种模式降低了延迟,但是不进行检错 This mode decreases the latency of the transmission, but also reduces error detection.,直通转发的类型: 一、快速转发(Fast-forward ) 二、无碎片方式 (Fragment-free )

8、,地址学习(Address learning) 决定转发或过滤帧(Forward/Filter frame decision) 避免环路(Loop avoidance),5.1.4 交换机的三种交换功能 (Three Switch Functions),5.1.4 交换机学习主机地址 (Switch Learn Host Address),初始MAC地址表是空的 Initial MAC address table is empty,5.1.4 交换机学习主机地址 (Switch Learn Host Address),A向C发送帧(Station A sends a frame to Stat

9、ion C) 交换机将A的MAC地址和其对应的接口E0放入MAC地址表 Switch caches station A MAC address to port E0 by learning the source address of data frames 该帧向除了E0接口的所有接口泛洪 The frame from station A to station C is flooded out to all ports except port E0,5.1.4 交换机学习主机地址 (Switch Learn Host Address),D向C发送帧(Station D sends a fram

10、e to station C) 交换机将D的MAC地址和其对应的接口E3放入MAC地址表 Switch caches station D MAC address to port E3 by learning the source Address of data frames 该帧向除了E3接口的所有接口泛洪 The frame from station D to station C is flooded out to all ports except port E3 (unknown unicast are flooded),5.1.4 交换机过滤帧 ( Switches Filter Fra

11、mes),A向C发送帧 Station A sends a frame to station C 目的地址已知,帧不被泛洪 Destination is known, frame is not flooded,E0: 0260.8c01.1111,E2: 0260.8c01.2222,E1: 0260.8c01.3333,E3: 0260.8c01.4444,0260.8c01.1111,0260.8c01.2222,0260.8c01.3333,0260.8c01.4444,E0,E1,E2,E3,X,X,D,C,A,B,MAC address table,5.1.4 交换机避免环路 (Lo

12、op avoidance),1 交换机之间的冗余链路是一件好事,万一某个链路出现故障,冗余链路可以用来防止整个网络失效。 Redundant link between switches is a good thing, once a link failure, redundant links can be used to prevent the failure of the entire network. 2 虽然冗余链路有用,但是它同时带来非常严重的问题,数据帧可以同时被广播到所有冗余链路上,导致网络环路。 Although redundant link is useful ,but it

13、also bring some serious problems, data frames can be simultaneously broadcast to all redundant links, the result is network loop. 3 生成树协议可以避免网络环路。 Spanning Tree Protocol can be avoided loop network.,主机D发送广播帧或多点帧 Station D sends a broadcast frame or Multicast frame 广播帧或多点帧泛洪到除源端口外的所有端口 A broadcast fr

14、ame or Multicast frame is flooded out to all ports except port E3,5.1.4 广播帧和多点传送帧 (broadcast frame and Multicast frame),5.1.4 网络冗余拓扑 (Network Redundant Topology),冗余拓扑消除了由于单点故障所引致的网络不通问题 A goal of redundant topologies is to eliminate network outages caused by a single point of failure. 冗余拓扑却带来了广播风暴、重

15、复帧和MAC地址表不稳定等问题 But redundant topology has brought the broadcast storms, multiple frame copies and MAC address table instability problems.,所有的网络需要冗余来提高可靠性 All networks need redundancy for enhanced reliability.,主机 X 发送一广播信息 Station X sends a broadcast messages,5.1.4 (1) 广播风暴 (Broadcast Storm),5.1.4 (

16、1) 广播风暴 (Broadcast Storm),主机 X 发送一广播信息 Station X sends a broadcast messages,交换机不停地发出广播信息 Switches constantly broadcast messages,5.1.4 (1) 广播风暴 (Broadcast Storm),5.1.4 (2) 重复帧 (Repeat Frame),主机X发关一单点帧给路由器Y Station X sends a unicast frame to router Y. 路由器Y的MAC地址还没有被交换机A和B学习到 The MAC address of router

17、Y has not been learned by switch A and B. so the unknown unicast frame to Router Y will be flooded.,交换机 A,交换机 B,网段 1,网段 2,服务器/主机 X,路由器 Y,主机X发关一单点帧给路由器Y Station X sends a unicast frame to router Y. 路由器Y的MAC地址还没有被交换机A和B学习到 The MAC address of router Y has not been learned by switch A and B. 路由器Y会收到同一帧的

18、两个拷贝 Routers Y will receive two copies of the same frame,5.1.4 (2) 重复帧 (Repeat Frame),主机X发送一单点帧给路由器Y 路由器Y的MAC地址还没有被交换机A和B学习到 交换机A和B都学习到主机X的MAC地址对应端口0,5.1.4 (3) MAC地址表不稳定 (MAC address table instability),主机X发送一单点帧给路由器Y 路由器Y的MAC地址还没有被交换机A和B学习到 交换机A和B都学习到主机X的MAC地址对应端口0 到路由器Y的数据帧在交换机A和B上会泛洪处理 交换机A和B都错误学习

19、到主机X的MAC地址对应端口 1,5.1.4 (3) MAC地址表不稳定 (MAC address table instability),更复杂的拓扑结构可能导致多重回路 More complex topology may lead to multiple loop. 在第2层没有能够防止这种回路的机制 Layer 2 has no mechanism to stop loops.,5.1.4 (4) 多重回路问题 (Multiple loop Problem),5.1.4 回路的解决办法: 生成树协议 (Spanning-Tree Protocol),将某些端口置于阻塞状态就能防止冗余结构的

20、网络拓扑中产生回路 A looped topology is often desired to provide redundancy, but looped traffic is undesirable. The Spanning Tree Protocol was originally designed for bridges. Today, it is also applied to LAN switches and routers operating as a bridge. STP ensures all bridged segments are reachable but any p

21、oints where loops occur will be blocked.,5.2 生成树协议 (Spanning Tree Protocol),5.2.1 创建逻辑无环路拓扑 (Creating a logical loop free topology) 5.2.2 STP术语 (STP Terms) 5.2.3 Spanning-Tree Protocol 5.2.4 生成树操作 (Spanning-Tree Operation) 5.2.5 生成树端口状态 (Spanning-Tree Port States),5.2.1 创建逻辑无环路拓扑 (Creating a logical

22、 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 loop free logical topology. 3. 无环路拓扑称为树,并且是可扩展的树 The loop free l

23、ogical 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 topology is the spanning-tree algorithm.,5.2.2 STP术语 (STP Terms),桥ID (Bridge ID) 开销 (Cost) 桥协议数据单元

24、 (BPDU),5.2.2 桥ID (Bridge ID, BID),1. BID用来识别每一个交换机/网桥。 2. BID用来确定网络的中心,在STP中称为根桥。 3. 优先级默认为32768 The BID consists of a bridge priority that defaults to 32768,5.2.2 开销 (Cost),最短路径是cost累加,而cost是基于链路的速率的。 Shortest path is based on cumulative link costs. Link costs are based on the speed of the link.,5

25、.2.2 桥协议数据单元 (BPDU),1. 交换机发送的创建逻辑无环路的数据信息称为BPDU The message that a switch sends, allowing the formation of a loop free logical topology, is called a Bridge Protocol Data Unit (BPDU). 2. BPDU在阻塞的接口上也可以接收,这确保如果链路或设备出现问题,新的生成树会被计算 BPDUs continue to be received on blocked ports. This ensures that if an

26、active path or device fails, a new spanning tree can be calculated. 3. 默认情况下,BPDU 每2秒发送一次 By default BPDUs are sent every two seconds.,5.2.3 Spanning-Tree Protocol,5.2.4 生成树操作 (Spanning-Tree Operation),5.2.4 Spanning-Tree Operation,1. 选举根桥,BID最小即是 Select a single switch that will act as the root of

27、the spanning tree. 2. 计算自己到根桥距离 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 are part o

28、f the spanning tree, the designated ports. Non-designated ports are blocked.,BPDU = Bridge protocol data unit (缺省地每2秒发送BPDU数据) 根桥 = 有最低桥识别码的桥 桥识别码 = 桥优先级 + 桥MAC地址 例中, 哪个交换机的桥识别码最低?,5.2.4 Root Bridge的选择 (Select the Root Bridge),请指出: 根桥 指定端口、非指定端口和根端口? 各端口分别是转发还是阻塞状态?,5.2.4 端口的选择 (Select the Port),根端口

29、:具有最低根路径的接口 指定端口要考虑的因素: 1 最低的根桥ID 2 最低的根路径代价 3 最低发送者桥ID 4 最低发送者端口ID,5.2.4 端口的选择 (Select the Port),5.2.4 生成树操作规则 (Spanning-Tree Operation Rules),1. 每个网络只有一个根桥 One root bridge per network. 2. 每个非根桥只有一个根端口 One root port per nonroot bridge. 3. 每个段只有一个指定端口 One designated port per segment. 4. 非指定端口不被使用 No

30、ndesignated ports are unused.,5.2.5 生成树端口状态 (Spanning-Tree Port States),5.2.5 生成树端口状态 (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秒。在该状态,用户的数据不能

31、转发,也不能学习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.,5.2.5 生成树端口状态 (Spanning-Tree Port States),3.在学习状态,用户的数据不

32、能转发,但是可以学习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 also called the forward delay. 4.在转发状态,用户数据被转发,MAC地址继续学习,BPDU仍然工作 In forwarding state user data is forwarded and MAC addr

33、esses continue to be learned. BPDUs are still processed.,Case Study,Refer to the exhibit. All switches have the default STP configuration and all links are Fast Ethernet. Which port on which switch will Spanning Tree place in blockingmode?,6 总结 (Summarize),1 交换的基本概念 2 交换的方式 3 交换机的交换功能 4 冗余拓扑导致网络环路问题

34、 5 生成树协议解决环路问题 6 STP工作原理和操作 7 STP的端口状态,7 思考题 (Questions),1. 交换机三种主要的功能是什么? 2. 交换机怎样学习主机地址? 3. 什么是存储转发? 4. 什么是快速转发? 5. 什么是无碎片方式转发? 6. 环路的存在,会导致 、 和 问题。 7. 交换机的ID由 和 组成。 8. 选举根桥时,具有较 值的桥ID的交换机会成为根桥。 9. 100M链路的新STP Cost为 。 10. STP收敛后 口和 口是处于转发状态的。 11. 决定指定端口时,会按顺序考虑 、 、 和 因素。 12. 缺省时,转发延时为 秒,Hello时间为 秒,BPDU的存活时间为 秒。 13. STP中,交换机的端口有 、 、 和 状态。,

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 其他


经营许可证编号:宁ICP备18001539号-1