Components of The Routing Table.

By | March 20, 2024

The routing table is a fundamental component of network devices like routers, which directs incoming data packets to their destination addresses by providing a set of rules for packet forwarding. Below is a brief introduction to the essential components of a routing table:

i. Routing Protocol Code

The routing protocol code identifies the source of the routing information. Different routing protocols use different codes. For example, static routes might be denoted by an “S“, routes learned through the Open Shortest Path First (OSPF) protocol by “O“, and those learned from the Border Gateway Protocol (BGP) by “B“. This code helps in quickly identifying how a route was learned and determines its priority and trustworthiness.

83% discount on VPN

Below is an illustrative example of the output from a show ip route command on a Cisco router. This command displays the contents of the router’s routing table, which is crucial for understanding how the router directs traffic. Keep in mind that the actual output can vary based on the router’s configuration, the routing protocols in use, and the network topology.

Router# show ip route

Codes: C – connected, S – static, R – RIP, M – mobile, B – BGP

D – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter area

N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2

E1 – OSPF external type 1, E2 – OSPF external type 2

i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2

ia – IS-IS inter area, * – candidate default, U – per-user static route

o – ODR, P – periodic downloaded static route, H – NHRP, l – LISP

+ – replicated route, % – next hop override

Gateway of last resort is not set

192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks

C 192.168.1.0/24 is directly connected, FastEthernet0/0

L 192.168.1.1/32 is directly connected, FastEthernet0/0

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

C 10.1.2.0/24 is directly connected, FastEthernet1/0

L 10.1.2.1/32 is directly connected, FastEthernet1/0

S 172.16.0.0/16 [1/0] via 10.1.2.2

192.168.2.0/24 [110/2] via 10.1.2.2, 02:22:22, FastEthernet1/0

In this example:

C indicates a directly connected network. For instance, the network 192.168.1.0 with a 24-bit mask (/24) is directly connected to the interface FastEthernet0/0.

L stands for a local route, which is the IP address assigned to the router’s interface itself. For example, 192.168.1.1/32 is the IP address for FastEthernet0/0.

S represents a static route. The route to the network 172.16.0.0/16 is statically configured to be accessed via the next-hop address 10.1.2.2.

O denotes routes learned through OSPF. The route to 192.168.2.0/24 has been learned via OSPF, with a metric of 2 and via the next hop 10.1.2.2 on the FastEthernet1/0 interface.

The administrative distance is not explicitly shown in this summary, but it’s understood based on the route source (e.g., OSPF routes have an AD of 110 by default). The metric is shown in brackets for routes learned through dynamic routing protocols (e.g., [110/2] for the OSPF route, where 110 is the administrative distance and 2 is the metric).

ii. Prefix

The prefix indicates the destination network address. It is the IP address of the network or subnetwork to which packets can be routed. The prefix size determines how large the network is, with smaller prefixes indicating larger networks. In IP version 4 (IPv4), this could be an address like 192.168.1.0, and in IP version 6 (IPv6), an address like 2001:db8::.

Basic IP Address Format

A diagram of a computerDescription automatically generated with medium confidence

iii. Network Mask

The network mask, also known as the subnet mask, works in tandem with the prefix to specify which portion of the address identifies the network and which part identifies the host within that network. For example, a subnet mask of 255.255.255.0 (/24 in CIDR notation) indicates that the first 24 bits of the IP address specify the network, leaving the last 8 bits for host addresses within that network.

Example:

A close-up of a numberDescription automatically generated

Above is a table illustrating how an IP address is shown with its corresponding network mask, CIDR notation, and the calculated number of hosts that can be in that network. This representation aids in grasping the scale and segmentation of a network for routing and addressing needs.

IP Address: This is the network’s address. Each row represents a different network.

Network Mask: This shows the mask applied to the IP address to identify the network portion of the address. The network mask helps determine the size of the network.

CIDR Notation: Classless Inter-Domain Routing notation is a compact representation of an IP address and its associated network mask. CIDR notation combines the IP address with a slash (“/”) followed by the bit length of the network mask.

Number of Hosts: This column calculates the number of usable IP addresses within each network minus the network and broadcast addresses. For example, in a /24 network, the theoretical number of addresses is 256 (2^8), but the number of usable addresses is 254 because the first address is reserved for the network address, and the last address is reserved for the network broadcast address.

iv. Next Hop

The next hop is the address of the next gateway (router) a packet should be sent to on its way to the final destination. This could be the final destination itself if it is directly reachable within the same network, or the address of another router that is closer to the destination. The next hop is critical for making forwarding decisions.

Example:

A diagram of a computer networkDescription automatically generated

v. Administrative Distance

The administrative distance (AD) is a measure of the trustworthiness of the source of the routing information. Lower values indicate more trusted sources. Each routing protocol is assigned a default AD; for instance, direct connections might have an AD of 0, static routes 1, EIGRP routes 90, and OSPF routes 110. This value helps routers to choose between routes learned from different sources.

Below is a table listing common routing protocols and their typical administrative distance (AD) values. Administrative distance is a metric routers use to choose the best path when multiple routes from different protocols lead to the same destination. A lower administrative distance indicates a more reliable source.

Routing Protocol Administrative Distance

Connected interface 0

Static route 1

Enhanced Interior Gateway Routing Protocol (EIGRP) summary route 5

External Border Gateway Protocol (eBGP) 20

Internal EIGRP 90

IGRP (Interior Gateway Routing Protocol) 100

OSPF (Open Shortest Path First) 110

IS-IS (Intermediate System to Intermediate System) 115

Routing Information Protocol (RIP) 120

External EIGRP 170

Internal Border Gateway Protocol (iBGP) 200

Unknown 255

vi. Metric

The metric is a value used by routing protocols to determine the best path to a destination network among multiple possible paths. It can be based on various factors such as bandwidth, delay, hop count, path cost, etc. Different routing protocols use different metrics. For example, OSPF uses cost based on link speed, while RIP uses hop count.

Purpose of Metrics.

The primary purpose of a metric is to provide a quantitative value that represents the “cost” of using a particular route from a source to a destination. This cost can be based on several factors, including:

Bandwidth: The capacity of the link. Higher bandwidth suggests a lower cost.

Delay: The time it takes for a packet to travel from the source to the destination. Lower delay paths are preferred.

Hop Count: The number of routers a packet must pass through to reach its destination. Fewer hops generally indicate a preferred path.

Load: The amount of traffic currently being handled by the route. Less loaded routes are preferred to avoid congestion.

Reliability: The dependability of a route, often measured by the error rate. More reliable routes have a lower cost.

Cost: An arbitrary value assigned by the network administrator based on the economic cost of using a particular link.

Metric in Different Routing Protocols

Different routing protocols use different metrics for selecting the best route:

RIP (Routing Information Protocol): Uses hop count as its metric, with a maximum allowable of 15 hops. A route is considered unreachable if it has 16 hops or more.

OSPF (Open Shortest Path First): Uses cost as its metric, which is inversely proportional to the bandwidth of the link. Administrators can also adjust the cost manually to influence route selection.

EIGRP (Enhanced Interior Gateway Routing Protocol): Uses a composite metric based on bandwidth, delay, load, and reliability. By default, only bandwidth and delay are considered.

BGP (Border Gateway Protocol): Though not a metric in the traditional sense, BGP uses attributes such as AS_Path length, origin, and local preference to make routing decisions.

vii. Gateway of Last Resort

The gateway of last resort is a route used by the router when a packet does not match any other route in the routing table. This gateway acts as a “catch-all” route, often pointing to a router that has connectivity to the rest of the network or the Internet. It ensures that packets with unknown destinations are not dropped but sent towards a router that might have more information.

You can provide a gateway of last resort to a router using the command:

ip route 0.0.0.0 0.0.0.0 <next hop ip address>

Understanding these components is crucial for network administrators and engineers to effectively manage and troubleshoot routing within networks. Each component plays a specific role in the routing process, ensuring efficient and correct packet forwarding based on the network’s topology and the routing protocols in use.

Read More: Routing in a network