Today our topic is about subnet mask, This topic is important and interesting, most of the people confused in subnet mass, Because their concepts is not clear and always in doubt, How much you know about subnet mask i don’t know, But i ensure you after complete reading of this post your concept and all doubt will be clear forever in easy way. In previous post we have discussed in details about IP concepts, In subnet mask that concept will be use so i will suggest you to refer first IP concepts post after that you can well understand subnet mask. So lets start this topic.
What is Subnet mask ?
Subnet mask introduce from subnetting, Hence to understand subnet mask we have to understand subnetting.Now we will see what is subnetting ? why subnetting is required, If you can recall our IP post reference we have already discussed there are two version of IP one is IPv4 and other is IPv6. We generally use IPv4 and our discussion is also about IPv4 in this version we have limited IP. Now you can think all over the world people required unique IP to connect through internet, But we have limited IP so it is major problem in front of the technology, How to overcome of this problem introduce concept and reason of subnetting. So we can say to overcome the problem of limited IP, We required subnetting.
subnet mask explained
Subnetting is a technique to use IP addresses efficiently or preserved IP addresses with minimum wastage of IP addresses. To do this we have only three methods.
1 Use private IP, We know private IP for class A 10.0.0.0 for class B 172.16.x.x and for class C 192.0.0.0
2 Use IPv6 where unlimited IP are available no shortage for whole globe 128 bits, remember in IPv4 only 32 bits available.
3 Use Subnetting.
Hence here we will use subnetting concept to find subnet mask, The meaning of subnetting is “network within a network” or logically division of IP addresses,To understand why subnetting is required take an example to well explain the concept of subnetting see below picture.
How to find subnet mask ?
From above figure see the network router interface different users combination, It is important point every interface of Router must be different network, Means network ID must be different on every interface of router. If you don’t know about network ID please refer previous post IP concepts.
Take an example on 10 users network IP is 188.8.131.52 suppose this IP is given to one user among 10 users. Now i have given other router interface 50 users IP 184.108.40.206, one user among 50 users, Now question arises, Is it correct i can allocate IP 220.127.116.11 to 50 users router interface.
To check this first find class of this IP if you have studies my previous IP post then of course you know this is class B IP address, Then you can easily find Network ID of this IP address which will be 18.104.22.168 because for class B two octet is reserved for network and other two for host id, Hence it is clear Network ID for IP address 22.214.171.124 will be 126.96.36.199 .
Now similarly find Network ID for IP address 188.8.131.52 it will be again 184.108.40.206 because it is also class B IP address.
Now you see for both router interface network ID is same, Which violate every router interface Network ID must be different, Hence it is clear that we can’t allocate IP address 220.127.116.11 to 50 users router interface.
Then what IP address you can allocate to 50 users router interface, Except network ID given to 10 users router interface, You can take any IP address like 10.15.2.5 because this is class A IP address and its network ID will be 10.0.0.0 hence it is different, So every router interface must have different Network ID. I hope you have got the point.
Now among the 50 users you can use network ID 10.0.0.0 but other router interface must be different network ID. This is same like two engineering branches Electronics and Mechanical, All Electronics students have same network ID and all Mechanical students have same network ID but Electronics students will not be allowed to sit with Mechanical students. Because Electronics students have other classes and Mechanical students have other classes.
Now if you are not understanding why network ID must be different on every interface of router ? . Then first you have to understand router working principle.
Well Router is an inter networking device, Its means that router is only use whenever need to communicate between two different networks. It is not use to communicate within the same network between different users,Within the same network between different users switch device is used.
Now you tell me if the same network ID on different router interface then router will confuse where to send the packet, Hence different network ID required on different router interface.
Now we will see how to calculate subnet mass.
subnet mask calculator
Allocate 10 users group Class A IP address 10.0.0.0 network ID (10.0.0.0)
Allocate 50 users group class B IP address 18.104.22.168 network ID (22.214.171.124)
Allocate 4 users group class C IP address 126.96.36.199 network ID (188.8.131.52)
Allocate 20 users group class C IP address 184.108.40.206 network ID (220.127.116.11)
Now you can see clearly all network ID are different for every router interface well .
# tags Allocate 10 users group Class A IP address 10.0.0.0 network ID (10.0.0.0)
Now you will allocate 10 users IP like.
1 → 10.0.0.1
2 → 10.0.0.2
3 → 10.0.0.3
4 → 10.0.0.4
5 → 10.0.0.5
6 → 10.0.0.6
7 → 10.0.0.7
8 → 10.0.0.8
9 → 10.0.0.9
10 → 10.0.0.10
Above IP address are allocated to 10 users. Can you think how much more IP address you can provide to users from this network ID. If you can recall from previous post then you will find for class A three octet are reserved for host that is 24 bits.
Its means that you can connect total number of users to this network ID will be (2²⁴ -2) it will be a very large number. it will approx to 16 Lakhs.
But you have only allocated 10 users, Then think about the rest IP addresses which is not used. Can we use rest IP addresses to other router interface BIG no, As discussed above all different router interface must have different network ID.
Now maximum you will use 100 to 200 users not even one Lakhs, Then you are wastage IP addresses of class A.
Now take similarly for class B.
# tags Allocate 50 users group class B IP address 18.104.22.168 network ID (22.214.171.124)
You will allocate 50 users IP addresses like.
1 → 126.96.36.199 and 50th user 188.8.131.52 but think how many more users can connect in this network ID. This is class B hence two octet reserved for host so total number of users can be (2¹⁶ -2) which will be equal to 65,534. This much of computer can be connect, But we are connecting only 50 computer again this is wastage of IP address of class B.
Now take for class C.
# tags Allocate 4 users group class C IP address 184.108.40.206 network ID (220.127.116.11)
similarly allocate 4 users IP addresses like
1 → 18.104.22.168 and 4th user 22.214.171.124 but think how much more computer can be connected on this network ID.This is class C hence one octet is reserved for host so we can connect total number of computer here (2⁸ -2) it will be equal to 254.But we are only connecting 4 computer. Again wastage of IP addresses of class C but little bit less compare to class A and B.
Hence to save the wastage of these IP addresses we apply technique such that the same network can be divided into sub network and maximum IP addresses can be used and router don’t understand that is same network need subnetting.
One important point CIDR value for all classes A, B, C respectively 10.0.0.0/8
126.96.36.199/16 188.8.131.52/24 if it is written by default it means that no any subnetting has been done. Except this number 8,16, 24 if any number written then subnetting has been done.
Now we will continue this topic in next post.I hope you have enjoyed learning Subnet mass concepts. If you like please share social media and comments.
Thanks for reading and sharing keep reading more and more.
Dated 21st Oct 2018