Achievable logoAchievable logo
CCNA
Sign in
Sign up
Purchase
Textbook
Practice exams
Support
How it works
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
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

8 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.

(Image 156)

Image Title - Static Route to network 192.168.4.0/24 remains in R1’s routing table even though it is no longer available

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.

(Image 157)

Image Title - 3 Routers advertising their directly connected networks to each other

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.

(Image 158)

Image Title - R3 alerting R2 that the 192.168.4.0/24 network is down. In turn R2 alerts R1 to remove the route from its Routing Table

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.

(Image 159)

Image Title - OSPF Routers exchanging Link State Advertisements (LSAs)

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.

(Image 160)

Image Title - Cost between R1 and R3 to get to the 192.168.4.0/24 network

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:

(Image 161)

Image Title - R1 receiving an equal cost route to 192.168.4.0/24 from both R2 and R3

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

OSPF neighbor adjacencies

  • Routers must form neighbor adjacencies before exchanging routes
  • Enable OSPF on interfaces to:
    • Generate and share LSAs
    • Send/receive Hello messages to detect neighbors

OSPF Router-ID (RID)

  • Unique identifier for each OSPF router
  • Used in Hellos, LSAs, and route advertisements

OSPF neighbor adjacency process

  • States: Down → Init → 2-Way → Exstart → Exchange → Loading → Full
    • 2-Way: Bi-directional communication confirmed
    • Full: LSDBs synchronized, adjacency complete
  • Hello timer: interval for sending Hellos
  • Dead timer: interval before declaring neighbor down

OSPF adjacency types (broadcast vs. point-to-point)

  • Ethernet interfaces default to Broadcast adjacency
    • Default Hello timer: 10s; Dead timer: 40s
  • Broadcast networks use Designated Router (DR) and Backup DR (BDR)
    • DR/BDR are the central point for OSPF updates
    • DR/BDR reduce adjacency overhead in multi-router segments
    • DR/BDR election based on OSPF Priority (interface value), then Router-ID if tie
    • DR/BDR selection is non-preemptive

Point-to-point OSPF network type

  • Useful for when only two routers are connected
  • No DR or BDR, no election process
  • Same default Hello/Dead timers as Broadcast type
  • Serial interfaces default to point-to-point

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.

(Image 156)

Image Title - Static Route to network 192.168.4.0/24 remains in R1’s routing table even though it is no longer available

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.

(Image 157)

Image Title - 3 Routers advertising their directly connected networks to each other

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.

(Image 158)

Image Title - R3 alerting R2 that the 192.168.4.0/24 network is down. In turn R2 alerts R1 to remove the route from its Routing Table

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.

(Image 159)

Image Title - OSPF Routers exchanging Link State Advertisements (LSAs)

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.

(Image 160)

Image Title - Cost between R1 and R3 to get to the 192.168.4.0/24 network

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:

(Image 161)

Image Title - R1 receiving an equal cost route to 192.168.4.0/24 from both R2 and R3

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

OSPF neighbor adjacencies

  • Routers must form neighbor adjacencies before exchanging routes
  • Enable OSPF on interfaces to:
    • Generate and share LSAs
    • Send/receive Hello messages to detect neighbors

OSPF Router-ID (RID)

  • Unique identifier for each OSPF router
  • Used in Hellos, LSAs, and route advertisements

OSPF neighbor adjacency process

  • States: Down → Init → 2-Way → Exstart → Exchange → Loading → Full
    • 2-Way: Bi-directional communication confirmed
    • Full: LSDBs synchronized, adjacency complete
  • Hello timer: interval for sending Hellos
  • Dead timer: interval before declaring neighbor down

OSPF adjacency types (broadcast vs. point-to-point)

  • Ethernet interfaces default to Broadcast adjacency
    • Default Hello timer: 10s; Dead timer: 40s
  • Broadcast networks use Designated Router (DR) and Backup DR (BDR)
    • DR/BDR are the central point for OSPF updates
    • DR/BDR reduce adjacency overhead in multi-router segments
    • DR/BDR election based on OSPF Priority (interface value), then Router-ID if tie
    • DR/BDR selection is non-preemptive

Point-to-point OSPF network type

  • Useful for when only two routers are connected
  • No DR or BDR, no election process
  • Same default Hello/Dead timers as Broadcast type
  • Serial interfaces default to point-to-point

More from IP connectivity

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