OSPFBeginner45 min read

What Does OSPF adjacency Mean?

Reviewed byJohnson Ajibi· Senior Network & Security Engineer · MSc IT Security
Cisco CCNACompTIA Network+CompTIA Security+AZ-104SAA-C03Google ACECompTIA A+ Core 1
On This Page

Quick Definition

OSPF adjacency is when two routers running the OSPF routing protocol become neighbors and agree to share routing information. They do this by exchanging hello packets and then synchronizing their link-state databases. This relationship allows them to understand the network topology and forward data packets efficiently.

Common Commands & Configuration

router ospf 1

Enters OSPF router configuration mode with process ID 1. This is the first step in configuring OSPF on a Cisco router.

CCNA and Network+ exams often ask for the process ID range (1-65535) and that it is locally significant.

network 192.168.1.0 0.0.0.255 area 0

Enables OSPF on interfaces with IP addresses in the 192.168.1.0/24 subnet and places them in area 0 (backbone area).

The wildcard mask is tested frequently; candidates must understand it is the inverse of the subnet mask.

ip ospf hello-interval 10

Sets the Hello interval to 10 seconds on a specific interface. Must match on both sides for adjacency to form.

Exams test that mismatched Hello intervals cause adjacency to stay in Init state.

ip ospf dead-interval 40

Sets the Dead interval to 40 seconds on a specific interface. Default is 4x hello interval.

Common question: what is default dead interval for broadcast network? Answer: 40 seconds.

ip ospf cost 10

Manually sets the OSPF cost to 10 on an interface, overriding the auto-calculated cost based on bandwidth.

Used to influence path selection; questions may ask which path is preferred when costs differ.

auto-cost reference-bandwidth 10000

Changes the reference bandwidth to 10 Gbps so that higher-speed links have distinct costs (e.g., Gigabit = 10).

Tested for impact on cost calculation; must be consistent across all routers in the OSPF domain.

ip ospf network point-to-point

Sets the OSPF network type to point-to-point on an interface, bypassing DR/BDR election.

CCNA requires knowing that point-to-point adjacency goes directly to Full without 2-Way state.

show ip ospf neighbor

Displays the state of all OSPF neighbors, including neighbor ID, priority, state, dead time, and interface.

Most commonly used command for adjacency troubleshooting; state field is key to diagnosing issues.

OSPF adjacency appears directly in 53exam-style practice questions in Courseiva's question bank — one of the most-tested concepts on Cisco CCNA. Practise them →

Must Know for Exams

OSPF adjacency is a high-frequency topic across several major IT certification exams, especially those focused on networking and cloud infrastructure. Understanding the adjacency states and the conditions required for their formation is essential for achieving a passing score.

For the CCNA (Cisco Certified Network Associate) exam, OSPF adjacency is a core objective. The exam blueprint includes identifying the states of an OSPF adjacency (Down, Init, Two-Way, ExStart, Exchange, Loading, Full) and the role of the DR/BDR in broadcast networks. Candidates are expected to interpret output from show ip ospf neighbor and debug ip ospf adj commands. Multiple-choice questions often present a scenario where an adjacency is stuck in a particular state, and the candidate must identify the cause and the correct configuration fix. Simulation questions may require configuring OSPF on routers and verifying that adjacencies establish correctly.

For the Network+ exam (CompTIA Network+), OSPF adjacency appears in a lighter form. The exam covers the fundamentals of dynamic routing protocols, including OSPF link-state characteristics. Candidates need to know that OSPF routers form neighbor relationships and exchange routing information, but the detailed state machine is not examined as deeply as in CCNA. However, questions about the benefits of OSPF over distance-vector protocols like RIP often reference the adjacency-based, loop-free nature of OSPF.

The AWS Certified Solutions Architect (SAA) exam also touches on OSPF adjacency, primarily in the context of AWS Transit Gateway and VPN connectivity. When connecting on-premises networks to AWS using Dynamic VPNs (BGP is more common, but OSPF can be used in certain scenarios), understanding adjacency helps troubleshoot BGP/OSPF peerings. Even though the exam focuses on BGP for AWS Direct Connect, the general concept of routing adjacencies and state machines is relevant.

For the Azure Administrator (AZ-104) and Google Professional Cloud Architect (ACE) exams, OSS routing protocols are less central because Azure and Google Cloud often use BGP for hybrid connectivity. However, knowing the basics of OSPF adjacency can help when reading about on-premises networking and migration scenarios. The CompTIA Security+ exam does not directly test OSPF adjacency, but understanding that OSPF adjacency requires authentication and can be secured with MD5 or SHA hashes is relevant for security-focused questions.

exam questions on OSPF adjacency will test your ability to recognize the states, understand the parameters that must match, and diagnose why an adjacency is not forming. Expect scenario-based questions that ask, A router is stuck in the ExStart state. What is the most likely cause? or Why does this OSPF adjacency not go to Full? Mastering these details will directly boost your score on networking certifications.

Simple Meaning

Imagine you and a friend are trying to build a giant jigsaw puzzle of your neighborhood, but each of you only has a few pieces. To complete the puzzle together, you first need to agree to work together and then exchange copies of your pieces so you both have the same full picture. In a computer network, OSPF routers work exactly like that.

OSPF (Open Shortest Path First) is a routing protocol that helps routers figure out the best paths for data to travel across a network. For two routers to work together effectively, they must first establish something called an OSPF adjacency. Think of this as a formal partnership. The routers start by sending each other small greeting messages called hello packets. If these messages are received and understood correctly, the routers agree that they are neighbors. But being just a neighbor is not enough; they need to become full adjacencies.

Once they agree to be neighbors, they move into a more detailed process. They begin exchanging information about every route they know, like sharing all the puzzle pieces. This process is called database synchronization. The routers send each other database description packets, which are like a table of contents of their routing knowledge. Then they ask for specific details they lack, and the other router sends them. This careful process ensures that both routers end up with an identical copy of the routing database, known as the link-state database.

Why go through all this trouble? OSPF uses a concept called link-state routing. Every router in an area must have the same map of the network to calculate the shortest path to any destination. An adjacency guarantees that both routers have identical maps. Without full adjacency, a router might think a path exists when it does not, or it might choose a longer path, causing delays or outages.

OSPF adjacency is the core relationship that allows routers to trust each other and share accurate routing information. It is built through a series of defined states: Down, Init, Two-Way, ExStart, Exchange, Loading, and finally Full. Each state represents a step in the process of becoming fully synchronized. This system is designed to be reliable and error-free, ensuring that the network stays stable even when new routers are added or existing ones fail.

Full Technical Definition

OSPF adjacency is the logical, operational relationship established between two OSPF-enabled routers that have completed a multi-step state machine process, culminating in the synchronization of their link-state databases (LSDB). This relationship is fundamental to the operation of OSPF (Open Shortest Path First), a link-state routing protocol defined in RFC 2328 (OSPFv2 for IPv4) and RFC 5340 (OSPFv3 for IPv6). An adjacency is distinct from a mere neighbor relationship; a router may have many OSPF neighbors but only form adjacencies with a subset, depending on the network type (broadcast, point-to-point, NBMA, etc.).

The formation of an OSPF adjacency follows a deterministic sequence of states. The first step is the Down state, where no hello packets have been received from a potential neighbor. When a router starts sending hello packets out its OSPF-enabled interfaces, it enters the Init state upon receiving a hello packet that does not contain its own router ID. Once a router receives a hello packet that does include its own router ID, it knows the other router has seen it, and the state transitions to Two-Way. In broadcast and Non-Broadcast Multi-Access (NBMA) networks, the Two-Way state is significant because it determines whether routers proceed to form an adjacency. Routers do not form adjacencies with every neighbor; instead, a Designated Router (DR) and Backup Designated Router (BDR) are elected, and all other routers exchange information only with the DR and BDR. Routers in the Two-Way state that are not the DR or BDR remain as neighbors but do not form full adjacencies.

Next, the routers move into the ExStart state, where they negotiate the master/slave relationship for the Database Description (DD) packet exchange. The router with the higher router ID becomes the master and controls the exchange. In the Exchange state, the routers send DD packets that contain summaries of their LSDB entries. Each DD packet is acknowledged, and the routers compare their databases. If a router discovers it has missing or more recent information, it enters the Loading state, where it sends Link State Request (LSR) packets to request specific Link State Advertisements (LSAs). The neighbor responds with Link State Update (LSU) packets containing the requested LSAs, which are then acknowledged with Link State Acknowledgment (LSAck) packets. Once all LSAs have been exchanged and the databases are fully synchronized, the routers enter the Full state. In the Full state, the adjacency is fully established, and the routers can exchange routing information and compute shortest paths using Dijkstra's algorithm.

Several parameters must match for an adjacency to form. These include the OSPF area ID, the subnet mask, the hello interval and dead interval timers, the authentication credentials (if configured), and the OSPF network type. If any of these parameters differ between routers on the same link, the adjacency will stall at the Two-Way state or earlier, and a full adjacency will not be achieved.

In real IT implementations, OSPF adjacency is critical for the proper operation of large enterprise networks, service provider backbones, and data center fabrics. Misconfigurations such as mismatched MTU sizes, incorrect area assignment, or firewall ACLs blocking OSPF multicast traffic (224.0.0.5 for all OSPF routers, 224.0.0.6 for DR/BDR) can prevent adjacencies from forming. Network engineers use commands like show ip ospf neighbor and debug ip ospf adj to troubleshoot adjacency issues. Understanding adjacency mechanics is essential for designing scalable OSPF networks, especially when using features like OSPF stub areas, virtual links, and route summarization.

Real-Life Example

Think about planning a surprise birthday party for a coworker. You and another colleague, Alex, are both in charge of the party. At first, you each have your own list of people to invite, your own idea for the cake, and your own budget. You have never talked about it. That is like the Down state in OSPF, no relationship exists.

One day, you send Alex a quick text message that says, Hey, are we still doing the party? This text is like an OSPF hello packet. Alex gets your message and realizes you are trying to collaborate. Alex replies, Yes, I am working on it! But your original text did not include Alexs name, it was a general message. Alex might not reply with your name either. This is like the Init state: you have heard from someone, but they have not yet acknowledged seeing you.

Now, you send another text that includes Alexs name: Alex, are we still doing the party? Alex replies, Yes, I got your message, and I see you are asking about the party. This back-and-forth establishes mutual recognition, like the Two-Way state. You are now neighbors. But you still have not shared any details.

Next, you both realize you need to agree on who will coordinate the different tasks. You say, I will send you the list of what I have. I will be the master organizer of this exchange. Alex agrees and becomes the slave. This is the ExStart state, where you negotiate who leads the conversation.

Now you start sending Alex your list: ideas for decorations, a cake order, a list of invitees, and a budget. Each item is like a Database Description packet. Alex cross-checks your list against their own list. If Alex sees an item they do not have, like you found a cheaper cake vendor, Alex will ask you for more details. This is the Exchange state. Alex then sends a request: Please send me the full details on that cake vendor. This is a Link State Request. You respond with the vendors name, phone number, and price, a Link State Update. Alex acknowledges receipt. This is the Loading state.

Once you have shared all information and both have identical lists, you finalize the plan. You both now know everything about the party. This is the Full state, a full adjacency. From this point on, any change to the plan, like a new guest or a different cake flavor, will be communicated immediately so you both stay synchronized.

If at any point one of you stops replying or sends incompatible information, the party planning breaks down. Similarly, if an OSPF router stops sending hello packets or sends mismatched parameters, the adjacency fails. This analogy shows how OSPF adjacency ensures that routers have a complete and consistent view of the network before they start making routing decisions.

Why This Term Matters

OSPF adjacency is the bedrock of OSPF routing. Without successfully formed adjacencies, OSPF cannot function at all. In practical IT environments, network reliability depends on routers having accurate and up-to-date routing tables. An OSPF adjacency ensures that each router in an area has the same topological map of the network, which is called the link-state database. This consistency prevents routing loops, black holes, and suboptimal paths.

In day-to-day operations, network engineers must know how to verify and troubleshoot adjacencies. A single misconfigured interface can prevent an adjacency from forming, potentially isolating a subnet or causing traffic to take a longer path. Common issues include mismatched hello/dead timers, mismatched area IDs, MTU mismatches, and authentication failures. Understanding adjacency states helps engineers quickly isolate whether the problem is layer 2 connectivity, OSPF configuration, or something else entirely.

From a design perspective, OSPF adjacency affects network scalability. In broadcast networks (like Ethernet), every router does not form an adjacency with every other router. Instead, only the Designated Router (DR) and Backup Designated Router (BDR) form full adjacencies with all other routers, while other routers remain in the Two-Way state. This design reduces the number of adjacencies and the amount of routing update traffic. If a network engineer misunderstands this concept, they might misconfigure the OSPF network type or the DR/BDR election process, leading to too many or too few adjacencies, which can degrade performance.

OSPF adjacency also has direct implications for network convergence time, the time it takes for the network to react to a change like a link failure. A properly functioning adjacency allows fast propagation of link-state changes through flooding. If adjacencies are unstable, convergence time increases, causing intermittent connectivity for users. In mission-critical networks, even a few seconds of downtime can be costly, so maintaining stable adjacencies is a top priority. In short, OSPF adjacency is not just an abstract protocol concept; it is a practical, everyday concern for anyone managing IP networks.

How It Appears in Exam Questions

OSPF adjacency questions appear in three main patterns on certification exams: scenario-based troubleshooting, command output interpretation, and configuration verification.

Scenario-based troubleshooting questions describe a network with misconfigured OSPF. For example: Router A and Router B are directly connected via Ethernet interfaces. Both have OSPF enabled in area 0. The show ip ospf neighbor command on Router A shows Router B in the INIT state. Which of the following is the most likely cause? The answers might include mismatched subnet masks, mismatched hello timers, an MTU mismatch, or an ACL blocking OSPF multicast traffic. The learner must recall that the Init state means Router A has received a hello from Router B but the hello did not contain Router As router ID, which typically happens when the subnet mask does not match.

Another common scenario: Two routers remain in the Two-Way state and never progress to Full. The question asks why this is expected or what condition is causing it. The correct answer for a broadcast network is that a DR and BDR election has occurred, and only the DR and BDR form full adjacencies with all other routers. The non-DR/BDR routers remain in Two-Way with each other, which is normal.

Command output interpretation questions present the output of show ip ospf neighbor and ask what state a specific router is in, or what the next state will be. For example: R1# show ip ospf neighbor Neighbor 10.1.1.2, interface GigabitEthernet0/0, state EXSTART/DR ... The question might ask what is happening at this point. The learner must know that in ExStart, the routers are negotiating the master/slave relationship and that the master will be the router with the higher router ID.

Configuration verification questions provide a configuration snippet and ask whether an adjacency will form. For instance: Router A has interface ip address 192.168.1.1 255.255.255.0 and ip ospf hello-interval 10. Router B has interface ip address 192.168.1.2 255.255.255.0 and ip ospf hello-interval 20. Will an adjacency form? Why? The answer is no, because the hello intervals must match.

Finally, exam questions sometimes mix OSPF adjacency with security. For example: An OSPF adjacency is failing to establish. The network administrator enables authentication on both sides, but the adjacency still fails. What is the most likely issue? The answer could be that the authentication keys do not match. Understanding that OSPF adjacency parameters must match exactly is critical for these questions.

Practise OSPF adjacency Questions

Test your understanding with exam-style practice questions.

Practise

Example Scenario

You are setting up a small company network with two OSPF routers, R1 and R2, connected by a single Ethernet cable. R1 has an IP address of 192.168.1.1/24 on its GigabitEthernet0/0 interface, and R2 has an IP address of 192.168.1.2/24 on the same interface type. You have configured OSPF on both routers in area 0.

When you first turn on the routers, they begin sending hello packets every 10 seconds (the default for broadcast networks). R1 sends a hello packet to the multicast address 224.0.0.5. R2 receives it and sees that R1s router ID is 1.1.1.1. R2 replies with a hello that includes R1s router ID. R1 receives that and sees its own ID, so it knows R2 has seen it. According to the state machine, R1 and R2 now move to the Two-Way state. Since this is a point-to-point link (two routers directly connected), there is no DR/BDR election. They proceed directly to ExStart.

In ExStart, the routers decide who will be the master. R2 has a higher router ID (2.2.2.2) than R1, so R2 becomes the master. They then move to the Exchange state, where they send Database Description packets containing summaries of their link-state databases. R1 notices that R2 has a route to a network 10.0.0.0/24 that R1 does not have. R1 enters the Loading state and sends a Link State Request for that specific route. R2 responds with a Link State Update containing the complete LSA. R1 acknowledges and adds the information to its own database.

After all exchanges are complete, both routers have identical link-state databases, and the adjacency transitions to the Full state. Now, if a change occurs on R2, like a new network being added, R2 will flood the updated LSA to all its adjacencies, and R1 will update its routing table accordingly. This scenario demonstrates the step-by-step process that ensures both routers have consistent routing information before they start forwarding traffic.

Common Mistakes

Believing that all OSPF neighbors must form a Full adjacency.

In broadcast multi-access networks, only the DR and BDR form Full adjacencies with all other routers. Other routers remain in Two-Way state with each other, which is normal and expected.

Understand that a router can be a neighbor but not an adjacent neighbor. The Two-Way state is valid and functional in multi-access networks.

Assuming that OSPF adjacency will form automatically if two routers are connected and OSPF is enabled.

Many parameters must match: area ID, subnet mask, hello interval, dead interval, authentication credentials, and OSPF network type. Even a small mismatch will prevent the adjacency from progressing beyond the Init or Two-Way state.

Always verify that all OSPF timers, area assignments, and authentication settings are identical on both sides. Use the show ip ospf interface command to check.

Confusing the OSPF neighbor state with the adjacency state.

Neighbor state includes all states from Down to Full. Full is the only state where a full adjacency exists. Two-Way is still a neighbor state but not a full adjacency unless it is a DR/BDR pair.

Memorize the states and remember that Full is the goal for point-to-point links and for DR/BDR relationships in broadcast networks.

Thinking that a higher hello interval always means faster convergence.

A shorter hello interval detects failures faster, but it also increases network traffic. Both sides must use the same interval. A mismatch causes the adjacency to fail, which is worse than a slightly longer interval.

Always match hello and dead intervals on both sides. Use the default values unless you have a specific reason to change them.

Overlooking MTU mismatch as a cause of adjacency failure.

If the MTU on an interface differs between two routers, the Database Description packet may be too large to send, causing the adjacency to stall in ExStart or Exchange state.

Ensure that all interfaces on the same link have the same IP MTU. Use the ip mtu command on Cisco devices to set it manually if needed.

Exam Trap — Don't Get Fooled

{"trap":"A question shows two routers in the EXSTART state and asks what is wrong. The answer choices include mismatched timers, mismatched area, or a failed DR election. The correct answer is usually mismatched MTU."

,"why_learners_choose_it":"Learners remember that mismatched timers or area IDs cause issues, but they often forget that MTU mismatches specifically cause the adjacency to get stuck in ExStart or Exchange because the Database Description packets cannot be transmitted properly.","how_to_avoid_it":"Always remember that ExStart/Exchange state issues are commonly caused by MTU mismatches. Also note that the dead interval is four times the hello interval by default, so if hello timers match but dead timers do not, the adjacency may briefly form and then drop."

Commonly Confused With

OSPF adjacencyvsOSPF neighbor

An OSPF neighbor is any router with which a router has exchanged hello packets and reached the Two-Way state. An OSPF adjacency is a fully synchronized neighbor relationship that has reached the Full state. All adjacencies are neighbors, but not all neighbors are adjacencies.

Two routers on an Ethernet segment that are not DR or BDR will be neighbors in Two-Way state but not adjacencies. They do not exchange LSAs directly.

OSPF adjacencyvsBGP peering

BGP (Border Gateway Protocol) uses TCP-based peering sessions to exchange routes. Unlike OSPF, BGP does not use a multi-state adjacency process with hellos and database synchronization. BGP peers must be manually configured and are typically used between autonomous systems rather than within a single routing domain.

Two routers in different companies use BGP to exchange internet routes. They establish a TCP connection on port 179. OSPF would never be used for inter-company routing.

OSPF adjacencyvsEIGRP neighbor

EIGRP (Enhanced Interior Gateway Routing Protocol) also forms neighbor relationships through hello packets, but it uses a different state machine (Init, Waiting, Open, etc.) and uses Reliable Transport Protocol (RTP) instead of direct LSA flooding. EIGRP does not have DR/BDR elections and forms adjacencies with all directly connected EIGRP routers.

On a broadcast network, OSPF may not form an adjacency with every neighbor, but EIGRP will form a neighbor relationship with every directly connected EIGRP speaker.

OSPF adjacencyvsIS-IS adjacency

IS-IS (Intermediate System to Intermediate System) is another link-state protocol similar to OSPF, but it uses a different packet structure and terminology (Level 1 and Level 2 adjacencies). IS-IS does not require IP addresses on interfaces to form adjacencies and uses CLNP addressing internally. OSPF requires IP connectivity between neighbors.

IS-IS can form adjacencies over unnumbered point-to-point links with just Layer 2 connectivity, while OSPF requires the IP subnet to match.

Step-by-Step Breakdown

1

Down

The initial state. No hello packets have been received from the potential neighbor. The router does not know the other router exists.

2

Init

The router has received a hello packet from the neighbor, but the packet does not contain the routers own router ID. This typically happens when the neighbor has not yet received a hello back from the router. The router is aware of the neighbor but there is no bidirectional communication yet.

3

Two-Way

The router has received a hello packet that contains its own router ID, confirming bidirectional communication. In broadcast networks, this is the state where a DR and BDR election occurs. If the router is elected as DR or BDR, it will proceed to form adjacencies with all other routers. If not, it will remain in Two-Way with non-DR/BDR routers and only form a full adjacency with the DR and BDR.

4

ExStart

The router and its neighbor negotiate who will be the master and who will be the slave for the Database Description exchange. The router with the higher router ID becomes the master and controls the sequence of DD packets. This state also establishes the initial sequence number for the exchange.

5

Exchange

The routers exchange Database Description packets that contain summaries of their respective link-state databases. Each DD packet describes a set of LSAs. The routers acknowledge each DD packet and compare the summaries against their own databases to identify missing or more recent information.

6

Loading

If a router discovers it has missing or outdated LSAs during the Exchange state, it sends Link State Request packets to request the specific LSAs. The neighbor responds with Link State Update packets that contain the full LSAs. The requesting router acknowledges each LSA with a Link State Acknowledgment packet.

7

Full

The final state. Both routers have identical link-state databases. The adjacency is fully established, and the routers can now compute shortest paths using Dijkstra's algorithm and exchange routing information. In this state, any changes to the network are flooded to all adjacencies.

Practical Mini-Lesson

OSPF adjacency is not just a theoretical concept; it is a practical tool that network professionals use every day to design, deploy, and troubleshoot networks. Understanding how adjacency forms and what can disrupt it is essential for maintaining reliable routing.

When configuring OSPF on a router, you typically enable OSPF on an interface using the network command under the OSPF process, or for Cisco IOS, using the ip ospf area command on the interface. The router then begins sending hello packets. As a professional, you should immediately verify adjacency formation using the show ip ospf neighbor command. This command shows the neighbor ID, the interface, the state, and how long the neighbor has been in that state. If you see a state other than Full or Two-Way (for broadcast networks), there is a problem.

One common practical issue is when an adjacency remains stuck in Init. This usually indicates that the router is receiving hello packets but the neighbor is not seeing itself in the hello. This often happens when the subnet mask does not match. For example, if one interface is configured as /24 and the other as /25, the broadcast address differs, and the routers cannot communicate properly. Another common issue is a firewall blocking the multicast addresses 224.0.0.5 or 224.0.0.6. On many enterprise networks, switches with port security or VLAN ACLs can accidentally drop OSPF traffic.

Another practical scenario is when two routers are directly connected but one is configured as a broadcast network type and the other as point-to-point. OSPF network type must match on both sides. If they differ, the adjacency will not form. Similarly, if you are using OSPF over a VPN tunnel, you may need to configure the network type as point-to-point to avoid DR election issues on virtual interfaces.

Professionals also use the debug ip ospf adj command to see real-time adjacency changes. This output shows every state transition and the reason for any failure. However, this command should be used with caution on production devices because it can consume CPU resources.

What can go wrong? Misconfigured MTU is a classic issue. If one router has an MTU of 1500 and the other has 1492 (common with PPPoE), the Database Description packets may be too large and get dropped, causing the adjacency to stall in ExStart or Exchange. The fix is to ensure consistent MTU or configure the ip mtu command to match the smaller size.

Finally, authentication is another area of trouble. OSPF supports simple password authentication (Type 1) and MD5 authentication (Type 2). If one router has authentication enabled and the other does not, the adjacency will fail. Even if both have MD5, the keys must match exactly, including the key ID. Practical mastery of OSPF adjacency involves knowing how to configure it, verify it, and troubleshoot the common misconfigurations that cause it to fail.

OSPF Adjacency State Machine: From Down to Full

The OSPF adjacency state machine is the core mechanism by which two OSPF routers establish and maintain a neighbor relationship for exchanging link-state advertisements (LSAs). Understanding these states is critical for network engineers and appears heavily in Cisco CCNA, CompTIA Network+, and cloud certification exams like AWS SAA and Azure AZ-104 when dealing with hybrid routing scenarios. The process begins when an OSPF-enabled interface on a router detects a Hello packet from a neighbor.

The first state is Down, meaning no Hello packets have been received from the neighbor in the last Dead Interval (typically four times the Hello Interval). When a Hello packet is received, the state transitions to Init. In Init, the router has seen its own Router ID in the neighbor's Hello packet, but the bidirectional communication is not yet confirmed.

The next key state is 2-Way, which is reached when both routers see each other's Router IDs in their respective Hello packets. This indicates bidirectional communication and confirms that the link is operational. For broadcast multi-access networks like Ethernet, the Designated Router (DR) and Backup Designated Router (BDR) election occurs at the 2-Way state.

Routers that are not DR or BDR remain in 2-Way and do not progress to full adjacency; they simply exchange Hellos for neighbor discovery. For point-to-point links, the process continues to ExStart, where the master/slave relationship is established using Database Description (DBD) packets. The master controls the sequence numbers and determines the order of LSA exchange.

In ExStart, the initial DBD packets do not contain actual LSA headers; they only set the sequence numbers. Next is Exchange, where routers send DBD packets containing summaries of their LSAs. Each router compares received summaries against its own link-state database (LSDB).

If a router discovers it is missing a newer LSA, it sends a Link State Request (LSR) packet. The peer responds with a Link State Update (LSU) containing the full LSA, and the receiving router acknowledges with a Link State Acknowledgment (LSAck). This brings the routers to the Loading state, where they actively request and receive missing LSAs.

Once all LSAs are synchronized, both routers transition to Full state, meaning they have identical LSDBs and can calculate the shortest path first (SPF) tree. The Full state is the final and desired adjacency state. Any deviation from this sequence, such as staying stuck in ExStart or Loading, indicates a problem like MTU mismatch or unicast reachability issues.

Exam scenarios often test your ability to identify which state a router is in based on show commands and what action is occurring. For example, if two routers remain in ExStart, the typical cause is an MTU mismatch because the DBD packets are dropped. Similarly, if they remain in 2-Way on a broadcast network, it is normal for non-DR/BDR routers.

Understanding the states also helps in designing OSPF networks for efficiency. On broadcast multi-access segments, only DR and BDR form Full adjacencies with all other routers; non-DR/BDR routers stop at 2-Way. This reduces the number of LSAs exchanged.

In point-to-point networks, every router pair forms a Full adjacency, which is acceptable due to the limited number of peers. The state machine is also relevant to Cisco's IP SLA and OSPF troubleshooting, as well as Azure vWAN when configuring VPN-based OSPF. Mastering the OSPF adjacency states-from Down to Full-is essential for passing exams and for real-world network troubleshooting.

Each state has a specific purpose and failure mode, and exam questions often ask what happens in a given state or what command reveals the current state. The show ip ospf neighbor command is the primary tool to view adjacency states. For example, a neighbor in Full state confirms a complete database synchronization, while a neighbor in 2-Way indicates a DR/BDR election is in progress or the router is a non-designated router.

Candidates should memorize the state progression and the conditions for each transition.

OSPF Adjacency Cost and Metric Calculation

OSPF uses a metric called cost to determine the best path to a destination network. The cost of an OSPF adjacency is automatically calculated based on the bandwidth of the interface. The formula used by Cisco routers is Reference Bandwidth divided by Interface Bandwidth.

The default reference bandwidth is 100 Mbps (100,000 kbps). For example, a Fast Ethernet interface (100 Mbps) has a cost of 100000 / 100000 = 1. A Gigabit Ethernet interface (1000 Mbps) would have a cost of 100000 / 1000000 = 0.

1, but since cost must be an integer, it is rounded to 1 by default. This means that on modern networks with high-speed links, many interfaces share a cost of 1, making the metric less meaningful and causing suboptimal routing. To address this, network engineers can change the reference bandwidth using the auto-cost reference-bandwidth command.

For example, setting it to 10000 (10 Gbps) gives a Gigabit Ethernet interface a cost of 10000 / 1000 = 10, allowing for more granular path selection. The cost of a full OSPF route is the sum of the costs of all outgoing interfaces along the path. The adjacency itself does not add cost; rather, the interface on which the adjacency is formed contributes its cost to the route.

However, the stability of the adjacency directly affects the routing table. If an adjacency goes down, OSPF sends a new LSU to update the LSDB, causing an SPF recalculation. This can cause temporary routing loops or black holes until the network converges.

Examiners test the cost concept in CCNA and Network+ exams by asking how to calculate the cost of a route or how to modify the reference bandwidth. In AWS SAA, OSPF is not directly tested, but understanding adjacency metrics helps in VPN over Direct Connect scenarios where BGP is used. In Azure AZ-104, OSPF is used in ExpressRoute and VPN gateways for routing; the cost influences which path is preferred when multiple connections exist.

Another important aspect is the ability to manually set the cost on an interface using the ip ospf cost command. This overrides the auto-calculated cost and is useful for traffic engineering, such as preferring one path over another for load balancing or backup. The cost range is from 1 to 65535.

Setting a higher cost on a backup link ensures it is used only when the primary link fails. The cost value is only relevant for outbound traffic routing. Inbound traffic is controlled by the neighbor's cost.

This asymmetry is a common exam topic. For example, if Router A has a cost of 10 to reach a network, and Router B has a cost of 20, traffic from A to the network goes via A's path, but traffic from the network to A may take a different path depending on the costs on the other routers. OSPF also supports equal-cost multipath (ECMP) up to 32 paths by default on Cisco IOS (configurable with maximum-paths).

When multiple adjacency paths have the same total cost, OSPF load balances traffic across them. This is often tested in scenarios where you need to identify how many paths are used. Cost influences the DR/BDR election only indirectly because the election is based on priority and Router ID, not cost.

However, once elected, the DR and BDR form adjacencies with all other routers and the cost of those adjacencies is still part of the overall path calculation. Cost is a vital part of OSPF adjacency understanding. It determines route selection, influences convergence, and is configurable for optimization.

Exam questions often require you to calculate the cost of a link given bandwidth, to modify the reference bandwidth, or to manually set cost for traffic engineering. The concept also appears in troubleshooting where a link with higher bandwidth than another still shows the same cost due to the default reference.

OSPF Adjacency Timers: Hello and Dead Intervals

OSPF adjacency relies on two critical timers: the Hello Interval and the Dead Interval. The Hello Interval defines how often a router sends Hello packets out of an OSPF-enabled interface. The default Hello interval is 10 seconds for broadcast and point-to-point networks, and 30 seconds for non-broadcast multi-access (NBMA) networks like Frame Relay.

The Dead Interval is the time after which a router declares a neighbor unreachable if no Hello packet is received. By default, the Dead Interval is four times the Hello Interval: 40 seconds for broadcast networks and 120 seconds for NBMA. These timers must match exactly between two OSPF neighbors for an adjacency to form.

If the Hello or Dead intervals differ, the routers will not progress beyond the Init state. This is a common exam scenario in CCNA and Network+ troubleshooting questions. For example, if a router’s show ip ospf neighbor output shows a neighbor stuck in Init, one of the first checks is to compare the timers on both sides using show ip ospf interface.

The timers can be changed globally or per interface using the ip ospf hello-interval and ip ospf dead-interval commands. Changing the Hello interval automatically adjusts the Dead interval to four times the new Hello value, unless the Dead interval is explicitly set. However, it is best practice to set both manually to ensure consistency.

In fast convergence environments, engineers might reduce the Hello interval to 1 second and Dead interval to 4 seconds using the ip ospf dead-interval minimal hello-multiplier command. This enables faster detection of link failures, which is critical for real-time applications. However, this increases CPU and bandwidth usage due to more frequent Hello packets.

The timer values also affect the SPF scheduling. In OSPF, the SPF delay (wait time before running SPF after receiving an LSA) and SPF hold time (minimum time between SPF calculations) are separate from adjacency timers, but they work together to control network stability. For example, if a link flaps frequently due to low dead intervals, the constant SPF recalculations can destabilize the network.

This is why default timers are conservative. In certification exams, particularly AWS SAA and AZ-104, you may encounter OSPF timers in the context of VPN connections or Direct Connect. For instance, if a VPN tunnel drops frequently, adjusting the OSPF dead interval on the virtual interface can prevent unnecessary flapping.

Another important point: the dead interval is not just for failure detection. It also determines how quickly a router notices that a neighbor has stopped sending Hellos due to a hardware failure or a routing process crash. In multi-point networks, the dead interval is longer because Hello packets are unicast to each neighbor, requiring more overhead.

Understanding these timers helps in designing OSPF for different media types. For example, on point-to-point serial links, using a 10-second Hello and 40-second Dead is standard. On broadcast Ethernet, the same timers are used.

On NBMA, 30-second Hellos and 120-second Dead are typical. A common mistake in labs is to set different timers on each side, resulting in adjacency failure. The show ip ospf neighbor command will show the neighbor state as Down or Init.

The show ip ospf interface command displays the timer values for each interface. In exam questions, you may be asked to interpret these outputs and identify the mismatch. You might need to know that OSPF supports Hello authentication using MD5 or SHA to prevent unauthorized routers from forming adjacencies.

This is a security feature that also appears in Security+ and Azure AZ-104 (when configuring OSPF over VPN). The timers themselves are not affected by authentication, but authentication failures will also prevent adjacency from forming. Hello and Dead intervals are fundamental to OSPF adjacency maintenance.

They must match, they influence convergence speed, and they are a primary source of troubleshooting issues. Exam questions often test your ability to identify a timer mismatch from a given show command output and to know the default values for different network types.

Troubleshooting OSPF Adjacency Issues

Troubleshooting OSPF adjacency problems is a critical skill for network professionals and a recurring theme in CCNA, Network+, and corporate network engineering roles. The most common issues include mismatched OSPF parameters, Layer 2 problems, authentication failures, mismatched area types, and MTU issues. The first step in troubleshooting is to use the show ip ospf neighbor command to view the current state of neighbors.

If a neighbor is missing, check the show ip ospf interface command to ensure OSPF is enabled on the correct interface and that the network type is appropriate. For example, if two routers are connected via Ethernet but one is configured as point-to-point and the other as broadcast, the adjacency may still form if the network type is compatible, but there can be DR/BDR election differences. However, a point-to-point network type will not form an adjacency with a broadcast type because the Hello packet formats differ.

Another common issue is an ACL blocking OSPF traffic. OSPF uses IP protocol 89. If an access list blocks this traffic, no adjacency forms. The symptom is that the neighbor shows as Down, and the show ip traffic command shows no OSPF packets received.

In exam simulations, you may be presented with an ACL and asked why the adjacency is failing. MTU mismatch is a classic cause of being stuck in ExStart state. When OSPF routers exchange Database Descriptor (DBD) packets, if one side has a lower MTU, the DBD packets can be fragmented or dropped, causing the process to hang.

The solution is to set the ip mtu to the same value on both sides or use ip ospf mtu-ignore (not recommended in production). Another frequent issue is passive-interface configuration. A passive interface on one router will not send Hello packets, so the neighbor remains Down.

The passive-interface command is used to suppress routing updates, but in OSPF, it also stops Hellos, effectively preventing adjacency. This is often used on interfaces where no OSPF neighbors should exist. However, if mistakenly applied to a link connecting two routers, adjacency fails.

The symptom is that the neighbor shows as Down, and the show ip ospf interface output shows the interface is passive. Another issue is area mismatch. Both routers must be in the same area (area ID) for the adjacency to form.

If they are in different areas (e.g., area 0 and area 1), the routers will see each other's Hellos but will not form an adjacency. The state shows as Init or 2-Way, but never Full.

This is because the Hello packet contains the area ID, and if mismatched, the receiving router ignores the packet. Stub area configuration also causes mismatches. For example, if one router is configured as a stub area router and the other is not, the adjacency will not form because the LSUs from the non-stub router contain Type 5 LSAs that the stub router does not process.

The routers will stay in ExStart or Exchange state. Another subtle issue is Router ID duplication. If two routers share the same Router ID, they will not form an adjacency because OSPF uses Router ID as unique identifier.

This is typically avoided by setting Router IDs manually. A conflict can cause one router to go down due to duplicate ID detection. OSPF authentication mismatches are also common. If one side uses MD5 authentication and the other uses null authentication, or if the authentication key is different, the adjacency fails with the neighbor showing as Down.

The show ip ospf interface command will show authentication status. In cloud environments like AWS and Azure, OSPF is often used over VPN tunnels, but the adjacency may fail due to incorrect tunnel settings (e.g.

, mismatched encryption domains, wrong BGP AS number when OSPF is redistributed). The troubleshooting approach is similar: verify that the tunnel interface is up, that Hellos are being sent (using packet capture or cloud logs), and that the MTU is set correctly-usually to 1400 or less to account for IPSec overhead. In exam contexts, you may be asked to identify the cause from a given set of outputs.

For example, a neighbor stuck in ExStart points to MTU; a neighbor in Init points to timer or authentication issues; a neighbor in Down points to Layer 2 or filter issues. Understanding these patterns allows you to quickly diagnose and fix OSPF adjacency problems. The tool command show ip ospf neighbor detail provides the state, dead time, and interface.

Use debug ip ospf events and debug ip ospf adjacency for real-time analysis, but with caution in production. OSPF adjacency troubleshooting requires a systematic approach: check Layer 3 connectivity, verify OSPF parameters (area, timers, network type), confirm authentication, check MTU, and ensure no conflicting ACLs or passive interfaces. Each issue has a specific symptom that aligns with a failure state in the OSPF state machine, and exam questions test your ability to map symptom to cause.

Troubleshooting Clues

MTU Mismatch

Symptom: OSPF neighbors stuck in ExStart state. Show ip ospf neighbor shows ExStart for a long time.

Database Description (DBD) packets are fragmented or dropped due to different MTU sizes on the two ends. The larger DBD packet from one side is dropped by the other.

Exam clue: Exam question: Two routers are stuck in ExStart. What is the most likely cause? Answer: MTU mismatch.

Mismatched Hello/Dead Timers

Symptom: Neighbors remain in Init state. Router sees its own Router ID in neighbor's Hello but never progresses to 2-Way.

OSPF requires Hello and Dead intervals to match exactly on both ends. If different, Hellos are ignored after the first due to timer field mismatch.

Exam clue: Questions often ask: What command shows timers? (show ip ospf interface). Why does adjacency not form? (timer mismatch).

Area ID Mismatch

Symptom: Neighbors stay in 2-Way or Init but never reach Full. Show ip ospf neighbor shows the neighbor but in 2-Way.

OSPF routers must be in the same area to form Full adjacency. The area ID is included in Hello packets; if different, the packet is dropped after the initial discovery.

Exam clue: Scenario: Two routers are configured with area 0 on one and area 1 on the other. They see each other but never become Full. Answer: area mismatch.

Passive Interface Configured

Symptom: Neighbor shows as Down. Show ip ospf interface shows the interface as passive.

A passive interface does not send or receive OSPF Hellos. This is often used on loopbacks or interfaces with no neighbors, but if applied to a transit link, no adjacency forms.

Exam clue: Common exam question: If a router has passive-interface default and then no passive-interface on a specific link, what happens? Answer: Hellos are sent only on that link.

Authentication Mismatch

Symptom: Neighbor shows as Down or Init. The show ip ospf interface shows authentication enabled but no packets received.

One side is using null authentication and the other is using MD5, or the keys are different. OSPF authentication ensures only trusted routers form adjacencies.

Exam clue: Exam troubles: Two routers have different OSPF authentication keys. The adjacency fails. Candidates must identify the issue from logs.

Duplicate Router ID

Symptom: One router repeatedly shuts down OSPF with a syslog message indicating duplicate Router ID. Neighbors show as Down.

When two routers have the same Router ID, the one with the lower IP address will shut down its OSPF process after detecting the conflict. This prevents routing loops.

Exam clue: Question: What happens if two routers share Router ID? Answer: One router will disable OSPF temporarily.

ACL Blocking OSPF Protocol 89

Symptom: Neighbors stay Down. No OSPF packets seen in show ip traffic. Ping between routers succeeds but no OSPF adjacency.

OSPF uses IP protocol 89. ACLs that deny protocol 89 effectively block all OSPF communication, even if ICMP (ping) works.

Exam clue: Scenario: Routers can ping each other but OSPF adjacency fails. What could be the issue? Answer: ACL blocking OSPF (protocol 89).

Stub Area Mismatch

Symptom: Neighbors stuck in ExStart or Exchange. One router is configured as a stub and the other is not.

Routers in a stub area reject Type 5 LSAs. If a non-stub router sends them, the stub router discards the DBD packets, preventing proper exchange.

Exam clue: Exam: Two routers in the same area but one has area 1 stub and the other does not. Why no adjacency? Answer: Stub area flag mismatch.

Memory Tip

Remember the adjacency states as D-I-E-E-L-F: Down, Init, ExStart, Exchange, Loading, Full, say Die Elf (German for the elf).

Learn This Topic Fully

This glossary page explains what OSPF adjacency means. For a complete lesson with labs and practice, see the topic guide.

Covered in These Exams

Current Exam Context

Current exam versions that test this topic — use these objectives when studying.

Related Glossary Terms

Quick Knowledge Check

1.Two OSPF routers are connected via Ethernet. The show ip ospf neighbor command shows the neighbor in the 'Init' state. What is the most likely cause?

2.Which OSPF adjacency state indicates that the Designated Router (DR) election has completed on a broadcast multi-access network, but the router is not the DR or BDR?

3.What is the primary function of the OSPF Dead Interval?

4.When configuring OSPF on a point-to-point serial link, which network type is most efficient?

5.Which command would you use to verify the OSPF Hello and Dead intervals on a specific interface?

Frequently Asked Questions

What is the difference between OSPF neighbor and OSPF adjacency?

An OSPF neighbor is any router that has been detected through hello packets and has reached at least the Two-Way state. An OSPF adjacency is a subset of neighbor relationships where the routers have synchronized their link-state databases and reached the Full state. In a broadcast network, not all neighbors become adjacencies; only the DR and BDR do.

Why is my OSPF adjacency stuck in ExStart?

The most common cause of an adjacency stuck in ExStart is an MTU mismatch between the interfaces. The Database Description packets may be too large to be transmitted. Other possible causes include mismatched OSPF network types or a unicast configuration issue.

Can OSPF adjacency form over a WAN link?

Yes, OSPF can form adjacencies over WAN links, including Frame Relay, ATM, and MPLS VPNs. However, the network type must be configured appropriately. For point-to-point WAN links, use the point-to-point network type. For multi-access WAN topologies, use the non-broadcast network type with manual neighbor configuration.

What happens if I change the hello interval on one router but not the other?

The adjacency will fail to form because the hello interval must match on both sides. The routers will not become neighbors because they will not receive hello packets at the expected intervals. The dead interval is typically automatically set to four times the hello interval, so a dead interval mismatch also occurs.

Do all OSPF routers need to be in the same area to form an adjacency?

Yes, two routers must be configured in the same area on the same link to form an OSPF adjacency. The area ID must match. Routers in different areas cannot form adjacencies; they exchange routing information through Area Border Routers (ABRs) using summary LSAs, not direct adjacency.

How long does it take to form an OSPF adjacency?

On a fast network with default timers, an OSPF adjacency typically forms in a few seconds. The hello interval is 10 seconds on broadcast networks, and after the first hello exchange, the remaining states (Two-Way through Full) can complete in under a second. However, if the link-state databases are large, the Exchange and Loading states can take longer.

Can I form an OSPF adjacency with a router that has a different OSPF process ID?

Yes, the OSPF process ID is local to each router and does not need to match between neighbors. Adjacency depends on matching area ID, timers, network type, authentication, and subnet mask, but not the process ID. The process ID is only used internally on the router.

Summary

OSPF adjacency is the cornerstone of the OSPF link-state routing protocol. It is a formal relationship between two routers that ensures they share a consistent view of the network topology. The adjacency is built through a well-defined sequence of states, Down, Init, Two-Way, ExStart, Exchange, Loading, and Full, each representing a step in the process of discovering and synchronizing routing information.

Understanding OSPF adjacency is critical for network professionals because it directly impacts network reliability, convergence time, and scalability. Misconfigurations such as mismatched timers, area IDs, MTU, or authentication settings can prevent adjacencies from forming, leading to routing issues. In broadcast networks, the concept of DR and BDR elections further refines which routers form full adjacencies, reducing unnecessary traffic.

For certification exams, particularly the CCNA and Network+, mastering adjacency states and common troubleshooting scenarios is essential. Scenario-based questions often test your ability to diagnose why an adjacency is stuck in a particular state. Remembering that ExStart/Exchange problems are often MTU-related, while Init problems often involve mismatched area or subnet mask, will serve you well.

In the real world, stable OSPF adjacencies are a sign of a healthy network. Network engineers rely on commands like show ip ospf neighbor and debug ip ospf adj to verify and fix issues. By understanding the mechanics of adjacency formation, you can design robust networks that adapt quickly to changes and path failures.

Overall, OSPF adjacency is not just an exam topic-it is a practical skill that every networking professional must have. Whether you are studying for a certification or managing a production network, a solid grasp of this concept will help you build and maintain efficient, reliable IP networks.