Routing Table in Computer Networks
Introduction
Routing tables will be covered in this lesson. We will discuss what they are and how they are utilized.
Additionally, we'll learn how to comprehend the additions made to routing tables. Because they maintain a list of linked networks, routing tables are crucial for ensuring that packets are sent as quickly as feasible.
Routing tables are necessary for routers to know how to route packets to their intended locations. It would take a long time and be laborious to forward everything.
The location of routers based on their IP addresses is stored in a table or database called a routing table. The RAM of the majority of routers or forwarding devices often houses this database, which serves as an address map to multiple networks. As a result, a routing table contains details about numerous networks and directions to reach them.
Components of Routing Table
The IP address of the destination network is referred to as the destination address.
The class or range of the destination address is indicated by the terms "subnet mask" or "netmask." The target address is mapped to the appropriate network using this.
The next IP address to which the packet is routed is referred to as the "gateway" or "next hop."
Interface: This describes the connection to the destination's outgoing interface.
Metric: this gives each route a value to make sure the best routes are picked while transmitting packets. The number of hops or routers necessary to reach the destination network is a statistic in some cases. The route with the lowest metric is typically picked when there are many options.
After listing the elements that make up a routing table entry, let's examine an entry using an example to help us comprehend it. We'll make use of the previously provided routing table.
Considering the first item below, let's assume PC1 wants to transmit a packet to PC3 at the address 101.25.67.0. The packet is forwarded to Router A by PC1 since PC3 is not connected to PC1's network. Once at Router A, the router looks up a route to destination 101.25.67.0 in its routing table:
Since there is a route, the packet will be sent over Router A's interface eth3 to the gateway at 10.0.0.2.
Let's now examine the second entry. Consider a scenario where a user on PC1 wishes to transmit a packet to PC25 through network 200.0.2.0. In order to find a route to the location where PC25 is situated, Router A will search its routing table. Router A transmits this packet to the default gateway at 10.0.0.1 over the interface eth0 to other networks connected to it because there is no entry in the logs:
Any routing table contains the default gateway route by default. When the routing table does not include an item for a particular network, it is utilised. Typically, the default gateway makes connections to other distant networks. For instance, the default gateway in a home setting is linked to the Internet.
Similar to the first step, a packet with the destination 192.25.67.0 will be routed to the gateway at 10.0.0.3 in the third and final entry through interface eth5:
Static routing and dynamic routing are the two ways available for adding routes to a routing database.
Static
Any manually programmed route in a routing database is referred to as a static route (entered). For instance, when the requirements for routing across networks are fairly straightforward, it is feasible to code routing tables directly into the host to meet all connection needs.
When networks get bigger, static routing has its limits. Managing the amount of routes might get challenging. Networks can also alter; for example, routers may stop working, rendering some routes inaccessible. New routes may also become accessible at the same time, but they must first be manually added to the routing database in order to be used. Dynamic routing can be utilised to get around these restrictions.
Dynamic
Routing protocols are used in dynamic routing to exchange data on the state of routes and interfaces. Routing Information Protocol (RIP) and Open Shortest Path First are two types of dynamic routing protocols that are supported by z/OS (OSPF).
Conclusion
Understanding the entries in routing tables has been outlined in this article. Prior to defining routing tables, we first established routers. We spoke about where routing tables are stored and how they are created. Additionally, we provided examples of how to read routing table entries and discussed the elements of such entries. The sorts of routes that are often kept in routing tables were our final focus.