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.
Distance-vector, link-state and path-vector routing protocols
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.
| Family | What is shared | Path computation | Typical examples |
|---|---|---|---|
| Distance-vector | Prefixes with a distance to neighbors | Bellman-Ford, hop by hop | RIP, RIPng |
| Advanced distance-vector | Prefixes with a composite metric | DUAL with feasible successors | EIGRP |
| Link-state | Link and topology descriptions flooded to an area | Dijkstra shortest path first | OSPF, IS-IS |
| Path-vector | Prefixes with path attributes and AS path | Policy-driven best path selection | BGP |
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.
| Protocol | Scope | Metric | Default administrative distance |
|---|---|---|---|
| RIPv2 | IGP | Hop count, maximum 15 | 120 |
| EIGRP | IGP | Bandwidth and delay by default | 90 internal, 170 external |
| OSPF | IGP | Cost derived from interface bandwidth | 110 |
| IS-IS | IGP | Configurable link metric | 115 |
| eBGP | EGP | Path attributes, not a single metric | 20 |
| iBGP | Inside one AS | Path attributes, not a single metric | 200 |
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.
| Aspect | Static routing | Routing protocol |
|---|---|---|
| Reaction to link failure | None without extra tracking | Automatic reconvergence |
| Configuration effort | Grows with every new network | Mostly constant per router |
| Resource use | Negligible | CPU, memory and control traffic |
| Predictability | Fully deterministic | Depends on metrics and timers |
| Typical place | Stub sites, default gateway | Cores, campuses, provider networks |
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.
| Situation | Usual choice | Reason |
|---|---|---|
| Small office with one uplink | Static default route | Nothing to learn dynamically |
| Enterprise campus, mixed vendors | OSPF | Open standard, fast convergence, areas |
| Large provider backbone | IS-IS with BGP | Scales well, independent of IP version |
| Connection to two internet providers | eBGP | Policy control between autonomous systems |
| Data center leaf-spine fabric | eBGP or OSPF with ECMP | Simple policy, many equal paths |
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.