This browser is too old to run Achievable.

Update it, or open this page in a current version of Chrome, Safari, Firefox or Edge. On an iPhone or iPad, update iOS: every browser there runs on the version of Safari that comes with it.

Achievable logoAchievable logo
CCNA
Sign in
Sign up
Purchase
Textbook
Practice exams
Support
How it works
Resources
Exam catalog
Mountain with a flag at the peak
Textbook
Introduction
1. Introduction to networking
2. Administering Ethernet LANs
3. IP connectivity
3.1 Understanding IP addresses
3.2 Calculating networks and hosts (Subnetting)
3.3 Routers and IPv4 routing fundamentals
3.4 Static routing
3.5 Static vs. dynamic routing and OSPF fundamentals
3.6 Router redundancy in an Ethernet LAN using First Hop Redundancy Protocols (FHRPs)
3.7 Configuring Cisco Routers
4. Network services
5. IPv6
6. Wireless networking
7. Network management and administering network devices
8. Network security fundamentals
9. Network automation and programmability
Wrapping up
Achievable logoAchievable logo
3.5 Static vs. dynamic routing and OSPF fundamentals
Achievable CCNA
3. IP connectivity
Our CCNA course is currently in development and is a work-in-progress.

Static vs. dynamic routing and OSPF fundamentals

12 min read
Font
Discuss
Share
Feedback

The downsides of static routes

In the previous chapter, you learned that routers can reach remote networks (networks they aren’t directly connected to) by manually configuring routes and pointing them toward the next router along the path to the destination network. For packets to reach the destination host, every router along the path must also have a route to that destination network.

The type of route you enter manually on a router is called a Static Route. As you saw earlier, this can be a tedious process. Also, if hosts need bi-directional communication, then every router along the path must have a route back toward the source network as well.

You can see how this becomes difficult if you had to configure static routes to 100 networks. It’s not practical, and it’s hard to maintain as networks change:

  • If a static route is no longer needed, you must remember to delete it.
  • If a static route needs to be changed, you must update it manually, every time.

There’s another important limitation of static routes. Because they’re configured manually, the local router doesn’t automatically know if the destination network becomes unavailable. As long as the link to the next-hop router stays up, the static route stays in the routing table. That’s because there is no inherent* mechanism in static routes that tracks whether the destination network is reachable.

Sidenote
Tracking Static Routes

Static Routes can be tied to what is called a “Tracking Object” which tracks the state and reachability of a destination network, but this is outside of the scope of the CCNA 200-301 v1.1 exam.

R1's routing table has static route S 192.168.4.0/24 [1/0] via 10.1.1.2, so R1 forwards a packet for 192.168.4.4 since its next hop still appears reachable; but R2's Gi0/0 interface to 192.168.4.0/24 is down, so R2 drops the packet instead of delivering it.
Unavailable static route remaining in R1's routing table
Achievable
 

R1 will remove the static route from its routing table only if the link to R2 (the next hop toward 192.168.4.0/24) goes down. Otherwise, R1 will still believe it can send traffic to 192.168.4.0/24. That wastes bandwidth across the routers, only for the packets to be dropped at R4.

Dynamic routing protocols

Static routes are still necessary in certain situations, and they have an important place in networking. However, in medium to large networks, it’s usually better to use dynamic routes by configuring a routing protocol.

Routing protocols let routers learn remote networks automatically:

  • Routers advertise their directly connected networks to each other.
  • Routers also advertise routes they learned from neighbors to other neighbors.

Topology of R1-R2-R3 via links 10.1.1.0/30 and 172.16.1.0/30, each router connected to a LAN (192.168.1.0/24 on R1, 192.168.4.0/24 on R3). Each router's table lists its directly connected networks plus routes learned from neighbors: R1 learns 172.16.1.0/30 and 192.168.4.0/24 via 10.1.1.2; R2 learns 192.168.1.0/24 via 10.1.1.1 and 192.168.4.0/24 via 172.16.1.2; R3 learns 10.1.1.0/30 and 192.168.1.0/24 via 172.16.1.1.
Routers advertising directly connected networks
Achievable
 

Unlike static routes, routing protocols do track route availability. If a route becomes unavailable (for example, a cable is unplugged or an interface is shut down), the routing protocol on the router where the failure occurred will alert its neighbor to remove the route from its routing table. That update then propagates to other routers that also learned the route.

R2's Gi0/0 to 192.168.4.0/24 is down, so it sends R1 a routing update (step 1) removing that route; R1's routing table now shows it struck out (step 2), so when a packet destined to 192.168.4.4 arrives (step 3), R1 drops it since it has no valid route (step 4).
R2 notifying R1 that 192.168.4.0/24 is down
Achievable
 

Once the network becomes available again, the route is automatically advertised to neighbors again.

To advertise your directly connected routes using a routing protocol, you typically enable the routing protocol on the router interface. This approach keeps configuration simpler and removes the need to manually maintain routes in the routing table.

The Open Shortest Path First (OSPF) routing protocol

One of the most widely deployed routing protocols is Open Shortest Path First (OSPF), specifically version 2, which is the version covered on the CCNA 200-301 v1.1 exam.

Sidenote
Other Dynamic Routing Protocols

OSPF is an industry standard routing protocol. This means that OSPF can run on any vendor’s Routers. There are other routing protocols however, such as Cisco’s proprietary: Enhanced Interior Gateway Routing Protocol (EIGRP), and Border Gateway Protocol (BGP) which is the routing protocol that runs the Internet, but they are out of scope of the CCNA 200-301 v1.1 exam.

OSPF is a Link State routing protocol. That means routers exchange topology information until they all share the same view of the network (like a map). With an identical, up-to-date topology view, each router can calculate the shortest path to every destination.

OSPF uses the Dijkstra algorithm (also known as the “Shortest Path” algorithm). It’s the same general idea used by GPS systems: given a map and link “weights,” compute the best path.

In OSPF Area 0, R1 (LAN 192.168.1.0/24, link 10.1.1.1/30) and R2 (LAN 192.168.4.0/24, link 10.1.1.2/30) exchange LSAs describing their connected subnets over the 10.1.1.0/30 link. Each router stores both LSAs in an identical Link State Database, then runs the SPF algorithm to build its routing table with the best path to the other's LAN subnet.
OSPF routers exchanging link-state advertisements
Achievable
 

In terms of Administrative Distance, OSPF has a default Administrative Distance of 110 on Cisco Routers.

Routing protocol metric (OSPF cost)

OSPF chooses the “best” path as the one with the lowest metric. In OSPF, the metric is called cost.

By default, cost is derived from the Reference Bandwidth (default 100Mbps) divided by the bandwidth of the outgoing router interface.

InterfaceBandwidthReferenceBandwidth​=Cost

100Mbps100Mbps​=1

You can also manually set the cost on an interface to get the behavior the network administrator wants.

Routers calculate the total cost to a destination by adding the costs of all outgoing links along the path. Because each OSPF router has a full topology view, it knows the cost of each link leading to the destination.

R1 reaches 192.168.4.0/24 via two OSPF paths: through R2 with costs 1+1+1=3, and through R3 with costs 10+1+1=12. R1 picks the lower-cost route, 192.168.4.0/24 [110/3] via 10.1.1.2, over the higher one via 172.16.1.2.
OSPF cost from R1 through R3 to 192.168.4.0/24
Achievable
 

R1 has two possible routes to reach 192.168.4.0/24:

  • One path through R2
  • Another path through R3

By default, modern router interfaces often have a default cost of 1, but in this example the link between R1 and R3 has been configured with a cost of 10. As a result, R1 selects the route through R2 because it has a lower total cost (cost of 3 vs. 12).

That doesn’t mean R1 discards the higher-cost route through R3. That route remains in the OSPF database as a backup. If the route through R2 fails, R1 can install the backup route into its routing table, similar to how a Floating Static Route works.

Equal cost multipath (ECMP)

Sometimes a router learns two or more routes to the same network with the same subnet mask. Consider the example below:

R1 reaches 192.168.4.0/24 via two equal-cost paths through R2 and R3 to R4, each link cost 1 for a total cost of 3, so R1's OSPF table installs both routes (110/3) as Equal Cost Multipath, load-sharing traffic across both.
R1 receiving equal-cost routes through R2 and R3
Achievable
 

Both R2 and R3 advertise 192.168.4.0/24 to R1, and both routes are calculated with a cost of 3.

  1. Since the Subnet Mask (Prefix-Length) is the same, R1 would then have to consider the Administrative Distance
  2. Both of the routes are OSPF routes, that means they both have an Administrative Distance (AD) of 110, since the AD is a tie, then R1 would have to consider the route with the lowest metric or “cost” in the case of OSPF.
  3. In this instance, both of the routes to 192.168.4.0/24 have a cost of 3

When the prefix length ties, the administrative distance ties, and the routing protocol metric also ties, the router will load balance across the equal routes. It installs multiple next hops in the routing table and uses them instead of choosing only one. This behavior is called Equal Cost Multipath (ECMP).

In this case, R1 installs both routes in its routing table and alternates sending packets to R2 and R3.

To recall the order of operations when selecting the best route and installing it into the Routing table, here is the criteria in order of precedence once again:

  1. Select the route with the longest prefix length
  2. If the prefix length is the same, select the route with the lowest Administrative Distance
  3. If the Administrative Distance is the same (meaning, the same routing source), then select the route with the lowest routing protocol metric.
  4. If the metric is the same between the duplicate routes, then load balance the packets between all of the next hops.

OSPF areas

OSPF areas provide structure by dividing routers into logical groups, which is especially useful in larger OSPF deployments. An area is simply a logical grouping of OSPF Routers that have similar configurations and the same view of the entire topology.

For the CCNA 200-301 v1.1 exam, the focus is Single Area OSPF, which uses only Area 0. Area 0 is the “Backbone” area, and it’s where the core of the OSPF topology stems from.

Downsides of static routes

  • Manual configuration required on every router for each network
  • No automatic removal or update if network changes
  • No inherent mechanism to detect unreachable destinations

Dynamic routing protocols

  • Routers automatically advertise directly connected and learned networks
  • Routing protocols track route availability and update neighbors on changes
  • Simplifies configuration and maintenance in medium/large networks

Open Shortest Path First (OSPF) routing protocol

  • Industry standard, link-state routing protocol (version 2 for CCNA)
  • Routers exchange Link State Advertisements (LSAs) to build a shared topology map
  • Uses Dijkstra (Shortest Path) algorithm to compute best paths
  • Default Administrative Distance: 110

Routing protocol metric (OSPF cost)

  • OSPF metric = cost; lower cost preferred
  • Cost = Reference Bandwidth (default 100Mbps) ÷ Interface Bandwidth
  • Total path cost = sum of all outgoing link costs to destination
  • Backup routes kept in OSPF database for failover

Equal cost multipath (ECMP)

  • If prefix length, administrative distance, and metric all tie, router load balances traffic
  • Multiple equal-cost routes installed in routing table
  • Route selection order:
    1. Longest prefix length
    2. Lowest administrative distance
    3. Lowest metric
    4. Load balance if all above tie

OSPF areas

  • Logical grouping of routers for scalability
  • Single Area OSPF (Area 0, Backbone area) for CCNA focus

Sign up for free to take 10 quiz questions on this topic

Previous
Next  | 3.6 Router redundancy in an Ethernet LAN using First Hop Redundancy Protocols (FHRPs)
All rights reserved ©2016 - 2026 Achievable, Inc.

Static vs. dynamic routing and OSPF fundamentals

The downsides of static routes

In the previous chapter, you learned that routers can reach remote networks (networks they aren’t directly connected to) by manually configuring routes and pointing them toward the next router along the path to the destination network. For packets to reach the destination host, every router along the path must also have a route to that destination network.

The type of route you enter manually on a router is called a Static Route. As you saw earlier, this can be a tedious process. Also, if hosts need bi-directional communication, then every router along the path must have a route back toward the source network as well.

You can see how this becomes difficult if you had to configure static routes to 100 networks. It’s not practical, and it’s hard to maintain as networks change:

  • If a static route is no longer needed, you must remember to delete it.
  • If a static route needs to be changed, you must update it manually, every time.

There’s another important limitation of static routes. Because they’re configured manually, the local router doesn’t automatically know if the destination network becomes unavailable. As long as the link to the next-hop router stays up, the static route stays in the routing table. That’s because there is no inherent* mechanism in static routes that tracks whether the destination network is reachable.

Sidenote
Tracking Static Routes

Static Routes can be tied to what is called a “Tracking Object” which tracks the state and reachability of a destination network, but this is outside of the scope of the CCNA 200-301 v1.1 exam.

 

R1 will remove the static route from its routing table only if the link to R2 (the next hop toward 192.168.4.0/24) goes down. Otherwise, R1 will still believe it can send traffic to 192.168.4.0/24. That wastes bandwidth across the routers, only for the packets to be dropped at R4.

Dynamic routing protocols

Static routes are still necessary in certain situations, and they have an important place in networking. However, in medium to large networks, it’s usually better to use dynamic routes by configuring a routing protocol.

Routing protocols let routers learn remote networks automatically:

  • Routers advertise their directly connected networks to each other.
  • Routers also advertise routes they learned from neighbors to other neighbors.

 

Unlike static routes, routing protocols do track route availability. If a route becomes unavailable (for example, a cable is unplugged or an interface is shut down), the routing protocol on the router where the failure occurred will alert its neighbor to remove the route from its routing table. That update then propagates to other routers that also learned the route.

 

Once the network becomes available again, the route is automatically advertised to neighbors again.

To advertise your directly connected routes using a routing protocol, you typically enable the routing protocol on the router interface. This approach keeps configuration simpler and removes the need to manually maintain routes in the routing table.

The Open Shortest Path First (OSPF) routing protocol

One of the most widely deployed routing protocols is Open Shortest Path First (OSPF), specifically version 2, which is the version covered on the CCNA 200-301 v1.1 exam.

Sidenote
Other Dynamic Routing Protocols

OSPF is an industry standard routing protocol. This means that OSPF can run on any vendor’s Routers. There are other routing protocols however, such as Cisco’s proprietary: Enhanced Interior Gateway Routing Protocol (EIGRP), and Border Gateway Protocol (BGP) which is the routing protocol that runs the Internet, but they are out of scope of the CCNA 200-301 v1.1 exam.

OSPF is a Link State routing protocol. That means routers exchange topology information until they all share the same view of the network (like a map). With an identical, up-to-date topology view, each router can calculate the shortest path to every destination.

OSPF uses the Dijkstra algorithm (also known as the “Shortest Path” algorithm). It’s the same general idea used by GPS systems: given a map and link “weights,” compute the best path.

 

In terms of Administrative Distance, OSPF has a default Administrative Distance of 110 on Cisco Routers.

Routing protocol metric (OSPF cost)

OSPF chooses the “best” path as the one with the lowest metric. In OSPF, the metric is called cost.

By default, cost is derived from the Reference Bandwidth (default 100Mbps) divided by the bandwidth of the outgoing router interface.

InterfaceBandwidthReferenceBandwidth​=Cost

100Mbps100Mbps​=1

You can also manually set the cost on an interface to get the behavior the network administrator wants.

Routers calculate the total cost to a destination by adding the costs of all outgoing links along the path. Because each OSPF router has a full topology view, it knows the cost of each link leading to the destination.

 

R1 has two possible routes to reach 192.168.4.0/24:

  • One path through R2
  • Another path through R3

By default, modern router interfaces often have a default cost of 1, but in this example the link between R1 and R3 has been configured with a cost of 10. As a result, R1 selects the route through R2 because it has a lower total cost (cost of 3 vs. 12).

That doesn’t mean R1 discards the higher-cost route through R3. That route remains in the OSPF database as a backup. If the route through R2 fails, R1 can install the backup route into its routing table, similar to how a Floating Static Route works.

Equal cost multipath (ECMP)

Sometimes a router learns two or more routes to the same network with the same subnet mask. Consider the example below:

 

Both R2 and R3 advertise 192.168.4.0/24 to R1, and both routes are calculated with a cost of 3.

  1. Since the Subnet Mask (Prefix-Length) is the same, R1 would then have to consider the Administrative Distance
  2. Both of the routes are OSPF routes, that means they both have an Administrative Distance (AD) of 110, since the AD is a tie, then R1 would have to consider the route with the lowest metric or “cost” in the case of OSPF.
  3. In this instance, both of the routes to 192.168.4.0/24 have a cost of 3

When the prefix length ties, the administrative distance ties, and the routing protocol metric also ties, the router will load balance across the equal routes. It installs multiple next hops in the routing table and uses them instead of choosing only one. This behavior is called Equal Cost Multipath (ECMP).

In this case, R1 installs both routes in its routing table and alternates sending packets to R2 and R3.

To recall the order of operations when selecting the best route and installing it into the Routing table, here is the criteria in order of precedence once again:

  1. Select the route with the longest prefix length
  2. If the prefix length is the same, select the route with the lowest Administrative Distance
  3. If the Administrative Distance is the same (meaning, the same routing source), then select the route with the lowest routing protocol metric.
  4. If the metric is the same between the duplicate routes, then load balance the packets between all of the next hops.

OSPF areas

OSPF areas provide structure by dividing routers into logical groups, which is especially useful in larger OSPF deployments. An area is simply a logical grouping of OSPF Routers that have similar configurations and the same view of the entire topology.

For the CCNA 200-301 v1.1 exam, the focus is Single Area OSPF, which uses only Area 0. Area 0 is the “Backbone” area, and it’s where the core of the OSPF topology stems from.

Key points

Downsides of static routes

  • Manual configuration required on every router for each network
  • No automatic removal or update if network changes
  • No inherent mechanism to detect unreachable destinations

Dynamic routing protocols

  • Routers automatically advertise directly connected and learned networks
  • Routing protocols track route availability and update neighbors on changes
  • Simplifies configuration and maintenance in medium/large networks

Open Shortest Path First (OSPF) routing protocol

  • Industry standard, link-state routing protocol (version 2 for CCNA)
  • Routers exchange Link State Advertisements (LSAs) to build a shared topology map
  • Uses Dijkstra (Shortest Path) algorithm to compute best paths
  • Default Administrative Distance: 110

Routing protocol metric (OSPF cost)

  • OSPF metric = cost; lower cost preferred
  • Cost = Reference Bandwidth (default 100Mbps) ÷ Interface Bandwidth
  • Total path cost = sum of all outgoing link costs to destination
  • Backup routes kept in OSPF database for failover

Equal cost multipath (ECMP)

  • If prefix length, administrative distance, and metric all tie, router load balances traffic
  • Multiple equal-cost routes installed in routing table
  • Route selection order:
    1. Longest prefix length
    2. Lowest administrative distance
    3. Lowest metric
    4. Load balance if all above tie

OSPF areas

  • Logical grouping of routers for scalability
  • Single Area OSPF (Area 0, Backbone area) for CCNA focus

More from IP connectivity

  • Calculating networks and hosts (Subnetting)
  • Routers and IPv4 routing fundamentals
  • Static routing
  • Router redundancy in an Ethernet LAN using First Hop Redundancy Protocols (FHRPs)