Routing protocol

On this page 8

A routing protocol is a standardized set of rules and message formats that routers use to exchange reachability information with each other, calculate the best paths to destination networks and install those paths in their routing tables automatically. In networking, routing protocols are the control-plane mechanism behind dynamic routing: they replace hand-written static routes with a distributed process that discovers the topology and reacts when links fail.

A routing protocol does not forward packets itself. Forwarding is the job of the data plane, which looks up each destination address in the forwarding table. The routing protocol only decides what goes into that table, which is why it is often described as the brain of routing rather than its muscles.

How a routing protocol builds and maintains routes

Every routing protocol performs the same four tasks: it discovers neighbors, exchanges routing information, computes best paths with an algorithm and reconverges after a change. Neighbors are usually found with periodic hello messages sent to a multicast address or configured explicitly, as in BGP sessions over TCP port 179.

Once neighbors are established, the protocol advertises the prefixes it knows together with a metric, a number that expresses the cost of reaching them. The router then runs its algorithm, selects the lowest-cost path for each prefix and offers the result to the routing information base. If several protocols offer the same prefix, the router prefers the source with the lowest administrative distance, a local trust value that is not exchanged between routers.

The time a network needs to reach a consistent view after a failure is called convergence time. It depends on how quickly the failure is detected, how fast the update spreads and how long the path computation takes. Modern link-state designs converge in well under a second when tuned with fast hellos or Bidirectional Forwarding Detection, while classic distance-vector designs may need tens of seconds or minutes.

Routing protocols fall into three algorithm families, and the family largely determines scalability and convergence behavior. Distance-vector protocols share their whole table or changes with direct neighbors and trust their neighbors’ view of distance. Link-state protocols flood a description of every link so that each router holds the complete topology map and runs Dijkstra’s shortest path first algorithm. Path-vector protocols advertise the full list of autonomous systems a route has crossed, which allows policy decisions and loop prevention between organizations.

The following table summarizes the three families and their main properties.

FamilyWhat is sharedPath computationTypical examples
Distance-vectorPrefixes with a distance to neighborsBellman-Ford, hop by hopRIP, RIPng
Advanced distance-vectorPrefixes with a composite metricDUAL with feasible successorsEIGRP
Link-stateLink and topology descriptions flooded to an areaDijkstra shortest path firstOSPF, IS-IS
Path-vectorPrefixes with path attributes and AS pathPolicy-driven best path selectionBGP
Routing protocol families compared

Distance-vector protocols are simple but suffer from slow convergence and routing loops, mitigated by split horizon, route poisoning and hold-down timers. Link-state protocols need more memory and processing for the topology database, but they converge quickly and scale well when the network is divided into areas or levels.

Interior and exterior gateway protocols

Routing protocols are also classified by scope. An interior gateway protocol (IGP) runs inside one autonomous system, such as a company or a service provider network, and optimizes for fast convergence and the shortest technical path. An exterior gateway protocol (EGP) connects different autonomous systems and optimizes for policy, business relationships and stability. In practice, BGP is the only exterior gateway protocol in use on the internet.

The table below lists the most common routing protocols with their scope, metric and typical default administrative distance on widely deployed router platforms.

ProtocolScopeMetricDefault administrative distance
RIPv2IGPHop count, maximum 15120
EIGRPIGPBandwidth and delay by default90 internal, 170 external
OSPFIGPCost derived from interface bandwidth110
IS-ISIGPConfigurable link metric115
eBGPEGPPath attributes, not a single metric20
iBGPInside one ASPath attributes, not a single metric200
Common routing protocols and their parameters

Administrative distance values are vendor defaults, not standards, and they can be changed. They matter when two protocols learn the same prefix, for example during a migration from RIP to OSPF, because the router installs only the route from the more trusted source.

Routing protocols compared with static routing

A routing protocol is the alternative to configuring static routes by hand. Static routing is predictable and uses no bandwidth or CPU, but it cannot react to failures unless combined with tracking features. A routing protocol adapts automatically, at the price of added complexity, protocol traffic and a larger attack surface.

AspectStatic routingRouting protocol
Reaction to link failureNone without extra trackingAutomatic reconvergence
Configuration effortGrows with every new networkMostly constant per router
Resource useNegligibleCPU, memory and control traffic
PredictabilityFully deterministicDepends on metrics and timers
Typical placeStub sites, default gatewayCores, campuses, provider networks
Static routing versus a routing protocol

Many networks combine both. A branch office often has only a default route toward the provider, while the core runs OSPF or IS-IS and the edge runs BGP. Route aggregation, policy-based routing and ECMP are then applied on top of what the protocols learn.

Choosing and configuring a routing protocol

The right routing protocol follows from network size, vendor mix, convergence requirements and administrative boundaries. Open standards such as OSPF, IS-IS and BGP work across vendors, which is why they dominate mixed environments. The following decision table shows typical choices.

SituationUsual choiceReason
Small office with one uplinkStatic default routeNothing to learn dynamically
Enterprise campus, mixed vendorsOSPFOpen standard, fast convergence, areas
Large provider backboneIS-IS with BGPScales well, independent of IP version
Connection to two internet providerseBGPPolicy control between autonomous systems
Data center leaf-spine fabriceBGP or OSPF with ECMPSimple policy, many equal paths
Typical routing protocol choices by situation

Good configuration practice includes authenticating neighbor sessions, making interfaces passive where no neighbors are expected, summarizing prefixes at area or site boundaries and filtering what is advertised. On BGP sessions, explicit prefix filters and maximum-prefix limits are essential protection against accidental route leaks.

Common pitfalls with routing protocols

Most routing protocol incidents come from configuration rather than from the protocols themselves. The recurring problems are well known:

  • Mismatched parameters such as hello timers, area IDs or MTU prevent neighbors from forming adjacencies.
  • Uncontrolled redistribution between two protocols creates routing loops or suboptimal paths.
  • Missing filters on BGP sessions leak internal or third-party prefixes to the internet.
  • Route flapping on an unstable link triggers repeated recalculations across the whole domain.
  • Unauthenticated sessions let a rogue device inject false routes.

Monitoring adjacency state, route counts and recalculation frequency catches most of these issues early. A sudden change in the number of learned prefixes is one of the most reliable warning signs.

A plain-language summary

A routing protocol is the way routers talk to each other about which networks they can reach and how far away those networks are. Each router listens to its neighbors, puts the information together and works out the best way to send traffic onward.

Think of drivers sharing live traffic reports. When one road closes, the news spreads and everyone picks another route without waiting for a new printed map. Routers do the same automatically, which keeps a network working even when a cable or device fails.

An example from practice

A regional hospital group connects six sites over two separate wide area links per site. The network team runs OSPF in a single backbone area between the sites and sets Bidirectional Forwarding Detection on every link with a 300 millisecond detection interval. Each site summarizes its internal prefixes, so the core carries only a handful of routes.

When a construction crew cuts one fiber between two sites, BFD detects the failure in under a second, OSPF floods the change and every router recalculates its paths. Imaging traffic and voice calls move to the second link with only a brief interruption, and no engineer has to change a single route by hand. The incident shows up in monitoring as an adjacency drop, which the team then reports to the carrier.