Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

Bronze

OSPF - Master/Slave - DR/BDR Election

Routers on the same ethernet segment - during bootup (if running OSPF) does the Master/Slave part happen after the DR/BDR are elected?

Also - If I brought up a new router into that segment (while the other routers are already on and converged) does the master/slave process happen still between this router and the others? I have read a few articles, including the OSPF section in the routing tcp/ip book, but still a bit confused as to when the master/slave happens in relation to the dr/bdr election.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Hi, Whenever router needs to

Hi,

 

Whenever router needs to exchange LSA database, it needs to decide Master/Slave relationship. Now in multiaccess network, all nodes exchange database only with DR/BDR and maintains 2-way neighborship with DRothers.

 

If you add a new router in a multiaccess network where DR/BDR already elected, in 2 way state new router will come to know about DR/BDR and will go for master/slave relationship (Extart state) only with them not with DRother nodes.

 

OSPF neighbor state machine

 

1. Down

2. Init

3. 2-way  ------> DR/BDR election

4. ExStart ------> Master/Slave relationship

5. Exchnage

6. Loading

7. Full

 

-- Pls dont forget to rate helpful posts --

 

Regards,

Akash

8 REPLIES
Cisco Employee

Hi, Whenever router needs to

Hi,

 

Whenever router needs to exchange LSA database, it needs to decide Master/Slave relationship. Now in multiaccess network, all nodes exchange database only with DR/BDR and maintains 2-way neighborship with DRothers.

 

If you add a new router in a multiaccess network where DR/BDR already elected, in 2 way state new router will come to know about DR/BDR and will go for master/slave relationship (Extart state) only with them not with DRother nodes.

 

OSPF neighbor state machine

 

1. Down

2. Init

3. 2-way  ------> DR/BDR election

4. ExStart ------> Master/Slave relationship

5. Exchnage

6. Loading

7. Full

 

-- Pls dont forget to rate helpful posts --

 

Regards,

Akash

New Member

Hi Akash,

Hi Akash,

Good post, so basically the router with interface having a higher IPv4/v6 address (for that particular broadcast or point-to-point segment) would become the master (or the initiator) and would send Database description packets with initiating sequence numbers? 

Thanks

Nage

New Member

Re: Hi, Whenever router needs to

Thank you for your complete explanation قاب گوشی
Bronze

Hi Akash,

Hi Akash, Thanks for the Info. When the new router comes up and goes to exstart state, can the dr/bdr become the slave in this case?
Cisco Employee

Hi, Yes dr/bdr can also

Hi,

 

Yes dr/bdr can also become slave. Election is based on ip address and node with higher ip address becomes Master 

ExStart.
In this state, the router and its neighbor establish a master/slave relationship and determine the initial DD sequence number in preparation for the exchange of Database Description packets. The neighbor with the highest interface address becomes the master.

 

Please see debug outputs below. there is ospf neighborship between R1 (9.0.0.1) and R2(9.0.0.2). Have configured "ip ospf priority 0" on R2 so that it can not become DR/BDR. But still since this router is having higher ip address, it became Master and R1 became Slave.

 

R2_7606B#show ip ospf nei

Neighbor ID     Pri   State           Dead Time   Address         Interface
9.0.0.1           1   FULL/DR         00:00:34    9.9.12.1        GigabitEthernet1/17

 

Aug 29 07:00:07.673: OSPF: 2 Way Communication to 9.0.0.1 on GigabitEthernet1/17, state 2WAY
Aug 29 07:00:07.673: OSPF: Backup seen Event before WAIT timer on GigabitEthernet1/17
Aug 29 07:00:07.673: OSPF: DR/BDR election on GigabitEthernet1/17 
Aug 29 07:00:07.673: OSPF: Elect BDR 0.0.0.0
Aug 29 07:00:07.673: OSPF: Elect DR 9.0.0.1
Aug 29 07:00:07.673:        DR: 9.0.0.1 (Id)   BDR: none 
Aug 29 07:00:07.673: OSPF: GigabitEthernet1/17 Nbr 9.0.0.1: Prepare dbase exchange
Aug 29 07:00:07.673: OSPF: Send DBD to 9.0.0.1 on GigabitEthernet1/17 seq 0x2C8 opt 0x52 flag 0x7 len 32
Aug 29 07:00:07.673: OSPF: Rcv DBD from 9.0.0.1 on GigabitEthernet1/17 seq 0xD62 opt 0x52 flag 0x7 len 32  mtu 1500 state EXSTART
Aug 29 07:00:07.673: OSPF: First DBD and we are not SLAVE

Aug 29 07:00:07.673: OSPF: Rcv DBD from 9.0.0.1 on GigabitEthernet1/17 seq 0x2C8 opt 0x52 flag 0x2 len 272  mtu 1500 state EXSTART
Aug 29 07:00:07.673: OSPF: NBR Negotiation Done. We are the MASTER
Aug 29 07:00:07.673: OSPF: GigabitEthernet1/17 Nbr 9.0.0.1: Summary list built, size 12
Aug 29 07:00:07.673: OSPF: Send DBD to 9.0.0.1 on GigabitEthernet1/17 seq 0x2C9 opt 0x52 flag 0x1 len 272
Aug 29 07:00:07.701: OSPF: Rcv DBD from 9.0.0.1 on GigabitEthernet1/17 seq 0x2C9 opt 0x52 flag 0x0 len 32  mtu 1500 state EXCHANGE
Aug 29 07:00:07.701: OSPF: Exchange Done with 9.0.0.1 on GigabitEthernet1/17
Aug 29 07:00:07.701: OSPF: Synchronized with 9.0.0.1 on GigabitEthernet1/17, state FULL
Aug 29 07:00:07.701: %OSPF-5-ADJCHG: Process 100, Nbr 9.0.0.1 on GigabitEthernet1/17 from LOADING to FULL, Loading Done
Aug 29 07:00:07.701: OSPF: Register neighbor 9.9.12.1 on interface GigabitEthernet1/17 with BFD
Aug 29 07:00:07.701: OSPF: GigabitEthernet1/17 Nbr 9.0.0.1: Clean-up dbase exchange
Aug 29 07:00:08.173: OSPF: Build router LSA for area 0, router ID 9.0.0.2, seq 0x80000552, process 100
Aug 29 07:00:08.477: OSPF: BFD Up event intf GigabitEthernet1/17 nbr 9.9.12.1
Aug 29 07:01:34.230: OSPF: We are not DR to build Net LSA for interface GigabitEthernet1/17
Aug 29 07:01:34.230: OSPF: Build network LSA for GigabitEthernet1/17, router ID 9.0.0.2

 

--Pls dont forget to rate helpful posts--

 

-Akash

 

New Member

Re: Hi, Yes dr/bdr can also

Just to clarify something re. "the neighbour with the highest IP address becomes the master"...

RFC2328 states

...and the neighbor's Router ID is larger than the router's own.  In this case the router is now Slave.

Router ID can be manually set, the highest unshut loopback interface IP address not used in any OSPF process, or the highest unshut non-loopback interface IP address not used in any OSPF process.

Unless this is another of those cases where Cisco choose to ignore the finer points of RFCs, Akash's reply should probably state Router ID rather than IP address.

Re: Hi, Yes dr/bdr can also

          Election is based on ip address and node with higher ip address becomes Master.

Not really. Priority comes first. If priorities are not equal highest priority wins, 0 as it is already said can't become DR or BDR. 

           The neighbor with the highest interface address becomes the master.

and then router ID comes into count (highest interface address is not part of calculation except to elect ospf router-id if router-id is not manually configured (highest loopback and then highest interface IP address))

 

This is topic from 2014 :(

New Member

Re: Hi, Yes dr/bdr can also

Be careful - the original question relates to the negotiation of Master/Slave roles for exchanging LSAs, not the election of a DR.

 

Router ID is set (in order of preference):

1) manually

2) highest unshut loopback interface IP address not used in any OSPF process

3) highest unshut non-loopback interface IP address not used in any OSPF process

 

The DR is elected based upon highest priority (0 - 255, 0 being disabled) then, in the case of a tie, the highest Router ID. This election takes place at the end of the 2-way state.

 

Once two routers have ascertained that they need to exchange LSAs, they must establish who will be the Master and who will be the Slave. This occurs in the ExStart state by an exchange of empty DBDs containing (among other things) Router IDs. The highest Router ID becomes the Master. Hence, contrary to what it's pretty natural to assume, the DR isn't necessarily also the Master.

 

 I know it's an old post, I came across it while trying to confirm these points during revision :-)

3790
Views
39
Helpful
8
Replies