OSPF DR and BDR election

nutech444nutech444 Member Posts: 50 ■■□□□□□□□□
I have a question on the ospf DR/BDR election process, If highest address on a router in a up/up state is not advertised can it still take part in the dr.bdr election process.

Comments

  • XenzXenz Member Posts: 140
    nutech444 wrote: »
    I have a question on the ospf DR/BDR election process, If highest address on a router in a up/up state is not advertised can it still take part in the dr.bdr election process.

    I think you're misunderstanding how the process works. The information needed to determine DR/BDR is in the hello packets. Hello packets are only sent on interfaces that are included in the process.

    The election is first determined by the priority which is set from 1-255. Setting this priority to 0 opts out of all elections and the higher priority wins. If the priority is the same, it uses a RID which is the highest IP address. This IP can be derived from a physical or loopback interface, with the loopback being used over physical interface IP's (for stability purposes).

    *note* Reading your question again, the highest IP address just determines the router ID. If the highest IP is a WAN P2P link where DR/BDR's don't exist and you have no loopback configured, the router ID will be the WAN IP. The interface with the highest IP does not need to participate in the election. Using the highest IP is just simply an ID for the router.
    Currently working on:
    CCNP, 70-620 Vista 70-290 Server 2003
    Packet Tracer activities and ramblings on my blog:
    http://www.sbntech.info
  • nutech444nutech444 Member Posts: 50 ■■□□□□□□□□
    thanks for your reply,
    how is the below possible ?
    lets imagine a network and the show ip ospf int output is below:
    ( only the important portion shown)
    dr RID 198.159.13.94 priority 1 network type boradcast
    bdr RID 225.145.139.15
  • mikej412mikej412 Member Posts: 10,086 ■■■■■■■■■■
    nutech444 wrote: »
    how is the below possible ?
    The OSPF DR/BDR elections are not preemptive.

    The first router to boot will usually get to be the DR (and the 2nd router to boot will be the BDR) unless you've set the priority on the routers not to participate in DR/BDR elections.
    :mike: Cisco Certifications -- Collect the Entire Set!
  • XenzXenz Member Posts: 140
    mikej412 wrote: »
    The OSPF DR/BDR elections are not preemptive.

    The first router to boot will usually get to be the DR (and the 2nd router to boot will be the BDR) unless you've set the priority on the routers not to participate in DR/BDR elections.


    ^ do clear ip ospf process * I believe this will show you the concept.
    Currently working on:
    CCNP, 70-620 Vista 70-290 Server 2003
    Packet Tracer activities and ramblings on my blog:
    http://www.sbntech.info
  • nutech444nutech444 Member Posts: 50 ■■□□□□□□□□
    mikej412 wrote: »
    The OSPF DR/BDR elections are not preemptive.

    The first router to boot will usually get to be the DR (and the 2nd router to boot will be the BDR)

    So the first one that boots gets to be the DR, I dint know that.
    mikej412 wrote: »
    unless you've set the priority on the routers not to participate in DR/BDR elections.

    As mentioned before the dr router has a priority of 1
    , the only other lower possible priority number for the router with the RID 225.145.139.15 is 0 , if that was the case the router could not be elected as a BDR.
  • XenzXenz Member Posts: 140
    If the priority is set to 0, it will not try to be a DR or BDR at all. It opts out of the election. A higher priority will make it the DR. If they are the same priority, it comes down to the router ID which is the highest IP.

    The IP chosen is based off whatever interface has the highest IP in precedence of Loopback > physical (ethernet,serial,etc).

    *note* setting the priority to 0 is important when you get to designs that don't allow neighbor relationships to form. For example, a hub and spoke. The spokes can't form relationships with each other but they can form relationships with the hub. In this case you would only want a DR and no BDR. This is outside of the scope of the CCNA though, but it's an idea to keep in mind.
    Currently working on:
    CCNP, 70-620 Vista 70-290 Server 2003
    Packet Tracer activities and ramblings on my blog:
    http://www.sbntech.info
  • nutech444nutech444 Member Posts: 50 ■■□□□□□□□□
    Xenz wrote: »

    *note* setting the priority to 0 is important when you get to designs that don't allow neighbor relationships to form. For example, a hub and spoke.

    Good Idea however, what happens when then the dr goes down and since the other routers are set to 0 they cannot participate in the re-election and the whole network goes down, that seems to be me a disadvantage of setting the Priority nbr to 0, instead a better idea would be to change the priority nbr of the router you want to rig to be dr to 255.
  • mikej412mikej412 Member Posts: 10,086 ■■■■■■■■■■
    nutech444 wrote: »
    Good Idea however, ....
    There are a couple of OSPF network types that can have a DR -- with a simple Ethernet Segment being just one of them.

    If you configured an OSPF/Frame Relay Hub and Spoke network scenario and gave a spoke router the chance to participate in the DR election you could have network issues when it wins the election (by being the first router to boot or the router who hasn't lost their network connection recently) -- but that's more of a CCNP/BSCI topic.

    For the CCENT/CCNA it's usually enough to put 3 routers on that simple Ethernet segment and shut/no shut interfaces, change the priority, and watch the DR/BDR elections (or lack of elections).
    :mike: Cisco Certifications -- Collect the Entire Set!
  • XenzXenz Member Posts: 140
    What Mike said. It's really outside of the scope of the CCNA and it is CCNP/BSCI related stuff. It's just important to note that a priority of 0 is used in some networks.

    I kind of wanted to throw that out there because I hated when someone would throw out some information but didn't really put any context to it. So instead of telling you just that 0 doesn't allow participation in the election process, I wanted to give you a little bit of an idea why a priority of 0 would be used.

    Hopefully I didn't confuse you or anything. Just figured you'd keep the information stored away in memory if there was some weight attached to it!

    Just one thing about your question though, in a hub and spoke, if the hub goes down the network goes down anyways regardless of any election process to choose a DR/BDR. The notion is that the DR/BDR has a connection to each other router. In a hub and spoke topology, only the hub has connectivity to every spoke router.

    With this connectivity, routers only need to neighbor up to the DR/BDR instead of each other which is cost prohibitive and doesn't scale well. Like Mike has said though, this is really outside of the scope of the CCNA when it comes to what network designs that use only a DR. You should understand basic design for the DR/BDR for CCNA though which I mentioned above about one to all connectivity.
    Currently working on:
    CCNP, 70-620 Vista 70-290 Server 2003
    Packet Tracer activities and ramblings on my blog:
    http://www.sbntech.info
  • tanixtanix Member Posts: 68 ■■□□□□□□□□
    mikej412 wrote: »
    There are a couple of OSPF network types that can have a DR -- with a simple Ethernet Segment being just one of them.

    If you configured an OSPF/Frame Relay Hub and Spoke network scenario and gave a spoke router the chance to participate in the DR election you could have network issues when it wins the election (by being the first router to boot or the router who hasn't lost their network connection recently) -- but that's more of a CCNP/BSCI topic.

    For the CCENT/CCNA it's usually enough to put 3 routers on that simple Ethernet segment and shut/no shut interfaces, change the priority, and watch the DR/BDR elections (or lack of elections).

    I noticed you mentioned that the first to boot will usually become the DR, unless as you stated the priority is set.

    I was working the OSPF lab within Tom Lammle CCNA study guide and he uses 3 routers (he said more is even better) connected via an Ethernet LAN to examine the election process.

    I setup 6 routers and connected them with a switch and applied the books process of setting each interface up and adding each one to the same area 0.

    following is what I used:

    LAB_A 10.1.1.1/24
    LAB_B 10.1.1.2/24
    LAB_C 10.1.1.3/24
    LAB_D 10.1.1.4/24
    LAB_E 10.1.1.5/24
    LAB_F 10.1.1.6/24

    All were default OSPF settings, no changes on initial setup.

    I used GNS3 with 3745's and started each one up in order. Now a couple of times playing with the labs, I saw the result of your mention, that is that first to boot took on the DR/BDR roles.

    As I was thinking about what you said, I began playing with it a bit more. My next start resulted in the correct election process winning out (LAB_F/Lab_E became DR/BDR).

    I then applied the books mention of changing the priority on another router to push its election to DR and then shutting down the current DR interface to start the process.

    It didn't turn out as the book notes. That is, the BDR was moved up to the position of the DR and the router that had its priority increased was moved into the BDR role.

    I went through the process several times and the behavior was the same. That is, the BDR was always promoted to the DR regardless of the priority of any other router. It did select the new BDR based on the priority of that change I made, but it did not select it for the DR position.

    So, now I am a little confused. Maybe I didn't read something right in the book concerning the behavior of the election process, but here is what I have concluded based on my lab.

    Once the election chooses a DR/BDR, the process of election (after the DR goes down) seems for choosing the next BDR replacement while it promotes its current BDR to DR.

    The only way I can figure to promote a router to DR that isn't currently the BDR is to first change its priority to insure it will be the guaranteed selection for DR academically (as the book was suggesting). Then, to shut down the DR, letting the process shift the roles BDR->DR and router with priority change->BDR, and then again, shut down the newly promoted DR to finally push the router with the highest priority into the DR position. The other option I guess would be to shut down both the BDR and the DR forcing the correct change to happen at once.

    Am I missing something? Should one be able to promote a router to DR by simply raising its priority and then shutting down the current DR? Or is what I observed the proper process and therefore the steps to achieving that role?

    I only have 2 physical routers so haven't been able to try it fully out of simulation, though I guess I could attempt it by linking one of my virtual routers to my physical ones to see if the behavior is the same. Anyway, any input would be greatly appreciated.
  • mikej412mikej412 Member Posts: 10,086 ■■■■■■■■■■
    tanix wrote: »
    the BDR was moved up to the position of the DR and the router that had its priority increased was moved into the BDR role.
    That is the expected behavior -- that's why there is a BDR.

    If the BDR didn't step up immediately to become the DR, then there would be no purpose to having one (though in the hub & spoke scenario you see the BDR isn't required to exist).

    When the DR dies (or takes the day off), the BDR takes over and the other routers battle to become the new BDR.
    :mike: Cisco Certifications -- Collect the Entire Set!
  • networker050184networker050184 Mod Posts: 11,962 Mod
    As Mike pointed out, thats normal behavior. The election process always chooses the BDR first, and then promotes it to the DR. Then another BDR is elected and stays the BDR. A little confusing, and probably a little more information then you will need for the CCNA or CCNP for that matter.


    I was actually doing some research on DR/BDR elections the other day for an issue I ran into so I have some test output laying around ;)
    *Mar  1 00:05:28.343: OSPF: DR/BDR election on FastEthernet0/0.21
    *Mar  1 00:05:28.347: OSPF: Elect BDR 10.1.1.2
    *Mar  1 00:05:28.347: OSPF: Elect DR 10.1.1.2
    *Mar  1 00:05:28.351: OSPF: Elect BDR 10.1.1.1
    *Mar  1 00:05:28.351: OSPF: Elect DR 10.1.1.2
    *Mar  1 00:05:28.355:        DR: 10.1.1.2 (Id)   BDR: 10.1.1.1 (Id)
    
    An expert is a man who has made all the mistakes which can be made.
  • tanixtanix Member Posts: 68 ■■□□□□□□□□
    I was actually doing some research on DR/BDR elections the other day for an issue I ran into so I have some test output laying around ;)
    *Mar  1 00:05:28.343: OSPF: DR/BDR election on FastEthernet0/0.21
    *Mar  1 00:05:28.347: OSPF: Elect BDR 10.1.1.2
    *Mar  1 00:05:28.347: OSPF: Elect DR 10.1.1.2
    *Mar  1 00:05:28.351: OSPF: Elect BDR 10.1.1.1
    *Mar  1 00:05:28.351: OSPF: Elect DR 10.1.1.2
    *Mar  1 00:05:28.355:        DR: 10.1.1.2 (Id)   BDR: 10.1.1.1 (Id)
    

    Interesting, if I am reading that right, it promoted it through the process from BDR then DR rather than the election simply being to establish the DR?

    So then, the DR will always promote from the BDR (in terms of the setup I had) and then it will establish a new BDR?


    That is, if the DR and BDR are already elected, and I change the priority on a DROTHER higher than the DR. Then shut down the current DR interface, the result would be the BDR promoted to DR and the DROTHER with the high priority promoted to BDR regardless of the fact that the DROTHER has a higher priority than the BDR that was promoted to DR?

    So if my book took the same exact example and expected the DROTHER to have taken on the position of DR, then the book would be in error then?
  • networker050184networker050184 Mod Posts: 11,962 Mod
    tanix wrote: »
    Interesting, if I am reading that right, it promoted it through the process from BDR then DR rather than the election simply being to establish the DR?

    Correct. The election always elects a BDR. If there is no DR then the BDR is promoted.
    tanix wrote: »
    So then, the DR will always promote from the BDR (in terms of the setup I had) and then it will establish a new BDR?

    Yes, as before if the DR fails the BDR is promoted and then an election is held for the next BDR.
    tanix wrote: »
    That is, if the DR and BDR are already elected, and I change the priority on a DROTHER higher than the DR. Then shut down the current DR interface, the result would be the BDR promoted to DR and the DROTHER with the high priority promoted to BDR regardless of the fact that the DROTHER has a higher priority than the BDR that was promoted to DR?

    Yep.
    tanix wrote: »
    So if my book took the same exact example and expected the DROTHER to have taken on the position of DR, then the book would be in error then?

    I guess, don't have your book in front of me to review it.
    An expert is a man who has made all the mistakes which can be made.
  • mikej412mikej412 Member Posts: 10,086 ■■■■■■■■■■
    tanix wrote: »
    That is, if the DR and BDR are already elected, and I change the priority on a DROTHER higher than the DR. Then shut down the current DR interface, the result would be the BDR promoted to DR and the DROTHER with the high priority promoted to BDR regardless of the fact that the DROTHER has a higher priority than the BDR that was promoted to DR?
    Correct.
    tanix wrote: »
    So if my book took the same exact example and expected the DROTHER to have taken on the position of DR, then the book would be in error then?
    Correct, the book would be in error.

    When there is a BDR, it gets promoted to DR. Then an election is held for a new BDR.

    The DR/BDR positions are not preemptive. Which ever router is in the position stays in the position until something happens to it (it dies, you reboot, you shut down the interface, you clear the ospf process on newer IOS images, etc).

    If the BDR dies, an election is held just for the BDR position. The existing DR stays the DR and doesn't care if you've added a new router with a better priority.
    :mike: Cisco Certifications -- Collect the Entire Set!
  • mikem2temikem2te Member Posts: 407
    Not trying to hijack a thread but-

    Watching this thread I've been wondering what happens if there are two ospf networks, same area, same network prefix etc. Each network has a DR & BDR elected. If the two networks are then connected together there will now be two DRs and two BDRs. I'm just wondering what OSPF would do.

    I'll have to fire up the lab on the weekend and have a play.
    Blog : http://www.caerffili.co.uk/

    Previous : Passed Configuring Microsoft Office SharePoint Server 2007 (70-630)
    Currently : EIGRP & OSPF
    Next : CCNP Route
  • networker050184networker050184 Mod Posts: 11,962 Mod
    mikem2te wrote: »
    Not trying to hijack a thread but-

    Watching this thread I've been wondering what happens if there are two ospf networks, same area, same network prefix etc. Each network has a DR & BDR elected. If the two networks are then connected together there will now be two DRs and two BDRs. I'm just wondering what OSPF would do.

    I'll have to fire up the lab on the weekend and have a play.

    I was curious so I labbed it up in my test bed. The routers start to go crazy doing new elections and eventually settle down and elect a new DR/BDR with everyone involved. The whole proccess took about 10 seconds in dynamips, so take that time with a grain of salt.

    This is the set up I used.
    R1-------                                  -------- R3
    
                     SW1 ------  SW2        
    
    R2 -------                                  -------- R4
    

    All four routers ethernet interfaces in the same subnet with OSPF enabled. I left the link between the switches shutdown and let each side (R1 - R2 and R3 - R4) form their neighbors and their own little election. Once everything setteled down, R1 DR R2 BDR and R3 DR R4 BDR. I then no shut the trunk and let them do their thing. In the end there ended up being like three more elections, and DR/BDR was reelected as normal.

    I have debug output if anyone is interested in seeing it. The only line of real interest I saw was this though that differed from a normal election.
    *Mar  1 00:10:53.591: OSPF: Include link to old DR on FastEthernet0/0
    

    EDIT: Excuse my awesome diagram. I think you get the point!
    An expert is a man who has made all the mistakes which can be made.
  • tanixtanix Member Posts: 68 ■■□□□□□□□□
    Thank you guys very much.

    I know it probably sounded like overkill with me trying to get clarification, but this little fact, though maybe blatantly obvious for most, kept me a bit on the self questioning side.

    Lammle's book for the most part has been excellent though. I can say for me personally, his explanation and tricks to subnetting in your head were priceless though. Makes me want to send hate mail to the MS Press books for bodging the concept up. *chuckle*

    Anyway, thanks again.
Sign In or Register to comment.