What Is a Dynamic Routing Protocol? How It Works

A dynamic routing protocol is a set of rules that lets routers automatically discover network paths and share that information with each other, without anyone manually programming each route. Instead of a network administrator typing in every possible path data could take, routers running a dynamic routing protocol figure it out themselves, constantly updating their internal maps as the network changes. If a link goes down or a new router comes online, the network adapts on its own.

How Dynamic Routing Works

Every router maintains a routing table, essentially a list of destinations and the best next step to reach each one. With dynamic routing, neighboring routers periodically exchange the contents of these tables, gradually building a complete picture of the network’s layout. When something changes (a cable is unplugged, a new connection is added, a router fails), the affected routers broadcast updates so every other router can recalculate its best paths.

This automatic process stands in sharp contrast to static routing, where an administrator must manually add, remove, or change every route. Static routing works fine for tiny, stable networks, but it becomes impractical the moment a network grows or changes frequently.

Two Core Approaches: Link-State vs. Distance Vector

Dynamic routing protocols generally use one of two methods to decide the best path.

Link-state protocols give every router a full map of the network. Each router periodically checks the status of its direct connections and broadcasts that information to all other routers. Every router then independently runs a shortest-path calculation to determine the best route to every destination. OSPF is the most widely used link-state protocol. Because every router holds a complete topology, link-state protocols converge quickly, meaning they adapt to changes fast. The tradeoff is higher memory and CPU usage, since each router is constantly recalculating.

Distance vector protocols take a simpler approach. Each router tells its immediate neighbors how far it believes it is from every destination, measured in “hops” or a similar cost metric. Neighbors incorporate that information into their own tables and pass it along. No single router sees the full picture. RIP is the classic distance vector protocol. It’s lightweight but limited: RIP enforces a maximum of 15 hops, and any destination beyond that is treated as unreachable. That ceiling makes RIP impractical for large networks.

A hybrid approach also exists. EIGRP, originally developed by Cisco, combines elements of both methods. It sends updates only when something changes rather than on a fixed schedule, which cuts down on unnecessary network chatter. EIGRP was published as RFC 7868 in May 2016, but that publication was an independent submission and not a formal internet standard, so in practice it still runs almost exclusively on Cisco equipment.

Interior vs. Exterior Protocols

Dynamic routing protocols split into two broad categories based on where they operate.

Interior Gateway Protocols (IGPs) handle routing inside a single organization’s network, technically called an autonomous system. OSPF, EIGRP, and RIP all fall into this category. Their job is to find the fastest, most efficient internal paths. They tend to share detailed topology information and update frequently.

Exterior Gateway Protocols (EGPs) manage routing between autonomous systems, for example between two internet service providers or between a company and its ISP. BGP (Border Gateway Protocol) dominates this space. Rather than flooding detailed internal maps, BGP exchanges route summaries and makes decisions based on policies, such as which provider a company prefers for certain traffic. That restraint is essential at internet scale, where the global routing table contains hundreds of thousands of entries.

OSPF vs. BGP: A Practical Comparison

OSPF and BGP are the two protocols you’ll encounter most in real networks, and they serve very different purposes.

OSPF works within a single network. It uses a cost metric derived from link bandwidth to pick the shortest path. When a link fails, OSPF routers detect the change and reconverge quickly, often within seconds. To handle growth, OSPF uses a hierarchical area structure: a large network is divided into areas, and routers only need the full topology of their own area. Routes between areas get summarized, which shrinks routing tables and reduces CPU load. Special configurations like stub areas go even further, blocking external route advertisements entirely so that routers inside only need to know their local routes plus a single default path out.

BGP operates between networks. It picks paths using a series of attributes (not just a single cost number), giving administrators granular control over how traffic enters and leaves their network. BGP converges slowly by design. On a network the size of the internet, you don’t want every router recalculating every time a single link flickers. BGP’s resource demands scale with the size of the routing table rather than with constant recalculation, so routers carrying the full internet routing table need substantial memory and processing power.

How Routers Choose Between Protocols

A router can run multiple dynamic routing protocols at once. When two protocols both offer a route to the same destination, the router uses a value called administrative distance to pick a winner. Lower numbers are trusted more. On Cisco equipment, the standard defaults are:

  • EIGRP (internal): 90
  • OSPF: 110
  • RIP: 120
  • External BGP: 20
  • Internal BGP: 200

So if both OSPF and RIP know how to reach the same network, the router trusts OSPF (110) over RIP (120). External BGP routes, with a distance of 20, beat almost everything because they represent paths learned from outside the organization and are considered highly authoritative. These default values vary across vendors. Juniper, for instance, assigns OSPF internal routes a preference of 10 and BGP a preference of 170. The concept is the same, but the specific numbers differ.

Why Dynamic Routing Matters

In any network with more than a handful of routers, dynamic routing protocols are what keep traffic flowing without constant human intervention. They provide automatic failover: if a primary path goes down, routers detect it and reroute traffic through an alternative, often before users notice anything. They also simplify network expansion, since adding a new router or subnet means the protocol discovers it and propagates the information automatically.

The choice of protocol depends on the situation. Small office networks might use RIP for simplicity, though its 15-hop limit means it can’t stretch far. Medium to large enterprise networks almost universally run OSPF for its fast convergence and scalability through area design. Any organization connecting to the public internet or peering with other networks will run BGP at the border. Many networks run OSPF internally and BGP externally, letting each protocol do what it does best.