主頁 >  其他 > HCNA Routing&Switching之動態路由協議OSPF DR和BDR

HCNA Routing&Switching之動態路由協議OSPF DR和BDR

2021-07-25 06:09:43 其他

  前文我們了解了OSPF建立鄰居關系的條件,回顧請參考https://www.cnblogs.com/qiuhom-1874/p/15032907.html;今天我們來聊一聊OSPF中的DR和BDR;

  在說DR和BDR之前我們先來了解下OSPF的網路型別;

  首先OSPF的網路型別是基于介面來劃分,其次OSPF的網路型別是通過介面的二層封裝報文的方式進行了劃分,默認情況下OSPF把介面二層是以太網封裝的網路稱為廣播型別,把介面二層是PPP或者HDLC封裝的網路稱為點到點型別;

  在生活中,廣播就是一個人說話,在同一個房間里的其他人都可以聽到;在網路里,廣播和這個類似;一個網路設備在一個廣播域發送一條廣播報文,在同一個廣播域的所有設備都能收到該設備的廣播;這樣一來我們要想和其中的一臺設備通訊怎么通訊呢?在二層為以太網封裝的廣播型別網路里,它是通過二層以太網封裝目標MAC和源MAC;其原因是ip地址是變化的,如果單純的使用ip地址不能夠準確的標識某一臺設備(因為ip地址是變化的),而MAC地址是設備的硬體地址,這個地址是設備出廠時就固定了,況且不會發生變化;所以確定一臺設備的唯一性,我們可以通過MAC地址;有了通信雙方的mac地址再結合三層的ip地址,我們就可以準確的將對應資料包發送給對方;

  對于點到點型別的網路,其二層就不需要封裝MAC地址,一條鏈路上就只有兩個端點,在A端點發送資料B端點就一定能收到;

  提示:廣播型別的介面是以太網型別介面(就是我們常常看到的網口),而點到點型別的介面是串口;

  在點對點型別的網路中,基于介面封裝的不同又可以分非廣播多路訪問和點到多點,如下圖

  提示:默認情況下,OSPF認為幀中繼(FR)、異步傳輸(ATM)的網路型別為NBMA;在幀中繼網路里非廣播多路訪問和以太網中的廣播型別,兩者有一個相同的特點,就是都可以接多個設備;不同點是以太網二層封裝需要封裝mac地址,支持廣播發送,而幀中繼網路二層不需要封裝mac地址,其原因是它不支持廣播;不支持廣播就意味著在ospf里不支持組播;不支持組播也就是說幀中繼網路里,ospf只能通過單播的方式建立鄰居;

  實驗:如下圖兩個拓撲,R1和R2為以太網型別介面,R3和R4為串口介面,在兩個實驗環境中配置ospf,抓包看看兩者發送到hello包有什么不同

  配置R1

sys
sys R1
int g0/0/0
ip add 12.0.0.1 24
ospf 1 router-id 1.1.1.1
area 0
net 12.0.0.1 0.0.0.0
dis ip int b
View Code

  配置R2

sys
sys R2
int g0/0/0
ip add 12.0.0.2 24
ospf 1 router-id 2.2.2.2
area 0
net 12.0.0.2 0.0.0.0
dis ip int b
View Code

  配置R3

sys
sys R3
int s4/0/0
ip add 34.0.0.3 24
ospf 1 router-id 3.3.3.3
area 0
net 34.0.0.3 0.0.0.0
dis ip int b
View Code

  配置R4

sys
sys R4
int s4/0/0
ip add 34.0.0.4 24
ospf 1 router-id 4.4.4.4
area 0
net 34.0.0.4 0.0.0.0
dis ip int b
View Code

  在R1或R2上抓包

  在R3或R4上抓包

  提示:默認情況串口鏈路的二層封裝為ppp型別,這里抓包就選擇ppp鏈路型別即可;

  提示:從上面的抓包情況可以看到,在以太網封型別的網路環境下抓包,其二層封裝了目標mac和源mac,而在點到點型別的網路環境下抓包,其二層就不是使用以太網協議而是用ppp協議,并且資料包里面也沒有封裝mac地址;

  驗證:查看對應ospf網路型別

  在R1或R2上驗證相關介面的網路型別

  在R3或R4上驗證相關介面的網路型別

  更改R3的s4/0/0的鏈路封裝為FR,看看對應的介面型別是什么

  提示:可以看到修改了R3的s4/0/0介面的封裝為FR以后,對應ospf就down掉了;并且對應介面的型別就變為了NBMA(非廣播多路訪問);

  OSPF DR和BDR

  DR和BDR的作用

  在上述的網路型別中,在多路訪問網路型別中跑OSPF,每個路由器都會和其他路由器建立鄰居,一個路由器發送一條鏈路更新,其他路由器都會跟著確認,這樣一來,每個路由器都要經過兩兩的互動和確認,在一定程度上會帶來路由器的性能的開銷(hello包,DD,LSR,LSU,LSACK這些包過多,增加路由器的處理壓力,從而導致路由器的性能降低);為了降低資料包的交換,在OSPF中會選舉DR和BDR;如下圖

  提示:廣播型網路MA和NBMA網路中,為了減少鄰接關系的數量,從而減少資料包交換,次數,最終節省帶寬,降低對路由器處理能力的壓力,選舉DR和BDR,

  相關術語概述

  DR:Designed Router,指定路由器,類似班長、總經理;

  BDR:Backup DR,備用DR,類似副班長、副總經理;

  DRouthers:類似普通學生、普通員工;

  三者的關系:DR、BDR、DRothers之間都保持鄰接關系(Full),DRothers之間保持鄰居關系(Two-Way);

  通信地址:224.0.0.6向DR和BDR發送鏈路狀態更新,224.0.0.5向所有OSPF路由器發送;

  DR選舉規則

  1、首先比較Hello報文中攜帶的優先級,優先級范圍是0-255,默認情況下都是1;優先級最高的被選舉為DR,優先級次高的被選舉為BDR;優先級為0的不參與選舉;

  2、如果優先級相同的情況下,比較Router id,router id 越大越優先;

  3、選舉不具有搶占性,除非當DR和BDR都失效或重啟OSPF行程;

  提示:DRothers的LSU向DR或BDR通過224.0.0.6發送,然后DR收到DRothers發送到LSU以后,會將對應的LSU通過224.0.0.5向其他路由器發送,其他路由器收到DR發送LSU以后,BDR向224.0.0.5直接確認,而DBothers則通過224.0.0.6向DR確認;總結一句話就是從DR或BDR發出的資料包都是發往224.0.0.5,DR和BDR都會監聽224.0.0.6這個地址;DRothers發出的資料會通過224.0.0.6向DR或BDR發送;

  實驗:如下圖,全網運行ospf,看看對應的資料包會這么發送,對應路由器之間是什么關系

  配置R1

sys
sys R1
int g0/0/0
ip add 1.0.0.1 24
ospf 1 router-id 1.1.1.1
a 0
net 1.0.0.0 0.0.0.255
dis ip int b
dis ospf peer brief
View Code

  在R1上查看g0/0/0的介面資訊,看看誰是DR和BDR

  提示:可以看到只配置了R1上的OSPF以后,對應DR就是它自己,因為此時沒有其他設備和它競選DR,所以只有它是DR;對于BDR來說,它不知道,因為目前就只有它自己在ospf里面,沒有看到其他設備;

  配置R2

sys
sys R2
int g0/0/0
ip add 1.0.0.2 24
ospf 1 router-id 2.2.2.2
a 0
net 1.0.0.0 0.0.0.255
dis ip int b
dis ospf peer brief
View Code
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 1.0.0.2 24
[R2-GigabitEthernet0/0/0]ospf 1 rout
Jul 24 2021 12:08:39-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R2-GigabitEthernet0/0/0]ospf 1 router-id 2.2.2.2
[R2-ospf-1]a 0
[R2-ospf-1-area-0.0.0.0]net 1.0.0.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]dis ip int b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 2
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 2
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              1.0.0.2/24           up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)     
[R2-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:08:44-08:00 R2 %%01OSPF/4/NBR_CHANGE_E(l)[1]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.0.1, NeighborEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) 
[R2-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:08:44-08:00 R2 %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.0.1, NeighborEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=2Way) 
[R2-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:08:44-08:00 R2 %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.0.1, NeighborEvent=AdjOk?, NeighborPreviousState=2Way, NeighborCurrentState=ExStart) 
[R2-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:08:44-08:00 R2 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.0.1, NeighborEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exchange) 
[R2-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:08:44-08:00 R2 %%01OSPF/4/NBR_CHANGE_E(l)[5]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.0.1, NeighborEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loading) 
[R2-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:08:44-08:00 R2 %%01OSPF/4/NBR_CHANGE_E(l)[6]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.0.1, NeighborEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) 
[R2-ospf-1-area-0.0.0.0]dis ospf peer brief

         OSPF Process 1 with Router ID 2.2.2.2
                  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          GigabitEthernet0/0/0             1.1.1.1          Full        
 ----------------------------------------------------------------------------
[R2-ospf-1-area-0.0.0.0]

  提示:可以看到當R2配置好ospf以后,它會和R1先建立其鄰接關系;

  再次在R1上查看g0/0/0的介面資訊,看看此時誰是DR和BDR

  提示:此時可以看到DR是R1的介面ip地址,BDR是R2的介面地址;

  配置R3

sys
sys R3
int g0/0/0
ip add 1.0.0.3 24
ospf 1 router-id 3.3.3.3
a 0
net 1.0.0.0 0.0.0.255
dis ip int b
dis ospf peer brief
View Code
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 1.0.0.3 24
Jul 24 2021 12:14:41-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R3-GigabitEthernet0/0/0]ospf 1 router-id 3.3.3.3
[R3-ospf-1]a 0
[R3-ospf-1-area-0.0.0.0]net 1.0.0.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]dis ip int b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 2
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 2
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              1.0.0.3/24           up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)     
[R3-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:14:45-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[1]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.0.1, NeighborEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) 
[R3-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:14:45-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.0.1, NeighborEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=2Way) 
[R3-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:14:46-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=2.0.0.1, NeighborEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) 
[R3-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:14:46-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=2.0.0.1, NeighborEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=2Way) 
[R3-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:14:46-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[5]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.0.1, NeighborEvent=AdjOk?, NeighborPreviousState=2Way, NeighborCurrentState=ExStart) 
[R3-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:14:46-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[6]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=2.0.0.1, NeighborEvent=AdjOk?, NeighborPreviousState=2Way, NeighborCurrentState=ExStart) 
[R3-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:14:46-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[7]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.0.1, NeighborEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exchange) 
[R3-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:14:46-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[8]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=2.0.0.1, NeighborEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exchange) 
[R3-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:14:46-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[9]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.0.1, NeighborEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loading) 
[R3-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:14:46-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[10]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.0.1, NeighborEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) 
[R3-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:14:46-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[11]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=2.0.0.1, NeighborEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loading) 
[R3-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:14:46-08:00 R3 %%01OSPF/4/NBR_CHANGE_E(l)[12]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=2.0.0.1, NeighborEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) 
[R3-ospf-1-area-0.0.0.0]dis ospf peer brief

         OSPF Process 1 with Router ID 3.3.3.3
                  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          GigabitEthernet0/0/0             1.1.1.1          Full        
 0.0.0.0          GigabitEthernet0/0/0             2.2.2.2          Full        
 ----------------------------------------------------------------------------
[R3-ospf-1-area-0.0.0.0]

  提示:可以看到當R3配置好以后,對應R3和R1和R2都建立起鄰接關系;

  查看R3g0/0/0介面資訊,看看DR和BDR變化沒有?

  提示:之所以DR和BDR沒有發生變化,其原因是ospf已經選好了DR和BDR,而DR和BDR的選舉是非搶占性,一旦選好,就不變了,除非重啟ospf行程(所有路由器)來觸發DR和BDR的重新選舉;

  配置R4

sys
sys R4
int g0/0/0
ip add 1.0.0.4 24
ospf 1 router-id 4.4.4.4
a 0
net 1.0.0.0 0.0.0.255
dis ip int b
dis ospf peer brief
View Code
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R4
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 1.0.0.4 24
Jul 24 2021 12:20:57-08:00 R4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R4-GigabitEthernet0/0/0]ospf 1 router-id 4.4.4.4
[R4-ospf-1]a 0
[R4-ospf-1-area-0.0.0.0]net 1.0.0.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]dis ip int b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 2
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 2
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              1.0.0.4/24           up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)     
[R4-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:21:02-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[1]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=2.0.0.1, NeighborEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) 
[R4-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:21:02-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[2]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=2.0.0.1, NeighborEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=2Way) 
[R4-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:21:02-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[3]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=2.0.0.1, NeighborEvent=AdjOk?, NeighborPreviousState=2Way, NeighborCurrentState=ExStart) 
[R4-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:21:02-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[4]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=2.0.0.1, NeighborEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exchange) 
[R4-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:21:02-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[5]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=2.0.0.1, NeighborEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loading) 
[R4-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:21:02-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[6]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=2.0.0.1, NeighborEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) 
[R4-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:21:04-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[7]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.0.1, NeighborEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) 
[R4-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:21:04-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[8]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.0.1, NeighborEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=2Way) 
[R4-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:21:04-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[9]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.0.1, NeighborEvent=AdjOk?, NeighborPreviousState=2Way, NeighborCurrentState=ExStart) 
[R4-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:21:05-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[10]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.0.1, NeighborEvent=NegotiationDone, NeighborPreviousState=ExStart, NeighborCurrentState=Exchange) 
[R4-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:21:05-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[11]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.0.1, NeighborEvent=ExchangeDone, NeighborPreviousState=Exchange, NeighborCurrentState=Loading) 
[R4-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:21:05-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[12]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.0.1, NeighborEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) 
[R4-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:21:06-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[13]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=3.0.0.1, NeighborEvent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init) 
[R4-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:21:06-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[14]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=3.0.0.1, NeighborEvent=2WayReceived, NeighborPreviousState=Init, NeighborCurrentState=2Way) 
[R4-ospf-1-area-0.0.0.0]dis ospf peer brief
Jul 24 2021 12:21:06-08:00 R4 %%01OSPF/4/NBR_CHANGE_E(l)[15]:Neighbor changes event: neighbor status changed. (ProcessId=256, NeighborAddress=3.0.0.1, NeighborEvent=AdjOk?, NeighborPreviousState=2Way, NeighborCurrentState=2Way) 
[R4-ospf-1-area-0.0.0.0]dis ospf peer brief

         OSPF Process 1 with Router ID 4.4.4.4
                  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          GigabitEthernet0/0/0             1.1.1.1          Full        
 0.0.0.0          GigabitEthernet0/0/0             2.2.2.2          Full        
 0.0.0.0          GigabitEthernet0/0/0             3.3.3.3          2-Way       
 ----------------------------------------------------------------------------
[R4-ospf-1-area-0.0.0.0]

  提示:可以看到當R4配置好以后,對應R4和R1(DR),R2(BDR)是鄰接關系;而和R3(DRothers)建立的鄰居關系;

  驗證:在R1上發布更新,抓包看看對應的資料包會怎么發送和確認?

  提示:可以看到當R1(DR)發送LSU時,它會直接向224.0.0.5發送;其中R2(BDR)向224.0.0.5確認;R3(DRothers)和R4(DRothers)向224.0.0.6確認;

  驗證:在R2上發送LSU,看看對應資料包會這么發送和確認的呢?

  提示:可以看到當R2(BDR)發送LSU時,它和R1發送LSU一樣直接向224.0.0.5發送LSU,對應R1(DR)直接向224.0.0.5確認;R3、R4(DRother)向224.0.0.6確認;

  驗證:當R3發送LSU,看看對應資料包會這么發送和確認呢?

  提示:可以看到當R3(DRother)發送LSU時,它首先會把LSU通過224.0.0.6向R1(DR)發送,當R1(DR)收到R3發送的LSU,它會通過224.0.0.5向其他路由器發送LSU(不會再發送給R3);R2(BDR)收到LSU向224.0.0.5確認,R4(DRother)向224.0.0.6確認;

  驗證:當R4 發送LSU時,看看對應資料包會怎么發送和確認呢?

  提示:可以看到R4(DRother)發送LSU和R3(DRother)發送LSU一樣;首先它會把LSU發送給R1(DR),然后由R1(DR)再向其他路由器發送LSU;BDR(R2)直接向224.0.0.5確認;DRother(R3)向224.0.0.6確認;

  驗證:全網重啟ospf行程,看看對應的DR和BDR是否會重新選舉?

  提示:可以看到4個路由器分別重新啟動了ospf以后,重置ospf 行程以后,R4當選為DR,R3當選為BDR;因為重啟ospf行程對應的鄰居和鄰接關系又重新建立,此時4個路由器首先會比較對應的hello包里的優先級,默認情況下優先級都是1 ,此時優先級一樣,會比較router id,router id誰大誰就是DR,次大者就為BDR,剩下沒有被選舉成DR或BDR的就淪為DRother;R4的router id為4.4.4.4 是4個路由器中最大的,所以R4當選DR,R3的router id為3.3.3.3 ,第二大,所以當選BDR;

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/289817.html

標籤:其他

上一篇:嵌入式工程師的生活生活是怎樣的?或者做單片機的 和程式員的生活一樣嗎?

下一篇:HCNA Routing&Switching之動態路由協議OSPF DR和BDR

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • 網閘典型架構簡述

    網閘架構一般分為兩種:三主機的三系統架構網閘和雙主機的2+1架構網閘。 三主機架構分別為內端機、外端機和仲裁機。三機無論從軟體和硬體上均各自獨立。首先從硬體上來看,三機都用各自獨立的主板、記憶體及存盤設備。從軟體上來看,三機有各自獨立的作業系統。這樣能達到完全的三機獨立。對于“2+1”系統,“2”分為 ......

    uj5u.com 2020-09-10 02:00:44 more
  • 如何從xshell上傳檔案到centos linux虛擬機里

    如何從xshell上傳檔案到centos linux虛擬機里及:虛擬機CentOs下執行 yum -y install lrzsz命令,出現錯誤:鏡像無法找到軟體包 前言 一、安裝lrzsz步驟 二、上傳檔案 三、遇到的問題及解決方案 總結 前言 提示:其實很簡單,往虛擬機上安裝一個上傳檔案的工具 ......

    uj5u.com 2020-09-10 02:00:47 more
  • 一、SQLMAP入門

    一、SQLMAP入門 1、判斷是否存在注入 sqlmap.py -u 網址/id=1 id=1不可缺少。當注入點后面的引數大于兩個時。需要加雙引號, sqlmap.py -u "網址/id=1&uid=1" 2、判斷文本中的請求是否存在注入 從文本中加載http請求,SQLMAP可以從一個文本檔案中 ......

    uj5u.com 2020-09-10 02:00:50 more
  • Metasploit 簡單使用教程

    metasploit 簡單使用教程 浩先生, 2020-08-28 16:18:25 分類專欄: kail 網路安全 linux 文章標簽: linux資訊安全 編輯 著作權 metasploit 使用教程 前言 一、Metasploit是什么? 二、準備作業 三、具體步驟 前言 Msfconsole ......

    uj5u.com 2020-09-10 02:00:53 more
  • 游戲逆向之驅動層與用戶層通訊

    驅動層代碼: #pragma once #include <ntifs.h> #define add_code CTL_CODE(FILE_DEVICE_UNKNOWN,0x800,METHOD_BUFFERED,FILE_ANY_ACCESS) /* 更多游戲逆向視頻www.yxfzedu.com ......

    uj5u.com 2020-09-10 02:00:56 more
  • 北斗電力時鐘(北斗授時服務器)讓網路資料更精準

    北斗電力時鐘(北斗授時服務器)讓網路資料更精準 北斗電力時鐘(北斗授時服務器)讓網路資料更精準 京準電子科技官微——ahjzsz 近幾年,資訊技術的得了快速發展,互聯網在逐漸普及,其在人們生活和生產中都得到了廣泛應用,并且取得了不錯的應用效果。計算機網路資訊在電力系統中的應用,一方面使電力系統的運行 ......

    uj5u.com 2020-09-10 02:01:03 more
  • 【CTF】CTFHub 技能樹 彩蛋 writeup

    ?碎碎念 CTFHub:https://www.ctfhub.com/ 筆者入門CTF時時剛開始刷的是bugku的舊平臺,后來才有了CTFHub。 感覺不論是網頁UI設計,還是題目質量,賽事跟蹤,工具軟體都做得很不錯。 而且因為獨到的金幣制度的確讓人有一種想去刷題賺金幣的感覺。 個人還是非常喜歡這個 ......

    uj5u.com 2020-09-10 02:04:05 more
  • 02windows基礎操作

    我學到了一下幾點 Windows系統目錄結構與滲透的作用 常見Windows的服務詳解 Windows埠詳解 常用的Windows注冊表詳解 hacker DOS命令詳解(net user / type /md /rd/ dir /cd /net use copy、批處理 等) 利用dos命令制作 ......

    uj5u.com 2020-09-10 02:04:18 more
  • 03.Linux基礎操作

    我學到了以下幾點 01Linux系統介紹02系統安裝,密碼啊破解03Linux常用命令04LAMP 01LINUX windows: win03 8 12 16 19 配置不繁瑣 Linux:redhat,centos(紅帽社區版),Ubuntu server,suse unix:金融機構,證券,銀 ......

    uj5u.com 2020-09-10 02:04:30 more
  • 05HTML

    01HTML介紹 02頭部標簽講解03基礎標簽講解04表單標簽講解 HTML前段語言 js1.了解代碼2.根據代碼 懂得挖掘漏洞 (POST注入/XSS漏洞上傳)3.黑帽seo 白帽seo 客戶網站被黑帽植入劫持代碼如何處理4.熟悉html表單 <html><head><title>TDK標題,描述 ......

    uj5u.com 2020-09-10 02:04:36 more
最新发布
  • 2023年最新微信小程式抓包教程

    01 開門見山 隔一個月發一篇文章,不過分。 首先回顧一下《微信系結手機號資料庫被脫庫事件》,我也是第一時間得知了這個訊息,然后跟蹤了整件事情的經過。下面是這起事件的相關截圖以及近日流出的一萬條資料樣本: 個人認為這件事也沒什么,還不如關注一下之前45億快遞資料查詢渠道疑似在近日復活的訊息。 訊息是 ......

    uj5u.com 2023-04-20 08:48:24 more
  • web3 產品介紹:metamask 錢包 使用最多的瀏覽器插件錢包

    Metamask錢包是一種基于區塊鏈技術的數字貨幣錢包,它允許用戶在安全、便捷的環境下管理自己的加密資產。Metamask錢包是以太坊生態系統中最流行的錢包之一,它具有易于使用、安全性高和功能強大等優點。 本文將詳細介紹Metamask錢包的功能和使用方法。 一、 Metamask錢包的功能 數字資 ......

    uj5u.com 2023-04-20 08:47:46 more
  • vulnhub_Earth

    前言 靶機地址->>>vulnhub_Earth 攻擊機ip:192.168.20.121 靶機ip:192.168.20.122 參考文章 https://www.cnblogs.com/Jing-X/archive/2022/04/03/16097695.html https://www.cnb ......

    uj5u.com 2023-04-20 07:46:20 more
  • 從4k到42k,軟體測驗工程師的漲薪史,給我看哭了

    清明節一過,盲猜大家已經無心上班,在數著日子準備過五一,但一想到銀行卡里的余額……瞬間心情就不美麗了。最近,2023年高校畢業生就業調查顯示,本科畢業月平均起薪為5825元。調查一出,便有很多同學表示自己又被平均了。看著這一資料,不免讓人想到前不久中國青年報的一項調查:近六成大學生認為畢業10年內會 ......

    uj5u.com 2023-04-20 07:44:00 more
  • 最新版本 Stable Diffusion 開源 AI 繪畫工具之中文自動提詞篇

    🎈 標簽生成器 由于輸入正向提示詞 prompt 和反向提示詞 negative prompt 都是使用英文,所以對學習母語的我們非常不友好 使用網址:https://tinygeeker.github.io/p/ai-prompt-generator 這個網址是為了讓大家在使用 AI 繪畫的時候 ......

    uj5u.com 2023-04-20 07:43:36 more
  • 漫談前端自動化測驗演進之路及測驗工具分析

    隨著前端技術的不斷發展和應用程式的日益復雜,前端自動化測驗也在不斷演進。隨著 Web 應用程式變得越來越復雜,自動化測驗的需求也越來越高。如今,自動化測驗已經成為 Web 應用程式開發程序中不可或缺的一部分,它們可以幫助開發人員更快地發現和修復錯誤,提高應用程式的性能和可靠性。 ......

    uj5u.com 2023-04-20 07:43:16 more
  • CANN開發實踐:4個DVPP記憶體問題的典型案例解讀

    摘要:由于DVPP媒體資料處理功能對存放輸入、輸出資料的記憶體有更高的要求(例如,記憶體首地址128位元組對齊),因此需呼叫專用的記憶體申請介面,那么本期就分享幾個關于DVPP記憶體問題的典型案例,并給出原因分析及解決方法。 本文分享自華為云社區《FAQ_DVPP記憶體問題案例》,作者:昇騰CANN。 DVPP ......

    uj5u.com 2023-04-20 07:43:03 more
  • msf學習

    msf學習 以kali自帶的msf為例 一、msf核心模塊與功能 msf模塊都放在/usr/share/metasploit-framework/modules目錄下 1、auxiliary 輔助模塊,輔助滲透(埠掃描、登錄密碼爆破、漏洞驗證等) 2、encoders 編碼器模塊,主要包含各種編碼 ......

    uj5u.com 2023-04-20 07:42:59 more
  • Halcon軟體安裝與界面簡介

    1. 下載Halcon17版本到到本地 2. 雙擊安裝包后 3. 步驟如下 1.2 Halcon軟體安裝 界面分為四大塊 1. Halcon的五個助手 1) 影像采集助手:與相機連接,設定相機引數,采集影像 2) 標定助手:九點標定或是其它的標定,生成標定檔案及內參外參,可以將像素單位轉換為長度單位 ......

    uj5u.com 2023-04-20 07:42:17 more
  • 在MacOS下使用Unity3D開發游戲

    第一次發博客,先發一下我的游戲開發環境吧。 去年2月份買了一臺MacBookPro2021 M1pro(以下簡稱mbp),這一年來一直在用mbp開發游戲。我大致分享一下我的開發工具以及使用體驗。 1、Unity 官網鏈接: https://unity.cn/releases 我一般使用的Apple ......

    uj5u.com 2023-04-20 07:40:19 more