Theory & Practical Classes Lectures

What is Subnet Mask in Networking?
OR
Subnetting in Computer Networks

Subnetwork

The subnetwork or subnet is the most important component of an IP address. It is the logical subdivision of IP network addresses; so it is the practice of dividing a single network into two or more networks.

Subnet mask is a 32 bit number; that is created by setting host bits to all 0s and network bits to all 1s. In this way; the subnet mask separates the IP address into the host part and network part. The word mask has significant value because the subnet mask essentially uses its own 32 bit number to mask the IP address.

The default subnet of class A category network is 255.0.0.0.

There are four octets in this 32 bit number and the first octet is addressing to the network value which holds eight 1s (11111111) and the rest three octets is addressing to the host values by holding 0s (00000000.00000000.00000000).

The default subnet of class B category network is 255.255.0.0.

There are four octets in this 32 bit number and the first two octets is addressing to the network value which holds sixteen 1s (11111111.11111111) and the rest two octets is addressing to the host values by holding 0s (00000000.00000000).

The default subnet of class C category network is 255.255.255.0.

There are four octets in this 32 bit number and the first three octets is addressing to the network value which holds twenty four 1s (11111111.11111111.11111111) and the last octet is addressing to the host values by holding 0s (00000000).

Now let us understand subnetting.

We will take a real life example to understand the requirement of subnetting.

Assume that there are three hotels; where hotel A is allotted with 100 rooms for all domestic visitors, hotel B is also allotted with 100 rooms for all foreign visitors and hotel C is also having 100 rooms but that is allotted for VIP visitors. The hotel B is full with 100 foreign visitors and hotel A is also full with 100 domestic visitors but another 50 domestic visitors is waiting outside the hotel A because they are not having rooms as the hotel A is full. Hotel C has the capacity of 100 rooms but there are only 20 VIP visitors staying and another 80 rooms are still available. Now 50 domestic visitors who were waiting outside the hotel A are then accommodated with rooms at the hotel C to utilize properly those 80 empty VIP visitors room.

To eliminate the number of hosts in a particular network; we use the technique called subnetting where a single network is logically sub divided into more numbers of sub networks as per the requirements arises for the organization.

Suppose in an organization there is a requirements of 10 host devices to be connected in a single network. So we can easily go for the class C category network because there we have 254 available slots for assigning host IP addresses. Compare to class B and A category; class C has minimum hosts availability and that will result to minimum wastage of IP addresses that is (254 - 10) 244 will be wastage.

We can further reduce the wastage numbers by subnetting.

Let us understand that all network octet holds 1s and all host octet holds 0s. Now take a class C category IP address 192.168.1.1 / 24 and the default subnet for this IP address is 255.255.255.0. The first three octets belong to network places and the last octet belongs to host place; so if we convert the decimal number into the binary number then the figure will look something like this (11111111) . (11111111) . (11111111) . (00000000). Now we are going to borrow four bits from the host place and then the figure will look like this (11111111) . (11111111) . (11111111) . (11110000). Therefore now the CIDR range value will changed for the IP address; it will be 192.168.1.1 / 28. The subnet value will also change; it will be no longer the default value.

CIDR stands for Classless Inter Domain Routing. It is use to identify the network bits that are allotted for a given IP address regardless of any class category of network.

The new subnet will be as follow:

255.255.255.240 because four host bits is leased out for network addressing.

We can see that how it is to be calculated. The calculation will start from the left side.

(27 x 1) + (26 x 1) + (25 x 1) + (24 x 1)

128 + 64 + 32 + 16 = 240

Now let us calculate that how many hosts can be allotted in this new sub network.

We can see that how it is to be calculated.

(2n - 2) here n is the number of host bits available in the octet place.

Here (-2) will deduct two numbers from the available host numbers because the left side first number will be assigned as sub network identifier address and the right side last number will be assigned to the broadcast address for the sub network.

(24 - 2 => 16 - 2 => 14) hosts are possible in this new sub network.

Therefore the starting IP address will be 192.168.1.1 and the last IP address will be 192.168.1.14.

The sub network identifier address will be 192.168.1.0.

The broadcast address for this sub network will be 192.168.1.15.

So by the subnetting technique we can eliminate the wastage of host numbers. If we create a small network of 10 computers in this new sub network then four host numbers will be waste only instead of 254 host numbers of a default class C category network before the subnetting was incorporated.

Now let us discus how many sub network can be done in this class C category network IP address.

That is 2n where n denotes the number of bits borrowed for the network space from the host space.

It will be 24 => resulting to 16 different sub networks is possible in this class C category IP address having 14 hosts in each sub network along with one network identifier address and broadcast address.

So the next sub network will start with the host IP range between 192.168.1.17 to 192.168.1.30 and network ID will be 192.168.1.16 and broadcast ID will be 192.168.1.31. Therefore in this way this single network can be further subdivided into networks as per the requirement arises for the organization.

What is Subnetting in Networking What is Subnetting in Computer Network What is Subnet Mask in Networking Subnetting Tutorial for Beginners Subnetting Rules Subnetting Real World Example Subnetting Range Subnetting in Computer Networks Subnetting How to Calculate Hosts Subnetting How to Calculate Subnetting Host Subnetting Broadcast Address Default Subnet Mask for Class B Default Subnet Mask For Class A B C Advantages of Subnetting in Computer Networks What is Subnetting in Networking What is Subnetting in Computer Network What is Subnet Mask in Networking Subnetting Tutorial for Beginners Subnetting Rules Subnetting Real World Example Subnetting Range Subnetting in Computer Networks Subnetting How to Calculate Hosts Subnetting How to Calculate Subnetting Host Subnetting Broadcast Address Default Subnet Mask for Class B Default Subnet Mask For Class A B C Advantages of Subnetting in Computer Networks What is Subnetting in Networking What is Subnetting in Computer Network What is Subnet Mask in Networking Subnetting Tutorial for Beginners Subnetting Rules Subnetting Real World Example Subnetting Range Subnetting in Computer Networks Subnetting How to Calculate Hosts Subnetting How to Calculate Subnetting Host Subnetting Broadcast Address Default Subnet Mask for Class B Default Subnet Mask For Class A B C Advantages of Subnetting in Computer Networks

Free Tutorial of Web Development

HTML, CSS, Java Script, PHP & MySQL

Free Tutorial of Web Design

HTML, CSS, Java Script

24 Important Interview Questions

Frequently Ask in Interview Panel

Online Competitive Mock Test

Open Book Examination