Introduction To Subnetting (original) (raw)

Last Updated : 10 Feb, 2026

Subnetting is the process of dividing a large IP network into smaller logical networks called subnets. Each subnet allows devices to communicate efficiently, improving network performance, security, and manageability.

This approach keeps departmental traffic separate, organized, and efficient, which is exactly what subnetting is designed to achieve.

Need of Subnetting

Subnetting enables a single IP network to be divided into smaller, logical networks, allowing for efficient IP address usage, improved performance, and enhanced security control.

Let's consider a company that follows classful addressing. It has a Class C network (192.168.1.0/24) with 256 IP addresses. It has three departments:

192_168_1_0_24

Subnetting

**Without subnetting:

**With subnetting:

Department Devices IPs Allocated (after subnetting)
Sales 20 32 (192.168.1.0/27)
HR 10 16 (192.168.1.32/28)
IT 50 64 (192.168.1.48/26)

**By subnetting, we:

Key Concepts in Subnetting

**IP Addressing: An IP address uniquely identifies a device on a network and is divided into logical parts to support routing and communication. An IPv4 address is a 32-bit value written as four octets separated by dots (for example, 192.168.1.1).

In classful IPv4 addressing, IP addresses are divided into classes based on how many bits are used for the network ID and host ID.

network_id_and_host_id

Classful Addressing

Subnet Mask

A **subnet mask is a 32-bit number used in IP addressing to separate the network portion of an IP address from the host portion. It helps computers and devices determine which part of an IP address refers to the network they are present, and which part refers to their specific location or address within that network.

subnet_mask

Subnet mask

**CIDR Notation: A Simplified Approach to Subnetting

Instead of using a long subnet mask (e.g., 255.255.255.0), CIDR uses a simple format like /24. The number after the slash (/n) represents the number of bits used for the **network portion of the IP address.

Working

The working of subnets starts in such a way that firstly it divides the subnets into smaller subnets. For communicating between subnets, routers are used. Each subnet allows its linked devices to communicate with each other. Subnetting for a network should be done in such a way that it does not affect the network bits.

In class C the first 3 octets are network bits so it remains as it is.

Thus, the range of subnet 1 is: **193.1.2.0 to 193.1.2.127

Subnet id of Subnet 1 is: 193.1.2.0
The direct Broadcast id of Subnet-1 is: 193.1.2.127
The total number of hosts possible is: 126 (Out of 128, 2 id's are used for Subnet id & Direct Broadcast id)
The subnet mask of Subnet- 1 is: 255.255.255.128

Thus, the range of subnet-2 is: **193.1.2.128 to 193.1.2.255

Subnet id of Subnet 2 is : 193.1.2.128
The direct Broadcast id of Subnet-2 is: 193.1.2.255
The total number of hosts possible is: 126 (Out of 128, 2 id's are used for Subnet id & Direct Broadcast id)
The subnet mask of Subnet- 2 is: 255.255.255.128
The best way to find out the subnet mask of a subnet is to set the fixed bit of host-id to 1 and the rest to 0.

Finally, after using the subnetting the total number of usable hosts is reduced from 254 to 252.

**Note:

  1. To divide a network into four (2 2 ) parts you need to choose two bits from the host id part for each subnet i.e, (00, 01, 10, 11).
  2. To divide a network into eight (2 3 ) parts you need to choose three bits from the host id part for each subnet i.e, (000, 001, 010, 011, 100, 101, 110, 111) and so on.
  3. We can say that if the total number of subnets in a network increases the total number of usable hosts decreases.

**The network can be divided into two parts: To divide a network into two parts, you need to choose one bit for each Subnet from the host ID part.

nid_193_1_2_0

Subnet

In the above diagram, there are two Subnets.

**Note: It is a class C IP so, there are 24 bits in the network id part and 8 bits in the host id part.

Advantages

Disadvantages