CCNA online course

Types of Routing Protocols: Static, Dynamic, Distance Vector, Link-State, and Path Vector

Learn how static routing, RIP, EIGRP, OSPF, IS-IS, and BGP exchange routes, select paths, converge, and fit into CCNA networks.

Routing is the process of selecting a path for packets traveling between different IP networks. A router examines a packet's destination IP address, consults its routing table, selects the best matching route, and forwards the packet toward the next hop or outgoing interface.

This lesson compares static routing with dynamic routing and explains the major routing families: distance vector, advanced distance vector, link state, and path vector. It also covers route selection, convergence, IPv4 and IPv6 considerations, Cisco IOS verification, and basic routing-protocol security.

Purpose of Routing

Networks are separated into IP prefixes, such as 10.10.0.0/16 or 2001:db8:10::/48. A host can usually deliver a packet directly only when the destination is on a connected local network. For a remote network, the host sends the packet to a default gateway, and routers forward it from network to network.

A router maintains a routing table: a collection of known destination prefixes and forwarding information. An entry can include a route source, prefix length, next hop, outgoing interface, administrative distance, and metric.

Control plane and forwarding plane

The control plane, also called the routing plane, learns routes. It may learn them from connected interfaces, static configuration, or routing protocols. Dynamic protocols exchange information, calculate paths, and install eligible routes in the routing table.

The forwarding plane, also called the data plane, uses the installed routing table to send packets. It does not normally recalculate the network topology for every packet; it performs a lookup and forwards the packet according to the selected route.

Route Sources and Route Types

  • Directly connected route: Created when a router interface is configured with an address and is operational. The router knows that the interface's network is directly reachable.
  • Local route: On Cisco IOS, a host route for the router's own interface address is commonly shown with code L.
  • Static route: Manually configured by an administrator.
  • Default route: A catch-all route used when no more specific route matches. In IPv4 it is 0.0.0.0/0; in IPv6 it is ::/0.
  • Dynamically learned route: Discovered and maintained by a routing protocol.

A routing protocol is not required for every network. A small branch with one upstream path may use a default static route, while the central router uses a return route to the branch. Static routing is often appropriate for a simple, stable stub network.

Route selection order

Routers do not choose a route simply because it has the lowest metric. Cisco-style route selection follows this general order:

Decision stageQuestion answeredExample
Longest-prefix matchWhich route is most specific for the destination address?10.10.10.0/24 beats 10.10.0.0/16 for a destination in 10.10.10.0/24.
Administrative distanceIf competing sources offer the same prefix, which source is trusted more?A static route normally beats an OSPF route for the same prefix because 1 is lower than 110.
Protocol metric or attributesAmong eligible routes from the same protocol, which path is preferred?OSPF compares cost; RIP compares hop count; BGP evaluates policy attributes.

Longest-prefix match is a forwarding decision. Administrative distance and protocol metrics are route-installation and route-selection decisions used to determine which candidate route becomes active.

Static Routing

A static route is entered and maintained manually by an administrator. It identifies a destination prefix and a next hop, exit interface, or both.

Common static-route forms

  • Specific network route: Reaches one destination prefix, such as 192.0.2.0/24.
  • Default static route: Sends otherwise unknown destinations to an upstream router.
  • Floating static route: A backup static route configured with a higher administrative distance than the primary route.
  • Summary static route: Represents multiple contiguous networks with one larger prefix when the design supports safe summarization.
! IPv4 specific and default static routes
ip route 192.0.2.0 255.255.255.0 198.51.100.1
ip route 0.0.0.0 0.0.0.0 198.51.100.1

! Backup route: installed only if the primary route is unavailable
ip route 0.0.0.0 0.0.0.0 203.0.113.1 200

! IPv6 static and default routes
ipv6 unicast-routing
ipv6 route 2001:db8:20::/64 2001:db8:1::2
ipv6 route ::/0 2001:db8:1::2

Static routing has predictable paths, consumes little bandwidth and CPU, sends no routing-protocol advertisements, and is straightforward in a small stable environment. Its limitations are poor scalability, manual changes after failures or topology changes, and the possibility of incorrect prefixes, masks, next hops, or return routes.

Exam note: Static routing is a routing method, not a dynamic routing protocol.

Dynamic Routing Protocols

A dynamic routing protocol allows participating routers to discover, advertise, and maintain routes. Routers typically form neighbor relationships, exchange route or topology information, calculate paths, and install eligible routes in their routing tables.

When a link or router fails, the protocol propagates an update or withdraws a route. Routers recalculate paths, select available alternatives, and eventually reach a stable state. Dynamic routing supports larger networks, automatic adaptation, redundant paths, and less manual route maintenance.

The costs include protocol complexity, control-plane CPU and memory use, routing-update traffic, configuration dependencies, and security requirements. A protocol should be designed rather than enabled indiscriminately.

Interior and Exterior Routing Protocols

An autonomous system is a collection of networks operated under a common routing policy and identifier. An enterprise may operate one autonomous system for internal routing. Internet service providers and multihomed organizations exchange reachability between autonomous systems.

  • Interior Gateway Protocol (IGP): Used within one autonomous system. RIP, EIGRP, OSPF, and IS-IS are IGPs.
  • Exterior Gateway Protocol (EGP): Used between autonomous systems. BGP is the primary EGP in modern IP networks.
Method or protocolStatic or dynamicIGP or EGPAlgorithm familyPrimary selection basisTypical deployment
Static routingStaticNeitherManualAdministrative configurationSmall, stable, or stub networks
RIPDynamicIGPDistance vectorHop countLegacy or very small networks
EIGRPDynamicIGPAdvanced distance vectorComposite metricCommonly Cisco-based environments
OSPFDynamicIGPLink stateCost and SPFEnterprise networks
IS-ISDynamicIGPLink stateCost and SPFService providers and large networks
BGPDynamicEGPPath vectorPolicy and path attributesInternet edge and inter-organization routing

Distance-Vector Protocols

A distance-vector protocol advertises destination reachability using a direction or next-hop concept and a distance metric. A router learns that a destination is reachable at a certain distance through a neighbor; it does not necessarily learn the complete network topology.

RIP

RIP is the primary CCNA example of a traditional distance-vector IGP. RIP uses hop count: each router crossed adds one hop. A route with a metric of 16 is unreachable, so the maximum usable distance is 15 hops.

Traditional RIP sends periodic updates. This simple behavior can make convergence slower than link-state designs, especially after a failure. During convergence, routers can temporarily have inconsistent information or form routing loops.

MechanismPurposeBehavior
Split horizonPrevents a learned route from being advertised back toward its source.A route learned on one interface is not advertised out that same interface.
Route poisoningInvalidates a failed route.The route is advertised with an infinite metric.
Poison reverseMakes split-horizon invalidation explicit.The learned route is advertised back with an infinite metric.
Hold-down timerReduces acceptance of unstable information.Routers temporarily ignore suspicious improvements or repeated changes.
Triggered updateSpeeds failure notification.An update is sent immediately after a significant change instead of waiting for the periodic timer.

RIP is easy to understand and configure, but its hop-count limit, slower convergence, periodic traffic, and limited scalability make it unsuitable for most modern large networks.

router rip
 version 2
 network 10.0.0.0
 passive-interface GigabitEthernet0/0

show ip protocols
show ip route rip

Advanced Distance Vector: EIGRP

EIGRP is an advanced distance-vector protocol. Some introductory materials call it a hybrid protocol because it combines distance-vector operation with features associated with faster, more informed routing behavior.

EIGRP discovers neighbors with hello messages and uses reliable updates when route information must be exchanged. Its DUAL algorithm, the Diffusing Update Algorithm, calculates loop-free paths.

  • Successor: The best route installed for a destination.
  • Feasible distance: The calculated total distance from the local router to the destination through a candidate path.
  • Reported distance: Also called advertised distance; the neighbor's distance to the destination.
  • Feasible successor: A loop-free backup route that satisfies EIGRP's feasibility condition and can be used quickly if the successor fails.

Under default settings, EIGRP's composite metric emphasizes bandwidth and delay. Reliability and load are part of the broader metric model but are not normally used by default. A valid feasible successor can provide rapid failover without a full recomputation.

EIGRP is commonly encountered in Cisco-based environments. When interoperability and open standards are priorities, compare it with OSPF or IS-IS.

show ip eigrp neighbors
show ip eigrp topology
show ip route eigrp
show ip protocols

Link-State Protocols

A link-state router builds a topology database from link-state information. Each router in the relevant area independently runs a shortest-path calculation over that database.

Routers form neighbor adjacencies, exchange link-state advertisements, flood those advertisements through the area, synchronize their link-state databases, and run the SPF algorithm. In OSPF, an LSA is a link-state advertisement and an LSDB is the link-state database.

OSPF

OSPF uses cost as its metric. The total path cost is calculated from the costs of the interfaces along the path. If two paths exist, OSPF normally prefers the path with the lower total cost.

OSPF uses areas to limit the size of flooding domains and SPF calculations. Area 0 is the backbone area; other areas normally connect to it through area-border routers. Area boundaries support summarization and help scale enterprise designs.

On a multiaccess network such as Ethernet, OSPF can elect a designated router (DR) and a backup designated router (BDR). These roles reduce the number of full adjacency relationships required on the segment. OSPF generally converges faster and scales better than RIP, but it uses more memory, CPU, and design knowledge.

IS-IS is another link-state IGP. It is particularly common in service-provider and large-scale environments and uses a hierarchical design with levels rather than OSPF area terminology.

show ip ospf neighbor
show ip ospf interface brief
show ip ospf database
show ip route ospf
show ip protocols

For related OSPF concepts, see Configure OSPF, Link-State Advertisement (LSA), and OSPF Route Summarization.

Path-Vector Routing

Path-vector routing advertises reachability together with path attributes. It does not select routes only by a simple numeric distance. The primary example is BGP, which exchanges routes between autonomous systems.

BGP includes AS_PATH, a list of autonomous systems that a route has traversed. If a router receives a route containing its own autonomous system in AS_PATH, it can reject the route, providing an important loop-prevention mechanism.

BGP is policy driven. Attributes such as local preference, MED, next hop, and Cisco's weight influence best-path selection. This allows a multihomed organization to prefer one provider for outbound traffic and another provider for selected prefixes. BGP's goal is policy-controlled interdomain reachability, not simply the physically shortest path.

IGPs such as OSPF or IS-IS normally provide internal reachability to BGP next hops. BGP then applies interdomain policy to choose which external routes to install or advertise.

show ip bgp summary
show ip bgp
show ip route bgp

Metrics and Administrative Distance

A metric is a protocol-specific value used to compare routes learned by the same routing protocol. RIP uses hop count, OSPF uses cost, EIGRP uses a composite metric with bandwidth and delay under default settings, and BGP uses a sequence of path attributes and policy decisions.

Administrative distance (AD) is a local trust ranking used when different route sources offer the same prefix. A lower AD is preferred. AD is not a measure of bandwidth, latency, or physical distance.

Route sourceDefault administrative distanceNotes
Connected0Most trusted source; local routes are also commonly shown with 0.
Static1Manual route; a configured higher value can create a floating static route.
EIGRP summary5Default Cisco value for an EIGRP summary route.
External BGP20Routes learned from another autonomous system.
EIGRP internal90Internal EIGRP route.
OSPF110Link-state IGP.
IS-IS115Common Cisco default shown for IS-IS.
RIP120Distance-vector IGP.
EIGRP external170Route redistributed into EIGRP from another source.
Internal BGP200Route learned from a BGP peer in the same autonomous system.

These are common Cisco defaults. Values can be platform-dependent or configurable. Always verify the platform and configuration.

Convergence and Routing Stability

Convergence is the process by which routers reach a consistent, usable routing state after startup or a topology change. Convergence time matters because packets may be lost, looped, or delayed while routers detect a failure, propagate updates, withdraw invalid routes, recalculate paths, and install replacements.

Backup paths can shorten recovery. EIGRP feasible successors and alternate OSPF paths are examples of available redundancy. Loop-prevention mechanisms and protocol timers trade responsiveness against stability: very aggressive timers may react quickly but can create unnecessary control-plane work or instability.

Protocol Comparison and Selection

ProtocolRoute exchange modelMetric or attributesConvergence characteristicsScalabilityKey strengthsKey limitations
RIPPeriodic distance-vector updatesHop count; 15-hop usable limitOften slowerLowSimple and widely understoodSmall scale, limited metric, slower recovery
EIGRPNeighbor discovery and reliable advanced distance-vector updatesBandwidth and delay by defaultFast with feasible successorsMedium to highEfficient convergence and low overhead in suitable designsCommonly associated with Cisco environments
OSPFLSA flooding and LSDB synchronizationCost and SPFGenerally fastHigh with areasOpen standard, hierarchical design, broad supportMore CPU, memory, and design complexity
IS-ISLink-state database exchangeCost and SPFFast and stable at scaleHighStrong service-provider and large-network designLess familiar to some enterprise teams
BGPPath-vector updates between autonomous systemsPolicy attributes, including AS_PATH and local preferencePolicy-controlled; can be slower than an IGPVery highInterdomain policy and Internet-scale reachabilityComplex policy, filtering, and security requirements
  • Small stub network: Use specific static routes or a default static route when there are few paths and changes are infrequent.
  • Small legacy network: RIP may be encountered for compatibility or teaching, but its limitations should be documented.
  • Medium or large enterprise: OSPF is a common open-standard choice; EIGRP may fit a predominantly Cisco environment.
  • Large provider network: IS-IS or OSPF may provide internal routing, with BGP for external and service-related policy.
  • Internet edge or multihomed organization: BGP is appropriate when exchanging routes with multiple autonomous systems and applying policy.

Selection also depends on interoperability, operational skills, policy requirements, IPv4 and IPv6 support, hardware capacity, failure domains, and organizational standards.

IPv4 and IPv6 Considerations

The core concepts apply to both address families: routers learn prefixes, choose next hops, and forward packets. Configuration syntax, route representations, and protocol variants differ.

  • IPv4 uses RIPv2; IPv6 uses RIPng.
  • IPv4 commonly uses OSPFv2; IPv6 commonly uses OSPFv3.
  • IPv6 routing requires ipv6 unicast-routing on Cisco routers.
  • IPv6 routing-protocol neighbors commonly communicate using link-local addresses.
ipv6 unicast-routing
show ipv6 route
show ipv6 route static

Basic Cisco IOS Verification

Use a layered verification process: confirm interface addressing and state, confirm neighbors, confirm advertised prefixes, confirm route installation, and then test reachability.

show ip route
show ipv6 route
show ip interface brief
show interfaces
ping <destination>
traceroute <destination>

show running-config | include ^ip route
show ip route static
show ip protocols

Common Cisco route codes include C for connected, L for local, S for static, R for RIP, D for EIGRP, O for OSPF, and B for BGP.

Routing-Protocol Security Fundamentals

Unsolicited or unauthorized routing updates can change traffic paths, create loops, expose traffic, or cause outages. Defensive controls should match the protocol and platform.

  • Use routing-protocol authentication where supported.
  • Configure passive interfaces on interfaces that should advertise a network but should not form neighbors.
  • Restrict permitted neighbors where the protocol supports neighbor controls.
  • Apply prefix filters and route filters to control what is accepted, installed, or advertised.
  • Use administrative boundaries, access controls, and clear separation between internal and external routing domains.

Security commands and capabilities vary by protocol, Cisco IOS release, and platform. Validate the result with protocol status, neighbor, and route commands.

Troubleshooting Routing Problems

Destination prefix is absent

  • Check whether the route was configured or advertised.
  • Verify interface state and IP addressing with show ip interface brief.
  • Check neighbors and protocol-specific databases.
  • Confirm the prefix is not blocked by a route filter.

OSPF neighbors do not form

Check area, hello and dead timers, authentication, subnet and network type, passive-interface settings, router ID, and duplicate addressing. Use show ip ospf neighbor and show ip ospf interface.

A floating static route is active unexpectedly

Inspect show ip route for the route source and AD. Verify that the primary next hop is reachable, its interface is operational, and the static prefixes and masks are correct.

RIP routes are missing

Check RIPv1 and RIPv2 compatibility, network statements, passive interfaces, auto-summary behavior, and the hop count. Use show ip protocols and show ip route rip.

OSPF selects an unexpected path

Compare interface costs and total path costs with show ip ospf interface. Check reference bandwidth, prefix lengths, administrative distances, and whether a more-specific route from another source wins.

BGP receives but does not select a route

Inspect BGP entries and best-path indicators. Check BGP attributes, next-hop reachability, import and export policy, and whether the local autonomous system appears in AS_PATH.

Practical Scenarios

Branch with one upstream router

A branch can use a default static route toward headquarters, while headquarters uses a specific static route back to the branch LAN. A dynamic protocol may add unnecessary complexity when there is only one path.

Backup WAN connection

Install a primary static route with the normal AD of 1 and a backup static route with a higher AD, such as 200. The backup is a floating static route and becomes active when the primary route is withdrawn or is otherwise no longer eligible.

RIP hop-count limitation

If a route would require 16 hops, RIP marks it unreachable. This illustrates why RIP is unsuitable for large routed topologies even when every individual link works.

OSPF enterprise topology

Routers exchange LSAs, synchronize their LSDBs, and run SPF. If two paths exist, the lower-cost path is selected. After a link failure, OSPF floods changed information and recalculates the affected paths.

EIGRP redundant paths

The successor is the installed best route. A feasible successor is a loop-free backup that can be used quickly when the successor fails, reducing recovery time.

BGP multihoming

An organization connected to two providers can use BGP policy to prefer one provider for outbound traffic and influence inbound traffic through suitable attributes and advertisements. The selected path is policy-oriented rather than based only on physical distance.

Route-selection conflict

Suppose a router has a static route and an OSPF route for the same prefix, plus a connected route for a more-specific subnet. The connected subnet wins first through longest-prefix match. For equal prefix lengths, the static route normally wins through AD. Among routes learned by OSPF, cost determines the preferred path.

Key Exam Notes

  • Routing selects paths between different IP networks; switching forwards frames within a local Layer 2 domain.
  • Longest-prefix match is considered before administrative distance and metrics.
  • Administrative distance compares different route sources; a metric compares routes within a protocol.
  • RIP uses hop count and has a 15-hop maximum usable distance.
  • EIGRP uses DUAL and can use a feasible successor for rapid failover.
  • OSPF builds an LSDB, floods LSAs, and runs SPF using cost.
  • Area 0 is the OSPF backbone area.
  • BGP is a path-vector EGP and uses policy attributes such as AS_PATH and local preference.
  • Static routing is useful for small stable or stub networks but does not scale as easily as dynamic routing.