Network Kings


$999 $499 only For All Access Pass Today! USE PROMO CODE : LIMITED

d :
h :

Subnetting in Computer Network: Explained 

subnetting in computer network

Before starting subnetting in computer network, let us grab some important concepts required for it.  

Conversion from Binary to Decimal 

Let us first understand how to convert a binary number into a decimal  

  • Convert 10011011 into decimal   

























  • On multiplying each column of the 2nd and 3rd row we get the following result 









= 155 

  • Now, on adding up each digit, we get a total of 155  

Hence 10011011 in binary format can also be written 155 as a decimal.  



Subnet Mask 

Default CIDR 

Class A 



Class B 



Class C 



Class D 




Class E 




Class A Format: – network.node.node.node  

Class B format: –  

Class C format: –  

We all are familiar with the above ranges of IP Addresses for every class, but how does this range get defined? 

  • The first bit of the first byte in a Class A network address is always off i.e., 0   

000000 = 0  

0111111 = 127  

Thus, class A Addresses will always be between 0 and 127   

  • The first bit of the 1st byte is always on, but 2nd bit is always off. When we turn all the other 6 bits off and then ON, we get the range for class B  

10000000 = 128  

10111111 = 191  

  • The first 2 bits of the first octet are always on, but 3rd bit is always off.  

11000000 = 192  

11011111 = 223  

What is Subnetting in computer networks?

We have already understood the IP Address and its types. We know the networks for different ranges of IP Addresses. What if we want to divide a particular range of IP Addresses into two or more categories?    

That can be done with the help of subnetting. So subnetting is a process of dividing a large network into the required number of networks.   

Before digging deep into how subnetting gets done, we need to understand why the concept of subnetting is mandatory in the first place. 

Why is Subnetting required?

Suppose a company had more than 254 hosts (say 315 hosts); Class C cannot fulfil the requirement. Hence the company would be purchasing the Class B network. But Class B can provide IP Addresses to 65,534 different hosts at the same time. Hence, there is a waste of IPs.   

Also, managing this large number of IPs is not an easy task for the network administrator. Thus, with the help of subnetting, a Class of IP Addresses can be divided into smaller parts according to the requirement, and each part of the network can get allocated to different companies, which ultimately reduces the wastage of IP. 

What are the benefits of using subnetting in computer networks?

Along with the reduced wastage of IP, we also get the following benefits by using subnetting-  

  • Network Traffic: Since we divided the network into smaller parts, network traffic reduces, and hence network congestion takes place. 
  • Optimized performance: Since network traffic gets reduced, network performance will increase.  

This process is also known as CIDR (Classless Interdomain Routing) and is used by ISP to allocate certain required block sizes to companies or customers, to home network gateways.  

If you get, that means you have 28 network bits and the remaining host bits are 4 (32 – 28= 4). 

So basically, a network is subnetted to /28 subnets.  

NOTE:/ Denotes the number of network bits.

How is subnetting done?

Let us take an example of IP Address, a class C IP Address, which is a total of 256 IPs and 254 usable IPs.  

The total of IPs is easily calculated using – 2(Total Bits – Network Bits).  

Hence, 32 – 24 = 8 and 28 = 256  

Total usable IPs = Total IP – 2, which implies 256 – 2 = 254.  

Let’s divide this network into two parts: –    

Since we know that the first three octets of class C are network Bits, and hence, we cannot change it, or the whole network will change. Therefore, to do the subnetting, we will use host bits.  

200.10.20. 00000000 (Host bits written in Binary 

To divide this network equally into two parts, we will fix the first bit of the host, and we know that bits are 0 and 1. The first bit can be fixed as 0 and 1.  

Hence it will look like this: – (S1) and (S2)  

The remaining 7 bits of the host can either be 1 or 0.   

Subnet 1,,, …. up to    

Hence the range of Subnet 1 is: – to 

Initially, the address range was to 

Network IP –  

Broadcast address –  

Total hosts – 128  

Usable Host – 128 – 2 = 126  

Subnet 2:,,, …… upto   

Hence the range of Subnet 2 is: – to 

Network IP –  

Broadcast address –  

Total hosts – 128  

Usable Host – 128 – 2 = 126  

NOTE: The network IP for S1 is and Broadcast IP for S2 is 

Have you realized that the Network IP and Broadcast IP for our initial IP Address, i.e., are also the same? Why? 

The default gateway router does not know about the subnetting, as we have discussed that subnetting is done inside the organization. We introduce one more router (on which subnetting is done) connected to the default gateway and help to route the packet to the particular subnet.  

Suppose the Destination address for a packet is, Default gateway will route this packet to the internal router. Internal Router knows the subnet mask and hence routes this packet to S1. Similarly, if the destination address is, the internal router will route the packet to S2.

What is a Variable length Subnet Mask (VLSM)?

So, we have understood how to divide a subnet into two equal parts, but what if we have three departments? 

  • The Academics Department requires a minimum of 100 hosts.  
  • The Sports Department requires a minimum of 50 hosts.  
  • Exam Department required a minimum of 50 hosts.  

Dividing a network with varying sizes of the host is known as Variable Length Subnet Mask.  

There is not much difference in the process of dividing the host into varying sizes.  

IP Address: –  

Let us divide the above network into three parts with a minimum of 100,50 and 50 hosts each.    

The process is simple. First, we will divide it into two parts as before, and then again divide S2 into two parts. (S1) and (S2)  

We reserve one more bit of S2 and hence: –  

S2: –   S3: –  

Subnet 2,, …… up to  

Hence the range of Subnet 2 in Binary is – to 

Network IP: –  

Broadcast address –  

Total hosts – 64  

Usable Host: – 64 – 2 = 62  

Subnet 3:,, ……up to  

Hence the range of Subnet 2 in Binary is to  

Network IP: –  

Broadcast address –  

Total hosts – 64  

Usable Host: – 64 – 2 = 62  

If the concept of subnetting is not introduced in computer networking, we would be using different class C networks and 256 IPs for each department leading to the wastage of a lot of IPs. 

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.