简单实验:OSPF中DR和BDR的选举的疑问..

今天在看OSPF路由选择协议时突然对DR和BDR的选举过程有点好奇,于是做了个实验去了解一下

实验是在Dynamips模拟器中进行的,拓扑如下图:

lab_1

将R1~R4上的F0/0接口打开,地址段用10.0.0.0,所有Router配置在area0中

4个路由器形成一个典型的多路访问广播网络.在这种网络中开启ospf是会引起DR和BDR的选举的.

在R1~R4上开启ospf进程,宣告10.0.0.0网络,为方便起见,在所有路由器上配上loopback地址(R1上为1.1.1.1,依次类推)并将他们都宣告到ospf进程中.如无意外4个路由器都会以各自的loopback口地址为RID,在全局配置模式下用show ip ospf nei查看DR和BDR的选举状况.或许你会见到DB不是我们希望见到的R4(因为R4的RID是最大的4.4.4.4)因为DR和BDR是非抢占试的,所以可能在你设置R4的loopback口时DR和BDR都已经选好了.R4就只能做DROther了,为了使R4成为DR,R3成为BDR,我需要使用clear ip ospf process命令去重置OSPF进程.在这之后ospf的邻居关系和链路状态数据库等将会重新建立

稍等片刻后,再次查看邻居表,R4已经成为了DR,R3也顺利成为BDR.

为了更加清晰了解DR的选举.我尝试将R2(DRother)的F0/0链路断开,并开启debug ip ospf adj查看邻居的建立过程

得出的信息如下(内容有删减):

Router(config-if)#no shut     //——-关闭F0/0链路
06:03:15: OSPF: Interface FastEthernet0/0 going Up  
06:03:15: OSPF: Build router LSA for area 0, router ID 10.0.0.2, seq 0×8000000B

06:03:17: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
06:03:17: OSPF: 2 Way Communication to 10.0.0.3 on FastEthernet0/0, state 2WAY(与R3建立双向关系)
06:03:17: OSPF: Backup seen Event before WAIT timer on FastEthernet0/0
06:03:17: OSPF: DR/BDR election on FastEthernet0/0  (在F0/0上选举DR和BDR)
06:03:17: OSPF: Elect BDR 10.0.0.3  (选举了R3为DR和BDR)
06:03:17: OSPF: Elect DR 10.0.0.3
06:03:17:        DR: 10.0.0.3 (Id)   BDR: 10.0.0.3 (Id)
06:03:17: OSPF: Send DBD to 10.0.0.3 on FastEthernet0/0 seq 0xC6D opt 0×42 flag 0×7 len 32

06:03:18: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
06:03:20: OSPF: 2 Way Communication to 10.0.0.1 on FastEthernet0/0, state 2WAY
06:03:20: OSPF: Neighbor change Event on interface FastEthernet0/0
06:03:20: OSPF: DR/BDR election on FastEthernet0/0
06:03:20: OSPF: Elect BDR 10.0.0.3
06:03:20: OSPF: Elect DR 10.0.0.3
06:03:20:        DR: 10.0.0.3 (Id)   BDR: 10.0.0.3 (Id)
06:03:20: OSPF: 2 Way Communication to 10.0.0.4 on FastEthernet0/0, state 2WAY
06:03:20: OSPF: Neighbor change Event on interface FastEthernet0/0
06:03:20: OSPF: DR/BDR election on FastEthernet0/0
06:03:20: OSPF: Elect BDR 10.0.0.3
06:03:20: OSPF: Elect DR 10.0.0.4
06:03:20:        DR: 10.0.0.4 (Id)   BDR: 10.0.0.3 (Id)

上面可以看出,R2首先是跟R3发Hello包的?所以他开始就认为R3是DR?然后,他又与R1建立邻居关系,但R3 RID比R1高,所以R3依然是DR,然后R2又跟R4建立邻居关系,但因为R4的RID比R3高,所以成为了DR.而R3降级为BDR,但上面不是说过DR是非抢占式的吗?这看似很矛盾,不过其实是我想错了.DR与BDR的选举不是个人问题.早在R2加入区域0时,DR跟BDR就已经选出了,R2 的加入时只是在area0中

下面的这段信息有点不明白:

06:03:20: OSPF: Send DBD to 10.0.0.4 on FastEthernet0/0 seq 0×1B79 opt 0×42 flag 0×7 len 32
06:03:20: OSPF: Remember old DR 10.0.0.3 (id)
06:03:21: OSPF: Reset old DR on FastEthernet0/0

不明白Remember old DR 10.0.0.3 (id),和Reset old DR on FastEthernet0/0的用意

上面只是初步了解,明天有时间再做实验或找个IE去讨论下

未完待续………

分享家:Addthis中国

3 条留言

我要留言
  • 1 F

    Black-Xstar  |  2009/03/20 00:18 上午  

    惨了,这么深奥,我全看不懂啊……

    [Reply]

  • 2 F

    断罪之翼  |  2009/03/20 00:18 上午  

    要多向你学习才行~

    [Reply]

  • 3 F

    alex  |  2009/03/20 00:18 上午  

    OBRA coverage will not be available. Most of the time individual health insurance policies are less expensive than COBRA.; health insurance quotes :-) ; auto insurance 5356; life insurance quotes %-DD; cheap auto insurance pwqnwz; health insurance :-P PP;

    [Reply]

(必填)
(必填,绝不公开)

:wink: :-| :-x :twisted: :) 8-O :( :roll: :-P :oops: :-o :mrgreen: :lol: :idea: :-D :evil: :cry: 8) :arrow: :-? :?: :!: