OSPF · Topic 2 of 5

Adjacencies, Neighbors and the DR and BDR

Learn OSPF neighbor states from Down to Full, network types, and how the designated router and backup designated router are elected on Junos for JN0-352.

  • 5 min
In a nutshell
  • Neighbor states: Down, Init, 2Way, ExStart, Exchange, Loading, Full.
  • Full adjacency is formed only with the DR and BDR on a broadcast segment; DROthers stay 2Way.
  • Election: highest priority, then highest router ID; priority 0 is not eligible.

What it is

An OSPF neighbor is another OSPF router on the same link that you have exchanged Hello packets with. An adjacency is a deeper relationship: two neighbors that have also synchronized their link state databases. Only adjacent routers exchange LSAs.

On a broadcast segment such as Ethernet, forming an adjacency between every pair of routers would create too many. OSPF elects a designated router (DR) and a backup designated router (BDR). Every other router becomes adjacent only with those two.

Downhello seenInitown ID in hello2WayDR electiondatabase exchange startsExStartDBDs sentExchangeLSAs requestedLoadingall LSAs receivedFull

How it works

Neighbor states

StateMeaning
DownNo Hello received
InitA Hello was received, but it does not list this router's ID yet
2WayBoth routers see each other in Hellos; the DR and BDR are elected here
ExStartThe master and slave for the database exchange are chosen
ExchangeDatabase description packets summarize the LSDB
LoadingLink state requests and updates fetch the missing LSAs
FullThe databases are synchronized; the adjacency is complete

The states are shown by show ospf neighbor:

user@router> show ospf neighbor
Address          Interface              State     ID               Pri  Dead
10.1.1.2         ge-0/0/1.0             Full      10.255.0.2       128    35
10.1.1.3         ge-0/0/1.0             2Way      10.255.0.3       100    33

The second line is normal on a broadcast segment. Two routers that are neither the DR nor the BDR (called DROthers) stay at 2Way with each other. Only the DR and BDR reach Full with everyone.

What must match for a neighbor to form

  • Same area ID on the link.
  • Same subnet and mask (broadcast and NBMA links).
  • Same hello and dead intervals.
  • Same authentication type and key.
  • Same stub area flag.
  • Unique router IDs.
  • Compatible MTU, or the adjacency stalls at ExStart or Exchange.

What the stuck states tell you

Stuck inLikely cause
Down or no neighborNo Hello arrives: the link is down, the interface is not in OSPF, a firewall filter drops OSPF, or the interface is passive
InitYou receive Hellos, but the other side does not receive yours or rejects them (one way)
2Way (not DROther pair)The routers are not eligible for DR, such as both with priority 0
ExStart or ExchangeMTU mismatch, or a problem with large packets
LoadingLost or filtered LSU packets, or a corrupted LSA

Network types

The network type decides whether a DR is elected and how Hellos are sent.

Network typeDR electionTypical interface
BroadcastYesEthernet, the Junos default for Ethernet
Point-to-pointNoSerial links, or Ethernet configured as point to point
Point-to-multipointNoPartial mesh WAN
NBMAYesFrame Relay style networks with neighbors listed by hand

On a link between exactly two routers, interface-type p2p removes the DR election, and the adjacency forms faster:

user@router# set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 interface-type p2p
Watch out

Both ends of a link must use the same network type. If one side is p2p and the other broadcast, Hellos still arrive, but the two sides behave differently and the result is unreliable.

DR and BDR election

The election happens on each broadcast or NBMA segment, when routers reach 2Way.

  1. The router with the highest interface priority wins. The Junos default priority is 128.
  2. If priorities tie, the highest router ID wins.
  3. Priority 0 makes a router ineligible to be the DR or BDR.
  4. The router with the second best result becomes the BDR.

The election is not preemptive. A router with a higher priority that joins later does not take the role from the existing DR. The roles change only if the DR fails, or the OSPF process restarts.

user@router# set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 priority 200
Routers reach 2Wayhighest priorityDR electednext bestBDR electedeveryone elseDROther

The DR sends updates to 224.0.0.5, and DROthers send updates to 224.0.0.6, the all designated routers group. The DR floods them on to the segment. The DR also originates the network LSA (type 2) for the segment.

user@router> show ospf interface
Interface           State   Area            DR ID           BDR ID          Nbrs
ge-0/0/1.0          DR      0.0.0.0         10.255.0.1      10.255.0.2         2
Exam tip

To make a router the DR, set its priority higher on that router, then clear the OSPF neighbors on the others or restart the process. Raising a priority alone does nothing while a DR exists.

Common mistakes

Calling 2Way between DROthers a fault. It is the normal final state for two non-DR routers on a broadcast link.

Expecting a new high priority router to become DR. The election does not preempt.

Using priority 0 and then expecting to see it in the election. Priority 0 is never elected.

Leaving a two router Ethernet link as broadcast. It works, but the DR election is unnecessary. Use interface-type p2p.

Mismatched timers. A router with hello 10 and dead 40 does not form a neighbor with one using hello 5 and dead 20.

What to remember for the exam

  • Neighbor states: Down, Init, 2Way, ExStart, Exchange, Loading, Full.
  • Full adjacency is formed only with the DR and BDR on a broadcast segment; DROthers stay 2Way.
  • Election: highest priority, then highest router ID; priority 0 is not eligible.
  • Junos default priority is 128; the election does not preempt.
  • Broadcast and NBMA elect a DR; point to point and point to multipoint do not.
  • Area, timers, authentication, subnet and the stub flag must match; MTU problems stall at ExStart.
  • show ospf neighbor and show ospf interface show states and the DR and BDR.

Check yourself

  • Two DROther routers on an Ethernet segment show 2Way with each other. Is that a problem?

    No, DROthers form full adjacencies only with the DR and BDR, so 2Way between them is normal.

  • A new router with priority 255 joins a segment that already has a DR. Does it become the DR?

    No, the DR election is not preemptive, so it becomes the DR only if the current DR fails or OSPF restarts.

  • An adjacency stays in ExStart. What is the most likely cause?

    An MTU mismatch between the two interfaces.

Topic 2 of 5 in OSPF

Test yourself on OSPF

The full Juniper JNCIS-ENT JN0-352 question bank has 846 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Juniper. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.