In Routing Tables part one, we covered the basic purpose of a routing table and how an end device or intermediate device such as a router or multilayer switch can route based off its table. We also viewed different routing tables and how they are used to find a given destination network. In this blog, we will cover the purpose of routing metrics, administrative distance, and static routing and how they are important to routing table with the SHOW IP ROUTE command.
As a quick review, I mentioned that routers will always route between directly connected interfaces. A routing protocol isn’t needed to forward packets between these subnets.
This example shows that a router has multiple connected interfaces that it routes between automatically. The codes listed in the table specify how the route was learned and C is for directly connected. (Remember as long as the interface is up and you applied a subnet to that interface, then the router will route between directly connected interfaces.) This is also applicable with Inter-VLAN routing as discussed last month. As shown in the example below, the router can route between its sub-interfaces that are associated with specific VLANS for router on a stick.
Complementary to the last example is the routing table that is produced by that configuration. You will notice that the sub-interfaces are listed as directly connected.
Next, Routers need routing protocols to route between subnets that aren’t directly connected. These protocols include examples such as Router Information Protocol (RIP) and Open Shortest Path First (OSPF). Within these protocols their own respective algorithms used a ranking structure to validate on path over another. This ranking is known as a Metric and varies by the protocol in use (for example: Hop count for RIP and Cost for OSPF), but they all have a similar feature, the lowest metric is always best. In other words, if a router calculates two or more paths to a given destination, and one path has a lower metric number that the other path ways, then that route will be added to the routing table.
In example 4, there are two routes that were learned by RIP (as specified with the code entry of “R”). The routing entry contains “[120/1] and [120/10]”. The 1 and the 10 are the metrics and represent a hop count of 1 and 10 respectively for the router to forward packets to the destination networks of 188.8.131.52/24 and 172.16.1.0/24.
While the lowest metric is the more preferred pathway, sometimes a router may have more than one path to a give destination.
In the example above, from router Denver perspective, it has two possible routes to get to the network 192.168.1.0/24. If the only routing protocol running between all routers were RIP, then the best path would be selected based off least number of hops. Therefore that path would be from <DALLAS-LANGLEY> with a hop count (metric of 2) instead of <SAINT PAUL- GRAND RAPIDS- LANGLEY> with a hop count of 3. However if a more sophisticated routing protocol such as OSPF were running between all routers then the best path would be chosen based off cost rather that hop count (Cost is a metric, which has an inverse relationship with bandwidth meaning that higher the bandwidth the lower the cost and therefore must be as better path.) Therefore with OSPF the best path way will be <SAINT PAUL- GRAND RAPIDS- LANGLEY> instead of <DALLAS-LANGLEY> because the bandwidth is higher (or cost is lower) over the upper route than the lower route.
Sometimes that may be a need to have two routing protocols configured at the same time. These reasoning may be due to having different vender routers or legacy routers interconnected with newer routers. Therefore if router DENVER learned a route from RIP <DALLAS-LANGLEY> as the best path and a route from OSPF <SAINT PAUL- GRAND RAPIDS- LANGLEY> as a best path, it would have to decide on which routing protocol is more trustworthy. This can be accomplished with Administrative Distance. Administrative distance is a tie breaker between different routing protocols when multiple are learned from different routing protocols. Denver needs to only trust one routing protocol RIP or OSPF. All routing protocols have default Administrative distance number assignments (These number technically are arbitrary however Cisco has its own protocols with a better Admin Distance that most others.) The lower the Administrative distance the better the believability. RIP administrative distance is 120 while OSPF is 110. There for all routes learned from OSPF are more preferred that RIP. Below are a few examples the most common routing protocols with their respective administrative distances. These will be displayed in the directly before the metric of a given protocol (such as [120/1] 120 is the administrative distance for RIP).
Lastly, Static route are administratively configured routes. Rather than using large amounts of memory to build tables like most dynamic routing protocols, static routes are simple and specify a next hop or an interface that the router must use to reach that given destination.
As shown above two routes were created and are found in the routing table. One entry has as next hop address 10.1.1.2 and the other which points out of FastEthernet 0/0. With that case the router will ARP to find the destination MAC- Address to get the next hop information at layer 2 (which in this case will also be router 10.1.1.2.)
This concludes Routing table part two. I discussed multiple views of the routing table and how to interpret the output its key features. These values include the code table, administrative distance and also how static routes appear with the SHOW IP ROUTE command