Dynamic routing is a method of routing in which routers learn paths automatically by exchanging information through routing protocols, build their routing tables from what they learn, and recalculate routes when the network changes. In networking, it is the alternative to static routing, where an administrator enters every route by hand, and it is what allows large networks and the Internet itself to adapt to failures without human intervention.
A dynamic routing protocol such as OSPF, IS-IS, EIGRP, RIP or BGP has three jobs: discover neighbors, share reachability information, and select the best path for each destination using its own metric. The router then installs the selected routes in its routing table and forwards packets toward the appropriate next hop.
How dynamic routing works
Every dynamic routing protocol follows a cycle of discovery, exchange, calculation and convergence. The details vary, but the overall process is similar across protocols.
- Neighbor discovery: routers send hello messages on enabled interfaces and form adjacencies with routers that run the same protocol.
- Information exchange: neighbors exchange routes, link states or path attributes.
- Best path calculation: each router applies its algorithm and metric to choose the best route per destination.
- Route installation: the winning routes go into the routing table, possibly alongside routes from other sources.
- Convergence: after a change, all routers update until they again hold a consistent view.
Convergence time is the key quality measure. During convergence, packets may be dropped or looped, so protocols use timers, sequence numbers and loop-prevention rules to shorten this window. With Bidirectional Forwarding Detection (BFD), failures can be detected in tens to hundreds of milliseconds instead of waiting for protocol hello timers that commonly run from seconds to minutes.
Distance-vector, link-state and path-vector protocols
Routing protocols fall into three algorithmic families, which differ in what each router knows and how it computes paths. The family determines scalability, convergence behavior and resource use.
| Family | What routers share | Path computation | Examples |
|---|---|---|---|
| Distance-vector | Their own routing table with distances | Bellman-Ford style, trusting neighbors | RIP, EIGRP (advanced variant) |
| Link-state | Descriptions of their links to all routers in an area | Each router runs Dijkstra’s SPF algorithm | OSPF, IS-IS |
| Path-vector | Routes with the full list of autonomous systems crossed | Policy-based selection with many attributes | BGP |
Distance-vector protocols are simple but know only what neighbors report, which makes them prone to slow convergence and routing loops; RIP limits paths to 15 hops partly for this reason. Link-state protocols give every router a complete map of its area, so they converge quickly and scale well inside an organization. BGP sacrifices speed for policy control, which is essential between independent networks.
Interior and exterior routing protocols
Dynamic routing protocols are also divided by where they run. Interior gateway protocols (IGPs) operate inside one autonomous system, where the goal is the fastest technically best path. The exterior gateway protocol, in practice only BGP, operates between autonomous systems, where business policy matters more than raw metrics.
| Protocol | Type | Metric | Typical use |
|---|---|---|---|
| RIP | IGP, distance-vector | Hop count, maximum 15 | Small or legacy networks |
| OSPF | IGP, link-state | Cost based on bandwidth | Enterprise and service provider cores |
| IS-IS | IGP, link-state | Configurable link metric | Large service provider backbones |
| EIGRP | IGP, advanced distance-vector | Composite of bandwidth and delay | Networks built mostly from one vendor |
| BGP | EGP, path-vector | Attributes such as local preference and AS path | Internet routing and large data centers |
When a router learns the same prefix from several protocols, it ranks the sources with an administrative distance or preference value. On widely deployed platforms, directly connected routes rank first, static routes next, and then eBGP, EIGRP, OSPF, IS-IS and RIP, with internal BGP ranked lowest. Within a single source, the router always prefers the longest matching prefix first.
Dynamic routing compared with static routing
Static and dynamic routing are complementary, not exclusive. Most networks use dynamic routing for the core and static routes for a few well-defined cases, such as a default route toward a single provider.
| Aspect | Static routing | Dynamic routing |
|---|---|---|
| Configuration effort | Every route entered manually | Protocol setup once, routes learned automatically |
| Reaction to failures | None without extra tracking | Automatic rerouting |
| Resource use | Negligible | CPU, memory and protocol traffic |
| Predictability | Fully predictable | Depends on metrics and timers |
| Security exposure | No protocol to attack | Requires authentication and filtering |
| Best fit | Stub sites and simple edges | Networks with redundant paths |
A practical rule is that any network with more than one path between important points benefits from dynamic routing, because manual updates cannot react in seconds. Where only one path exists, a static route is simpler, more secure and fully adequate.
Design practices and common pitfalls
Dynamic routing is powerful but can spread a single mistake across the whole network within seconds. Good designs constrain what each router can learn and announce.
- Authenticate adjacencies so that an unauthorized device cannot inject routes.
- Filter routes at boundaries, especially in BGP, where a leaked prefix can redirect Internet traffic.
- Summarize routes at area or site boundaries to limit table size and contain instability.
- Avoid uncontrolled redistribution between protocols, which can create loops and suboptimal paths.
- Tune timers carefully, using BFD for fast detection rather than very aggressive hello intervals.
- Use passive interfaces on user-facing segments so routing messages are not sent there.
Most serious incidents come from configuration and policy errors, not from protocol bugs. Change review, route filtering and monitoring of route counts catch the majority of them before users notice.
The short version
Dynamic routing is like a navigation app for data. Instead of following a fixed printed map, routers constantly talk to each other about which roads are open and how fast they are.
When a road closes, the routers hear about it within seconds and pick a new route automatically. Nobody needs to rewrite directions by hand, so the network keeps working even when parts of it fail.
Where it makes a difference
A logistics company connects its headquarters, two data centers and 25 warehouses. Originally every warehouse router had static routes pointing to the main data center. When the main data center’s WAN link failed, engineers had to change routes on dozens of routers by hand, and warehouses lost access to the inventory system for two hours.
The company deploys OSPF across its WAN, with each warehouse in its own area connected to a backbone area, and enables BFD on WAN links. Each warehouse now has paths to both data centers. During the next carrier outage, OSPF detected the failure in under a second and moved traffic to the second data center link, and scanners in the warehouses kept working without any manual change.