What is IP Routing
This can be understood as a process of sending a packet from one host from a network to a host in another network or remote network. This is mainly done by a router which look for the destination IP address in the sending packet and determine the next hop to forward the packet to. Router uses routing table for this purpose.
We can take an example of a small network where a host A is connected to a router and try sending a packet to Host B which is in another network.
In this way, we will need to know about two basic terms, as a default gateway and routing table. A default gateway here is provide a way to communicate to other hosts in the similar or remote network. It tells a host where to forward or reach to a network when there is not host entry in its local route list. When the default gateway is configured, the host route all the packets to the default gateway to reach to the remote network. While the routing table is maintained by a router connected in a network. This routing table has entries of each route and stored in its RAM. This routing table is used to specify a path to its destination network. Each route entry in the routing table has a destination, subnet mask, remote host address and outgoing interface.
Now, in the above example, Host A has address of router as the default gateway. When it is trying to connect to a remote network where Host B exist, Host A searching in its routing table for the destination network. If it is not found such entry, it sends the packets to the default gateway which further process it and send it to Host B.
VLSM and subnetting
The term VLSM directly means that a number of subnet masks are used in a network which belongs to a single class of network. Using VLSM, we can do subnetting of subnets and make them more usable. To understand it more clearly, take an example of a medium size network where a number of departments are there with different number of users like 10, 20, 30, 40, etc. And we are assigned with a range of IP address like 192.168.0.0/24 to allocate IP addresses to each device.
Here is a possible list of departments and containing users:
IT | 50 |
Accounts | 27 |
Management | 6 |
Sales | 120 |
Now we need to subnet the assigned IP range according to the host requirements. Here, we should know that the /24 CIDR block has 254 number of possible (usable) hosts and we can calculate this list further, as
/24 | 254 |
/25 | 126 |
/26 | 62 |
/27 | 30 |
/28 | 14 |
/29 | 6 |
/30 | 2 |
We can calculate the VLSM IP range for the hosts in these subnets (departments).
IT | 50 | 192.168.0.129-192.168.0.190 | /26 |
Accounts | 27 | 192.168.0.193-192.168.0.222 | /27 |
Management | 6 | 192.168.0.225-192.168.0.230 | /29 |
Sales | 120 | 192.168.0.1-192.168.0.126 | /25 |
Using VLSM and subnetting, there is lesser wastage of IP addresses as compared to FLSM.
Routing protocols
Routing protocols enable a network to communicate with each other effectively. depending on the size of the network, these protocols help in securely transfer of data. Majorly, these routing protocols can be categorized in to three pairs.
- link state and distance vector – link state protocols use best path to share information with nearby nodes. It uses path cost and calculate speed of those paths. They use algorithms to calculate speed and path cost and share tables containing different information like routing, topology and neighbor. On the other side, distance vector protocols work based on distance or hop count between the routes. Each hop represents a router through the packet will be passed on to the destination. As a major drawback of these distance vector protocols, it uses high bandwidth to share routing information to nearby nodes.
- EGP and IGP – the exterior gateway protocols are used to share routing information to different autonomous system or AS. In this way, these protocols are used to provide connectivity outside a network, which is less common for a LAN network. While the IGP or interior gateway protocols are used to share information within a network or LAN segment. The information generated and shared is fall under the same network and control without the interference of any outside routers.
- Classless and classful – the classless protocols include subnet mask in their routing updates and are capable to communicate with a device in another network. In this way, the classless protocols can find an accurate route and consume less bandwidth while sharing routing updates. On the other side, classful protocol did not use subnet mask information and uses an entire IP class rather than a specific IP address. This makes the routing update heavier and consume high bandwidth.
Resource:
https://www.calculator.net/ip-subnet-calculator.html
https://www.cloudflare.com/learning/network-layer/what-is-routing/