Interpreting the Components of a Routing Table

Introduction to Routing Tables

A routing table is a database stored inside a router or Layer 3 device that contains information about network destinations and the paths used to reach them.

Routers use the routing table to:

  • Forward packets
  • Select the best path
  • Reach remote networks efficiently
  • Control network traffic congestion

What is a Routing Table?

A routing table is a collection of network routes stored inside a router, Layer 3 switch, or computer. It contains information about different network destinations and tells the device where to forward packets.

The routing table helps a router determine the best path to send data from a source network to a destination network.

A routing table contains information that helps a router determine the best path to forward packets from one network to another.

It stores details about:

  • Destination networks
  • Next-hop routers
  • Exit interfaces
  • Routing metrics
  • Route sources

Main Information Contained in a Routing Table

ComponentDescription
Routing Protocol CodeIndicates how the route was learned
Destination Network / PrefixTarget network address
Subnet MaskDefines network size
Next-Hop AddressNext router to forward packets
Exit InterfaceInterface used to send packets
Administrative DistanceTrustworthiness of route source
MetricBest path calculation value
Gateway of Last ResortDefault route for unknown networks

Routing Table Example

Router# show ip route

Example output:

C    192.168.1.0/24 is directly connected, GigabitEthernet0/0
O    10.10.10.0/24 [110/20] via 192.168.1.2, 00:00:12, GigabitEthernet0/1
S*   0.0.0.0/0 [1/0] via 192.168.1.1

Components of a Routing Table

Routing Protocol Code

Routing protocol codes are identifiers displayed in a router’s routing table that show the source of each route. They help network administrators understand whether a route was learned through a routing protocol, configured manually, or discovered directly through a connected network.


Common Routing Protocol Codes

CodeMeaning
CConnected
SStatic
OOSPF
DEIGRP
RRIP
BBGP
LLocal

Example

O    10.10.10.0/24

Interpretation

  • O means the route was learned through OSPF.

What is a Prefix?

A prefix is a notation that specifies a network and the number of bits used to identify that network. It is used by routers to determine how packets should be routed through a network.

It identifies the network portion of an IP address and indicates how many bits are used for the network.

Format:

Network Address/Prefix Length

Example:

192.168.1.0/24
  • 192.168.1.0 → Network address
  • /24 → Prefix length (24 bits are used for the network part)

This means all IP addresses from 192.168.1.0 to 192.168.1.255 belong to the same network.

Interpretation

  • Network address = 192.168.10.0
  • Prefix length = /24

Network Mask

A network mask (subnet mask) is a number used to identify which part of an IP address represents the network and which part represents the host, enabling proper routing and communication within a network.

It helps devices determine whether another device is on the same network or a different network.

Example:

IP Address:     192.168.1.10
Subnet Mask:    255.255.255.0

In this example:

  • 192.168.1 represents the network portion.
  • 10 represents the host portion.

Common subnet masks:

Subnet MaskPrefix Length
255.0.0.0/8
255.255.0.0/16
255.255.255.0/24
255.255.255.192/26

Next Hop

A next hop is the IP address of the immediate router or gateway that a packet should be forwarded to in order to move closer to its destination. It helps routers determine the path that packets take through a network.

When a router receives a packet, it checks its routing table and forwards the packet to the next hop specified for the destination network.

Example

Destination Network: 192.168.2.0/24
Next Hop: 10.0.0.2

This means that to reach the network 192.168.2.0/24, the router should send the packet to the router with IP address 10.0.0.2.


Administrative Distance

Administrative Distance (AD) is a numerical value that indicates how reliable a routing information source is. Routers use it to choose the best route when multiple routes to the same destination are available from different sources. Lower values are preferred.

Common Administrative Distance Values

Route SourceAdministrative Distance
Connected Route0
Static Route1
EIGRP (Internal)90
OSPF110
RIP120
EIGRP (External)170
Unknown/Unreachable255

Example

Suppose a router learns a route to 192.168.1.0/24 through:

  • OSPF (AD = 110)
  • RIP (AD = 120)

The router selects the OSPF route because 110 is lower than 120.


Metric

A metric is a numerical value assigned by a routing protocol to indicate the desirability of a route. Routers use metrics to select the most efficient path to a destination. Generally, a lower metric indicates a better route.

Different routing protocols use different metrics, such as:

  • Hop Count (RIP)
  • Bandwidth and Delay (EIGRP)
  • Cost (OSPF)
  • Path Attributes (BGP)

Example

If RIP knows two routes to the same network:

Route 1: 3 hops
Route 2: 5 hops

RIP chooses Route 1 because it has the lower metric (fewer hops).

Different Routing Protocol Metrics

Routing ProtocolMetric Used
RIPHop Count
OSPFCost
EIGRPBandwidth and Delay
BGPPath Attributes

Gateway of Last Resort

A Gateway of Last Resort is the default router or gateway that a router forwards packets to when no specific route to the destination exists in its routing table. It serves as a fallback route for reaching unknown networks.

If a router receives a packet destined for an unknown network, it sends the packet to 192.168.1.1, which is the default gateway.

If no matching route is found, the packet is forwarded to the gateway of last resort.

Example

Gateway of last resort is 192.168.1.1

Routing Table Example

Gateway of last resort is 192.168.1.1 to network 0.0.0.0

S* 0.0.0.0/0 [1/0] via 192.168.1.1

Here:

  • S* = Static default route
  • 0.0.0.0/0 = Default route (matches all destinations)
  • 192.168.1.1 = Gateway of Last Resort

Complete Routing Table Analysis Example

O    10.1.1.0/24 [110/30] via 192.168.1.2, GigabitEthernet0/1
ComponentMeaning
OOSPF route
10.1.1.0/24Destination prefix
110Administrative Distance
30Metric
192.168.1.2Next hop
G0/1Exit interface

Verify Routing Table

Verifying routing tables helps network administrators confirm that routes are present, routing protocols are working correctly, and packets can reach their destinations. The most common commands used for verifying routing tables are as follows.

Commands Used

  1. Display the routing table
show ip route
  1. Display a specific route
show ip route 192.168.1.0
  1. Display routes learned by a specific protocol
show ip route ospf
show ip route rip

Example

Router# show ip route

C 192.168.1.0/24 is directly connected, GigabitEthernet0/0
O 10.1.1.0/24 [110/2] via 192.168.1.2
R 172.16.0.0/16 [120/1] via 192.168.1.3

Explanation:

  • C = Connected route
  • O = Route learned through OSPF
  • R = Route learned through RIP
  • 110/2 = Administrative Distance/Metric
  • via = Next-hop address

Verify Specific Route

Router# show ip route 10.1.1.0

Conclusion

The routing table is one of the most important components of a router. Understanding routing protocol codes, prefixes, subnet masks, next-hop addresses, administrative distance, metrics, and the gateway of last resort is essential for packet forwarding and troubleshooting.

Leave a Comment