OSPF MASTERCLASS · CHAPTER 3

Network types, DR/BDR and the 8 OSPF states

OSPF changes the way it works depending on the medium. Learn to read the network type, each router's role and each neighbor's state.

14 min readVideos: Day 1, parts 5 and 6Level: intermediate

From point A to point B

Point A: you can already bring up an OSPF adjacency on a serial link, break it and fix it. But when you see FULL/DR, 2WAY/DROTHER or a 30-second timer, you don't know where it comes from. Point B: by the end of this chapter you will predict how OSPF behaves on each network type, which role each router takes and which state each neighbor should reach.

In the class we sum it up in one sentence: OSPF is media dependent. The same process, on an Ethernet, serial or Frame Relay interface, may or may not elect a DR, uses different timers and finds its neighbors in a different way.

What you will see
  1. Plain-text authentication as seen in Wireshark
  2. The 6 network types with their timers and addresses
  3. Loopbacks: why they are advertised as /32
  4. DR, BDR and DROTHER: neighbor versus adjacent
  5. The 8 neighbor states, from Down to Full
  6. A Frame Relay link that turns the network type into NON_BROADCAST

The key in plain sight

Wireshark had stopped decoding packets on the R1–R2 serial link. The cause: the interface was still using HDLC, Cisco's default encapsulation. Once the link ran PPP on both ends, the capture could read OSPF again.

With a clean capture, the important part shows up. In the OSPF header of the Hello you see the authentication type simple password and, right next to it, the whole key: thor123. That is why it is called plain-text authentication. Anyone with a sniffer on the link can read it.

Then comes the troubleshooting. show ip ospf neighbor shows no neighbors. R1 has authentication on its interface; R2 has none, meaning null authentication. Configuring it on R2's serial interface is enough to bring the adjacency back to FULL.

R2# show ip ospf neighbor
R2# show run interface serial 0/1
! R1 sends plain-text authentication; R2 sends null: no neighbor
R2# conf t
R2(config)# interface serial 0/1
R2(config-if)# ip ospf authentication
R2(config-if)# ip ospf authentication-key thor123
R2(config-if)# do show ip ospf neighbor
Three authentication types. Type 0 or null (the default), type 1 or plain text, and type 2 or MD5. Both ends must use the same type and the same key. Cisco warns that plain text leaves the network open to a sniffer: it prevents configuration mistakes, it does not protect anything. Day 2 of the class comes back to MD5.

OSPF depends on the medium

Based on the interface type, OSPF decides three things on its own: whether it elects a DR and BDR, which Hello and Dead timers it uses, and whether it discovers neighbors through multicast (224.0.0.5) or you must declare them with neighbor. For example, on Ethernet the type is broadcast, with DR, BDR and a 10-second Hello. On an HDLC or PPP serial it is point-to-point, with no DR or BDR, also at 10 and 40 seconds.

This is the table from the class; as Jesús says, you learn it by practicing.

Network typeWhere you find itNeighborsDR/BDRHello / Dead
BroadcastEthernet, LAN segment224.0.0.5Yes, automatic10 s / 40 s
Non-broadcast (NBMA)Frame Relay on the main interface, ATMStatic, with neighborYes30 s / 120 s
Point-to-pointHDLC or PPP serials, Frame Relay point-to-point subinterfaces224.0.0.5No10 s / 40 s
Point-to-multipointMultipoint Frame Relay, DMVPN (hub and spoke)224.0.0.5No30 s / 120 s
Point-to-multipoint non-broadcastCisco-specific hub and spokeStatic, with neighborNo30 s / 120 s
LoopbackLoopback interfacesNo neighborsNoNot applicable

Two rules help you remember it. First: everything that starts with “point”, plus loopbacks, has no DR. That is why on a serial link show ip ospf neighbor only shows FULL, with no role. Second: by default, the Dead interval is 4 times the Hello.

The default priority is 1 and it only matters on networks with a DR. NBMA networks come from Frame Relay and ATM. MPLS displaced Frame Relay, but some providers still use it. As for point-to-multipoint non-broadcast, Jesús admits that in 20 years in the field he has never configured it in production.

Loopback: /32 and passive-interface

Loopbacks are a network type of their own. What you need to remember: OSPF advertises them as a /32 host route, whatever mask you configure. If you put 22.22.22.0 with a /16 mask on a loopback, the rest of the domain receives a /32.

If you need to advertise the real mask, go into the loopback and configure ip ospf network point-to-point. Jesús prefers another habit: configure each loopback as a host, for example 2.2.2.2 with 255.255.255.255.

In production, every loopback should be a passive-interface: there are no neighbors to find there, and the network is still advertised.

R2(config)# interface loopback 0
R2(config-if)# ip address 2.2.2.2 255.255.255.255
R2(config-if)# exit
R2(config)# router ospf 1
R2(config-router)# passive-interface loopback 0
! Only if a loopback must be advertised with its real mask (e.g. /24):
! R2(config-if)# ip ospf network point-to-point

DR, BDR and DROTHER

With 5 routers on an Ethernet segment and full adjacencies between all of them, you would have 10 adjacencies and repeated LSAs. To avoid that, OSPF elects a DR (designated router) and a BDR (backup). The rest are DROTHERs.

DR, BDR and DROTHER on a broadcast segment Five OSPF routers share one Ethernet segment. One is elected DR and another BDR. Each of the three DROTHER routers forms a full adjacency only with the DR and the BDR; between themselves the DROTHERs stay in the 2-Way state. DROTHERs send their link state updates to 224.0.0.6 (DR and BDR), and the DR floods them back to 224.0.0.5 (all OSPF routers). ETHERNET SEGMENT · NETWORK TYPE BROADCAST DR highest priority / RID BDR second in line FULL DROTHER priority 1 DROTHER priority 1 DROTHER priority 0 2-WAY 2-WAY FULL = adjacency (LSDB synchronized) 2-WAY = neighbors, no adjacency DROTHER → 224.0.0.6 (AllDRouters) · DR/BDR → 224.0.0.5 (AllSPFRouters) · priority 0 never becomes DR or BDR

On a broadcast segment, DROTHERs reach FULL only with the DR and the BDR; between themselves they stay in 2-Way. Diagram: The House of Routing.

Here a key difference appears, between a neighbor and an adjacent router:

  • Neighbor: the two routers see each other in their Hellos. They stay in 2-Way.
  • Adjacent: they are in FULL, with a synchronized database and able to exchange routing information.

Each DROTHER forms an adjacency only with the DR and the BDR. Between DROTHERs the relationship is 2-Way, and that is not an error. Hellos go to 224.0.0.5. When a DROTHER has an update, it sends its LSU to 224.0.0.6, the address the DR and BDR listen to. The DR then floods it to everyone on 224.0.0.5.

The election follows simple rules. The highest priority wins (0 to 255; 1 by default) and, on a tie, the highest router ID. With priority 0 a router never becomes DR or BDR. And the rule that surprises people most: the DR is not preemptive. If a DR already exists and you later raise another router to priority 255, the DR does not change. It has to go down.

If the DR fails, the BDR becomes DR. The routers that were in 2-Way negotiate again and elect a new BDR; the others go back to 2-Way. In the class someone asked what happens if only the BDR fails. RFC 2328 answers it: the election runs again and one of the DROTHERs becomes BDR, while the DR stays in place.

The 8 states, from Down to Full

Every neighbor goes through a sequence of states. Knowing it tells you at which step an adjacency gets stuck (stuck in).

The eight OSPF neighbor states, from Down to Full Two routers, R1 and R2, move through the OSPF neighbor states. Down: no Hello received yet. Attempt, only on NBMA networks: unicast Hellos to a configured neighbor. Init: a Hello arrived but my router ID is not in it. 2-Way: each router sees its own router ID in the other's Hello, and the DR and BDR are elected. ExStart: Database Description packets with the I, M and MS bits and a sequence number decide who is master; the higher router ID wins. Exchange: DBD packets carry only LSA headers. Loading: link state requests ask for what is missing and link state updates deliver the full LSAs, which are acknowledged. Full: the databases are synchronized; Hellos keep the adjacency alive and each LSA is refreshed every 1800 seconds. R1 R2 DOWN no Hello received yet · dead interval expired ATTEMPT Hello (unicast) · NBMA, neighbor command INIT Hello · my RID is not in it yet 2-WAY Hello lists my RID · DR/BDR election EXSTART DBD · I, M, MS bits + seq · higher RID = master EXCHANGE DBD · LSA headers only LOADING LSR · send me what is missing LSU · full LSAs LSAck FULL LSDB synchronized · Hellos · LSA refresh 1800 s

The 8 OSPF neighbor states and the packets in each one. Diagram: The House of Routing.

  1. Down. No Hello has been received. It happens when the interface is down, when the OSPF process is shut down (shutdown under router ospf) or when the neighbor stops answering and the Dead interval expires.
  2. Attempt. It only exists on NBMA networks, with neighbors configured with neighbor. The router sends unicast Hellos and gets no answer yet.
  3. Init. A Hello arrived from the neighbor, but your router ID is not in it: the Hello is one-way.
  4. 2-Way. You see your own router ID in the received Hello: you are neighbors now. This is where the DR and BDR are elected.
  5. ExStart. The DBDs (database descriptors) start, with the I (Init), M (More) and MS (Master) bits and a sequence number. The routers decide who is master: the one with the highest router ID. The debug says it plainly: “I am slave”.
  6. Exchange. The DBDs carry only the LSA headers (types 1, 2, 3, 4, 5 and 7), not their content.
  7. Loading. With the headers in hand, each router asks for what it lacks with an LSR. The neighbor answers with an LSU that carries the full LSAs: every interface, every loopback, every cost. Then it confirms with an LSAck.
  8. Full. The databases are synchronized. There is an adjacency and routing can begin.
“Missing information” is not lost information. English texts talk about “missing information” during the DBD exchange. Translated literally into Spanish, it sounds like “lost information”. Nothing is lost in OSPF: it is information you don't have yet, the body of the LSAs whose headers you already received. It arrives in the LSU.

There are four typical stuck states. Stuck in Attempt or stuck in Init: Hellos don't get through in one direction, often because of an ACL that blocks IP protocol 89. Stuck in ExStart: you will see it in chapter 4 with an MTU mismatch. 2-Way between DROTHERs: that is normal.

R2# show ip ospf neighbor
R2# show ip ospf database
R2# debug ip ospf hello
R2# debug ip ospf adj

Full and the paranoid update

With the LSUs, each router builds its topology database, the LSDB. You check it with show ip ospf database. It is neither the routing table nor the neighbor table: it is OSPF's third database, the one SPF uses to calculate routes.

Once in Full, the last LSAck goes out and the link calms down: only Hello, Hello, Hello. If something changes, OSPF sends only that change. RIP, by contrast, sends its whole table periodically.

Even so, OSPF has a streak of distrust that Jesús calls the paranoid update. Every 1,800 seconds, that is, every 30 minutes, each router re-originates its own LSAs even if nothing changed. It sends a new LSU and gets its LSAck. That way no LSA ages out.

Lab: non-broadcast Frame Relay

Now the lab grows. The R2–R3 link (50.50.50.0/24) goes into area 10, so R2 becomes an ABR between area 0 and area 10.

Lab topology for this chapter: R1, R2 and R3 R1 and R2 share the serial link 40.40.40.0/24 in area 0, with PPP, plain-text authentication and the point-to-point network type: Hello 10 and Dead 40 seconds. R2 and R3 share the serial link 50.50.50.0/24 in area 10, with Frame Relay back-to-back on the main interface and DLCI 20: the network type changes to non-broadcast, with Hello 30 and Dead 120 seconds. R2 is the ABR between area 0 and area 10. R3 has router ID 0.0.0.3 and loopback 3.3.3.3/32 and will later become an ASBR. R1 · AREA 0 RID 0.0.0.1 S0/0 40.40.40.1 R2 · ABR RID 0.0.0.2 S0/1 40.40.40.2 S0/0 50.50.50.2 R3 · AREA 10 RID 0.0.0.3 S0/1 50.50.50.3 Lo0 3.3.3.3/32 AREA 0 40.40.40.0/24 PPP · auth type 1 AREA 10 50.50.50.0/24 FR b2b · DLCI 20 POINT_TO_POINT Hello 10 s · Dead 40 s · no DR/BDR NON_BROADCAST Hello 30 s · Dead 120 s · DR/BDR · unicast Serial links · Cisco IOSv in GNS3 · router ID 0.0.0.N

Chapter topology: area 0 over point-to-point and area 10 over back-to-back Frame Relay. Diagram: The House of Routing.

First, OSPF is enabled on R2's serial 0/0 and checked with show ip ospf interface: POINT_TO_POINT type, 10-second Hello, and Hellos to 224.0.0.5 in the debug. Then the encapsulation changes to Frame Relay on the main interface, in back-to-back mode with DLCI 20.

R2(config)# interface serial 0/0
R2(config-if)# ip address 50.50.50.2 255.255.255.0
R2(config-if)# ip ospf 1 area 10
R2(config-if)# no shutdown
R2(config-if)# do show ip ospf interface serial 0/0
! Serial with HDLC: Network Type POINT_TO_POINT, Hello 10
R2(config-if)# encapsulation frame-relay
R2(config-if)# no keepalive
R2(config-if)# frame-relay interface-dlci 20
R2(config-if)# do show ip ospf interface serial 0/0
! Now: Network Type NON_BROADCAST, Hello 30, Dead 120

The change is instant: the network type becomes NON_BROADCAST, with a 30-second Hello and a 120-second Dead, and the DR and BDR election comes back. At that point you know the adjacency won't form over multicast: it will need unicast Hellos.

Next, R3 is configured as an internal router in area 10: router ID 0.0.0.3, a 3.3.3.3/32 loopback and serial 0/1 with the same encapsulation and the same DLCI. No separate area 0 is created on R3: it would be an area 0 cut off from the backbone, and that is a design error. Later, R3 will be the ASBR that redistributes routes from BGP.

R3# show run | section router
R3# configure terminal
R3(config)# router ospf 1
R3(config-router)# router-id 0.0.0.3
R3(config-router)# interface loopback 0
R3(config-if)# ip address 3.3.3.3 255.255.255.255
R3(config-if)# ip ospf 1 area 10
R3(config-if)# interface serial 0/1
R3(config-if)# ip address 50.50.50.3 255.255.255.0
R3(config-if)# ip ospf 1 area 10
R3(config-if)# encapsulation frame-relay
R3(config-if)# no keepalive
R3(config-if)# frame-relay interface-dlci 20
R3(config-if)# do show ip ospf neighbor

Why the DLCI? It is the Frame Relay layer 2 address. On Ethernet, ARP resolves IP to MAC thanks to broadcast. Frame Relay has no broadcast, so the IP-to-DLCI relationship is resolved with maps. In back-to-back mode both ends use the same DLCI: it is the same cable, encapsulated in Frame Relay.

Does the adjacency come up? Not yet. On an NBMA network, one command is missing. You will see it, with a stuck in Attempt caused on purpose, in chapter 4.

Class videos

These are the two videos from the 1st OSPF Marathon that this chapter covers. They were recorded live with Cisco IOSv routers in GNS3, debug and Wireshark; the audio is in Spanish, with subtitles in Spanish, English, French and Portuguese.

Recorded live; Spanish audio with Spanish, English, French and Portuguese subtitles. When you play it, the video loads from YouTube. Day 1 playlist on YouTube

Test what you learned

1. On an Ethernet segment with 4 routers, two DROTHERs are in 2-Way with each other. Is that a problem?

Answer. No. DROTHERs only form an adjacency, FULL, with the DR and the BDR. Between themselves they stay in 2-Way by design, to cut down adjacencies and repeated LSAs.

2. You configure loopback 10.1.1.1 with mask 255.255.255.0. How do the other OSPF routers see it?

Answer. As 10.1.1.1/32. OSPF advertises loopbacks as host routes. To advertise the /24 you must configure ip ospf network point-to-point on the loopback.

3. The DR has priority 1. You raise another router to priority 255. What happens?

Answer. Nothing, for now. DR election is not preemptive: the router with 255 becomes DR only when the current DR fails or the OSPF process is restarted on the segment.

4. In which state are only the LSA headers exchanged, and in which do the full LSAs arrive?

Answer. The headers travel in DBDs during Exchange. The full LSAs arrive in Loading, in the LSUs that answer each LSR.

5. You set a serial to encapsulation frame-relay. Which network type and timers does show ip ospf interface show?

Answer. NON_BROADCAST, with a 30-second Hello and a 120-second Dead. There is a DR and BDR election, and the adjacency needs unicast Hellos.

Your takeaways

  • Plain-text authentication shows the key in every Hello: useful against configuration mistakes, not against a sniffer.
  • OSPF is media dependent: the network type defines DR/BDR, timers and how neighbors are discovered.
  • Broadcast and point-to-point use Hello 10 and Dead 40; NBMA and point-to-multipoint, 30 and 120.
  • Loopbacks are advertised as /32 and, in production, are passive interfaces.
  • DROTHERs stay in 2-Way with each other and in FULL with the DR and BDR. The DR is not preemptive.
  • Down, Attempt, Init, 2-Way, ExStart, Exchange, Loading and Full: each state has its packets and its typical failures.
  • Each router refreshes its LSAs every 1,800 seconds, even if nothing changes.

Official resources

Source and credits. Chapter written from the OSPF Masterclass that Jesús Espinoza recorded live in 2021. Text drafted with AI assistance and reviewed; original diagrams by The House of Routing. Technical details and configuration were checked against official Cisco documentation and IETF RFCs.

Navigate