0% found this document useful (0 votes)
47 views

How Does Route Selection Work in Cisco Routers

Route selection criteria
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

How Does Route Selection Work in Cisco Routers

Route selection criteria
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 22

How Does Route Selection Work

in Cisco Routers?
Written by Meena. Posted in IT & Networking Blog

Most routing protocols have metric structures and algorithms that are not compatible
with other protocols. In a network where multiple routing protocols are present, the
exchange of route information and the capability to select the best path across the
multiple protocols are critical.

Administrative distance is the feature used by routers to select the best path when
there are two or more different routes to the same destination from different routing
protocols. Administrative distance defines the reliability of a routing protocol. Each
routing protocol is prioritized in order of most to least reliable (believable) using an
administrative distance value.
Before we dive deep into the selection process of route for best path, I want to start
from very basics first.

Suppose we have two PCs the they are directly connected with each other.

The network starts to grow and we have more PCs.

Now we need a switch to connect them, but still they are in a single network.
Network continuously growing and they also need to access the Internet or they
need to connect to the other networks as well.

To establish the communication between the networks, we require router. The router
maintains the routing table, and places the routes or networks in the routing table.

Processes Involved In Building And Maintaining


The Routing Table
There are three processes involved in building and maintaining the routing table,
particularly in a Cisco router:

1. Routing protocol
2. Routing table
3. Packet Forwarding decision

Routing protocol

Router builds routing table by collecting the information about the network or
networks, which can be connected directly or remotely. Who will provide the
information about these networks? For the directly connected networks router need
not any routing protocol, it enters these network into routing table by its own. The
networks which are not directly connected, router needs to learn by manually or with
the help of routing protocols.

Building the Routing Table

The main considerations while building the routing table are:

Administrative distance (AD)− This is the measure of trustworthiness of the


source of the route. If a router learns about a destination from more than one routing
protocol, administrative distance is compared and the preference is given to the
routes with lower administrative distance. In other words, it is the believability of the
source of the route.

Metrics − This is a measure used by the routing protocol to calculate the best path
to a given destination, if it learns multiple paths to the same destination. Each
routing protocol uses a different metric.

Prefix length

With the help of example, we will observe how these parameters are affecting in the
building the routing table and packet forwarding decisions.
In this scenario on R1-R5, configured RIP, OSPF, and EIGRP simultaneously. Let us
see how the router will work in this situation. Configure a Loopback interface
(Loopback 1, with IP address 1.1.1.1/24) on each router, advertise this loopback on
every router and in each routing protocol and also define a static route on R1 for the
same.

Routing protocol configurations and Routing


tables:
We will observe only the loopback route (1.1.1.1)

Observation 1:

In the output of the R1, we can see network 1.1.1.0/24 is advertised in EIGRP, OSPF,
RIP, and static route. R1 will install the directly connected 1.1.1.0/24 and 1.1.1.1/32
in its routing table, reason is that AD of the directly connected route is lowest which
is 0.
R2 is receiving the network 1.1.1.1 via EIGRP as 1.1.1.0/24 and via OSPF as
1.1.1.1/32. For R2 1.1.1.0/24 and 1.1.1.1/32 are the different routes, so it includes
both and are advertised by two different routing protocols.
R3 installed the directly connected 1.1.1.0/24 and 1.1.1.1/32 in its routing table.
R4 installed the directly connected 1.1.1.0/24 and 1.1.1.1/32 in its routing table.
R5 installed the directly connected 1.1.1.0/24 and 1.1.1.1/32 in its routing table.
Observation 2:

In the next steps, get ready to see the magic!

R1 placed the 1.1.1.1/32 and 1.1.1.0/24 directly connected routes in the routing
table. On R1 we also have configured static route for 1.1.1.0/24, turn off the
loopback 1 on R1. Now R1 will give the entry to the 1.1.1.0/24 route learned by static
route, due to the AD is lower than the any other routing protocol.
Observation 3:

If we remove the static route on R1, it will place the 1.1.1.1/32 longest prefix length
route in the routing table, which is learned by OSPF.
Observation 4:

After disabling the EIGRP, then the routes advertised by OSPF will place in the
routing table, because the OSPF AD is 110 and RIP's AD is 120.

Observation 5:

If we will disable OSPF, then the router will advertise the route in routing table, which
are learned by RIP.
So, we can say that when a router receives a route with the same prefix from
different routing protocols, the selection of the route is dependent on Administrative
Distance of the routing protocol and lower AD will be preferred.

Prefix length
Let's look at another scenario to see how the router handles another situation:
varying prefix lengths. Assume, again, that each router has running EIGRP, OSPF,
and RIP configured 1.1.1.0 on respective router as per given below:

 R3--EIGRP (internal): 1.1.1.0/26


 R4--RIP: 1.1.1.0/24
 R5--EIGRP: 1.1.1.0/19

Q. Which of these routes will be installed in the routing table?

Since EIGRP internal routes have the best administrative distance, it's tempting to
assume that the first one will be installed. However, each of these routes have a
different prefix length (subnet mask), they're considered different destinations, and
they will all be installed in the routing table.
Let's see how the forwarding engine uses the information from the routing table to
make forwarding decisions.
Making Forwarding Decisions
Let's look at the three routes we just installed in the routing table, and see how they
look on the router.

R2# show ip route

If a packet arrives on a router interface destined for 1.1.1.1, which route would the
router choose?

It depends on the prefix length, or the number of bits set in the subnet mask. Longer
prefixes are always preferred over shorter ones when forwarding a packet.

In this case, a packet destined to 1.1.1.1 is directed toward 23.1.1.1, because 1.1.1.1
falls within the 1.1.1.0/26 network (1.1.1.0 to 1.1.1.63). It also falls within the other
two routes available, but the 1.1.1.0/26 has the longest prefix within the routing
table (26 bits verses 24 or 19 bits).

Likewise, if a packet destined for 1.1.1.100 arrives on one of the router's interfaces,
it's forwarded to 24.1.1.1, because 1.1.1.100 doesn't fall within 1.1.1.0/26 (1.1.1.0
through 1.1.1.63), but it does fall within the 1.1.1.0/24 destination (1.1.1.0 through
1.1.1.255). Again, it also falls into the range covered by 1.1.1.0/19, but 1.1.1.0/24
has a longer prefix length.
Beyond the scope of those two, rest of the traffic will go to 1.1.1.0/19, and is
forwarded towards 25.1.1.1

Route selection can also be influenced by changing in matric and it also varies as per
the protocol.

What do you think about this explanation?

Thanks.

EIGRP Preferred Path Manipulation


Rashmi Bhardwaj | | Blog, Config & Troubleshoot
Advertisements
Introduction: EIGRP Preferred Path
Inside an EIGRP routing domain, many times there is a need to control the
EIGRP route path. For instance in scenarios where we have 2 or more equal
path links to the destination and need to configure 1 st link as preferred path
and rest to perform the backup functionality. Below documentation
enlightens on how EIGRP parameters can be tweaked and preferred path
selection may be achieved.
EIGRP Preferred Path Manipulation
Methods
Some of the EIGRP Preferred Path manipulation methods discussed in this
article are:

Bandwidth
Delay
Offset List
Administrative Distance
Though traffic manipulation can be performed via other factors also, some
methods will be discussed in this post –
The Above Diagram depicts 2 Routers (R1 and R2) connected via 2 links –
Link 1 = R1 Fa0/0 to R2 Fa0/0
Link 2 = R1 Fa0/1 to R2 Fa0/1

R1 and R2 are running EIGRP and configuration of both Routers is shared


below –

Base Configuration of R1
Hostname R1
interface Loopback0
ip address 192.168.0.1 255.255.255.0
!
Interface FastEthernet0/0
ip address 192.168.12.1 255.255.255.0
!
interface FastEthernet0/1
ip address 192.168.112.1 255.255.255.0
!
router eigrp 1
network 192.168.0.0 0.0.255.255
no auto-summary
Base Configuration of R2
Hostname R2
!
interface FastEthernet0/0
ip address 192.168.12.2 255.255.255.0
!
interface FastEthernet0/1
ip address 192.168.112.2 255.255.255.0
!
router eigrp 1
network 192.168.12.0
network 192.168.112.0
no auto-summary
R2 has 2 equal cost paths to network 192.168.0.0/24 , 1st from interface
fa0/0 and 2nd via interface fa0/1.
Metric for 192.168.0.0/24 from Fa0/0 Interface of R2
The formula considers that only K1 and K3 values (by default) are 1 while K2,
K4 and K5 are 0 –
Where K1 = Bandwidth and K3 = Delay
Metric = 256 * {(10^7/min BW) + (Total DLY/10)}
Min BW = minimum BW along the path from fa0/0 of R2 to from Looopback0
of R1
Since Loopback0 of R1 has bandwidth of 8000000 Kbps while Fa0/0 of R2 had
Bandwidth of 10000 Kbps, hence min BW will be 10000 Kbps
Total DLY = Sum of Delay along the path from fa0/0 of R2 to from
Looopback0 of R1
Since Loopback0 of R1 has delay of 5000 Microseconds while Fa0/0 of R2 has
delay of 1000 microseconds, hence Total DLY will be 1000 + 5000 = 6000
Microseconds.
Now,
Metric = 256 * {(10^7/min BW) + (Total DLY/10)}
= 256 * {(10^7/10000) + (6000/10)}
= 256 * {1000 + 600}
= 409600
Metric for 192.168.0.0/24 from Fa0/1 Interface of R2
In this case also, the metric values are same as above leading to
Metric = 256 * {(10^7/min BW) + (Total DLY/10)}
= 256 * {(10^7/10000) + (6000/10)}
= 256 * {1000 + 600}
= 409600
Now, we will devise below methods to make path via Interface Fa0/0 of R2
the preferred one (Successor) for reaching Loopback 0 (192.168.0.0/24) of
R1.The backup (Feasible Successor) will be via Interface Fa0/1 of R2.
EIGRP Preferred Path Manipulation via
Bandwidth
As per requirement depicted in the above diagram to make R2 prefer
Interface Fa0/0 (Successor) to destination
192.168.0.0/24, Bandwidth parameter (K1 Value) will be tweaked to change
path preference.
Once the Bandwidth on Interface is increased from 10000 Kbps to 100000
Kbps, recalculation for network 192.168.0.0/24 is performed on R2 which
reduces Metric from interface fa0/0 from 409600 to 179200. From now
onwards, traffic destined for network 192.1680.0/24 from R2 will take path
via Interface Fa0/0.
EIGRP Preferred Path Manipulation via Delay
As per requirement depicted in the above diagram to make R2 prefer
Interface Fa0/0 (Successor) to destination 192.168.0.0/24, Delay parameter
(K3 Value) will be tweaked to change path preference.
Once the delay on Interface is decreased from 1000 microseconds to 100
microseconds, recalculation for network 192.168.0.0/24 is performed on R2
which reduces Metric on interface fa0/0 from 409600 to 386560. From now
onwards, traffic destined for network 192.1680.0/24 will take path via
Interface Fa0/0.

EIGRP Preferred Path Manipulation via Offset


List
Offset List – Option 1
For R2 to prefer Interface Fa0/0 (Successor) towards destination
192.168.0.0/24, Offset-List may be configured which henceforth will
influence EIGRP path selection by increasing the path metric.
With Offset-list, additional metric will add up for the destination
network matching the access list. As shown in the above diagram, the offset
list is applied on inbound interface fa0/1 of R2. Access-list 10 matches the
learned routes for which metric 1 needs to be added (in this case access list
10 matches network 192.168.0.0/24).This method adds +1 to the calculated
metric on R2 for 192.168.0.0/24.The total metric value now becomes 409600
+ 1 = 409601.Now the Successor path is via Fa0/0 and Feasible successor
will be via fa0/1.
Offset List – Option 2
Offset list can be applied on the outgoing interface of advertising router. In
this method,R1 will add Metric 1 for network 192.168.0.0/24 advertised via
interface fa0/1 towards R2.By doing so,R2 will learn metric from fa0/0
(409600) and fa0/1 (409601) .Hence the Successor path for R2 is via Fa0/0
and Feasible successor will be via fa0/1.

EIGRP Preferred Path Manipulation via


Administrative Distance
As we understand that administrative distance is an important parameter
during best path selection, hence this can be incorporated on local router to
govern best path selection from 2 or more paths of equal cost.

Above diagram depicts how Administrative distance can be leveraged for


best path selection. Under the “Router EIGRP 1” command, we change the
EIGRP Administrative Distance from default 90 to 91 for routes received from
Source (IP = 192.168.112.1,Wildcard Mask = 0.0.0.0).The command calls
access list 1 which matches the subnet 192.168.0.0/24 (Loopback 0 of
R1).This configuration drives R2 to prefer path via interface fa0/0
(Administrative distance = 90) and make it the successor while keeping
interface fa0/1 as backup.

How routers select best routes ?


Routers select best routes based on the following criteria:

1. Longest prefix match: Routers select routes with the longest match to
the destination address in the forwarded packet. For example if a packet is
destined to 192.168.12.1 and the router has 192.168.0.0/16 and
192.168.12.0/24 in its routing table, it will forward the packet using the
192.168.12.0/24 route.
2. Administrative distance: If a router is receiving the same route from
multiple routing protocols it will install the route with
the lowest Administrative distance in the routing table. For example if the
router is receiving 192.168.12.0/24 from both OSPF (AD:110) and RIP
(AD:120) the OSPF route will be selected.
The following table is listing from lowest to highest:

Routing protocol Default AD

Connected interface 0

Static route 1

Enhanced Interior Gateway Routing Protocol (EIGRP) summary


5
route

External Border Gateway Protocol (BGP) 20

Internal EIGRP 90

IGRP 100

OSPF 110

Intermediate System-to-Intermediate System 115


(IS-IS)

Routing Information Protocol (RIP) 120

Exterior Gateway Protocol (EGP) 140

On Demand Routing (ODR) 160

External EIGRP 170

Internal BGP 200

Unknown 255

3. Metric: If the router is receiving the same route many times from the
same routing protocol it will consult the metric value for its selection; the
lowest the best. If routes has the same metric both will be installed in the
routing table and the router will load balance packets over them. CISCO
routers install up to 4 equal metric routes (IGP) by default in the routing
tables and you can manipulate the number using the
command maximum-paths under the protocol configuration mode.

You might also like