Chinaunix首页 | 论坛 | 博客
  • 博客访问: 454355
  • 博文数量: 143
  • 博客积分: 6159
  • 博客等级: 准将
  • 技术积分: 1667
  • 用 户 组: 普通用户
  • 注册时间: 2010-08-25 23:08
文章分类

全部博文(143)

文章存档

2013年(1)

2012年(11)

2011年(55)

2010年(76)

分类:

2010-11-11 23:50:15

BPDU format in STP protocol


     config BPDU:
size    (offset)        name
-----------------------------
2       (0)             Protocol ID
1       (2)             Protocol version
1       (3)             BPDU type: CONFIG
1       (4)             bit7: TC(topo change), bit0: TCA
8       (5)             Root Bridge ID
4       (13)            Root Path cost
8       (17)            Bridge ID
2       (25)            Port ID
2       (27)            Message Type
2       (29)            Max age
2       (31)            Hello Time
2       (33)            Forward Delay


     TCN BPDU:
size    (offset)        name
-----------------------------
2       (0)             Protocol ID
1       (2)             Protocol version
1       (3)             BPDU type: TCN (topo change notification)

其中 [RootBridgeID, RootPathcost, BridgeID, PortID]组成priority vector(22 bytes),STP通过比较此vector的大小作出root bridge的选择,越小越好。

BridgeID的结构为:
------------------------------
4 bits   Bridge Priority
12bits   SystemID extension, 与VLAN长度相等
48bits   MAC address

PortID的结构为:
------------------------------
4 bits   Port Priority
12bits   Port ID


========================================
STP中的timer

Hello:        = 2s, 用于定时生成config BPDU, 只用root bridge使用
TCN:          = fwd delay + max aging
              当switch检测到topo变化,必须通知root bridge.  
              由此timer控制,直到root bridge发出ack。
Topo Change:  = hello time
              只有root bridge使用。当root受到TCN,
              由此timer控制通知所有bridge topo changed。
Aging:        = 300 or fwd delay
              定期清理fwd table。应为有root的定时hello,
              正常情况下不应该有超时的entry。


========================================
topo change:

1。 bridge A检测到topo change
2。 bridge A通过root port发出TCN message到他的designated bridge,通知root
3。 此bridge启动TCN timer,在每个hello都发出一个TCN
4。 designated bridge D受到TCN,将在下一个config BPDU中设上TCA
5。 A收到TCA,将停止自己的TCN timer,也停止TCN的发送
6。 Bridge D启动自己的TCN timer,在每个Hello发送TCN,直至root bridge
7。 root发出带TC flag的config BPDU,此flag一直保持到所有bridge都收到TC nofication
8。 bridge收到带TC的config BPDU,启动自己的Short Aging timer
9。 root发出不带TC的config BPDU
10。bridge发现config BPDU中的TC已经清除,将Short Aging切换到default Aging

阅读(1370) | 评论(0) | 转发(0) |
0

上一篇:Interlaken协议

下一篇:carrier-grade software

给主人留下些什么吧!~~