原文链接https://mellowd.co.uk/ccie/?tag=mstp

LET’S TAKE A LOOK AT SOME BPDUS

NOVEMBER 25, 2012 2 COMMENTS

Due to the limitations of my kit, I can’t test EVERYTHING I would like to. I need a spare ME3400 for that which I don’t have.

I’ll be using the following topology throughout this discussion:

All lines are in fact 2 links between each switch. What is a router doing there I hear you ask? Well there is a method to the madness here. All will be revealed!

I have a laptop connected to SW1 and spanned a port. This is to get some wireshark captures to see actual frames. This source will change throughout the blog in order to get specific frames.

SW1#sh run | begin monitor
monitor session 1 source interface Fa1/0/23
monitor session 1 destination interface Fa1/0/14 encapsulation replicate

I’ve turned off CDP, DTP, and VTP as I don’t want any noisy frames. I’m capturing this in Linux as my Windows driver is stripping off the vlan tag!

I’ve created 4 vlans: 10, 20, 30, 40.

Default spanning tree

Let’s keep the STP mode to the default. I’ve configured a bridge priority of 4096 on SW1.

Let’s take a look at the spanning-tree for vlan 10 on SW1:

SW1#sh span vlan 10 | include protocolSpanning tree enabled protocol ieee

The spanning tree enabled says protocol ieee. ieee what exactly? ieee 802.1d-1998 is the standard STP. ieee 802.1d-2004 is the standard RSTP. I guess we can assume that this is 802.1d-1998, but I don’t like to assume anything. Let’s take a look at bpdus sent from SW1 to SW2:

I can see 5 BPDUs sent from SW1 to SW2. Let’s dig deeper into the first:

This is a pvst+ bpdu. Wireshark tells us this straight away, but you can also work it out from the destination MAC address. i.e. this is NOT an ieee BPDU. Note that my switch is currently sending 5 of these. Each one is vlan tagged with the vlan belonging to the bpdu. I have 4 vlans configured (10, 20, 30, 40) so I get a tagged bpdu with each, and a tagged bpdu with vlan 1.
What about the fifth?

Well this IS an ieee BPDU. So really when you are running standard spanning-tree on a Cisco 3560/3750, you’re really sending BPDUs for both ieee and pvst+. But why? Well this is to allow a non-Cisco device to also play ball. PVST+ is Cisco proprietary. We can test this by bridging two interface on my router. You didn’t think we were actually going to route on that device did you?

Once we’ve bridged the routers interfaces running to SW1 and SW2, let’s take a look at the bpdu’s received on SW1 from R1. For this task I’ve changed the root bridge to R1.

The router {7200 running 12.4(15)T17} is only sending out ieee 802.1-1998 bpdus. These are untagged. SW1 shows that the link going off to R1 is the root.

Let’s add a subinterface on R1 tagged with vlan 10, and bridge that to see what happens. This is where things get interesting.
I now see 3 bpdus per cycle:

I see an untagged ieee bpdu. one tagged pvst+ frame for vlan 10, and finally one untagged pvst+ frame for vlan 1. Also to note is that the router does NOT add the vlan id value to it’s priority. Recall that if a switch is the root for vlan 20, and you set the priority to 4096, it actually adds 20 to 4096 to come up with a value of 4116.

SW1#sh span vlan 20 | include RootRoot ID    Priority    4116

If we check the current root for vlan 10, we can see the priority is a flat 4096:

SW1#sh span vlan 10 | include RootRoot ID    Priority    4096
Fa1/0/1             Root FWD 19        128.3    P2p

This means if you are running STP between a few routers and switches, and all their priorities all the same, then the routers will have lower priority and hence will become your root bridges. That is probably not what you want.

Rapid PVST+

Let’s change the mode to rapid-pvst on all switches. I’ve changed the priority of SW1 to zero. This time I see 6 bpdus sent from SW1 to SW2 per cycle. 5 tagged Rapid-PVST+ bpdus, 1 per vlan. This time I get a tagged rapid-pvst+ frame for vlan1.

I also have an untagged ieee frame. However this is ieee-802.1d-2004. You can see this from the protocol identifier version:

What about our router? Let’s take a look at the bpdus sent from SW1 to R1. SW1 is still sending 6 bpdus per cycle, but take a look at the difference for the bpdu sent for vlan 10 and vlan 20.
vlan 10

vlan 20

The bpdu sent to vlan 10 is using regular pvst+, while the bpdu sent to vlan 20 is rapid-pvst+
R1 has been sending regular pvst+ bpdus to SW1. SW1 recognises this and so knows the neighbour only supports that mode. I have not bridged vlan 20 on the router yet and so SW1 continues to send out rapid-pvst+ bpdus with that tag. The untagged ieee bpdu send from SW1 is also using the non-rapid bpdu.

You can see SW1 knows the device on port fa1/0/1 is a regular STP peer:

SW1#sh span vlan 10 | include Fa1/0/1
Fa1/0/1             Desg FWD 19        128.3    P2p Peer(STP)

Multiple Spanning Tree

Multiple spanning tree is quite different. First, it’s an ieee standard – 802.1s – It also uses ieee rapid-stp internally. Only a single BPDU is sent out per cycle. This bpdu is untagged and it also contains M record to show the name, revision, and a digest of the vlan-to-instance mapping. This allows the switches to determine whether or not they are part of the same MSTP region.

Please excuse the change of font, I had to open the capture on my Windows box in order to get the entire frame in a single shot.

Just to note, all bpdus sent to R1 are now sent as regular PVST+ tagged and ieee 802.1d-1998 format.

Conclusions

So why exactly does this all matter? It’s important to know which frames are tagged and which are not, especially if you’re going to be providing some kind of layer 2 service over your network. This becomes even more important if you are matching different customer’s traffic via vlan tag and not via an actual separate port. Another example would be if you were providing a selective QinQ service in which a single port can map different vlans to different S-vlan tags. Untagged traffic will not play nicely with this.

I’ll leave that discussion for another day though otherwise this post will never get finished. I do not have any handy kit on me to do selective QinQ, but I do have regular QinQ and EoMPLS (VLL/Pseudowire) which will be the basis to revisit this port in the future sometime.

转载于:https://blog.51cto.com/1478762/1665334

各版本的STP BPDU相关推荐

  1. 以太网 STP临时环路的产生、STP BPDU的转发过程、根桥故障案例分析。

    2.10.2 以太网 传统STP生成树(STP临时环路.STP BPDU的转发过程.根桥故障案例) 传统STP生成树 2.10.2 以太网 传统STP生成树(STP临时环路.STP BPDU的转发过程 ...

  2. STP——BPDU报文

    目录 BPDU作用 BPDU报文 BPDU相关计时器 BPDU类型-4种 BPDU标记域 BPDU作用 STP每隔2s会发送一次BPDU报文,非根桥连续三次没有收到BPDU,表示发生故障 BPDU主要 ...

  3. STP BPDU报文

    字段 字节数 说明 Protocol Identifier(协议ID) 2 总是为0 Protocol Version(协议版本) 1 STP(802.1D)传统生成树,值为0; RSTP(802.1 ...

  4. STP——BPDU格式及字段说明

    STP(Spanning Tree Protocol,生成树协议)是根据IEEE 802.1D 标准建立的,用于在局域网中消除数据链路层物理环路的协议.运行该协议的设备通过彼此交互信息发现网络中的环路 ...

  5. RSTP快速生成树简介、RSTP与STP的区别、RSTP BPDU字段信息、RSTP角色与端口状态介绍、RSTP工作过程之P/A机制详细分解)

    2.11.0 以太网 RSTP快速生成树(简介.RSTP与STP.RSTP BPDU.RSTP端口状态.RSTP工作过程之P/A机制) RSTP快速生成树 简介 RSTP.STP的区别 RSTP BP ...

  6. 以太网 传统STP生成树的BPDU介绍、STP端口状态介绍与切换过程,STP详细的工作过程。

    2.10.1 以太网 传统STP生成树(STP BPDU.STP端口状态.STP工作过程) STP生成树协议的之间的交互通过STP BPDU(根协议数据单元,Bridge Protocol Data ...

  7. HCIE 面试资料-STP/RSTP/MSTP

    STP STP介绍 STP(Spanning Tree Protocol)生成树协议 有三个版本,协议版本标识符,STP为0,RSTP为2,MSTP为3. STP的作用是进行逻辑阻断,通过堵塞端口来消 ...

  8. STP理论02-BPDU(STP)

    STP理论02-BPDU(STP) 在前面的章节中介绍了桥 ID.路径开销和端口 ID 等信息,所有这些信息都是通过 BPDU 协议报文传输. 1).配置 BPDU 是一种心跳报文,只要端口使能 ST ...

  9. STP和RSTP详解-原理篇

    STP和RSTP详解-原理篇 一.STP 1.1 STP基本概念 1.2 STP三个定时器 1.3 STP BPDU报文 1.3.1 配置 BPDU 1.3.2 TCN BPDU 1.3.3 BPDU ...

  10. STP、RSTP、MSTP协议

    常见的单点故障 二层 解决方案:链路聚合,STP生成树协议 新的问题产生:环路产生---产生了广播风暴,导致资源震荡 MAC地址表震荡 三层 解决方案:VRRP协议 ----------------- ...

最新文章

  1. HTML/CSS——form表单select联动(JavaScript方法)
  2. 帝国CMS模板|中国历史网整站数据MIP源码下载、带Tags提取插件
  3. 浏览器内核与web标准
  4. Android控件——ListView之Adapter提供数据(其二)
  5. Ubuntu 禁用 触摸板
  6. logistic regression及其Python实现
  7. zblog修改上传服务器,【记录有用】ZBlog备份、恢复与搬家(换空间换服务器)方法...
  8. PETSHOP模式IDAL,SQLSERVERDAL,存储过程以及模型类代码的生成工具
  9. SLAM领域的优秀作者与实验室汇总
  10. Minimum supported Gradle version is 6.1.1. Current version is 5.6.4
  11. 前端项目中代码格式化配置:eslint + prettier + stylelint + pre-commit
  12. TPshop项目步骤(二)
  13. 交互体验之产品的文案
  14. 把笔记本改造成无线路由器 —— 手机抓包牛刀小试
  15. 显示器颜色偏色的排查过程(偏黄、偏红、偏蓝、偏绿等)
  16. Linux的pcie模拟网卡,Intel英特尔PCIe万兆网卡虚拟功能驱动4.11.1版For Linux(2021年3月5日发布)...
  17. 操作系统原理——第2章 操作系统概述
  18. SCI论文并没有想像中的难写,发表SCI论文的小技巧。2012年和2013年SCI期刊论文和EI期刊论文
  19. 学习成绩 =90分的同学用A表示,60-89分之间的用B表示,60分以下的用C表示。(C语言版)
  20. 请问大家我这里哪里有错误呢?谢谢

热门文章

  1. [DELPHI]数据类型
  2. 命令前加./ ,在后台运行程序 linux批处理 linux自动运行程序
  3. 图像读取函数cv::imread()的几种使用方式
  4. Centos7安装官方JDK
  5. 编程大讲坛:C#核心开发技术从入门到精通pdf
  6. notepad++查看aspx
  7. java swing 复选JCheckBox组件美化
  8. 《BI那点儿事》ETL中的关键技术
  9. 我的5年Python7年R,述说她们的差异在哪里?
  10. R资讯| 广州R会第三批嘉宾揭晓!!