1 / 63

局域网技术

局域网技术. 冲突检测原理. 发送期间同时接收,并把接收到的数据与缓冲区的数据进行比较 若比较结果一致,说明没有冲突,重复 1 若比较结果不一致,说明发生冲突,立即停止发送,并发送一个 Jamming 信号. A. B. C. D. A. B. C. D. A. B. C. D. 最小帧长. R :网络数据速率 d :最大段长 V : 信号的传播速度 信号在铜线中的传播速度约为光速的 65%~77% ,光的传播速度约为 3.0x10 8 m/s 802.3 规定,最小帧长为 64 字节. 802.3 规范.

adonai
Télécharger la présentation

局域网技术

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 局域网技术

  2. 冲突检测原理 • 发送期间同时接收,并把接收到的数据与缓冲区的数据进行比较 • 若比较结果一致,说明没有冲突,重复1 • 若比较结果不一致,说明发生冲突,立即停止发送,并发送一个Jamming信号

  3. A B C D A B C D A B C D

  4. 最小帧长 • R:网络数据速率 • d :最大段长 • V : 信号的传播速度 • 信号在铜线中的传播速度约为光速的 65%~77%,光的传播速度约为3.0x108m/s • 802.3规定,最小帧长为64字节

  5. 802.3规范 • 802.3规定,最小帧长为64字节 • 802.3规定,最大帧长为1500字节

  6. 二进制指数回退算法

  7. CSMA/CD协议的实现 HHub E IHub IHub P P D B C A

  8. CSMA/CD协议的实现 • 最小帧间隔时间0.96us • 阻塞信号:8个十六进制数的序列55555555

  9. CSMA/CD性能分析 吞吐率 利用率 令:

  10. VLAN • VLAN(Virtual Local Area Network)是根据管理功能,组织机构或应用类型对交换局域网进行分段而形成的逻辑网络。 • VLAN实现的种类 • 静态分配VLAN • 动态分配VLAN

  11. VLAN的优点 • 控制流量 • 提高网络的安全性 • 灵活的网络管理

  12. 网桥体系结构 网桥协议结构 用户 用户 LLC LLC MAC MAC MAC PHY PHY PHY PHY

  13. 网桥互联多个LAN 1 2 3 网桥101 网桥102 网桥104 网桥103 6 7 4 5

  14. 帧转发 • 查找出X端口之外的其他转发数据库 • 如果没有发现,则丢弃 • 如果在Y端口发现目标,且Y端口没有阻塞,则从Y端口转发。否则丢弃

  15. 地址学习 • 静态路由 • 动态路由 • 检查端口接收到的数据帧,记录其中的原MAC地址,存入数据库, • 数据库的每一项,都配有一个定时器,如果超时则被自动删除。

  16. 地址学习 • 端口X检查流入该端口的帧, • 若帧的原MAC地址不在X的端口数据库中,则添加新记录。 • 若在数据库中,则更新定时器。 • 定时器超时,则删除该记录

  17. 站A 网桥a 网桥b 站B 环路分解—生成树算法 • 环路破环了网桥的数据库,使得网桥无法获得正确的转发信息。

  18. 站A 网桥a 网桥b 站B 环路分解 有环路的网路

  19. STP协议简介 STP都做了些什么? 1. STP在二层交换网络中选择一个根桥作为全部二层交换网络的逻辑中心(Root Bridge)。 2. STP为全网中每一个参与STP运算的交换机计算到达根桥的最短距离(Path Cost)。 3. 检测二层交换网络中存在的冗余链路,并把他们置于阻断/备份状态。 4. 检测拓扑结构的变化并根据情况计算新的生成树。

  20. Prim

  21. 生成树建立步骤 • 确定一个根桥 • 确定其他网桥的跟端口 • 对每一个LAN确定一个唯一的指定桥和指定端口

  22. STP协议简介 STP协议的结果是什么? 阻断了冗余链路,形成了以根桥为树根的树状拓扑结构。 Switch A BID =0001 DP DP RP – ROOT PORT AP DP Switch C BID =1045 Switch B BID =0050 RP DP – DESIGNATED PORT DP RP Switch D BID =0030 AP – ALTERNATE PORT

  23. STP协议简介 常用概念 根桥(Root Bridge)—桥ID最小的网桥。其中桥ID是由网桥的优先级和网桥的MAC组成。 根端口(Root Port)—这个端口到达根桥的路径是该端口所在网桥到达根桥的最佳路径。全网中只有根桥是没有根端口的。 指定端口(Designated Port)—每一个网段选择到根桥最近的网桥作为指定网桥,该网桥到这一网段的端口为指定端口。 可选端口(Alternated Port)—既不是指定端口,也不是根端口的端口。 Switch A BID =0001 DP DP AP RP – ROOT PORT DP Switch C BID =1045 Switch B BID =0050 RP DP – DESIGNATED PORT DP Switch D BID =0030 AP RP

  24. BPDU报文结构(1) STP通过BPDU(Bridge Protocol Data Unit)报文来学习网络拓扑结构。 BPDU报文的目标MAC地址为:01-80-C2-00-00-00. BPDU报文在直连的两个网桥或多个网桥内交换,不能被转发。没有运行STP协议的网桥将把BPDU报文当作普通业务报文转发。 BPDU Switch C Switch B BPDU

  25. BPDU报文结构(2) DMA:目的MAC地址 目的地址是一个固定的桥的组播地址(0x0180c2000000) SMA:源MAC地址 即发送该配置消息的桥MAC地址 L/T:帧长 LLC Header:固定的链路头 Payload: BPDU数据 L/T DMA SMA LLC Header Payload 值 域 占用字节 2 协议ID 1 协议版本 1 BPDU类型 1 标志位 8 根桥ID 4 根路径开销 8 指定桥ID 2 指定端口ID 2 Message Age 2 Max Age 2 Hello Time 2 Forward Delay

  26. 如何确定根桥(1) 根桥—BID(网桥ID)最小的网桥定为根桥。 BID—网桥的优先级+网桥MAC。 网桥的优先级为可配置,缺省值为32768。 在缺省情况下,根桥将由MAC地址最小的网桥担任。

  27. 如何确定根桥(2) I’m the Root Switch I’m the Root Switch I’m the Root Switch I’m the Root Switch Switch A BID =0001 Switch C BID =1045 Switch B BID =0050 Switch D BID =0030

  28. 如何确定根桥(3) I’m the Root Switch I’m the Root Switch I’m the Root Switch Switch A BID =0001 BPDU: Root Switch = 0050 BPDU: Root Switch = 0001 BPDU: Root Switch= 0001 BPDU: Root Switch= 1045 Switch C BID =1045 BPDU: Root Switch = 0050 Switch B BID =0050 BPDU: Root Switch = 0030 BPDU: Root Switch = 1045 BPDU: Root Switch = 1045 BPDU: Root Switch = 0050 BPDU: Root Switch= 0030 I’m the Root Switch Switch D BID =0030

  29. 如何确定根桥(4) Root Switch =0001 Root Switch = 0001 Switch A BID =0001 I’m the Root Switch I’m the Root Switch Switch C BID =1045 Switch B BID =0050 Switch D BID =0030

  30. 如何确定根桥(5) Root Switch = 0001 Root Switch =0001 Switch A BID =0001 I’m the Root Switch I’m the Root Switch BPDU: Root Switch = 0001 BPDU: Root Switch = 0001 BPDU: Root Switch= 0001 BPDU: Root Switch= 0001 BPDU: Root Switch = 0001 Switch C BID =1045 Switch B BID =0050 BPDU: Root Switch = 0001 BPDU: Root Switch = 0030 BPDU: Root Switch = 0001 BPDU: Root Switch = 0001 BPDU: Root Switch= 0030 Switch D BID =0030

  31. 如何确定根桥(6) Root Switch =0001 Root Switch = 0001 Switch A BID =0001 I’m the Root Switch Root Switch = 0001 Switch C BID =1045 Switch B BID =0050 Switch D BID =0030

  32. 如何计算STP Path Cost Path Cost的两种定义标准 Speed Link type 802.1D cost 802.1t cost 10Mbps Half Duplex 100 2,000,000 Full Duplex 95 1,999,999 Aggregated link 90 1,000,000 100Mbps Half Duplex 19 200,000 Full Duplex 18 199,999 Aggregated Link 15 100,000 1000Mbps Full Duplex 4 20,000 Aggregated Link 3 10,000

  33. 如何决定BPDU配置消息的优劣 比较RID(Root Bridge ID),确定网络同步。 RID相同,比较Path Cost(到根桥距离),越小越优。 RID/Path Cost相同,比较指定桥的BID (Designated Bridge ID),越小越优。 RID/Path Cost/DBID相同,比较指定端口的ID (Designated Port ID),越小越优。 哪边更优? BPDU BPDU

  34. BPDU交换过程 Switch A BID =0001 2 Gig Aggregated Path cost = 3 100M Path cost = 18 Switch C BID =1045 Switch B BID =0050 1 Gig Path Cost = 4 100M Path Cost = 18 1 Gig Path Cost = 4 Switch D BID =0030

  35. BPDU交换过程 I’m the Root Switch I’m the Root Switch I’m the Root Switch Switch A BID =0001 BPDU: Root Switch = 0050 Cost to Root = 0 BPDU: Root Switch = 0001 Cost to Root =0 BPDU: Root Switch= 0001 Cost to Root = 0 BPDU: Root Switch= 1045 Cost to root =0 BPDU: Root Switch = 0050Cost to Root = 0 Switch C BID =1045 Switch B BID =0050 BPDU: Root Switch = 1045 Cost to Root = 0 BPDU: Root Switch = 0030 Cost to Root = 0 BPDU: Root Switch = 1045 Cost to Root = 0 BPDU: Root Switch = 0050 Cost to Root = 0 BPDU: Root Switch= 0030 Cost to Root = 0 I’m the Root Switch Switch D BID =0030

  36. BPDU交换过程 I’m the Root SwitchLowest Cost to Root = 0 Root Switch is 0001 Lowest Cost to Root = 3 Root Switch is 0001 Lowest Cost to Root = 18 Switch A BID =0001 BPDU: Root Switch = 0001 Cost to Root = 18 BPDU: Root Switch = 0001 Cost to Root =0 BPDU: Root Switch= 0001 Cost to Root = 0 Cost to Root =3 BPDU: Root Switch= 0001 Cost to root = 3 Cost to Root =18 BPDU: Root Switch = 0001Cost to Root = 18 Switch C BID =1045 Switch B BID =0050 BPDU: Root Switch = 0001 Cost to Root = 3 BPDU: Root Switch = 0030 Cost to Root = 0 BPDU: Root Switch = 0001 Cost to Root = 3 BPDU: Root Switch = 0001 Cost to Root = 18 BPDU: Root Switch= 0030 Cost to Root = 0 I’m the Root Switch Lowest Cost to Root = 0 Switch D BID =0030

  37. BPDU交换过程 I’m the Root SwitchLowest Cost to Root = 0 Root Switch is 0001 Lowest Cost to Root = 3 Root Switch is 0001 Lowest Cost to Root = 7 Switch A BID =0001 BPDU: Root Switch = 0001 Cost to Root = 7 BPDU: Root Switch = 0001 Cost to Root =0 BPDU: Root Switch= 0001 Cost to Root = 0 BPDU: Root Switch= 0001 Cost to root = 3 Cost to Root =3 Cost to Root =18 BPDU: Root Switch = 0001Cost to Root = 7 Cost to Root =7 Switch C BID =1045 Switch B BID =0050 Cost to Root =22 BPDU: Root Switch = 0001 Cost to Root = 3 BPDU: Root Switch = 0001 Cost to Root = 21 BPDU: Root Switch = 0001 Cost to Root = 3 BPDU: Root Switch = 0001 Cost to Root = 7 Cost to Root =21 BPDU: Root Switch= 0001 Cost to Root = 21 Root Switch = 0001 Lowest Cost to Root = 21 Switch D BID =0030 Cost to Root =22

  38. BPDU交换过程 I’m the Root SwitchLowest Cost to Root = 0 Root Switch is 0001 Lowest Cost to Root = 7 Root Switch is 0001 Lowest Cost to Root = 3 Switch A BID =0001 BPDU: Root Switch = 0001 Cost to Root = 7 BPDU: Root Switch = 0001 Cost to Root =0 BPDU: Root Switch= 0001 Cost to Root = 0 BPDU: Root Switch= 0001 Cost to root = 3 Cost to Root =18 BPDU: Root Switch = 0001Cost to Root = 7 Cost to Root =3 Cost to Root =7 Switch C BID =1045 Switch B BID =0050 Cost to Root =11 BPDU: Root Switch = 0001 Cost to Root = 3 BPDU: Root Switch = 0001 Cost to Root = 11 BPDU: Root Switch = 0001 Cost to Root = 3 BPDU: Root Switch = 0001 Cost to Root = 7 Cost to Root =21 BPDU: Root Switch= 0001 Cost to Root = 11 Root Switch = 0001 Lowest Cost to Root = 11 Switch D BID =0030 Cost to Root =11

  39. BPDU交换过程 I’m the Root SwitchLowest Cost to Root = 0 Root Switch is 0001 Lowest Cost to Root = 3 Root Switch is 0001 Lowest Cost to Root = 7 Switch A BID =0001 BPDU: Root Switch = 0001 Cost to Root = 7 BPDU: Root Switch = 0001 Cost to Root =0 BPDU: Root Switch= 0001 Cost to Root = 0 BPDU: Root Switch= 0001 Cost to root = 3 Cost to Root =3 Cost to Root =18 BPDU: Root Switch = 0001Cost to Root = 18 Cost to Root =7 Switch C BID =1045 Switch B BID =0050 Cost to Root =22 Cost to Root =29 Cost to Root =15 BPDU: Root Switch = 0001 Cost to Root = 3 BPDU: Root Switch = 0001 Cost to Root = 11 BPDU: Root Switch = 0001 Cost to Root = 3 BPDU: Root Switch = 0001 Cost to Root = 7 Cost to Root =21 BPDU: Root Switch= 0001 Cost to Root = 11 Root Switch = 0001 Lowest Cost to Root = 11 Switch D BID =0030 Cost to Root =11

  40. 确定网桥端口角色 BPDU报文中总是携带网桥到根桥的最优值。 通过BPDU配置消息来决定端口的角色: 根端口:网桥各个端口中到根桥最近的端口。 指定端口:网桥的端口发送的BPDU配置消息较接收的BPDU配置消息更优,则端口为指定端口。 可选端口:网桥的端口发送的BPDU配置消息较接收的BPDU配置消息更差,则端口为可选端口。

  41. 确定网桥端口角色 Best cost to root is 7 Cost of this link to root is 18 (0+18) Result BLOCK LINK ALTERNATE PORT这个端口发送的BPDU比接收到的BPDU更差,被选为可选端口。 7>0 Root Switch is 0001Lowest Cost to Root = 7 BPDU: Root Switch = 0001 Cost to Root = 7 BPDU: Root Switch = 0001 Cost to Root =0 BPDU: Root Switch = 0001Cost to Root = 7 Cost to Root =18 AP ROOT PORT这个端口到根桥的距离为7,最近,被选为根端口。 Cost to Root =7 Switch B BID =0050 RP BPDU: Root Switch = 0001 Cost to Root = 3 DP Cost to Root =15 BPDU: Root Switch = 0001 Cost to Root = 7 BPDU: Root Switch= 0001 Cost to Root = 11 DESIGNATED PORT这个端口发送的BPDU比接收到的BPDU更优,被选为指定端口。7<11

  42. 确定阻断端口 I’m the Root SwitchLowest Cost to Root = 0 Root Switch is 0001 Lowest Cost to Root = 3 Root Switch is 0001 Lowest Cost to Root = 7 Switch A BID =0001 DP BPDU: Root Switch = 0001 Cost to Root = 7 DP BPDU: Root Switch = 0001 Cost to Root =0 BPDU: Root Switch= 0001 Cost to Root = 0 RP – ROOT PORT Cost to Root =3 BPDU: Root Switch= 0001 Cost to root = 3 Cost to Root =18 BPDU: Root Switch = 0001Cost to Root = 7 Switch C BID =1045 Switch B BID =0050 RP DP Cost to Root =7 Cost to Root =11 Cost to Root =29 Cost to Root =15 BPDU: Root Switch = 0001 Cost to Root = 3 DP DP – DESIGNATED PORT BPDU: Root Switch = 0001 Cost to Root = 11 BPDU: Root Switch = 0001 Cost to Root = 3 BPDU: Root Switch = 0001 Cost to Root = 7 Cost to Root =21 Root Switch = 0001 Lowest Cost to Root = 11 BPDU: Root Switch= 0001 Cost to Root = 11 RP Switch D BID =0030 Cost to Root =11

  43. 确定阻断端口 Switch A BID =0001 DP DP AP RP – ROOT PORT Switch C BID =1045 Switch B BID =0050 DP RP DP – DESIGNATED PORT DP AP RP Switch D BID =0030

  44. 思考题 Switch A BID =0001 Both Roots Costs are =8BID-A < BID B DP DP PC = 4 PC = 8 BPDU: Root Switch = 0001Cost to Root = 4 RP Switch B BID =1045 Switch C BID =0050 PC = 4 BPDU: Root Switch = 0001 Cost to Root = 8 • 问题1:哪个端口将被阻断? • 问题2:如果所有的PathCost都相同,哪个端口将被阻断?

  45. MAC地址信息的生存期 拓扑结构改变会使站点在生成树中的相对位置发生移动,那么网桥原来学习到的MAC地址信息就可能变得不正确,所以学习的MAC地址信息也要有生存期,如果该时间内没有证明地址的正确,则抛弃这条地址信息。 在STP中有两个生存期: 拓扑稳定的时候用较长的生存期. 拓扑改变的时候用较短的生存期. 网络拓扑发生改变的时候,并不是所有的网桥都能够发现这一变化,所以需要把拓扑改变的信息通知到整个网络。

  46. 站点的相对位置发生变化 B4 物理段 D B1 物理段 E 物理段 B ROOT 物理段 A B3 物理段 C B2

  47. 拓扑改变消息中标志位的使用 值 域 占用字节 7 6 5 4 3 2 1 0 2 协议ID 1 协议版本 1 BPDU类型 1 标志位 8 根桥ID 4 根路径开销 8 指定桥ID 2 指定端口ID 2 Message Age 2 Max Age 2 Hello Time 2 Forward Delay L/T DMA SMA LLC Header Payload Topology Change Topology Change Acknowledgment FLAG标志位中1至6位保留。

  48. 拓扑改变消息的传播 ROOT 5 4 5 3 6 2 6 1 拓扑改变通知消息 拓扑改变应答消息 拓扑改变消息 • 拓扑改变的触发条件有两个: • 当Forwarding端口转变为其他状态时; • 某端口变为Forwarding状态,且交换机具备DP(交换机为非独立交换机)。 • 检测到拓扑变化的交换机以HelloTime为周期持续在根端口向外发送TCN报文,到接收到TCA为止。 • 收到TCN后,Root Bridge 发送的BPDU报文中的TC位将被置位,维持时间为ForwardDelay+MaxAge。

  49. STP端口状态 端口状态 端口能力 Disabled 不收发任何报文 不接收或转发数据,接收但不发送BPDU,不进行地址学习 Blocking 不接收或转发数据,接收并发送BPDU,不进行地址学习 Listening 不接收或转发数据,接收并发送BPDU,开始地址学习 Learning 接收并转发数据,接收并发送BPDU,进行地址学习 Forwarding

More Related