# DR:指定路由器 # BDR:備份指定路由器 # DROTHER:非DR/BDR的其餘路由器 # DR/BDR選舉過程 # MA網絡用途:選舉DR,用於能夠減小數據庫條目,減小網絡開銷 # 一、wait timer ( dead timer ) 40s等待時間,若無hello包,本身成爲DR; # 二、priority(接口中ospf優先級,0-255,優先級增大); # 三、priority相同,比較Router-id,優先級越大; # 四、DR/BDR的選舉過程爲非搶佔的 # 五、priority爲0,不能成爲DR/BDR,DROTHER之間爲2WAY狀態; IOU3#sh ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 1.1.1.1 1 FULL/DROTHER 00:00:37 10.1.123.1 Ethernet0/0 2.2.2.2 1 FULL/BDR 00:00:37 10.1.123.2 Ethernet0/0 IOU3#sh ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 1.1.1.1 0 FULL/DROTHER 00:00:34 10.1.123.1 Ethernet0/0 2.2.2.2 0 FULL/DROTHER 00:00:35 10.1.123.2 Ethernet0/0 IOU1#sh ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 2.2.2.2 0 2WAY/DROTHER 00:00:33 10.1.123.2 Ethernet0/0 3.3.3.3 255 FULL/DR 00:00:32 10.1.123.3 Ethernet0/0 IOU2#sh ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 1.1.1.1 0 2WAY/DROTHER 00:00:38 10.1.123.1 Ethernet0/0 3.3.3.3 255 FULL/DR 00:00:31 10.1.123.3 Ethernet0/0 IOU3#sh ip ospf int e0/0 Ethernet0/0 is up, line protocol is up Internet Address 10.1.123.3/24, Area 2, Attached via Network Statement Process ID 1, Router ID 3.3.3.3, Network Type BROADCAST, Cost: 10 Topology-MTID Cost Disabled Shutdown Topology Name 0 10 no no Base Transmit Delay is 1 sec, State DR, Priority 255 Designated Router (ID) 3.3.3.3, Interface address 10.1.123.3 Backup Designated router (ID) 2.2.2.2, Interface address 10.1.123.2 Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:07 Supports Link-local Signaling (LLS) Cisco NSF helper support enabled IETF NSF helper support enabled Index 1/1, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 1, maximum is 2 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 2, Adjacent neighbor count is 2 Adjacent with neighbor 1.1.1.1 Adjacent with neighbor 2.2.2.2 (Backup Designated Router) Suppress hello for 0 neighbor(s) IOU3#sh ip int e0/0 Ethernet0/0 is up, line protocol is up Internet address is 10.1.123.3/24 Broadcast address is 255.255.255.255 Address determined by setup command MTU is 1500 bytes Helper address is not set Directed broadcast forwarding is disabled Multicast reserved groups joined: 224.0.0.251 224.0.0.5 224.0.0.6 # DR/BDR 監聽組播地址:224.0.0.5 224.0.0.6
# OSPF 鄰居創建過程 # 報文5種類型:HELLO、DBD、LSR、LSU、LSACK # 鄰居狀態:down、init、2way、exstart、exchange、loading、full、attempty(NBMA/P2MP) # 一、R4發送Hello至224.0.0.5; # 二、R5收到Hello包後,鄰居狀態設置爲init,並回復Hello,攜帶active neibour:R4的router-id; # 三、R4收到攜帶active neibour的Hello包後,設置R5的鄰居狀態爲2way,並回復Hello,攜帶active neibour:R5的router-id; # 四、R5收到攜帶active neibour的Hello包後,設置R4的鄰居狀態爲2way;假設R5爲DR或者爲Priority/router-id較大; # 開始同步DBD(數據庫描述,LSA頭部)和LSR一塊兒用於提升OSPF數據庫同步效率,同步過程當中不使用ack,可靠有序; # 可靠有序機制:根據router-id選舉主從機制,從確認主,非累加確認; # 五、主從的第一個交互DBD不攜帶信息,爲空,鄰居狀態爲exstart; # 從先發序列號4321,主發送序列號1234,從用主的序列號1234確認主(序列號非累加),主確認從在發送1235(序列號累加); # 六、除第一個DBD交互過程,鄰居狀態爲exchange; # flag標誌位:I/M/M(S),是否爲第一個DBD/是否DBD剩餘/主從;從的flag爲0x000,主flag爲0x001; # 特殊的DBD交互過程:從的DBD先完/主的DBD先完; # DBD交互完畢後,從發送LSR,主發送LSU,併發送LSRACK進行確認;可靠有序