广播多路访问链路上的OSPF
?
通過本實驗可以了解:
1、 路由器OSPF的啟動過程;
2、 啟用路由接口,并通告網絡所在路由;
3、 DR選舉的控制;
4、 廣播多路訪問鏈路的特征;
實驗拓撲圖:
實驗步驟:
配置各個路由器fa0/0和loopback 0的IP地址,并配置OSPF路由協議
R1的ospf配置如下:
R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 192.168.1.0 255.255.255.0 area 0
R1(config-router)#network 1.1.1.0 255.255.255.0 area 0
R2、R3、R4與之類似。
當所有配置完成之后,在R1、R2上查看路由信息,可以看到DR,BDR的選舉正在進行
再到R4上執行“show ip ospf neighbor”
以上實驗輸出表明在該廣播多路訪問網絡中,R4是DR,R3是BDR,R1和R2是DROTHER。
【注】:
1、為了避免路由器之間建立完全鄰接關系而引起的大量開銷,OSPF協議要求在多路訪問鏈路中選舉一個DR,每個路由器都與之建立鄰接關系。選舉DR的同時,也選舉一個BDR。在DR失效的時候,BDR擔負起DR的責任,而且所有其他路由器只與DR和BDR建立鄰接關系;
2、DR和BDR有他們自己的組播地址224.0.0.6;
3、DR和BDR的選舉是以各個網絡為基礎的,也就是說DR和BDR選舉是一個;路由器的接口特性,而不是整個路由器的特性;
4、DR的選舉規則為:
①首要因素是時間,最先啟動的路由器被選舉為DR;
②如果是同時啟動,或者重新選舉,則看接口優先級(范圍是0--255),優先級最高的被選舉為DR,默認情況下,多路訪問網絡的接口優先級為1,點到點的接口優先級為0,修改優先級的命令為“ip ospf priority ”,如果接口的優先級被置為0,那么該接口將不參與DR的選舉;
③如果前兩者相同,最后看路由器ID,路由器最高的被選舉為DR;
5、DR選舉是非搶占的,除非人為地重新選舉,重新選舉的方法有兩種,一是路由器重啟,二是執行“clear ip ospf process”命令;
在R1上執行show ip ospf int fastEthernet 0/0命令
R1#show ip ospf int fa0/0
FastEthernet0/0 is up, line protocol is up
Internet Address 192.168.1.1/24, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
//網絡類型為BROADCAST;
Transmit Delay is 1 sec, State DROTHER, Priority 1
//自己的State是DROTHER;
Designated Router (ID) 4.4.4.4, Interface address 192.168.1.4
//DR的路由器ID和接口地址;
Backup Designated router (ID) 3.3.3.3, Interface address 192.168.1.3
//BDR的路由器ID和接口地址;
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:09
Supports Link-local Signaling (LLS)
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 3, Adjacent neighbor count is 2
//有3個鄰居,只與R3、R4形成鄰接關系,與R2只是鄰居關系;
Adjacent with neighbor 3.3.3.3 (Backup Designated Router)
Adjacent with neighbor 4.4.4.4 (Designated Router)
//與R3、R4形成鄰接關系;
Suppress hello for 0 neighbor(s)
?
?
在R4上執行show ip ospf int fastEthernet 0/0命令
R4#show ip ospf int fastEthernet 0/0
FastEthernet0/0 is up, line protocol is up
Internet Address 192.168.1.4/24, Area 0
Process ID 1, Router ID 4.4.4.4, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 1
//自己是DR;
Designated Router (ID) 4.4.4.4, Interface address 192.168.1.4
//DR路由器的ID和接口地址;
Backup Designated router (ID) 3.3.3.3, Interface address 192.168.1.3
//BDR路由器的ID和接口地址;
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)
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 4 msec, maximum is 4 msec
Neighbor Count is 3, Adjacent neighbor count is 3
//R4是DR,有3個鄰居,并且全部形成鄰接關系;
Adjacent with neighbor 1.1.1.1
Adjacent with neighbor 2.2.2.2
Adjacent with neighbor 3.3.3.3 (Backup Designated Router)
Suppress hello for 0 neighbor(s)
從路由器的R1和R4的輸出來看,鄰居關系和鄰接關系是不相同的,鄰居關系是指達到2WAY狀態的路由器,而鄰接關系是指達到FULL狀態的路由器。
Debug ip ospf adj 命令顯示鄰接關系的創建或中斷的過程。在OSPF鄰接關系創建的過程中,接口狀態變化包括:DOWN,2WAY,EXSTART,EXCHANGE,LOADING,FULL
?
?
R4# debug ip ospf adj
OSPF adjacency events debugging is on
R4#clear ip ospf process
………………
*Mar 1 00:09:44.811: OSPF: Elect DR 3.3.3.3
*Mar 1 00:09:44.811: DR: 3.3.3.3 (Id) BDR: 4.4.4.4 (Id)
*Mar 1 00:09:47.495: OSPF: 3.3.3.3 address 192.168.1.3 on FastEthernet0/0 is dead
*Mar 1 00:09:47.495: OSPF: 3.3.3.3 address 192.168.1.3 on FastEthernet0/0 is dead, state DOWN
………………
*Mar 1 00:09:47.495: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Dead timer expired
*Mar 1 00:09:47.499: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar 1 00:09:47.499: OSPF: DR/BDR election on FastEthernet0/0
………………
*Mar 1 00:10:05.791: OSPF: 2 Way Communication to 3.3.3.3 on FastEthernet0/0, state 2WAY
*Mar 1 00:10:05.791: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar 1 00:10:05.791: OSPF: DR/BDR election on FastEthernet0/0
*Mar 1 00:10:05.795: OSPF: Elect BDR 1.1.1.1
*Mar 1 00:10:05.795: OSPF: Elect DR 4.4.4.4
*Mar 1 00:10:05.795: DR: 4.4.4.4 (Id) BDR: 1.1.1.1 (Id)
*Mar 1 00:10:05.795: OSPF: Send DBD to 3.3.3.3 on FastEthernet0/0 seq 0x6CD opt 0x52 flag 0x7 len 32
………………
*Mar 1 00:10:06.703: OSPF: Rcv DBD from 3.3.3.3 on FastEthernet0/0 seq 0x8AF opt 0x52 flag 0x7 len 32 mtu 1500 state EXSTART
*Mar 1 00:10:06.703: OSPF: First DBD and we are not SLAVE
*Mar 1 00:10:06.727: OSPF: Rcv DBD from 3.3.3.3 on FastEthernet0/0 seq 0x6CD opt 0x52 flag 0x2 len 132 mtu 1500 state EXSTART
*Mar 1 00:10:06.727: OSPF: NBR Negotiation Done. We are the MASTER
*Mar 1 00:10:06.731: OSPF: Send DBD to 3.3.3.3 on FastEthernet0/0 seq 0x6CE opt 0x52 flag 0x3 len 132
*Mar 1 00:10:07.063: OSPF: Rcv DBD from 3.3.3.3 on FastEthernet0/0 seq 0x6CE opt 0x52 flag 0x0 len 32 mtu 1500 state EXCHANGE
*Mar 1 00:10:07.063: OSPF: Send DBD to 3.3.3.3 on FastEthernet0/0 seq 0x6CF opt 0x52 flag 0x1 len 32
*Mar 1 00:10:07.111: OSPF: Rcv LS UPD from 3.3.3.3 on FastEthernet0/0 length 88 LSA count 1
*Mar 1 00:10:07.115: OSPF: Rcv LS UPD from 3.3.3.3 on FastEthernet0/0 length 68 LSA count 1
*Mar 1 00:10:07.183: OSPF: Rcv LS REQ from 3.3.3.3 on FastEthernet0/0 length 36 LSA count 1
*Mar 1 00:10:07.187: OSPF: Send UPD to 192.168.1.3 on FastEthernet0/0 length 52 LSA count 1
*Mar 1 00:10:07.187: OSPF: Rcv DBD from 3.3.3.3 on FastEthernet0/0 seq 0x6CF opt 0x52 flag 0x0 len 32 mtu 1500 state EXCHANGE
*Mar 1 00:10:07.187: OSPF: Exchange Done with 3.3.3.3 on FastEthernet0/0
*Mar 1 00:10:07.187: OSPF: Synchronized with 3.3.3.3 on FastEthernet0/0, state FULL
*Mar 1 00:10:07.191: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on FastEthernet0/0 from LOADING to FULL, Loading Done
………………
轉載于:https://blog.51cto.com/linuxtro/389019
總結
以上是生活随笔為你收集整理的广播多路访问链路上的OSPF的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 最近老是梦到动物什么预兆
- 下一篇: 女人做梦梦到好多大鱼