OSPF Dynamic Routing · Topic 3 of 8
OSPF Neighbour States and DR and BDR Election
Learn the OSPF neighbour states from Down to Full, why broadcast networks elect a DR and BDR, and how priority and router ID decide the election.
- 5 min
- Includes a diagram
- The states in order are Down, Init, 2 Way, ExStart, Exchange, Loading and Full.
- Attempt applies only to NBMA networks.
- A DR and BDR are elected on broadcast and NBMA segments.
What it is
Neighbour states show how far two OSPF routers have got in becoming fully adjacent, and the DR election limits adjacencies on shared networks.
Two routers move through a fixed series of states. Only routers in the Full state have identical databases and can use each other for forwarding.
On a broadcast network, many routers share one segment. If each one formed an adjacency with every other, the number of adjacencies and the flooding traffic would grow quickly. The designated router solves this.
How it works
Routers walk through the states, and on shared segments they elect a DR and a BDR to be the central point.
The neighbour states
| State | Meaning |
|---|---|
| Down | No Hello received from this neighbour |
| Attempt | NBMA only, the router is trying to contact a configured neighbour |
| Init | A Hello arrived, but the neighbour has not yet seen this router |
| 2 Way | Each router sees itself in the other's Hello |
| ExStart | The routers pick a master and a slave for the database exchange |
| Exchange | Database descriptions are swapped |
| Loading | Missing LSAs are requested and received |
| Full | Databases match, and the routers are fully adjacent |
The master and slave in ExStart only decide who leads the exchange. The master is the router with the higher router ID.
A router that stays in 2 Way is not an error on a broadcast segment. It is the normal state between two routers that are neither DR nor BDR.
A router stuck in ExStart or Exchange often points to a size problem, because the database description packets are large. An MTU mismatch between the two ends is a known cause.
Why a DR is needed
On a broadcast segment with many routers, a full mesh of adjacencies is wasteful. Instead, one router becomes the designated router, or DR, and a second becomes the backup designated router, or BDR.
Every other router, called a DROther, forms a full adjacency only with the DR and the BDR. DROthers stay in 2 Way with each other.
Updates go to the DR at 224.0.0.6. The DR floods them to all routers at 224.0.0.5. The DR also creates the network LSA for the segment.
The election
The election runs on each broadcast and NBMA segment, and the rules are simple.
- The router with the highest priority becomes the DR.
- On a tie, the highest router ID wins.
- The router with the second best result becomes the BDR.
- A router with priority 0 can never be DR or BDR.
The election is not pre emptive. A router that joins later with a better priority does not take over. The existing DR and BDR keep the roles until one of them fails.
The BDR then becomes the DR, and a new BDR is elected. This means the order in which routers start can decide the result.
/routing ospf interface add interface=ether1 network-type=broadcast priority=100
/routing ospf interface add interface=ether2 priority=0
The first line makes this router the preferred DR on ether1. The second line prevents it from becoming a DR on ether2.
In RouterOS v7, the priority is set on the interface template instead.
Point to point links
On a point to point link, only two routers exist, so there is no election. The routers reach Full directly.
Verifying
/routing ospf neighbor print
/routing ospf interface print
The neighbour list shows the state of each neighbour, and the interface list shows the role of this router on each segment, as DR, BDR or DROther.
Because the election is not pre emptive, give the router you want as DR the highest priority and start it first, or restart the OSPF interfaces together.
What to remember for the exam
Seven facts cover most questions on this topic.
- The states in order are Down, Init, 2 Way, ExStart, Exchange, Loading and Full.
- Attempt applies only to NBMA networks.
- A DR and BDR are elected on broadcast and NBMA segments.
- Highest priority wins, and then the highest router ID.
- Priority 0 means the router can never be DR or BDR.
- The election is not pre emptive.
- DROthers form Full adjacencies only with the DR and BDR, and stay in 2 Way with each other.
A neighbour in 2 Way is normal between two DROthers. Do not treat it as a fault.
Common mistakes
These four errors appear often.
Expecting a new router to take over as DR. The election is not pre emptive, so a late joiner with a high priority waits.
Setting priority 0 on the wrong router. The router then cannot become DR, and the election result changes.
Treating 2 Way as a failure. Between DROthers it is the correct final state.
Forgetting the election needs a tie breaker. With equal priorities, the router ID decides, so set the router IDs on purpose.
Check yourself
Work through these three questions.
What are the OSPF neighbour states in order?
Down, Init, 2 Way, ExStart, Exchange, Loading and Full. Attempt is used only on NBMA networks.
How is the DR chosen on a broadcast segment?
The highest priority wins, and a tie is broken by the highest router ID. A router with priority 0 is never elected.
Why do two DROthers stay in 2 Way?
DROthers form Full adjacencies only with the DR and the BDR. This limits the number of adjacencies on a shared segment.
Topic 3 of 8 in OSPF Dynamic Routing
Test yourself on OSPF Dynamic Routing
The full MikroTik MTCRE question bank has 417 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 MikroTik. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.