1 / 24

Spanning Tree Understanding

Spanning Tree Understanding. Based on IEEE802.1D-1998 Edition. By Morning Mencius. Content. Why to use Spanning Tree? Spanning Tree figure Spanning Tree Algorithm Implementation of STA Q&A. Why to use Spanning Tree?. Spanning Tree Algorithm 运行的必要条件.

melia
Download Presentation

Spanning Tree Understanding

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. Spanning Tree Understanding Based on IEEE802.1D-1998 Edition By Morning Mencius

  2. Content • Why to use Spanning Tree? • Spanning Tree figure • Spanning Tree Algorithm • Implementation of STA • Q&A

  3. Why to use Spanning Tree?

  4. Spanning Tree Algorithm运行的必要条件 • Bridge的Port有5种状态Disabled, Blocking, Listening, Learning, Forwarding • 每个switch都会处理目地址为MAC group address(01-80-c2-00-00-00)的frame • 每个switch都有一个唯一的ID • 每个switch的每个PORT都有一个唯一的PORT ID

  5. Spanning Tree Algorithm运行的参数 • Root Bridge ,交换网络中Bridge ID最小的switch • TransmissionCost,传输速度越快,该port的TC越小 • Path Cost: • Root Port,switch上唯一一个通向Root Bridge方向的Port • Root Path Cost • Designated Port,LAN上唯一一个通向Root Bridge方向cost最小的Port • Designated Bridge,LAN上拥有Designated Port的Bridge

  6. Spanning Tree Algorithm运行的时间参数 • Forward Delay,一个frame经过所有的bridge所需的最长时间 • Message Age,root bridge所发出的BPDU frame已生存的时间 • Maximum Age,frame的最大生存时间 • Hello Time,root bridge产生问候frame的时间间隔

  7. Spanning Tree Algorithm的基本方法 • 通过不断的发送hello frame交换信息 • 选root bridge,Bridge ID最小的 • 选root port,Root Path Cost最小,Port ID最小 • 选designate port,Path cost最小,Bridge ID最小的 • 简单模拟一下STP的工作过程(flash)

  8. BPDU frame Bit8 – Topology Change Acknowledgment flag Bit1 -- Topology Change flag

  9. 抓包获得的BPDU

  10. 两种BPDU的数据结构

  11. 记录Bridge信息的数据结构

  12. 记录Port信息的数据结构

  13. STP协议实体的数据

  14. STP初始化 认为自己为root bridge,向所有端口发BPDU STP协议的初始化 • 认为自己是root bridge 将所有端口设为Blocking状态 并设置为指定端口 将指定端口设置为Listening 默认每2s向所有指定端口上发BPDU

  15. 某个端口上接到BPDU received_config_bpdu(port_no, BPDU) { /* 端口的指定root大于BPDU中的root */ /* 端口的指定cost大于BPDU中的root path cost */ /* 端口的指定bridge大于BPDU中的bridge id */ /* 端口的指定port大于BPDU中的port id */ if (supersedes_port_info(port_no, BPDU)) { /*将BPDU中的信息记录到端口数据port_info中*/ record_config_information(port_no, config); configuration_update(); /* 更新协议的配置 */ port_state_selection(); /* 重新设置端口状态 */ if (port_no == bridge_info.root_port) { /* 记录下BPDU中time信息到bridge_info中 */ record_config_timeout_values(config); config_bpdu_generation(); /* 向所有指定端口发包*/ } else if (designated_port(port_no)) { reply(port_no); /* 回复对方自己信息 */ } }

  16. Topology Change

  17. 默认参数表

  18. 生成树协议的发展 • STP/RSTP • PVST/PVST+ • MISTP/MSTP

  19. Q&A • 支持STP的switch端口有哪几种状态? • 在使用STP的网络中每一个switch都有一个root port,R(right) or W(wrong)? • STP使用的BPDU (目的MAC为01-80-c2-00-00-00)封包有哪几种类型?

  20. 4.如图运行STP的网络正常工作时, a.哪个bridge为root bridge? b.哪些端口为root port? c.哪些端口为designated port d.哪个端口是blocking状态?

  21. Q&A 5.如图运行STP的网络正常工作时, a.哪个bridge为root bridge? b.哪些端口为root port? c.哪些端口为designated port d.哪些端口是blocking状态?

  22. THANKS

More Related