Routing

Routing Protocols Guide — BGP, OSPF, EIGRP, RIP Explained

G Gurpreet Singh July 28, 2026 5 min read
Routing Protocols Guide — BGP, OSPF, EIGRP, RIP Explained
Routing protocols determine the best path for packets across a network. IGPs (OSPF, EIGRP, RIP) route within one Autonomous System. EGPs (BGP) route between different ASes. OSPF uses Dijkstra's algorithm (AD 110), EIGRP uses DUAL (AD 90), BGP uses path-vector attributes (AD 20 eBGP, 200 iBGP).
Key takeaways

  • BGP is the internet's routing protocol — EGP that routes between Autonomous Systems using TCP port 179
  • OSPF is the most popular enterprise IGP — link-state, uses Dijkstra's SPF, administrative distance 110
  • EIGRP is Cisco's advanced distance-vector protocol — uses DUAL algorithm, AD 90, fastest convergence
  • RIP uses hop count (max 15) as its only metric — largely obsolete but still in CCNA curriculum
  • Administrative Distance determines which protocol's route is preferred when multiple protocols advertise the same prefix
  • IS-IS is preferred by large ISP backbone networks — runs over Layer 2, not IP
  • Static routes have AD of 1 — always preferred over dynamic routing protocols

Routing protocols are algorithms that determine the best path for data to travel across a network. The two main categories are Interior Gateway Protocols (IGPs) like OSPF and EIGRP used inside a single AS, and Exterior Gateway Protocols (EGPs) like BGP used between different Autonomous Systems on the internet.

What is a Routing Protocol?

A routing protocol is a set of rules that routers use to discover network paths, share routing information with each other, and determine the best path to forward packets. Without routing protocols, routers would only know about directly connected networks — they would have no idea how to reach distant destinations.

Every routing protocol must solve the same fundamental problem: given a destination IP address, what is the best next hop to forward this packet toward its destination?

Types of Routing Protocols

1. Static vs Dynamic Routing

Before diving into specific protocols, understand the fundamental choice:

  • Static routing: Routes manually configured by an administrator. Simple, predictable, but does not adapt to failures. Good for small networks or specific policy routes.
  • Dynamic routing: Routers automatically discover paths and adapt to changes. Essential for medium and large networks.

2. Distance Vector vs Link-State

FeatureDistance VectorLink-State
AlgorithmBellman-FordDijkstra (SPF)
ViewKnows direction + distanceComplete network map
ExamplesRIP, EIGRPOSPF, IS-IS
ConvergenceSlowerFaster
CPU/MemoryLowerHigher
UpdatesPeriodic full tableEvent-driven LSA flooding

IGP vs EGP — Interior vs Exterior

FeatureIGP (Interior)EGP (Exterior)
ScopeWithin one ASBetween different ASes
ExamplesOSPF, EIGRP, RIP, IS-ISBGP
MetricCost, bandwidth, delayPolicy-based attributes
ScaleThousands of routes900,000+ internet routes

BGP — Border Gateway Protocol

BGP is the routing protocol of the internet — it connects Autonomous Systems (ASes) across the globe. Every major ISP, cloud provider, and large enterprise runs BGP.

Key facts:

  • EGP — runs between different ASes (eBGP) or within an AS (iBGP)
  • Uses TCP port 179 for session establishment
  • Path-vector protocol — decisions based on policy attributes, not just shortest path
  • BGP decision process uses 11 attributes in order: Weight → Local Preference → Locally originated → AS-Path → Origin → MED → eBGP over iBGP → IGP metric → etc.

BGP Cluster on this site:

OSPF — Open Shortest Path First

OSPF is the most widely deployed IGP for enterprise networks. It is an open standard (RFC 2328) link-state protocol that uses Dijkstra’s SPF algorithm to calculate the shortest path to every destination.

Key facts:

  • Uses IP protocol 89 — not TCP or UDP
  • Multicast addresses: 224.0.0.5 (all OSPF routers) and 224.0.0.6 (DR/BDR)
  • Hierarchical — uses areas to limit LSA flooding scope
  • Area 0 (backbone) required — all areas must connect to it
  • Metric = cost (reference bandwidth / interface bandwidth)
  • Elects DR/BDR on multi-access networks to reduce LSA flooding

OSPF Cluster on this site:

EIGRP — Enhanced Interior Gateway Routing Protocol

EIGRP is Cisco’s advanced distance-vector protocol using the DUAL (Diffusing Update Algorithm). It was Cisco-proprietary until 2013 when it was partially opened as an informational RFC.

Key facts:

  • Uses IP protocol 88 — multicast 224.0.0.10
  • Composite metric: bandwidth + delay (+ reliability, load, MTU optionally)
  • DUAL algorithm guarantees loop-free paths and fast convergence
  • Feasible Successor = pre-calculated backup path — instant failover
  • Unequal-cost load balancing supported (variance command)
  • Partial updates only — does not send full routing table periodically

RIP — Routing Information Protocol

RIP is the simplest dynamic routing protocol and one of the oldest. It uses hop count as its only metric (max 15 hops — 16 = unreachable).

  • RIPv1: Classful, broadcast updates — obsolete
  • RIPv2: Classless, multicast (224.0.0.9), supports authentication
  • RIPng: RIPv2 for IPv6

RIP is rarely used in production today — OSPF and EIGRP converge faster and scale far better. It is still tested on CCNA exams as a foundational concept.

IS-IS — Intermediate System to Intermediate System

IS-IS is a link-state protocol similar to OSPF. It runs directly over Layer 2 (not IP), making it extremely scalable. It is the preferred IGP for large ISP backbone networks and is widely used by Tier 1 providers.

  • Runs over CLNP (not IP) — immune to IP routing loops
  • Two-level hierarchy: Level 1 (intra-area) and Level 2 (inter-area)
  • Supports both IPv4 and IPv6 in the same instance (multi-topology)

Routing Protocol Comparison

ProtocolTypeAlgorithmTransportADBest For
BGPEGPPath-vectorTCP 17920 (eBGP) / 200 (iBGP)Internet, multi-homing
OSPFIGPLink-state (Dijkstra)IP 89110Enterprise networks
EIGRPIGPAdvanced distance-vector (DUAL)IP 8890 (internal)Cisco networks, fast convergence
RIPIGPDistance-vector (Bellman-Ford)UDP 520120Small labs, legacy
IS-ISIGPLink-state (Dijkstra)Layer 2115ISP backbones
StaticManual1Small nets, default routes

Administrative Distance — How Routers Choose Between Protocols

Administrative Distance (AD) determines which routing protocol’s routes are preferred when multiple protocols advertise the same prefix. Lower AD wins.

  • Connected interface: 0
  • Static route: 1
  • EIGRP summary: 5
  • eBGP: 20
  • EIGRP internal: 90
  • OSPF: 110
  • RIP: 120
  • iBGP: 200

Key Routing Concepts

Route Redistribution

When multiple routing protocols run in the same network, route redistribution imports routes from one protocol into another. Always set appropriate metrics when redistributing to avoid routing loops and suboptimal paths.

Cisco Express Forwarding (CEF)

CEF is Cisco’s high-performance packet switching mechanism — enabled by default on all modern Cisco platforms. It uses the FIB (Forwarding Information Base) and Adjacency Table to forward packets in hardware without CPU involvement.

Asymmetric Routing

Asymmetric routing occurs when forward and return traffic take different paths. This breaks stateful firewalls and NAT — always design for symmetric routing in enterprise networks.

Frequently Asked Questions

Which routing protocol should I use for my enterprise network?

OSPF is the industry standard choice for most enterprise networks — it is vendor-neutral, scales well, and converges quickly. Use EIGRP if your network is 100% Cisco and you need faster convergence with simpler configuration. Use BGP when connecting to multiple ISPs or cloud providers.

What is the difference between iBGP and eBGP?

eBGP (External BGP) runs between routers in different Autonomous Systems — typically between your network and your ISP. iBGP (Internal BGP) runs between routers within the same AS to distribute external routes internally. iBGP requires a full mesh or route reflectors.

What is OSPF area 0?

OSPF Area 0, also called the backbone area, is mandatory in any multi-area OSPF network. All other OSPF areas must connect directly to Area 0 via an Area Border Router (ABR). Inter-area traffic must always transit Area 0.

Can OSPF and EIGRP run together?

Yes. You can run multiple routing protocols simultaneously and use route redistribution to share routes between them. This is common in networks transitioning between protocols or using different protocols in different parts of the network.

]]>

GU
Written by

Gurpreet Singh

Hey! I"m Gurpreet Singh and I Have 7+ Years of experience in the Network & Security Domain as well as the Cloud Infra Domain. I am Certified with Cisco ( CCNA ), CheckPoint ( CCSA ), 1xAWS, 3xAZURE, and 3xNSE. So I love to share my tech knowledge with you.

Leave a Reply

Your email address will not be published. Required fields are marked *