WHAT IS DYNAMIC ROUTING?

Dynamic routing operates at Layer 3 of the OSI model. It involves configuring a dynamic routing protocol on routers, enabling them to automatically discover and maintain optimal paths to destination networks. Unlike static routing, which uses fixed paths, dynamic routing adapts to changes in the network, ensuring optimal routing efficiency.

Key Definitions:
-
Network Route: A route to a network or subnet (Mask Length < /32).
Example: 10.0.12.0/30 and 10.0.13.0/30 are network routes. -
Host Route: A route to a specific host (/32).
Example: 10.0.12.1/32 and 10.0.13.1/32 are host routes.
These routes are automatically added to R1’s G0/0 and G1/0 interfaces.
HOW DYNAMIC ROUTING WORKS

In a dynamic routing environment, if R4 advertises its routes to R2, which then advertises them to R1, and R1 to R3, the route to R4 is added to their routing tables.
If a network route becomes unavailable, it is dynamically removed from the routing table.

In this scenario, R1 removes the route to R4 from its routing table when the connection fails.
In Static Routing: A downed router continues to receive traffic, and the routing tables remain unchanged.

Here, R1 has a static route to R4 and continues to forward traffic destined for that network regardless of the status.
To enhance redundancy, an additional connection between R3 and R4 can be implemented.

The secondary dynamic route added from R1 to R4 via R3 updates the routing table accordingly. If the route through R2 fails, traffic is automatically rerouted via R3.

Cost Preference
The routing preference may depend on the cost associated with each path. This is similar to how the Spanning Tree Protocol (STP) operates with switches.
INTRODUCTION TO DYNAMIC ROUTING PROTOCOLS
Dynamic routing protocols enable routers to advertise information about the routes they know to other routers.
- Routers establish adjacencies or neighbor relationships with adjacent routers to facilitate this information exchange.
- If multiple routes to a destination are learned, the router determines the superior route based on the metric. The route with the lower metric is considered superior.
TYPES OF DYNAMIC ROUTING PROTOCOLS
Dynamic routing protocols can be divided into two main categories:
-
IGP (Interior Gateway Protocol)
- Used to share routes within a single autonomous system (AS), typically within an organization.

-
EGP (Exterior Gateway Protocol)
- Used to share routes between different autonomous systems (AS).

Algorithms and Protocols
Each type of protocol uses specific algorithms:

Note: Memorization of the algorithms associated with each protocol is crucial for the CCNA exam.
DISTANCE VECTOR ROUTING PROTOCOLS
Distance Vector protocols are so named because they communicate only the ‘distance’ (metric) and ‘vector’ (direction, next-hop router) of each route.
- These protocols were developed before Link State protocols.
- Early examples include RIPv1 and Cisco’s IGRP (which evolved into EIGRP).
Distance Vector protocols operate by sharing:
- Their known destination networks.
- The metric to reach these networks.
This method of sharing routing information is often referred to as “routing by rumor.” This is because the router only knows the network information provided by its neighbors.

DYNAMIC ROUTING PROTOCOL METRICS
A router’s routing table contains the best route to each destination network it knows about.
When a router using a dynamic routing protocol learns two different routes to the same destination, it determines which is best based on the metric value.
- Lower metric = better route! (similar to STP)
Each routing protocol uses a different metric to evaluate routes.

In the example above, the red path is chosen because the cost of using R3’s F2/0 and R4’s F2/0 (FastEthernet) is higher than the cost of R2’s G1/0 and R4’s G0/0 (GigabitEthernet).
Equal Cost Multi-Path (ECMP)
If both connections are of the same type (e.g., both GigabitEthernet), both routes will be added to the routing table, enabling load balancing over both routes.

If a router learns multiple routes via the same routing protocol to the same destination (same network address, same subnet mask) with the same metric, all will be added to the routing table.

In this example:
- “O” indicates the OSPF protocol next to the routes.
- [110/3]: The “3” represents the metric, while the “110” indicates the administrative distance (discussed later).
Summary of Different Metrics

Note: IS-IS will not be covered in detail.
ADMINISTRATIVE DISTANCE
Most companies typically use a single IGP, commonly OSPF or EIGRP. In some cases, two different routing protocols may be utilized, especially when two companies connect their networks to share information.
- Metric is used to compare routes learned via the same routing protocol.
- Since different routing protocols use different metrics, these cannot be directly compared. For example:
- An OSPF route to 192.168.4.0/24 might have a metric of 30, while an EIGRP route to the same destination may have a metric of 33280.
To determine which routing protocol is preferred, the Administrative Distance (AD) is employed. A lower AD indicates a more trustworthy routing protocol.
Administrative Distance Numbers

Use flashcards to memorize these values!
💡 If the Administrative Distance is 255, the router does not trust the source of that route and will not install it in the routing table.

The metric is used to compare routes learned from the same routing protocol. Before comparing metrics, the AD is used to select the best route.
Thus, the best route might be: “next hop 192.168.3.1, learned via OSPF (lower AD than RIP), metric 10.”
- You can change the AD of a routing protocol, which will be demonstrated during the lecture on OSPF configuration.
- It is also possible to adjust the AD of a static route:


Why Would You Want to Do This?
Floating Static Routes
By changing the AD of a static route, you can make it less preferred than routes learned by a dynamic routing protocol to the same destination, thereby enabling a backup route in the event of primary route failure.