ENGINEERING GUIDE · ROUTING

Routing Protocols

How routers learn routes, choose paths and recover from failures—with practical coverage of OSPF, EIGRP, BGP and other major protocols.

Engineering referenceLayer 3IGP · BGP
The important bit: longest-prefix match comes first. When multiple routes match a destination, the most specific prefix wins; route-source preference and protocol metrics are considered after that.

Control and data planes

The control plane learns and maintains routes. Routes can be connected, static or learned dynamically. The data plane forwards packets using the resulting forwarding information, usually held in a FIB derived from the routing table.

Route selection

Routers first use the destination prefix to find the most specific match. For example, 10.10.10.0/24 beats 10.10.0.0/16 for a destination inside the /24.

If multiple sources offer the same prefix, implementations use a route-source preference. Cisco calls this Administrative Distance (AD); other vendors use terms such as route preference. Common Cisco defaults include connected 0, static 1, eBGP 20, EIGRP internal 90, OSPF 110 and RIP 120.

After the route source is selected, the routing protocol's own metric or path-selection attributes determine the preferred path where multiple candidates exist. A route can therefore be present in a routing table without being the path ultimately used for a particular destination.

Metrics

Metrics are protocol-specific. RIP uses hop count. OSPF uses cost. EIGRP uses a composite metric. BGP is policy-driven and considers path attributes rather than simply selecting the shortest physical route.

OSPF

OSPF is a link-state IGP. Routers form adjacencies, exchange LSAs, build a link-state database and run the Shortest Path First calculation to derive routes.

  • Area 0: the backbone area in a conventional multi-area design.
  • ABR: connects OSPF areas.
  • ASBR: injects routes from another routing domain.
  • DR/BDR: reduce adjacency overhead on broadcast multi-access networks.
  • OSPFv2: commonly used for IPv4.
  • OSPFv3: designed for IPv6 and extended for address-family support by implementations.

OSPF cost is implementation-dependent. On Cisco IOS, the default reference bandwidth is 100 Mbps, so modern high-speed links can require an explicit reference-bandwidth adjustment to avoid unintended equal costs.

When OSPF fails, distinguish an interface problem from an adjacency problem, an LSDB problem and an SPF/routing problem. Two routers can have an interface that is up while failing to form an adjacency because of area, timer, MTU, network-type, authentication or parameter mismatches.

EIGRP

EIGRP is an advanced distance-vector protocol associated strongly with Cisco networks. Its DUAL algorithm maintains loop-free paths and can use feasible successors for rapid recovery.

Important terminology includes successor, feasible successor, feasible distance and reported distance. Variance can permit unequal-cost load balancing where topology and implementation conditions are satisfied.

EIGRP is documented by RFC 7868 as an Informational RFC; it is not an IETF standards-track IGP.

BGP

BGP is a path-vector protocol used between autonomous systems and extensively within large networks. eBGP exchanges routes between ASes; iBGP distributes routes within an AS.

BGP selection is policy-driven. Common attributes include LOCAL_PREF, AS_PATH, MED, origin, next hop and communities. Filtering, prefix limits and route-policy controls are essential operational safeguards.

For internet-facing infrastructure, RPKI-based Route Origin Validation can help identify announcements inconsistent with published route-origin authorisations. It does not replace routing policy or prove that an entire route is safe.

Other protocols

ProtocolRole
RIP/RIPngSimple distance-vector routing; mostly legacy or small deployments
OSPF/OSPFv3Link-state IGP for enterprise and service-provider networks
IS-ISLink-state IGP widely used in service-provider and large networks
EIGRPAdvanced distance vector, primarily Cisco environments
BGPInter-AS and policy-driven routing; also widely used inside large networks

Troubleshooting

  1. Check the destination address and longest-prefix match.
  2. Identify every route source offering the prefix.
  3. Check administrative distance/route preference and protocol metric.
  4. For OSPF, inspect neighbours, LSDB, LSAs, area placement and SPF results.
  5. For BGP, inspect session state, next hop, policy, LOCAL_PREF, AS_PATH, MED and filtering.
  6. Check the FIB/forwarding entry and next-hop resolution.
  7. Trace the packet hop-by-hop and verify return routing.
Common failure: a route can be present in the control-plane table while forwarding still fails because of next-hop resolution, ACL/firewall policy, asymmetric return routing or a data-plane programming issue.

Standards and references

  • RFC 2328 — OSPF Version 2.
  • RFC 4271 — BGP-4.
  • RFC 7868 — EIGRP specification.
  • Vendor documentation for implementation-specific route preference and metric defaults.

Key takeaways

Routing is hierarchical decision-making: match the destination prefix, select the appropriate route source, apply protocol-specific path selection and then forward towards a resolvable next hop. Troubleshooting becomes much easier when these stages are checked separately.