Routing information base
In networking a routing table, or Routing Information Base (RIB), is an electronic table (file) or database type object that is stored in a router or a networked computer. The routing table stores the routes (and in some cases, metrics associated with those routes) to particular network destinations. This information contains the topology of the network immediately around it. The construction of routing tables is the primary goal of routing protocols and static routes.
Routing tables are generally not used directly for packet forwarding in modern router architectures; instead, they are used to generate the information for a smaller forwarding cache which contains only the routes which are chosen by the routing algorithm as preferred routes for packet forwarding, often in a compressed or pre-compiled format that is optimized for hardware storage and lookup. The remainder of this article will ignore this implementation detail, and refer to the entire routing/forwarding information subsystem as the "routing table".
A routing table utilizes the same idea as using a map in package delivery. Whenever a node (i.e., a host or router) needs to send data to another node on a network, it needs to know where to send it. Whenever a device cannot directly connect to the destination node, it needs to find another way to send the package. Whenever a node does not know how to send the package it sends an Internet Protocol version 4 or Internet Protocol version 6 packet to a router in the local subnet. Since this is a complicated task to route the package to the correct destination, a gateway needs to keep track of the way to deliver this. A Routing Table is the way in which this data is stored, like a map. It is a database which keeps track of paths like a map and provides this information to the node requesting the data. Current router architecture separates the control plane function of the routing table from the forwarding plane function of the forwarding information base 
Hop-by-hop routing, each routing table lists, for all reachable destinations, the address of the next device along the path to that destination; the next hop. Assuming that the routing tables are consistent, the simple algorithm of relaying packets to their destination's next hop thus suffices to deliver data anywhere in a network. Hop-by-hop is the fundamental characteristic of the IP Internetwork Layer  and the OSI Network Layer, in contrast to the functions of the IP End-to-End and OSI Transport Layers.
During the process of routing, decisions of hosts and routers are aided by a database of routes known as the routing table. The routing table is not exclusive to a router. Depending on the routable protocol, hosts may also have a routing table that may be used to decide the best router for the packet to be forwarded. Host-based routing tables are optional for the Internet Protocol.
The types of entries in a routing table:
- Network Route: A route (path) to a specific Network ID in the internetwork.
- Host Route : A route to a specific internetwork address (Network ID and Host ID). Host routes allow intelligent routing decisions to be made for each network address. Host routes are used to create custom routes to control or optimize specific types of network traffic.
- Default Route: A route that is used when no other routes for the destination are found in the routing table. If a router or end system (such as a PC running Microsoft Windows or Linux), cannot find a route for a destination, the default route is used.
Difficulties with Routing Tables
The need to record routes to large numbers of devices using limited storage space represents a major challenge in routing table construction. In the Internet, the currently dominant address aggregation technology is a bitwise prefix matching scheme called Classless Inter-Domain Routing (CIDR).
Since in a network each node presumably possesses a valid routing table, routing tables must be consistent among the various nodes or routing loops can develop. This is particularly problematic in the hop-by-hop routing model in which the net effect of inconsistent tables in several different routers could be to forward packets in an endless loop. Routing loops have historically plagued routing, and their avoidance is a major design goal of routing protocols.
Contents of Routing Tables
The routing table consists of at least three information fields:-
- the network id: i.e. the destination network id
- cost: i.e. the cost of the path through which the packet is to be sent .
- next hop: next hop is the address of the next station to which the packet is to be sent on the way to destination .
Depending on the application and implementation, it can also contain additional values that refine path selection:
- quality of service associated with the route
- links to filtering criteria/access lists associated with the route
Routing tables also are a key aspect of certain security operations, such as unicast reverse path forwarding (uRPF) . In this technique, which has several variants, the router also looks up, in the routing table, the source address of the packet. If there exists no route back to the source address, the packet is assumed to be malformed or an attack, and is dropped.
- Forwarding and Control Element Separation (ForCES) Framework,L. Yang et al., RFC3746,April 2004.
- Requirements for IPv4 Routers,F. Baker, RFC 1812, June 1995
- Ingress Filtering for Multihomed Networks,RFC 3704, F. Baker & P. Savola,March 2004