the Internet

Know what is the routing table in a router

The word router is one of the words we read or hear the most when talking about networks. However, it never hurts to learn a little more about their inner workings. This time we are going to talk routing tables . It is one of the essential components for a router to perform its function, and which consists in directing the data packets to the destination by the most suitable route.

A routing table is a set of rules used to determine the path that data packets should follow. All this through any network that works with the IP protocol. Any device that has the option of having an IP address, including routers and PCs like Windows, Linux, or Mac, has a routing table for how to get to the destination.

Components of a routing table

Such a table contains all the information necessary for one or more data packets to circulate in the network using the best path. Thus, its arrival at the destination is guaranteed, as long as connection-oriented transport layer protocols are used, such as TCP, because TCP ensures that a packet reaches the destination correctly. It is good to remember that each data packet contains, which is worth the redundancy, additional data which helps us to know the source IP address and l' destination IP address , among other information found in the header.

Let us quote a router as an example, this type of device has one (or more) routing table. What this table does is allow said device to send the data packet to the next hop, that is, to the next network interface it can find. However, it only depends on how we have configured our network devices. In this case, the routers.

The components of a routing table are:

  • Destination network: it corresponds to the destination network where the data packet must go.
  • Subnet mask: it is the one used to define the subnet mask of the network to which we must go.
  • Next hop: in english, we talk about next hop . This is the IP address of the network interface where the data packet will travel, to continue its path until the end.
  • Output interface: it is the network interface through which the packets must go out, to finally reach the destination.
  • Metrics: they  have several applications. One of them is to indicate the minimum number of hops to the destination network, or simply the "cost" to reach the destination network, and is used to prioritize.

The types of routes that can be stored in a route table are:

  • Directly connected
  • Remote routes
  • From the host
  • Default routes
  • Destiny

It is extremely important to reinforce the concept of routing. That is, what is the function of a router in the network:

  1. Receive the data package.
  2. Find out what the destination address is.
  3. Check the route table that you configured.
  4. Send the package to its destination by the best possible route.

How do you maintain a routing table?

Basically, in three ways: directly connected networks are automatically maintained because they are directly connected and routes are added automatically. We also have static routing , where the network administrator adds or removes one or more routes, and, finally, we have dynamic routing .

Today, great importance is given to dynamic routing. How does it work? Network devices, in this case routers, create and update their routing tables automatically. They do this through routing protocols to exchange information regarding network topologies. If you have a large or very large network, static routing, and therefore its manual maintenance, will require many hours of effort from technical personnel. The latter is very impractical and much less productive. Dynamic route tables allow connected network devices to "listen" to each other so that they can automatically update their route tables based on network events. Especially if we are talking about outages or congestion in the network.

Next, we'll take a closer look at static and dynamic routing.

Static routing

As we commented, static routes are manually configured in the router, so is their maintenance. When can a change request be given? When there are changes in the topology of the network. Although, generally, static routing is very laborious, especially when it comes to maintenance, it has a few advantages that always make it an option for configuring routing:

  • More security that a route has been entered correctly and that there are no problems, as they are entered manually by the administrator.
  • Efficiency in resource management, as no protocol is running on the router.

There are two main types of static routing: to a specific network and routing static default (or default route) . For better context, if IPv4 is used, the static routing configuration to a specific network has the following structure:

DirecciónIP MáscaradeSubred IPsiguientesalto | InterfazDeSalida

Let's apply this structure to a Cisco manufacturer router command:

ip route 192.168.0.0 255.255.255.0 192.168.10.5

Instead of the next hop IP, i.e. the IP of the interface through which the data packet will continue to navigate, we can indicate the interface:

ip route 192.168.0.0 255.255.255.0 serial 0/0/1

Now, on the side of the static default route or default route, you should know that it works when the routing table does not have a specific route for the destination network. This is especially true when you need to configure routers that allow Internet access. Why wouldn't the route to a specific network be helpful if we're going to be surfing the internet? Because no one is sure what kind of websites and services they will be accessing each day. We do not perceive it, but we, as users of the network of networks, access multiple networks on a daily basis. Therefore, the specific static route is not feasible and neither is the dynamic route because home routers would not support all networks in the world. Therefore, the default route will allow us to go where we want, when we have to go on the Internet,

However, the structure of the configure command is very similar to the "normal" static route. Let's see its structure:

0.0.0.0 0.0.0.0 IPsiguientesalto | InterfazDeSalida

Let's apply this structure again to a Cisco router command:

ip route 0.0.0.0 0.0.0.0 192.168.10.5

Instead of the next hop IP, i.e. the IP of the interface through which the data packet will continue to navigate, we can indicate the interface:

ip route 0.0.0.0 0.0.0.0 serial 0/0/1

Dynamic routing

Routers use different dynamic routing protocols to share all data related to the network status . Rather than having a network administrator manually configure the routing tables, dynamic routing protocols take care of it. The only thing the administrator will have to do is configure the dynamic routing protocol correctly and share the networks that are directly connected, so that other routers know where to go in case access to that network is required. This type of learning allows you to determine the best route for each case and add it later to the router's routing table.

It is important to mention a few advantages of dynamic routing. Most important is the ability to determine a new best route if the one originally determined has been left out of service. On the other hand, human intervention is by no means necessary, even in the face of the most complex network topology changes. Depending on the scenario, we will need to use Interior Gateway Routing (IGP) protocols, which are used within an AS (Autonomous System), such as RIP, OSPF, IS-IS or EIGRP. Likewise, if we are going to intercommunicate different ASs, the protocol used is BGP.

Similar items

Leave your comment

Your email address will not be published. Required fields are marked with *

Button back to top