Routing describes trans­mis­sion paths and in­ter­faces used to send data packets in a network. A routing table with dynamic or static entries from specific routing in­form­a­tion is used for efficient trans­mis­sion of data packets. The more complex a network, including routers and network-enabled end devices, the more com­pre­hens­ive the routing table.

What are routing tables?

A routing table refers to a col­lec­tion of policies and routing in­form­a­tion for networks, routers and network-enabled endpoints - based on the Internet Protocol. The in­form­a­tion output (in tabular form) defines the rules of how to transport data packets between network, routers and end devices.

Routers and switches (in­ter­faces) as well as end devices such as computers, laptops, printers or scanners use routing tables to deliver data as ef­fi­ciently as possible. The more instances a network comprises, the larger the routing table. In addition, devices usually create their own routing table for each routing protocol used. If network nodes use several protocols, there are different routing tables.

What are the contents of a routing table?

The entries in a routing table contain specific in­form­a­tion about the route taken and the desired transport path of data packets. If a packet is received by an in­ter­me­di­ate instance such as a router or an interface, these match the in­form­a­tion with their own routing table. This makes it possible to trace where the packet ori­gin­ated and which data trans­mis­sion path is suitable for the most efficient trans­mis­sion. For this purpose, data packets are provided with the IP iden­ti­fic­a­tion and the re­spect­ive des­tin­a­tion address. The table provides the device receiving the packet with important in­form­a­tion about which hops are suitable for transport in the network.

  • Des­tin­a­tion address/IP address range/subnet mask: In­form­a­tion about the IP address, des­tin­a­tion and the IP address range for the des­tin­a­tion of the re­spect­ive data packet.
  • In­ter­faces: Details of the re­spect­ive switches (in­ter­faces) in the network via which packets are sent on their way to the des­tin­a­tion address.
  • Next hop/gateway in each case: IP addresses of the hops and in­ter­faces to which packets are trans­por­ted; in most cases, the router addresses are near IP-layer routers or, in the case of BGP entries, border routers.
  • Effort metrics: Metrics for routes can be used to determine the best possible route (with the lowest con­nec­tion costs or the smallest bandwidth, among other things) based on the lowest possible factor or pref­er­ence. However, effort metrics only matter when multiple routes are available for selection for a routing path. Therefore, the route with the smallest metric path is the most efficient. Balancing of data trans­mis­sions on equal-ranking routes happens for the same metric values for different routes.
  • Transport routes: The entries include routes in connected or indirect subnets that can be reached by hops. Standard routes for specific traffic or in case of missing in­form­a­tion can also be found. Route entries can be dis­tin­guished between directly connected routes, static routes and dynamic routes.

Example of the structure of a routing table

The structure of a routing table contains entries for the des­tin­a­tion network address, subnet masks, gateways (routers), in­ter­faces as well as metrics such as the number of hops or the routing effort. To il­lus­trate what a rudi­ment­ary table looks like, below is an example of a network routing table. This can be displayed with the ‘netstat -r’ command in the Windows command prompt.

Image: A routing table in the Windows command prompt
Depending on the system, the local routing table can be displayed with commands such as ‘netstat -r’ under Windows.

Dif­fer­ence between entries in the routing table

The entries of a routing table and the specific routing in­form­a­tion for networks can be dis­tin­guished by three variants. The main dif­fer­ence is the way switches, routers and end devices learn to create network paths and cor­res­pond­ing table entries.

The three types of routing entries include:

Static/manual entries

Manual entries are static table in­form­a­tion created by an ad­min­is­trat­or. Changing the entries must be done manually. Protocols that are used include RIP, OSPF, BGP, IGP and EIGRP. Static entries have the advantage that the defined routes cannot be easily ma­nip­u­lated. However, they’re only practical when dealing with man­age­able entries and networks. In case of large and complex tables, manual entries can quickly lead to security gaps or network errors.

Dynamic entries

If the routing table entries are dynamic, the table is auto-filled using routing protocols such as BGP, IGP, RIP, EIGRP, or OSPF. Connected devices use routing protocols to collect necessary routing and network in­form­a­tion and auto­mat­ic­ally generate table entries. Even networks that are connected to routers can be auto­mat­ic­ally entered into a table. Dynamic entries can react to network changes, failures of network nodes and switches, select a new route and record it in the table. In addition, in­form­a­tion about network status and high util­isa­tion can be detected. Y can define routing pri­or­it­ies to avoid con­tra­dic­tions caused by different paths with the same des­tin­a­tion.

Entries to connected routers

Networks connected to routers are auto­mat­ic­ally trans­ferred into the routing table so long as the computer interface has been IP-con­figured.

Entries with special functions

There are also table entries with special functions. These include entries for a default route that can be iden­ti­fied with the network mask ‘0.0.0.0’. Data packets without cor­res­pond­ing routing entries are auto­mat­ic­ally forwarded to the default gateway of the device via this entry. Entries marked ‘127.0.0.0’ refer to a loopback address of the local network interface. Packets for this address remain in the local network. Other separate entries include the IP ranges ‘224.0.0.0’ or ‘255.255.255.255’. For routes with identical metrics, a load balancer is used.

How to create a routing table

In dynamic routing, the re­spect­ive routing protocols are auto­mat­ic­ally applied to create a routing table. The protocols serve the following purposes:

  • Border Gateway Protocol (BGP): Es­tab­lishes online con­nec­tions between autonom­ous systems (AS)
  • Enhanced Interior Gateway Routing Protocol (EIGRP): Enables efficient com­mu­nic­a­tion between routers
  • Interior Gateway Protocol (IGP): Exchanges routing in­form­a­tion in autonom­ous systems
  • Open Shortest Path First (OSPF): De­term­ines the most efficient path for data packets
  • Routing In­form­a­tion Protocol (RIP): Serves as standard protocol in autonom­ous IP networks

Required entries are auto­mat­ic­ally read and added by the re­spect­ive end devices, routers and in­ter­faces. This means the nodes know which hops a data packet has already passed and which hops will get it to its des­tin­a­tion fastest. Depending on the size of the network or in case of sub­net­ting, ad­min­is­trat­ors can create the routing table manually using the ap­pro­pri­ate entries. Al­tern­at­ively, a table with dynamic routing can be sup­ple­men­ted with specific static routes.

Tip

Looking for web hosting that’s secure, fast and flexibly scalable? Book Web­host­ing with IONOS.

How to access a routing table?

Depending on your operating system and the Internet Protocol you’re using, the current routing table can be displayed as follows:

Via IPv4:

  • Windows: Type the netstat-command netstat -r in the command prompt. Al­tern­at­ively, the route print or route -4 print commands work in Windows.
  • macOS: Enter netstat -nr in the terminal.
  • Unix-/Linux systems: Use netstat -r or in Linux iproute2 or iproute.

Via IPv6:

  • Windows: Enter the command netsh interface ipv6 show route or route -6 print.
  • Linux: Use the command route -6 or ip -6 route. Al­tern­at­ively, you can use netstat by entering netstat -6 -r.
  • Unix systems: Enter the command netstat -f inet6 -r.
Go to Main Menu