Compare
3.2.a Compare routing concepts of EIGRP and OSPF (advanced distance vector vs. link state, load balancing, path selection, path operations, metrics, and area types)
Aligned to Cisco's 350-401 ENCOR v1.2 exam topics.
On this page
EIGRP and OSPF both help routers learn routes dynamically. The difference is how they think.
EIGRP behaves like an advanced distance-vector protocol. A router asks, “What distance does my neighbor report, and what is my total distance through that neighbor?”
OSPF behaves like a link-state protocol. A router asks, “What does the topology look like, and what is the shortest path through that topology?”
That difference explains most exam questions.
High-level comparison
| Topic | EIGRP | OSPF |
|---|---|---|
| Type | Advanced distance vector | Link state |
| Algorithm | DUAL | SPF / Dijkstra |
| Neighbor scope | Direct neighbors exchange route information | Routers flood LSAs inside areas |
| Metric | Composite metric based mainly on bandwidth and delay by default | Cost, usually based on interface bandwidth |
| Topology view | Best routes and feasible backup routes | Link-state database for the area |
| Design unit | Autonomous system with optional summarization/stubs | Areas, with backbone area 0 |
| Load balancing | Equal-cost and unequal-cost with variance | Equal-cost only by default |
EIGRP path selection
EIGRP keeps three important values straight:
- Feasible Distance (FD): your total metric to the destination through a neighbor.
- Reported Distance (RD) or Advertised Distance: the neighbor’s metric to the destination.
- Feasibility Condition: a neighbor can be a feasible successor if its RD is less than your current FD.
The feasibility condition prevents loops. It is also why the “second best” route may not be immediately usable as a backup.
Destination prefix X
N1 · current successor
N2 · alternate neighbor
R1 feasible distance FD via N1
Feasible successor · fast switchover if N1 fails
Not feasible · N2 cannot be backupBasic named-mode EIGRP example:
router eigrp CAMPUS
address-family ipv4 unicast autonomous-system 100
network 10.0.0.0 0.255.255.255
af-interface default
passive-interface
exit-af-interface
af-interface GigabitEthernet0/0
no passive-interface
exit-af-interface
exit-address-familyVerify:
show ip eigrp neighbors
show ip eigrp topology
show ip route eigrp
show ip protocolsOSPF path selection
OSPF routers build a link-state database and run SPF to choose shortest paths. OSPF cost is normally based on interface bandwidth.
Basic OSPFv2 example:
router ospf 10
router-id 1.1.1.1
passive-interface default
no passive-interface GigabitEthernet0/0
network 10.0.0.0 0.0.0.255 area 0Verify:
show ip ospf neighbor
show ip ospf database
show ip route ospf
show ip ospf interface briefMetrics
EIGRP metric
Classic EIGRP uses bandwidth and delay by default. Reliability and load exist in the formula but are not used by default unless K-values are changed.
The exam-level idea: EIGRP prefers the path with the lowest composite metric. Bandwidth is based on the slowest link in the path; delay accumulates along the path.
OSPF metric
OSPF cost is interface-based. Lower cost wins. The common formula is:
cost = reference bandwidth / interface bandwidthOn modern networks, set the reference bandwidth high enough for current link speeds:
router ospf 10
auto-cost reference-bandwidth 100000Use the same reference bandwidth everywhere in the OSPF domain. If routers disagree, path selection becomes confusing.
Load balancing
EIGRP can do equal-cost load balancing and unequal-cost load balancing.
router eigrp CAMPUS
address-family ipv4 unicast autonomous-system 100
variance 2
maximum-paths 4
exit-address-familyOSPF normally installs equal-cost paths only. If two OSPF paths have the same total cost, both can be installed.
router ospf 10
maximum-paths 4Area types and design
OSPF uses areas. Area 0 is the backbone. Non-backbone areas must connect to area 0 directly or through a virtual link in special cases.
Area types you should recognize:
| Area type | Purpose |
|---|---|
| Normal | Allows intra-area, inter-area, and external routes. |
| Stub | Blocks external LSAs and uses a default route. |
| Totally stubby | Blocks external and most inter-area detail; uses a default route. |
| NSSA | Allows limited external injection from inside a stub-like area. |
EIGRP does not use OSPF-style areas. It can use summarization, stub routers, and query boundaries to make operation cleaner.
Path operations
When a link fails:
- EIGRP can use a feasible successor immediately if one exists. If not, it queries neighbors.
- OSPF floods the topology change and routers run SPF again.
This matters for troubleshooting. An EIGRP route may disappear while the router queries. OSPF may have a neighbor adjacency that is fine, but the LSDB or area design causes the route you expect not to appear.
Lab: Compare route choice
Topology
R1
R2
R3
R4R1 has two paths to R4: through R2 and through R3.
Task 1: Run OSPF
Configure OSPF area 0 on all links:
router ospf 10
router-id 1.1.1.1
network 10.0.0.0 0.255.255.255 area 0Verify on R1:
show ip route ospf
show ip ospf neighbor
show ip ospf interface briefChange interface cost on one path:
interface gi0/0
ip ospf cost 50Watch the route change.
Task 2: Run EIGRP
Remove OSPF or use a separate lab. Configure EIGRP:
router eigrp CAMPUS
address-family ipv4 unicast autonomous-system 100
network 10.0.0.0 0.255.255.255
exit-address-familyVerify:
show ip eigrp topology
show ip route eigrpIf the backup path is a feasible successor, shut the primary link and watch EIGRP install the backup quickly.
Exam traps
- EIGRP’s feasible successor is not just the second-lowest metric route. It must pass the feasibility condition.
- OSPF neighbors can be full, but route filtering, summarization, area type, or cost can still change what appears in the routing table.
- OSPF cost depends on reference bandwidth. Bad reference bandwidth can make high-speed links look equal.
- EIGRP supports unequal-cost load balancing with
variance; OSPF does not in normal operation. - OSPF area 0 is the backbone. Area design matters.
Quick checklist
- Is this a neighbor problem or a path-selection problem?
- For EIGRP, what are FD, RD, successor, and feasible successor?
- For OSPF, what is the area, cost, and LSDB view?
- Is summarization or filtering hiding a route?
- Is equal-cost or unequal-cost load balancing expected?