Subnetting
Subnetting means dividing major network into subnetworks to overcome the broadcast and collision domains.
Advantages of Subnetting
- Subnetting reduces the broadcast domain.
- Subnetting reduces the collision domain.
- Subnetting increases or optimizes the network speed and performance.
- Subnetting simplifies the network management.
Process of Subnetting
To perform subnetting of a network, user have to deduct the bits from host octet and reserve them to create the subnetmask of new subnetwork.
For subnetting there are two formulas which are used
2^n
used to calculate the number of new subnets
In this formula "n" is the number of deducted bits from the host octet.
2^n-2
Used to calculate the number of valid hosts in subnet
In this formula "n" is the number of remaining bits in the host octet.
2 IP's are subtracted to calculate total valid IP's or assignable IP's and the subtracted IP's are Network IP and Broadcast IP.
What is Network IP?
Network IP is the IP which is used to identify the network to which all the valid IP belong. Network IP is also used to perform routing between different networks.
What is Broadcast IP?
Broadcast IP is the IP which is used to broadcast the message over the network instead of sending message one by one to the devices connected with that network.
Default Subnetmask of the classes are
Class A => 255.0.0.0
Class B => 255.255.0.0
Class C => 255.255.255.0
- IP's with any one of these subnetmask is know as Class-Full IP address.
- IP's having other than these subnetmask is know as Class-Less IP address.
Subnetting of Class C
In class C there is only one host octet which is last one octet. So we have to subtract the bits form last octet to perform the subnetting of class C. Keep in mind bits are subtracted from left to right without skipping any bit and we can't subtract last two bits which are 2 and 1. Because in a network we need at least two valid IP in subnet.
What are the bits which are to be subtracted?
The bits which are in each octet are
128, 64, 32, 16, 8, 4, 2, 1
How to perform Subnetting by transferring one bit?
First of all we have to subtract bit from host portion. So the bit which is to be subtracted is 128.
Now use the formulas
2^n = 2^1 = 2 subnets (We have transferred one bit so the power of 2 is 1)
2^7-2 = 128-2 = 126 Valid IP's (After subtracting one bit form host octet there are 7 remaining bits so the power of 2 is 7)
Now after putting the values in above formula we can see that there are 2 subnets each having 126 valid IP's in it with 1 Network IP and 1 Broadcast IP which means total 128 IP's in each subnet.
How to perform Subnetting by transferring two bit?
First of all we have to subtract bits from host portion. So the bits which are to be subtracted are 128, 64.
Now use the formulas
2^n = 2^2 = 4 subnets (We have transferred 2 bits so the power of 2 is 2)
2^6-2 = 64-2 = 62 Valid IP's (After subtracting 2 bits form host octet there are 6 remaining bits so the power of 2 is 6)
Now after putting the values in above formula we can see that there are 4 subnets each having 62 valid IP's in it with 1 Network IP and 1 Broadcast IP which means total 64 IP's in each subnet.
(Perform same procedure to do subnetting for 3, 4, 5 and 6 bits subtraction)
Example # 1
Major Network = 192.168.1.0
Subnetmask = 255.255.255.0
IF we transfer 1 bit
2^1 = 2 Subnets
2^7-2 = 128-2 = 126 Valid IP's
Subnet 1
192.168.1.0 => Network IP
192.168.1.1 => First Valid IP
192.168.1.126 => Last Valid IP
192.168.1.127 => Broadcast IP
(To calculate last valid IP add the total number of valid IP's in network IP like this 0+126=126)
Subnet 2
192.168.1.128 => Network IP
192.168.1.129 => First Valid IP
192.168.1.254 => Last Valid IP
192.168.1.255 => Broadcast IP
(To calculate last valid IP add the total number of valid IP's in network IP like this 128+126=254)
Now we have to calculate the Subnetmask of these two new subnets. For this add the subtracted bit into the last octet of subnetmask of major network subnetmask like this
255.255.255.(0+128) => 255.255.255.128
So, the new subnetmask 255.255.255.128 is the subnet mask of new subnetworks.
Example # 2
Major Network = 192.168.1.0
Subnetmask = 255.255.255.0
IF we transfer 2 bit
2^2 = 4 Subnets
2^6-2 = 64-2 = 62 Valid IP's
Subnet 1
192.168.1.0 => Network IP
192.168.1.1 => First Valid IP
192.168.1.62 => Last Valid IP
192.168.1.63 => Broadcast IP
(To calculate last valid IP add the total number of valid IP's in network IP like this 0+62=62)
Subnet 2
192.168.1.64 => Network IP
192.168.1.65 => First Valid IP
192.168.1.126 => Last Valid IP
192.168.1.127 => Broadcast IP
(To calculate last valid IP add the total number of valid IP's in network IP like this 64+62=254)
Subnet 3
192.168.1.128 => Network IP
192.168.1.129 => First Valid IP
192.168.1.190 => Last Valid IP
192.168.1.191 => Broadcast IP
(To calculate last valid IP add the total number of valid IP's in network IP like this 128+62=190)
Subnet 4
192.168.1.192 => Network IP
192.168.1.193 => First Valid IP
192.168.1.254 => Last Valid IP
192.168.1.255 => Broadcast IP
(To calculate last valid IP add the total number of valid IP's in network IP like this 192+62=254)
Now we have to calculate the Subnetmask of these four new subnets. For this add the subtracted bits into the last octet of subnetmask of major network subnetmask like this
255.255.255.(0+128+64) => 255.255.255.192
So, the new subnetmask 255.255.255.192 is the subnet mask of new subnetworks.
(Perform same procedure to do subnetting for 3, 4, 5 and 6 bits subtraction)
Thanks Daniyal Bro. You explained subnetting in very easy way. It is very helpful for me.
ReplyDeleteThank you for your feedback. It's my pleasure to help students understand networking....
Delete