What is Routing in Networking
In this tutorial, we are going to see What is routing in networking? IP routing is part of the IP layer of the TCP/IP suite. Routing consists in ensuring the routing of an IP datagram through a network by taking the shortest path. This role is performed by machines called routers, i.e. machines that connect (link) at least two networks.
Routers:
Routers are the devices that “choose” the path that datagrams will take to reach their destination.
They are machines with several network cards, each of which is connected to a different network.
Image source: www.servethehome.com
Thus, in the simplest configuration, the router only has to “look” at which network a computer is on in order to send the datagrams from the sender to it.
However, on the Internet the scheme is much more complicated for the following reasons:
- The number of networks to which a router is connected is usually large
- The networks to which the router is connected may be connected to other networks that the router does not know about it.
Thus, routers work with routing tables and routing protocols, according to the following pattern:
- The router receives a frame from a machine connected to one of the networks to which it is attached
- The datagrams are transmitted to the IP layer
- The router looks at the header of the datagram
- If the destination IP address belongs to one of the networks to which one of the router’s interfaces is attached, the information must be sent to layer 4 after the IP header has been de-encapsulated (removed)
- If the destination IP address is part of a different network, the router checks its routing table, a table that defines the path to take for a given address
- The router sends the datagram through the network card connected to the network on which the router decides to send the packet
Image source: www.wikiversity.org
Thus, there are two scenarios, either the sender and the receiver belong to the same network, which is called direct delivery, or there is at least one router between the sender and the receiver, which is called indirect delivery.
In the case of indirect delivery, the role of the router, particularly the routing table, is very important. The way a router works is determined by the way the routing table is created.
- If the routing table is entered manually by the administrator, we speak of static routing ( valid for small networks)
- If the router builds the routing table itself according to the information it receives (through routing protocols), it is called dynamic routing