Networking Concepts: IP Routing Process
IP Routing is a process of sending packets from one network to another network. It is usually done with the help of a router. If we have to send some data in same LAN then we use a switch for that but when we want communication between two or more different networks, we use a router for that. Let’s take a look at how IP Routing works in a network.
IP Routing Process:
Whenever a router receives a packet, it looks for the destination address. Then it looks up it’s routing table to check if destination is in the table or not. Basically, router checks if it can reach to the destination or not. If it doesn’t has any path to the destination, it will drop the packet and if it has some entry in routing table, it will forward the packet to default gateway. By default, only directly connected routes are stored in router’s routing table. So if you have connected two different networks with a single router, both will communicate without an IP routing protocol.
Now, what is a default gateway?
Default gateway is an address where the router will forward the packet after receiving. It could be an IP Address of router. Take a look at following snapshot,
If PC-1 and PC-2 want to communicate with PC-3, they need to leave their network and if they want to leave their network, they will have to go to Router-1 because R-1 is connecting both the networks. Now, how will they reach to Router-1? By going to address 192.168.1.1. That is default gateway for both PC-1 and PC-2. Similarly if PC-3 wants to communicate with PC-1 or PC-2, default gateway will be 172.16.1.1.
Now for the router- when a packet, destined to PC-3, is received at Router-1, it looks it’s routing table for a valid path to the destination. If Router-1 wants to communicate with Router-2, it will have to forward the packet to 10.0.0.2. That is default gateway for R-1 and Serial 2/0 interface of Router-1 can also be used to forward the packet. It depends on the Routing Protocol used in the network. In the same way, 10.0.0.1 will be the default gateway for Router-2. Learn more about Default Gateway here.
What do we need for IP Routing ?
A Routing Protocol. If you want to connect two or more different networks, you will need some IP Routing protocols. These protocols allow communication over different networks. There are some static and dynamic routing protocols. Key difference in both is that in Static, you have to manually enter the routing information (Networks that are not directly connected). On the other hand, in Dynamic routing protocols, you have to enter information of directly connected networks only. Router will automatically learn the information of other networks withe the help of update packets. We will discuss about them in upcoming articles.
We can also use subnetting if we want to use only one network address in complete topology. As we have already discussed that this can be done with the help of subnetting.
Note that we don’t need any kind of IP routing Protocol for a network like shown below. Here a single router is connecting two different networks.Router stores directly connected network in routing table so it will have both the networks. Because of that packet from one LAN will be handed over to other LAN without any IP routing protocol. Communication will be successful.