Skip to content
Log in Sign up My account

3.2.a EIGRP vs OSPF

Blueprint 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)

  • Advanced distance vector (EIGRP, DUAL) vs link state (OSPF, SPF)
  • Load balancing: equal-cost in both, unequal-cost in EIGRP only
  • Path selection and path operations: successor and feasible successor vs SPF tree and route types
  • Metrics: composite bandwidth and delay vs cost from reference bandwidth
  • Area types: OSPF hierarchy (backbone, normal, stub, NSSA) vs a flat EIGRP domain

The verb is compare. You will not configure EIGRP for ENCOR beyond the basics, but you must be able to say which protocol does what, why, and with which default. ENARSI goes much deeper on both. This page gives you the ENCOR level and a lab that shows the most testable differences on real routers.

Two families of interior protocol

Both protocols are interior gateway protocols that converge quickly, support VLSM and authentication, and send updates only when something changes. The difference is in what each router knows.

EIGRP OSPF
Family Advanced distance vector (sometimes called hybrid) Link state
Algorithm DUAL (Diffusing Update Algorithm) Dijkstra SPF
What a router knows Each neighbor's metric to each prefix (the neighbor's view) A full map of its area (every router and link)
Standard Cisco, published as informational RFC 7868 Open standard: OSPFv2 RFC 2328, OSPFv3 RFC 5340
Transport IP protocol 88, RTP for reliability IP protocol 89
Multicast (IPv4) 224.0.0.10 224.0.0.5 all OSPF routers, 224.0.0.6 DR and BDR
Multicast (IPv6) FF02::A FF02::5 and FF02::6
Administrative distance 90 internal, 170 external, 5 summary 110 for all OSPF routes
Hello and hold or dead (LAN) 5 s and 15 s 10 s and 40 s
Hierarchy None. Flat autonomous system Two levels: backbone area 0 and other areas
Summarization On any interface, any router Only on ABRs (area range) and ASBRs (summary-address)
Load balancing Equal-cost, plus unequal-cost with variance Equal-cost only

Distance vector, done well

A pure distance vector protocol such as RIP only knows "my neighbor says the destination is N hops away". EIGRP adds three things that make it "advanced": it keeps every neighbor's advertised metric in a topology table, it uses DUAL to prove a backup path is loop free before it ever needs it, and it sends partial bounded updates instead of periodic full tables.

Every OSPF router in an area floods link-state advertisements (LSAs) describing its links. Every router in the area ends up with an identical link-state database (LSDB), then runs SPF with itself as the root to build a shortest-path tree. Routes come from that tree. Because every router has the same map, OSPF does not need DUAL style feasibility checks to avoid loops, but every change in an area triggers SPF on every router in that area. Areas exist to limit that.

graph TB
  subgraph EIGRP ["EIGRP: routing by rumour with proof"]
    E1["Neighbor tables"] --> E2["Topology table<br/>FD and RD per path"]
    E2 --> E3["DUAL picks successor<br/>and feasible successors"]
    E3 --> E4["Routing table"]
  end
  subgraph OSPF ["OSPF: routing by map"]
    O1["Neighbor table"] --> O2["LSDB, identical<br/>in the area"]
    O2 --> O3["SPF tree with<br/>self as root"]
    O3 --> O4["Routing table"]
  end

Metrics

EIGRP composite metric

EIGRP can use bandwidth, delay, load and reliability, controlled by the K values. The defaults are K1 = 1, K2 = 0, K3 = 1, K4 = 0, K5 = 0, which means only bandwidth and delay count. K values must match between neighbors or the adjacency does not form.

With default K values, the classic metric is:

metric = 256 x ( 10^7 / lowest bandwidth on the path in kbps + total delay on the path in tens of microseconds )

  • Bandwidth is the slowest link along the path, so one slow link dominates.
  • Delay is cumulative, so every hop adds to it.
  • Both come from the interface bandwidth and delay commands, not from measured traffic. Changing bandwidth changes the metric without changing the link speed.

Worked example for a GigabitEthernet path: bandwidth 1,000,000 kbps gives 10^7 / 10^6 = 10. Each Gigabit interface has a delay of 10 microseconds, which is 1 in tens of microseconds. A prefix one Gigabit hop away on a connected Gigabit interface has 256 x (10 + 2) = 3072.

Named mode (router eigrp NAME) uses 64-bit wide metrics so links faster than 1 Gbps can be told apart. The values in the topology table are much larger, and the value placed in the routing table is scaled down. You only need to know that wide metrics exist and why.

OSPF cost

OSPF cost per interface = reference bandwidth / interface bandwidth, with a minimum of 1. The default reference bandwidth is 100 Mbps. The path cost is the sum of the outgoing interface costs along the path.

Interface Cost with default 100 Mbps reference Cost with auto-cost reference-bandwidth 100000 (100 Gbps)
10 Mbps Ethernet 10 10000
100 Mbps FastEthernet 1 1000
1 Gbps 1 100
10 Gbps 1 10
100 Gbps 1 1

With the default, OSPF cannot tell 100 Mbps, 1 Gbps and 10 Gbps apart. Fix it with auto-cost reference-bandwidth <Mbps> on every router in the domain, or set ip ospf cost per interface.

Exam trap

auto-cost reference-bandwidth is entered in Mbps, while the interface bandwidth command is in kbps. And if you raise the reference bandwidth on only some routers, the routers calculate costs on different scales and you get asymmetric or suboptimal paths. IOS even warns you to make it consistent on all routers.

Path selection and path operations

EIGRP: successor and feasible successor

Term Meaning
Reported distance (RD) The neighbor's own metric to the prefix, as it advertised it. Also called advertised distance
Feasible distance (FD) The best metric this router has ever had to the prefix since it last went passive: RD plus the cost to reach that neighbor
Successor The neighbor on the best path. Installed in the routing table
Feasibility condition A path is loop free if its RD is strictly less than the current FD
Feasible successor (FS) A backup neighbor that meets the feasibility condition. Kept in the topology table, ready to use instantly

When the successor fails, EIGRP promotes a feasible successor at once without asking anyone. If there is no feasible successor, the route goes active and the router sends queries to its neighbors, which may query their own neighbors. If a query is not answered in time (3 minutes by default), the route becomes stuck in active (SIA). Summarization and stub routers are the tools that bound the query range. A route that is stable is passive.

graph LR
  R1["R1"] -- "via R2: FD 131072, RD 130816" --- R2["R2"]
  R1 -- "via R3 direct: FD 153856, RD 128256" --- R3["R3<br/>owns 10.255.255.3/32"]
  R2 --- R3

In the lab below, the path through R2 is the successor (metric 131072). The direct path to R3 has RD 128256, which is less than 131072, so it is a feasible successor.

OSPF: route types, then cost

OSPF picks a path in two steps. It prefers route types in this order, and only compares cost between routes of the same type:

  1. Intra-area (O)
  2. Inter-area (O IA)
  3. External type 1 (O E1, or O N1 from an NSSA)
  4. External type 2 (O E2 or O N2). E2 is the default for redistributed routes and its cost does not grow inside the domain

When the LSDB changes, OSPF floods the new LSA and every router in the area reruns SPF. A change in another area only changes type 3 summaries, which needs a partial calculation, not a full SPF. LSAs are refreshed every 30 minutes and age out after 60 minutes.

Load balancing

EIGRP OSPF
Equal-cost paths Yes, maximum-paths (default 4) Yes, maximum-paths (default 4)
Unequal-cost paths Yes, with variance No
Rule for unequal-cost Path must be a feasible successor and its metric must be less than variance x FD Not applicable
Traffic share Proportional to metric Equal

With variance 2, any feasible successor with a metric lower than twice the FD is installed alongside the successor. A path that is not a feasible successor is never used for load balancing, however low the variance multiplier makes it look.

Exam trap

Variance only applies to feasible successors. If a question shows a path with a metric that falls inside variance x FD but whose reported distance is equal to or higher than the FD, it is not installed. Equal is not good enough: the feasibility condition is strictly less than.

Area types and scaling

EIGRP has no areas. Every router in the autonomous system can be reached by queries, and you scale it with summarization (on any interface) and stub routers (eigrp stub), which tell neighbors not to send them queries. The AS number must match between neighbors.

OSPF scales with areas. All non-backbone areas must connect to area 0. ABRs connect areas, ASBRs inject external routes. Area types control which LSAs enter an area:

Area type Type 3 (inter-area) Type 5 (external) Type 7 (NSSA external) Default route
Normal (and backbone) Yes Yes No Only if originated
Stub Yes No No Yes, from ABR
Totally stubby (Cisco) No, except default No No Yes, from ABR
NSSA Yes No Yes, converted to type 5 at the ABR Not by default
Totally NSSA (Cisco) No, except default No Yes Yes, from ABR

ENCOR 3.2.b only asks you to configure normal areas. The other types are here for the compare objective and are covered in depth in ENARSI 1.10.

Exam trap

"Which protocol supports areas?" is not the whole question. EIGRP can summarize anywhere and can limit queries with stub routing, so it scales without areas. OSPF can only summarize at area borders. When a question asks where you can place a summary, the protocol decides the answer.

Configuration side by side

router eigrp 100
 eigrp router-id 10.255.255.1
 network 10.0.0.0
 passive-interface Loopback0
 variance 2
 maximum-paths 4
!
show ip eigrp neighbors
show ip eigrp topology
show ip eigrp interfaces
show ip protocols
router eigrp LAB
 address-family ipv4 unicast autonomous-system 100
  eigrp router-id 10.255.255.1
  network 10.0.0.0
  af-interface Loopback0
   passive-interface
  exit-af-interface
  topology base
   variance 2
  exit-af-topology
!
show eigrp address-family ipv4 neighbors
show eigrp address-family ipv4 topology
router ospf 1
 router-id 10.255.255.1
 auto-cost reference-bandwidth 100000
 passive-interface Loopback0
 maximum-paths 4
!
interface GigabitEthernet0/1
 ip ospf 1 area 0
!
show ip ospf neighbor
show ip ospf interface brief
show ip route ospf

Lab: same topology, two protocols, two answers

Topology: module lab routers R1, R2, R3, plus a temporary extra link R1 Gi0/2 to R3 Gi0/2 on 10.1.3.0/30 (R1 .1, R3 .2). Set bandwidth 100000 (100 Mbps) on both ends of that link. Goal: see EIGRP unequal-cost load balancing and the OSPF reference bandwidth problem on the same links.

graph LR
  R1["R1"] -- "Gi0/1 10.1.2.0/30 1 Gbps" --- R2["R2"]
  R2 -- "Gi0/0 10.2.3.0/30 1 Gbps" --- R3["R3 Lo0 10.255.255.3"]
  R1 -- "Gi0/2 10.1.3.0/30 bandwidth 100 Mbps" --- R3
  1. Address all links and loopbacks. On R1 and R3 Gi0/2, add bandwidth 100000.
  2. Configure router eigrp 100 with network 10.0.0.0 on all three routers.
  3. On R1, look at the topology entry for R3's loopback.

    R1# show ip eigrp topology | section 10.255.255.3
    P 10.255.255.3/32, 1 successors, FD is 131072
            via 10.1.2.2 (131072/130816), GigabitEthernet0/1
            via 10.1.3.2 (153856/128256), GigabitEthernet0/2
    

    The path through R2 is the successor. The direct path has RD 128256, lower than the FD of 131072, so it is a feasible successor. Check the maths: through R2 the lowest bandwidth is 1 Gbps (10) and the delay is three hops of 10, 10 and 5000 microseconds (502), so 256 x 512 = 131072. Directly, the lowest bandwidth is 100 Mbps (100) and the delay is 10 plus 5000 microseconds (501), so 256 x 601 = 153856.

  4. Add variance 2 under router eigrp 100 on R1. 153856 is less than 2 x 131072, so both paths are installed.

    R1# show ip route 10.255.255.3
    Routing entry for 10.255.255.3/32
      Known via "eigrp 100", distance 90, metric 131072, type internal
      ...
      * 10.1.2.2, from 10.1.2.2, ..., via GigabitEthernet0/1
          Route metric is 131072, traffic share count is ...
        10.1.3.2, from 10.1.3.2, ..., via GigabitEthernet0/2
          Route metric is 153856, traffic share count is ...
    

    Both next hops are installed with different metrics. The traffic share counts (elided here) are unequal, with more traffic sent on the lower-metric path.

  5. Configure OSPF on all three routers (ip ospf 1 area 0 on every link and loopback). The routing table does not change, because EIGRP's AD of 90 beats OSPF's 110.

  6. Remove EIGRP with no router eigrp 100 on all routers. Check R1 again.

    R1# show ip route ospf | include 10.255.255.3
    O        10.255.255.3/32 [110/2] via 10.1.3.2, 00:00:12, GigabitEthernet0/2
    

    OSPF now prefers the slow link. With the 100 Mbps reference, both 1 Gbps and 100 Mbps links cost 1, so the direct path (two interfaces) beats the path through R2 (three interfaces).

  7. Add auto-cost reference-bandwidth 100000 on all three routers. Now Gigabit links cost 100 and the 100 Mbps link costs 1000, so R1 uses Gi0/1 through R2 (200 plus the loopback cost) instead of Gi0/2 (1000 plus the same loopback cost). OSPF has no variance, so it uses only one path.

  8. Remove the temporary R1 to R3 link before the next page's lab.

Quick check

R1 has a successor to 10.9.9.0/24 with FD 3072. A second neighbor reports the prefix with RD 3072 and a total metric of 3328. Is it a feasible successor?

No. The feasibility condition requires the reported distance to be strictly less than the feasible distance. 3072 is equal, not less, so the path is not guaranteed loop free and is not kept as a feasible successor. variance cannot use it either.

An engineer upgrades a link from 1 Gbps to 10 Gbps. The OSPF path does not change. Why?

With the default reference bandwidth of 100 Mbps, both links have cost 1. Raise auto-cost reference-bandwidth consistently on all routers (for example to 100000 for 100 Gbps) or set ip ospf cost manually.

Which protocol needs an extra feature to stop a change in one part of the network from reaching every router, and what are those features?

EIGRP, because it has no areas and queries can travel across the whole AS. Summarization and stub routers bound the query scope. OSPF limits the scope of SPF with areas by design.

References

  • RFC 7868, Cisco's Enhanced Interior Gateway Routing Protocol (EIGRP), at rfc-editor.org
  • RFC 2328, OSPF Version 2, and RFC 5340, OSPF for IPv6, at rfc-editor.org
  • IP Routing: EIGRP Configuration Guide and IP Routing: OSPF Configuration Guide for IOS XE: search on cisco.com
  • Cisco Live On-Demand Library: search "EIGRP deployment" and "OSPF design"