Networking.com

routing table

By Kinza Yasar

What is a routing table?

A routing table is a set of rules, often viewed in table format, that's used to determine where data packets traveling over an Internet Protocol (IP) network will be directed. This table is usually stored inside the Random Access Memory of forwarding devices, such as routers and network switches.

In computer networking, each routing table is unique and acts as an address map for networks. It stores the source and destination IP addresses of the routing devices in the form of prefixes along with the default gateway addresses and corresponding routing information.

Routing tables are typically updated dynamically through network routing protocols. But sometimes network administrators might add static entries manually.

How does a routing table work?

The main purpose of a routing table is to help routers make effective routing decisions. Whenever a packet is sent through a router to be forwarded to a host on another network, the router consults the routing table to find the IP address of the destination device and the best path to reach it. The packet is then directed to a neighboring router -- or the next hop listed in the table -- until it reaches its final destination.

According to AWS, to handle network traffic, a router consults its routing tables millions of times each second.

Routing table entries

Each routing table might contain different entries and information, such as IPv4 or IPv6 address classes. But the primary fields of all routing tables stay the same.

The following are the main entries of a routing table:

How does network routing work?

A network packet must take various steps to reach its destination. To understand the relationship between routing and the routing table, examine the following steps that occur during the transfer of data packets:

  1. A computer sends a packet to a router. Similar to the address on a postal package, a sending device -- such as a computer -- attaches IP addresses to data packets and sends them to a router. This helps the router determine the best routes to transport the packets to their destinations. A computer typically connects to a local area network (LAN) to send packets while a router can send packets between different LANs and WANs.
  2. The router receives the packet. Once the router receives the packet, it analyzes it against its internal routing tables to determine the most efficient path to send the packet through. The goal of the router is to forward the packet to the router closest to its ultimate destination.
  3. The router routes the packets. It's unlikely that the initial router will get the packet directly to its destination. It looks at the routing table to get the packet to the next hop. The routing table keeps the hop count low by providing the router with the most effective route. The final hop count is the number of times a packet goes from one router to another until it reaches its destination.
  4. The process is repeated. At the next hop, another router takes over and repeats the same process of determining where to send the packet by looking at its internal routing tables. This process repeats several times before the packet reaches its destination. The routing process might sound lengthy, but it's extremely quick due to the routing protocols involved.
  5. The packet reaches its destination. Once a packet has finally reached a router that resides on the same network as the destination IP address, it's directly routed to the device or server that it was intended for.

Types of routing: static routing vs. dynamic routing

Routing is the process of selecting the most ideal path to a network and routers use the information entered in a routing table to determine the best route. Essentially, there are two methods of building and maintaining a routing table: static routing and dynamic routing.

The pros and cons of static routing

The pros and cons of dynamic routing

Subnetting plays a vital role in the world of IP routing. Learn how to break a network into smaller subnets and calculate the subnet mask of an IP address based on the required number of subnets and hosts.

30 Nov 2022

All Rights Reserved, Copyright 2000 - 2024, TechTarget | Read our Privacy Statement