Sunday 22 September 2019

How Router Choose Best Path? Cisco Router Path Section

How Router Choose Best Path? Cisco Router Path Section

This article is about How Router Choose Best Path and how router build routing table. We will see how to use several routing protocols. For understanding the concept how router choose best path we need to know how router works. For exploring the router functionality we will discus concept related to it. First we learn the router switching functionality:

Router Switching Function:

One of the main functions of a router is to forward packets to its destination. This is achieved through a switching function , which is the process that a router uses to accept a packet in one interface and forward it through another interface.
Note: in this context, the term “switching” literally means moving packets from source to destination and should not be confused with the function of a layer 2 switch.
Once the router has determined the exit interface through the route determination function , the router must encapsulate the packet in the data link frame of the exit interface. What does a router do when it receives a packet from a network that is destined for another network? The router executes the following three main steps:

  1. Uncapsulate the plot header and the Layer 2 trailer to expose the Layer 3 package.
  2. Examine the destination IP address of the IP packet to find the best path in the routing table.
  3. If the router finds a route to the destination, it encapsulates the layer 3 packet in a new layer 2 frame and forwards the frame through the output interface.

As shown in the following image, the devices have Layer 3 IPv4 addresses, and the Ethernet interfaces have Layer 2 data link addresses.

Routing Decision:

We have already mentioned that one of the main functions of routers is to determine the best route to send packets. To determine the best route, the router searches its routing table for a network address that matches the destination IP address of the packet and can find 3 determinations:
Network directly connected : If the destination IP address of the packet belongs to a device on a network that is directly connected to one of the router interfaces, that packet is forwarded directly to the destination device. This means that the destination IP address of the packet is a host address on the same network as the router interface.
Remote network : If the destination IP address of the packet belongs to a remote network, the packet is forwarded to another router. Only remote networks can be reached by forwarding packets to another network.
No particular route : if the destination IP address of the packet does not belong to a connected or remote network, the router determines if a gateway of last resort is available. The gateway of last resort is set when a default route is configured or learned on a router. If there is a default route, the packet is forwarded to the gateway of last resort. If the router does not have a default route, the packet is discarded.

The Best Route

The determination of the best route implies the evaluation of several routes to the same destination network and the selection of the optimal or shortest route to reach that network. When there are several routes to the same network, each route uses a different output interface on the router to reach that network.
The best path is chosen by a routing protocol based on the value or metric it uses to determine the distance to reach that network. A metric is a quantitative value that is used to measure the distance that exists to a given network, therefore, the best path to a network is the route with the lowest metric.
Dynamic routing protocols generally use their own rules and metrics to build and update routing tables. Here are some dynamic protocols and the metrics they use:


  1. Routing Information Protocol (RIP) : hop count.
  2. OSPF (Open Shortest Path First) protocol : the cost of Cisco based on cumulative bandwidth from source to destination.
  3. Enhanced Internal Gateway Routing Protocol (EIGRP) : bandwidth, delay, load, reliability.

Load Balance

What happens if a routing table has two or more routes with identical metrics to the same destination network? In case they have a metric of the same cost it is called “ load balancing of the same cost ” and the router does what it does is forward the packets using both routes equally. If configured correctly, load balancing can increase the effectiveness and performance of the network. Load balancing of the same cost can be configured to use both dynamic routing protocols and static routes.

Note: only EIGRP supports load balancing with a different cost.

Best Path on Router Configured with Multiple Routing Protocols:

It is possible to configure a router with several routing protocols and several static routes. If this occurs, the routing table can have more than one route source for the same destination network. For example, if RIP and EIGRP are configured on a router, both routing protocols can discover the same destination network. However, each routing protocol may decide to take a different route to reach the destination according to the metrics of that routing protocol. RIP chooses a route according to the hop count, while EIGRP chooses a route according to the composite metric. How does the router know which route to use? ... with the administrative distance
The Cisco IOS uses what is known as "administrative distance" (AD) to determine the route to be installed in the IP routing table. The AD represents the “reliability” of the route: the smaller the AD, the more reliable the origin of the route will be . For example, the AD of a static route is 1, while the AD of a route discovered by EIGRP is 90. The router chooses the route with the lowest AD between two different routes to the same destination. When a router can choose between a static route and an EIGRP route, the static route has priority. Likewise, a route directly connected with an AD of 0 has priority over a static route with an AD of 1.





No comments:

Post a Comment