R1#debug ip ospf adj
*Sep 23 19:35:38.739: OSPF: Interface FastEthernet0/0 going Down
*Sep 23 19:35:38.739: OSPF: 1.1.1 .1 address 192.168.10.1 . FastEthernet0/0 is dead, state DOWN
*Sep 23 19:35:38.739: OSPF: Neighbor change Event . interface FastEthernet0/0
*Sep 23 19:35:38.739: OSPF: DR/BDR election . FastEthernet0/0
*Sep 23 19:35:38.739: OSPF: Elect BDR 0.0.0 .0
*Sep 23 19:35:38.739: OSPF: Elect DR 192.168.235.1
*Sep 23 19:35:38.739: OSPF: Elect BDR 0.0.0 .0
*Sep 23 19:35:38.743: OSPF: Elect DR 192.168.235.1
*Sep 23 19:35:38.743:        DR: 192.168.235.1 (Id)   BDR: none
*Sep 23 19:35:38.743: OSPF: 192.168.235.1 address 192.168.10.2 . FastEthernet0/0 is dead, state DOWN
[EC1] 
*Sep 23 19:47:40.403: OSPF: Cannot see ourself in hello from 192.168.235.1 . FastEthernet0/0, state INIT [EC2] 
 
*Sep 23 19:35:38.743: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.235.1 . FastEthernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
*Sep 23 19:35:38.747: OSPF: Neighbor change Event . interface FastEthernet0/0
*Sep 23 19:35:38.747: OSPF: DR/BDR election . FastEthernet0/0
*Sep 23 19:35:38.747: OSPF: Elect BDR 0.0.0 .0
*Sep 23 19:35:38.747: OSPF: Elect DR 0.0.0 .0
*Sep 23 19:35:38.747:        DR: none    BDR: none
*Sep 23 19:35:38.747: OSPF: Remember old DR 192.168.235.1 (id)
[EC3] 
*Sep 23 19:35:38.819: OSPF: Interface FastEthernet0/0 going Up
*Sep 23 19:35:38.819: OSPF: i_up : interface is down
*Sep 23 19:35:39.243: OSPF: Build router LSA for area 0, router ID 1.1.1 .1, seq 0x80000001
*Sep 23 19:35:47.459: OSPF: 2 Way Communication to 192.168.235.1 . FastEthernet0/0, state 2WAY
*Sep 23 19:35:47.459: OSPF: Backup seen Event before WAIT timer . FastEthernet0/0
*Sep 23 19:35:47.459: OSPF: DR/BDR election . FastEthernet0/0
*Sep 23 19:35:47.459: OSPF: Elect BDR 1.1.1 .1
*Sep 23 19:35:47.463: OSPF: Elect DR 192.168.235.1
*Sep 23 19:35:47.463: OSPF: Elect BDR 1.1.1 .1
*Sep 23 19:35:47.463: OSPF: Elect DR 192.168.235.1
*Sep 23 19:35:47.463:        DR: 192.168.235.1 (Id)   BDR: 1.1.1 .1 (Id)
[EC4] 
*Sep 23 19:35:47.463: OSPF: Send DBD to 192.168.235.1 . FastEthernet0/0 seq 0x727 opt 0x52 flag 0x7 len 32
*Sep 23 19:35:47.535: OSPF: Rcv DBD from 192.168.235.1 . FastEthernet0/0 seq 0x1921 opt 0x52 flag 0x7 len 32  mtu 1500 state EXSTART
*Sep 23 19:35:47.535: OSPF: NBR Negotiation Done. We are the SLAVE
[EC5] 
*Sep 23 19:35:47.535: OSPF: Send DBD to 192.168.235.1 . FastEthernet0/0 seq 0x1921 opt 0x52 flag 0x2 len 52
*Sep 23 19:35:47.583: OSPF: Rcv DBD from 192.168.235.1 . FastEthernet0/0 seq 0x1922 opt 0x52 flag 0x3 len 52  mtu 1500 state EXCHANGE
*Sep 23 19:35:47.583: OSPF: Send DBD to 192.168.235.1 . FastEthernet0/0 seq 0x1922 opt 0x52 flag 0x0 len 32
[EC6] 
*Sep 23 19:35:47.587: OSPF: Database request to 192.168.235.1
*Sep 23 19:35:47.587: OSPF: sent LS REQ packet to 192.168.10.2, length 12
[EC7] 
*Sep 23 19:35:47.607: OSPF: Rcv DBD from 192.168.235.1 . FastEthernet0/0 seq 0x1923 opt 0x52 flag 0x1 len 32  mtu 1500 state EXCHANGE
*Sep 23 19:35:47.607: OSPF: Exchange Done with 192.168.235.1 . FastEthernet0/0
[EC8] 
 
*Sep 23 19:35:47.607: OSPF: Send DBD to 192.168.235.1 . FastEthernet0/0 seq 0x1923 opt 0x52 flag 0x0 len 32
*Sep 23 19:35:47.611: OSPF: Synchronized with 192.168.235.1 . FastEthernet0/0, state FULL
*Sep 23 19:35:47.611: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.235.1 . FastEthernet0/0 from LOADING to FULL, Loading Done
[EC9]  DR返回LS Acknowlege报文,LSDB达到同步。Full状态
 
*Sep 23 19:35:47.967: OSPF: Build router LSA for area 0, router ID 1.1.1 .1, seq 0x80000002
*Sep 23 19:35:53.347: OSPF: Build router LSA for area 0, router ID 1.1.1 .1, seq 0x80000005
*Sep 23 19:35:57.419: OSPF: Neighbor change Event . interface FastEthernet0/0
*Sep 23 19:35:57.419: OSPF: DR/BDR election . FastEthernet0/0
*Sep 23 19:35:57.419: OSPF: Elect BDR 1.1.1 .1
*Sep 23 19:35:57.419: OSPF: Elect DR 192.168.235.1
*Sep 23 19:35:57.419:        DR: 192.168.235.1 (Id)   BDR: 1.1.1 .1 (Id)
如果是在DR上重启OSPF进程的话,也大致相同,只是原来DR的位置会被BDR顶替上。

 [EC1] 其实从进程开始重启后,马上已经开始了一轮DR竞选。状态为Down
 [EC2] hello包里未发现自己的router-id,所以状态变为  INIT
 
 [EC3] 重启ospf进程后,当路由器启动进程后,首先发送hello报文,构建一个空包BDRDR的竞选(BDRDR的地址都是全0),并构建一个wait timer,在这时间内如果没有收到域内DR/BDR的通告,就会发出通告说自己要参加竞选啦。这里的结果是收到了DR的通告(router-id192.168.235.1是老的DR),而并没BDR
 
 [EC4] 下一步,当与邻居发生邻接关系后state :2WAY),发起自己的竞选通告!前面指出,DR有了,BDR还没人当呢,所以hello报文里BDR部分就把自己的R-ID填上了。最后竞选成功,当了BDR
 
 [EC5] 接下来进入EXSTART状态。通过互相发送DBD报文,协商参数,决定了自己是从路由器身份。
 
 [EC6] 交换双方的LSA
 
 [EC7] 发送 LSQ DR 请求自己没有的 LSA
 [EC8] 从主路由器收到全部 LSU Exchange 状态完成
 [EC9] 向主路由器返回 LSACK LSDB 同步完成,达到 Full 状态