IP address was designed originally with two levels – netid and hostid. So to reach a host we first need to reach the network and then the host. But 2 levels of hierarchy are not enough for any organization. For instance if an organization is allotted Class A block then it is quite obvious that the organization will divide the large network into smaller network for better management.
Subnetting is the process of dividing a network into smaller sub network (subnet) with each sub network having its own sub network address (first address of the sub network).
The following picture shows a 2-level hierarchy where an IP address is divided into netid and hostid.
32 bit IP Address
Therefore in this case to reach a host, first we have to find the network address and then we can reach the host.
The following picture shows a 3-level hierarchy where an IP address is divided into netid, subnetid and hostid.
In this case first we need to find the network address after that we need to find the subnet to which the host belongs; after finding the subnet we can reach the host. Thus in subnetting the hostid part is reduced in size.
We can only divide a given network in multiple of 2 to get the sub network. So a network can be divided into 2, 4, 6, 8, 10, etc. subnets.
The first address of the sub network is called the subnet address.
Subnet Address = IP Address AND Subnet Mask
Subnet mask is a 32 bit number that is used to find the subnet address (first address of the sub network). There are n bits at the leftmost side of the 32 bit mask that is set to 1 while there remaining (32 – n) bit is set to 0.
Consider an IP address 18.104.22.168 that is allotted to a college. The college authority wants to divide (subnet) the network into 4 sub networks. Find the network address, subnet addresses and number of hosts in each of the sub network?
IP Address = 22.214.171.124
This is a class B address so the Network Mask (default mask) = 255.255.0.0
Network address = IP address AND Network Mask
=126.96.36.199 AND 255.255.0.0
In binary form
IP Address (Class B)
= IP Address AND Network Mask
In decimal form
Network Address = IP Address AND Network Mask
There are 16 numbers of 1s and 16 numbers of 0s in the Network (default) Mask.
It is given that the college wants to divide this network into 4 sub networks.
We can represent 4 as 22
This means the subnetid will have two 1s.
Thus total number of 1s in the subnet mask is 16+2=18
And total number of 0s in the subnet mask is 32-18=14
So the subnet mask = 188.8.131.52
Number of host in each subnet = 214 = 16,384
As there are 4 subnet so total number of host = 4 x no. of hosts in each subnet = 4 x 16,384 = 65,536
The four subnet addresses (first address of the subnet) are as follows
10101000 01100000 00000000 00000000
11111111 11111111 11000000 00000000
10101000 01100000 01000000 00000000
10101000 01100000 10000000 00000000
10101000 01100000 11000000 00000000
Have fun learning :-)
Copyright © 2014 - 2020 DYclassroom. All rights reserved.