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.
- Plain-text authentication as seen in Wireshark
- The 6 network types with their timers and addresses
- Loopbacks: why they are advertised as /32
- DR, BDR and DROTHER: neighbor versus adjacent
- The 8 neighbor states, from Down to Full
- 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
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 type | Where you find it | Neighbors | DR/BDR | Hello / Dead |
|---|---|---|---|---|
| Broadcast | Ethernet, LAN segment | 224.0.0.5 | Yes, automatic | 10 s / 40 s |
| Non-broadcast (NBMA) | Frame Relay on the main interface, ATM | Static, with neighbor | Yes | 30 s / 120 s |
| Point-to-point | HDLC or PPP serials, Frame Relay point-to-point subinterfaces | 224.0.0.5 | No | 10 s / 40 s |
| Point-to-multipoint | Multipoint Frame Relay, DMVPN (hub and spoke) | 224.0.0.5 | No | 30 s / 120 s |
| Point-to-multipoint non-broadcast | Cisco-specific hub and spoke | Static, with neighbor | No | 30 s / 120 s |
| Loopback | Loopback interfaces | No neighbors | No | Not 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.
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 8 OSPF neighbor states and the packets in each one. Diagram: The House of Routing.
- Down. No Hello has been received. It happens when the interface is down, when the OSPF process is shut down (
shutdownunderrouter ospf) or when the neighbor stops answering and the Dead interval expires. - Attempt. It only exists on NBMA networks, with neighbors configured with
neighbor. The router sends unicast Hellos and gets no answer yet. - Init. A Hello arrived from the neighbor, but your router ID is not in it: the Hello is one-way.
- 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.
- 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”.
- Exchange. The DBDs carry only the LSA headers (types 1, 2, 3, 4, 5 and 7), not their content.
- 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.
- Full. The databases are synchronized. There is an adjacency and routing can begin.
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.
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.
- Day 1 · Part 5OSPF plain-text authentication and the 6 network types: DR, BDR and DROTHERWatch video
- Day 1 · Part 6The 8 OSPF states: from Down to Full, and non-broadcast Frame RelayWatch video
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
- Understand OSPF Neighbor Statescisco.com
- OSPF authentication: configuration examplescisco.com
- Configure Initial Configurations for OSPF over Non-Broadcast Linkscisco.com
- Review OSPF Frequently Asked Questionscisco.com
- IP Routing: OSPF Command Reference (ip ospf network, ip ospf priority)cisco.com
- Configuring OSPF (IP Routing: OSPF Configuration Guide)cisco.com
- RFC 2328: OSPF Version 2rfc-editor.org
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.