Open Shortest Path First (OSPF) and Enhanced Interior Gateway Protocol (EIGRP) are two of the most popular Internal Gateway Protocols (IGPs) employed in today’s modern IP networks.
Both are mature protocols, having been around for decades, and are extremely reliable, flexible, and highly configurable. And yet, they are surprisingly dissimilar in their architecture, implementation, and design.
In this article we’ll discuss and compare OSPF vs EIGRP routing protocols, but first let’s see a quick comparison table of the two:
Comparison Table of OSPF vs EIGRP
The following table compares some of the most important characteristics of these two protocols:
|1||Type||Distance vector||Advanced link-state|
|2||Open standard?||Yes, since inception||Began as proprietary but has become an open standard as of 2013|
|3||Routing algorithm||Dijkstra’s Algorithm||Diffusing Update Algorithm (DUAL)|
|4||Topology||Each router maintains a network topology within the OSPF database of the area in which it resides||Each router maintains a topology table that contains the routes it has learned about via EIGRP|
|5||Areas||Uses areas to break down larger topologies into manageable segments||Does not use areas|
|6||Scalability||Extremely scalable due to area architecture and multiple LSA types||Extremely scalable due to incremental updates and storing of partial topologies|
|7||Resource usage (CPU, memory, and network throughput)||Low usage due to multiple LSA types and area architecture||Lowers usage due to incremental updates, and implementation of feasible successor|
|8||Support for IPv4 and IPv6||Yes, in OSPFv3||Yes|
|9||Convergence speed||Fast||Extremely fast|
|10||Default administrative distance (AD)||110||90|
Now let’s take a closer look at each one.
OSPF was first conceived in the 1980s and was officially released in 1989 in RFC 1131. It is a non-proprietary protocol, meaning it can be freely implemented by the equipment of any vendor, and it is what is known as a link-state routing protocol.
An OSPF router will gather link state information from neighboring OSPF routers and will create and maintain a topology of the whole network within its memory.
This is maintained within a data structure known as the OSPF database. In a converged network, all OSPF routers will have constructed an identical copy of the network topology in their memories. This is the main construct via which OSPF operates.
One of the major differences between OSPF and EIGRP is the fact that OSPF uses a concept of areas. An area in OSPF is simply a logical grouping of routers.
Each OSPF area maintains a separate OSPF database. OSPF routers can either exist wholly within an area, or they can have interfaces within two or more areas, making them border routers. Take a look at the following diagram which illustrates this:
In this case, R1 has one interface in Area 0 and one in Area 1. R1 is thus considered an Area Border Router or ABR. ABRs maintain a separate OSPF database for every area that they are connected to.
There are some restrictions as to how areas can be created, and these include:
- An OSPF topology must always have an Area 0. This is also called the backbone area.
- All non-backbone areas must be directly connected to Area 0. In other words, any ABR within a non-backbone area must also have a connection to Area 0.
With the introduction of areas, OSPF database contents are limited to the routes found within each area. A router in Area 0 doesn’t need to have information about the network topology in Area 1, for example.
It is this very characteristic, that of segmenting an OSPF topology into smaller more manageable areas, that makes OSPF extremely scalable.
Link State Advertisements
OSPF’s routing updates are called Link State Advertisements (LSAs). These are messages exchanged between OSPF routers to share information about their local routing topologies.
Because of the scalability introduced with the use of OSPF areas, not all LSAs are flooded out of all interfaces of an OSPF router.
There are various types of LSAs, each one limited to being shared with specific OSPF neighbors. In this way, detailed OSPF information is kept localized, ensuring that any routing information not useful for particular routers is not shared, while summary information about routes is flooded to the whole topology. This ensures the minimization of the use of system resources on OSPF routers.
Unlike OSPF, EIGRP began as a proprietary routing protocol developed by Cisco. It is the enhanced version of its original IGRP protocol and was introduced in 1993.
It is known as an advanced distance-vector routing protocol. EIGRP does not maintain a database containing the full network topology, but only shares information about the routes in its routing table.
When sending updates to its neighbors, an EIGRP router doesn’t share the entirety of its routing information, but sends incremental updates, vastly reducing network bandwidth usage as well as processing and memory resources on each router.
EIGRP uses the following data constructs in addition to the routing table, to achieve its operation:
Neighbor table – This is a record of the IP addresses of neighboring routers, those that have a direct physical connection to the local router. Only routers with IP addresses in the same subnet as an interface of the local router are considered neighbors.
Topology table – This construct stores routes that the router has learned from its neighbors. It only stores EIGRP-learned routes but makes a record of all possible routes to a particular destination. It is only the best route in the topology table that makes it into the routing table.
Successors and Feasible Successors
As mentioned before, within the topology table, all of the possible routes to a particular destination are recorded.
This means that there may be two, three, four, or more paths that can be taken to reach a particular destination, and all of them are maintained there. The best route, which is placed in the routing table is called the successor. The second-best route is called the feasible successor.
This is an important concept because EIGRP has a trick up its sleeve. It is always ready to immediately (within several milliseconds) replace the successor with the feasible successor in the event of a failure without the need to rerun the EIGRP routing algorithm, which may take substantially longer depending upon the size of the topology. This makes EIGRP lightning fast in the event of a failure of a route.
In order to become a feasible successor, this second-best route must fulfill what is known as the feasibility condition, but that’s a topic for another article.
We can come to some conclusions about these protocols based on the above information:
- OSPF is generally preferred due to its open architecture
- EIGRP is generally preferred due to its slightly better handling of resources, especially for large networks. This is reflected in its slightly lower AD
- There is no solid evidence for which protocol is more scalable (i.e. which can support a larger network size) as both, under varying circumstances, perform similarly. However:
- EIGRP is better in environments where there are more routes to share among fewer routers
- OSPF is better in environments where there are fewer routes to share among more routers
Links to relevant standards:
- OSPFv2 RFC2328
- OSPFv3 RFC5340 (includes support for IPv6)
- EIGRP RFC7868 (published when it became an open standard)