Subnetting Tutorial – Subnetting Explained with Examples
Default IP subnets contain too many IP addresses. Most networks do not need that many IP addresses. If they use default IP subnets, all unused IP addresses will go to waste. Subnetting solves this problem. It allows you to break default IP subnets based on network requirements and size. An IP address consists of two parts: the network address and the host address. A network address is a group address. All IP addresses in an IP group have the same network address. A host address is a node address. All IP addresses in an IP group have different host addresses. An IP group is known as an IP subnet.
An IP address is always used with the subnet mask. A subnet mask separates the network address from the host address. Both an IP address and a subnet mask are 32 bits in length. They arrange bits into four parts. Each part, known as an octet, contains 8 bits. Octets are separated by periods and written in a sequence.

A subnet mask assigns a bit to each bit of the IP address. A subnet mask bit can be either on or off. The value 0 represents an off bit. The value 1 represents an on bit. An off bit corresponds to a host bit in an IP address. An on bit represents a network bit in the IP address.
There are two popular notations for writing IP addresses and subnet masks: decimal and binary. The following table lists the relationship between subnet mask value and IP bits.
| Notation | Subnet Mask value | IP bit |
| Decimal | 1 to 255 | Network |
| 0 | Host | |
| Binary | 1 | Network |
| 0 | Host |
Examples of IP addresses with the subnet mask in binary format.
00001010.00001010.00001010.00001010 11111111.00000000.00000000.00000000 10101100.10101000.00000001.00000001 11111111.11111111.00000000.00000000 11000000.10101000.00000001.00000001 11111111.11111111.11111111.00000000

Examples of IP addresses with the subnet mask in decimal format.
10.10.10.10 255.0.0.0 172.168.1.1 255.255.0.0 192.168.1.1 255.255.255.0

Reserve IP classes, network bits, and host bits
Each IP address belongs to a predefined IP class. There are five predefined IP classes: A, B, C, D, and E. Classes D and E are reserved and not used in subnetting. In classes A, B, and C, the first 8, 16, and 24 bits are reserved for the network portion, respectively. These classes also reserve the last two bits for the host portion. You cannot use reserved bits for subnetting.

After excluding the reserved network and host bits, the remaining bits are considered subnetting-eligible host bits. You can use only subnetting eligible host bits for subnetting.

Network address and Broadcast address
Every IP network (subnet) needs two specific addresses: the network address and the broadcast address. A network address identifies the network itself, while a broadcast address identifies all hosts on the network. You cannot assign these addresses to any individual host on the network. Since each IP subnet requires these two addresses, the requirement increases when you split an IP subnet into multiple IP subnets.

Network and broadcast addresses are also known as Network ID and broadcast ID, respectively.
Valid host addresses
All addresses between the network and broadcast addresses are known as valid host addresses. Any device that uses the IP protocol to transfer data needs a valid host address. You can assign only valid host addresses to end devices such as computers, laptops, tablets, smartphones, IP phones, servers, printers, terminals, IP cameras, and networking devices such as switches, routers, firewalls, and proxy servers.
Block Size
A block size is the sum of the network address, valid host addresses, and the broadcast address. For example, if you have six valid host addresses, the block size will be 8 (1 network address + 6 valid host addresses + 1 broadcast address).
Power of 2
An IP address is a 32-bit binary number. In an IP address:-
- A combination of all 32 binary bits shows the complete IP address.
- A combination of only network bits indicates the number of IP subnets it provides in decimal.
- A combination of only host bits indicates the number of host addresses it provides in decimal.
To know how many combinations the number of bits provides, use the power of 2. For example, to break a single IP subnet into 4 IP subnets, you need 2 subnetting-eligible host bits (22 = 4). This way, if you have 3 subnetting-eligible host bits, you can create 8 (23 = 8) additional networks.
The following table lists the powers of 2 from 22 to 232.
| 2X | Value | 2X | Value | 2X | Value | 2X | Value |
| 1 | 2 | 9 | 512 | 17 | 131072 | 25 | 33554432 |
| 2 | 4 | 10 | 1024 | 18 | 262144 | 26 | 67108864 |
| 3 | 8 | 11 | 2048 | 19 | 524288 | 27 | 134217728 |
| 4 | 16 | 12 | 4096 | 20 | 1048576 | 28 | 268435456 |
| 5 | 32 | 13 | 8192 | 21 | 2097152 | 29 | 536870912 |
| 6 | 64 | 14 | 16384 | 22 | 4194304 | 30 | 1073741824 |
| 7 | 128 | 15 | 32768 | 23 | 8388608 | 31 | 2147483648 |
| 8 | 256 | 16 | 65536 | 24 | 16777216 | 32 | 4294967296 |
In 2X, the X is the number of bits.
Subnetting Direction
Subnetting always goes in a single direction (left to right) without skipping any bits. This rule gives you the exact location of subnetting bits in an address space.
Let’s take an example. A class C network is subnetted into 4 subnets. Find the number of host bits used in subnetting and their location in the address space.

To create 4 subnets, you need 2 subnetting-eligible host bits (22 = 4). Since in class C network space, subnetting-eligible bits start at 25 and subnetting always proceeds from left to right without skipping any bit, the bits used in this network are 25 and 26.
This tutorial is part of the tutorial series "IP Addressing, and Subnetting in Computer Networks Explained with examples". Other parts of this series are the following.
Chapter 01 Introduction to Subnetting
Chapter 02 Network Address Basic Concepts Explained with Examples
Chapter 03 The Subnet Mask and Slash Notation
Chapter 04 Converting Decimal IP Addresses to Binary and Binary to Decimal
Chapter 05 Basic Subnetting in Computer Networks Explained
Chapter 06 Subnetting Tutorial - Subnetting Explained with Examples
Chapter 07 Subnetting Tricks: Subnetting Made Easy with Examples
Chapter 08 FLSM Subnetting and VLSM Subnetting
Chapter 09 VLSM Subnetting Explained with Examples
Chapter 10 VLSM Subnetting Examples and Calculation Explained
Chapter 11 Route Summarization Advantages and Disadvantages
Chapter 12 Supernetting Tutorial: - Supernetting Explained with Examples
Conclusion
This tutorial introduced the components of subnetting and their functions. Learning these helps you perform subnetting more effectively. The next tutorial in this tutorial series explains how to use these components through various examples.
By ComputerNetworkingNotes Updated on 2026-05-09