Understanding Subnetting
Introduction When I first started learning about networking, subnetting was something I just couldn’t wrap my head around. I struggled with it for a long time. But once I finally got it, it felt like discovering a superpower. Today, I’m feeling generous, so if you’re in the same boat I was, I hope this post helps break down subnetting in the simplest way possible, so it clicks for you too! To understand subnetting, there are a few key concepts you'll want to be comfortable with first. Basic Understanding of IP Addresses Binary and Decimal Numbers because subnetting heavily involves converting between binary (base 2) and decimal (base 10). If you're already comfortable with these concepts, subnetting will start to make more sense! The key is practice, so don’t worry if it seems tricky at first, it'll click eventually. What is Subnetting? Subnetting is a fundamental networking concept that allows you to divide a larger network into smaller, more manageable subnetworks. It’s a critical skill for network administrators and anyone working with IP addresses. I’ll break it down step-by-step in a clear and practical way. When you subnet, you "borrow" bits from the host portion to create more networks, reducing the number of hosts per network. Understand IP Addresses and the Basics An IP address (IPv4) is a 32-bit number, typically written as four octets separated by dots (e.g., 192.168.1.0). Each octet is 8 bits, and the value ranges from 0 to 255. Network Portion: Identifies the network. Host Portion: Identifies devices within that network. Subnet Mask A subnet mask determines which part of the IP address is the network portion and which is the host portion. It’s also 32 bits long and can be written in dotted decimal (e.g., 255.255.255.0) or CIDR notation (e.g., /24, where 24 is the number of 1s in the binary mask). CIDR Notation CIDR notation is a compact way of indicating a subnet by using a single number to represent the subnet mask. In CIDR notation, a subnet is indicated by adding a forward slash (‘/’) and a number to the end of the IP address. > CIDR notation allows for a more concise representation of subnets, especially when dealing with large networks. It also provides a more explicit indication of how many bits of the IP address are used for the network portion of the subnet, which can save you the trouble of having to calculate it yourself, as you might need to do with subnet mask notation The number after the slash indicates the number of bits that are reserved for the network portion of the address. For example: IP: 192.168.1.0 Subnet Mask: 255.255.255.0 (/24) 255 = 11111111 in binary (8 bits per octet). /24 means the first 24 bits are the network portion, leaving 8 bits for hosts. Now does this mean only 8 hosts are in this subnet? No, it doesn’t mean there are only 8 hosts in the subnet. Let me clarify this common point of confusion. When we say a /24 subnet has 8 bits left for the host portion, it refers to the number of bits available to assign addresses within that subnet. The total number of possible addresses (including network and broadcast) is calculated as 2^n, where (n) is the number of host bits. Break Down • A /24 subnet means the subnet mask is 255.255.255.0 (binary: 11111111.11111111.11111111.00000000). • The first 24 bits are reserved for the network portion, leaving 8 bits for the host portion (the last octet). • With 8 bits, the total number of possible addresses is 2^8 = 256 o These 256 addresses range from 0 to 255 in the last octet (e.g., 192.168.1.0 to 192.168.1.255). Usable Hosts Out of these 256 addresses: • 1 address is reserved for the network address (e.g., 192.168.1.0). • 1 address is reserved for the broadcast address (e.g., 192.168.1.255). • That leaves 256 - 2 = 254 usable host addresses for devices like computers, routers, etc. So, a /24 subnet can support 254 hosts, not 8. The "8" refers to the number of bits, not the number of hosts directly. Why the Confusion? The mix-up often comes from misinterpreting "8 bits" as "8 hosts." Instead, think of it as "8 bits give me 2^8 possibilities." Each bit doubles the number of combinations, so 8 bits provide a lot more than 8 hosts! Quick Verification • /24 = 256 total addresses = 254 usable hosts. • If you subnet further (e.g., /25), you’d borrow 1 bit, leaving 7 host bits ( 2^7 = 128 addresses, 126 usable hosts per subnet). The Subnetting Process Let’s subnet a network step-by-step. Example: Subnet 192.168.1.0/24 Suppose you need 4 subnets from this network. (This means we are trying to create 4 smaller networks from this network) Determine the Number of Subnets Needed o You need 4 subnets. o Subnets are created by borrowing bits from the host portion. The formula for the number of subnets is 2^n, where (n) is the number of borrowed bits. o 2^2 = 4, so you need to borrow 2 bits. Why Borrow Bits? The number of subnets you can create depends on how many bits

Introduction
When I first started learning about networking, subnetting was something I just couldn’t wrap my head around. I struggled with it for a long time. But once I finally got it, it felt like discovering a superpower. Today, I’m feeling generous, so if you’re in the same boat I was, I hope this post helps break down subnetting in the simplest way possible, so it clicks for you too!
To understand subnetting, there are a few key concepts you'll want to be comfortable with first.
- Basic Understanding of IP Addresses
- Binary and Decimal Numbers because subnetting heavily involves converting between binary (base 2) and decimal (base 10).
If you're already comfortable with these concepts, subnetting will start to make more sense! The key is practice, so don’t worry if it seems tricky at first, it'll click eventually.
What is Subnetting?
Subnetting is a fundamental networking concept that allows you to divide a larger network into smaller, more manageable subnetworks. It’s a critical skill for network administrators and anyone working with IP addresses. I’ll break it down step-by-step in a clear and practical way.
When you subnet, you "borrow" bits from the host portion to create more networks, reducing the number of hosts per network.
Understand IP Addresses and the Basics
An IP address (IPv4) is a 32-bit number, typically written as four octets separated by dots (e.g., 192.168.1.0). Each octet is 8 bits, and the value ranges from 0 to 255.
Network Portion: Identifies the network.
Host Portion: Identifies devices within that network.
Subnet Mask
A subnet mask determines which part of the IP address is the network portion and which is the host portion. It’s also 32 bits long and can be written in dotted decimal (e.g., 255.255.255.0) or CIDR notation (e.g., /24, where 24 is the number of 1s in the binary mask).
CIDR Notation
CIDR notation is a compact way of indicating a subnet by using a single number to represent the subnet mask. In CIDR notation, a subnet is indicated by adding a forward slash (‘/’) and a number to the end of the IP address.
> CIDR notation allows for a more concise representation of subnets, especially when dealing with large networks. It also provides a more explicit indication of how many bits of the IP address are used for the network portion of the subnet, which can save you the trouble of having to calculate it yourself, as you might need to do with subnet mask notation
The number after the slash indicates the number of bits that are reserved for the network portion of the address.
For example:
IP: 192.168.1.0
Subnet Mask: 255.255.255.0 (/24)
255 = 11111111 in binary (8 bits per octet).
/24 means the first 24 bits are the network portion, leaving 8 bits for hosts.
Now does this mean only 8 hosts are in this subnet?
No, it doesn’t mean there are only 8 hosts in the subnet. Let me clarify this common point of confusion.
When we say a /24 subnet has 8 bits left for the host portion, it refers to the number of bits available to assign addresses within that subnet. The total number of possible addresses (including network and broadcast) is calculated as
2^n, where (n) is the number of host bits.
Break Down
• A /24 subnet means the subnet mask is 255.255.255.0 (binary: 11111111.11111111.11111111.00000000).
• The first 24 bits are reserved for the network portion, leaving 8 bits for the host portion (the last octet).
• With 8 bits, the total number of possible addresses is
2^8 = 256
o These 256 addresses range from 0 to 255 in the last octet (e.g., 192.168.1.0 to 192.168.1.255).
Usable Hosts
Out of these 256 addresses:
• 1 address is reserved for the network address (e.g., 192.168.1.0).
• 1 address is reserved for the broadcast address (e.g., 192.168.1.255).
• That leaves 256 - 2 = 254 usable host addresses for devices like computers, routers, etc.
So, a /24 subnet can support 254 hosts, not 8. The "8" refers to the number of bits, not the number of hosts directly.
Why the Confusion?
The mix-up often comes from misinterpreting "8 bits" as "8 hosts." Instead, think of it as "8 bits give me
2^8 possibilities." Each bit doubles the number of combinations, so 8 bits provide a lot more than 8 hosts!
Quick Verification
• /24 = 256 total addresses = 254 usable hosts.
• If you subnet further (e.g., /25), you’d borrow 1 bit, leaving 7 host bits ( 2^7 = 128 addresses, 126 usable hosts per subnet).
The Subnetting Process
Let’s subnet a network step-by-step.
Example: Subnet 192.168.1.0/24
Suppose you need 4 subnets from this network.
(This means we are trying to create 4 smaller networks from this network)
- Determine the Number of Subnets Needed o You need 4 subnets. o Subnets are created by borrowing bits from the host portion. The formula for the number of subnets is 2^n, where (n) is the number of borrowed bits. o 2^2 = 4, so you need to borrow 2 bits.
Why Borrow Bits?
The number of subnets you can create depends on how many bits you "borrow" from the host portion to add to the network portion. The formula is 2^n, where (n) is the number of borrowed bits.
You need 4 subnets, so:
2^1 = 2 (not enough, only 2 subnets).
2^2 = 4 (perfect, exactly 4 subnets).
2^3 = 8 (more than needed, but possible).
Since the goal is to create 4 subnets, borrowing 2 bits gives you exactly the 4 subnets required, no more, no less.
- Adjust the Subnet Mask
Original mask: /24 (255.255.255.0).
Borrow 2 bits from the host portion: /24 becomes /26.
New mask: 255.255.255.192 (binary: 11111111.11111111.11111111.11000000).
Note: Remember 255 = 11111111 in binary (8 bits per octet), 11000000 =1 92 when converted to decimal. For partial octets, calculate the value of the 1s: Shortcut: 1 bit = 128, 2 bits = 192, 3 bits = 224, 4 bits = 240, 5 bits = 248, 6 bits = 252, 7 bits = 254, 8 bits = 255
- Calculate the Number of Hosts per Subnet o Original /24 has 8 host bits (2^8 = 256 total addresses, 254 usable for hosts because 1 is the network address and 1 is the broadcast).
New /26 has 6 host bits (2^6 = 64 addresses per subnet).
Usable hosts per subnet = 64 - 2 = 62 (subtract network and broadcast addresses).
Determine Subnet Ranges
With a /26 mask, the last octet increments by 64 (because 256 ÷ 4 subnets = 64). (256 from the initial total addresses)
Subnet 1: 192.168.1.0 - 192.168.1.63
Network: 192.168.1.0
Broadcast: 192.168.1.63
Usable: 192.168.1.1 - 192.168.1.62Subnet 2: 192.168.1.64 - 192.168.1.127
Network: 192.168.1.64
Broadcast: 192.168.1.127
Usable: 192.168.1.65 - 192.168.1.126Subnet 3: 192.168.1.128 - 192.168.1.191
Subnet 4: 192.168.1.192 - 192.168.1.255
Why Subnet?
Now you may wonder, in what possible scenarios would I possibly need subnets? Great Question!
Needing extra subnets, like dividing 192.168.1.0/24 into 4 subnets, comes up in real-world scenarios where you want to organize, secure, or optimize a network. Here are some practical situations where you might need to create additional subnets:
1. Departmental or Functional Separation
Scenario: A small business has 50 employees across 4 departments (e.g., Sales, Engineering, HR, and IT). Each department needs its own network for organization and access control.
Why Subnet?: By splitting 192.168.1.0/24 into 4 subnets, this keeps traffic separate and allows you to apply specific firewall rules or policies per department.
2. Security Isolation
Scenario: You run a network with sensitive devices (e.g., servers) and less secure devices (e.g., IoT gadgets like smart cameras). You don’t want them sharing the same network.
Why Subnet?: Subnetting lets you isolate the servers from IoT devices. This limits the attack surface—if an IoT device is compromised, it can’t easily reach the server subnet.
Example: A hacker accessing a camera on 192.168.1.65 can’t directly ping a server at 192.168.1.10 without routing rules.
3. Reducing Broadcast Traffic
Scenario: Your network has 200 devices on a single /24 subnet, and performance is sluggish because every device hears every broadcast (e.g., ARP requests).
Why Subnet?: A /24 has 254 usable hosts, and broadcasts go to all of them. Splitting it into 4 subnets (/26, 62 hosts each) reduces the broadcast domain to 64 addresses per subnet, cutting down on unnecessary traffic and improving performance.
Example: A printer spamming broadcasts only affects its own subnet (e.g., 192.168.1.128–192.168.1.191) instead of the whole 192.168.1.0–255 range.
4. Guest Network Separation
Scenario: You run a café or office with Wi-Fi. You want employees on one network and guests on another to prevent guests from accessing internal resources.
Why Subnet?: Subnetting gives guests their own range while staff use another. You can limit guest bandwidth or block access to internal IPs.
5. Physical Location Segmentation
Scenario: A company has offices on different floors or buildings, each with its own network needs.
Why Subnet?: Subnetting assigns each location its own range for easier management. Floor 1 might use 192.168.1.0/26, Floor 2 uses 192.168.1.64/26, etc.
Example: A switch failure on Floor 1 doesn’t disrupt Floor 2’s subnet.
6. Specialized Device Groups
Scenario: You have VoIP phones, computers, and security cameras, each requiring different Quality of Service (QoS) or VLANs.
Why Subnet?: Subnetting lets you group similar devices and apply specific policies like prioritizing voice traffic. Example: Phones get low-latency settings, while cameras get bandwidth limits.
7. IP Address Exhaustion
Scenario: You’re assigned a small IP block (like 192.168.1.0/24), but need to support more logical networks than a single subnet allows.
Why Subnet?: If you can’t get more IPs, subnetting squeezes more networks out of what you have. Four /26 subnets give you 4 networks instead of 1, each with 62 hosts.
Example: A growing startup avoids requesting a new IP block by subnetting efficiently.
When Wouldn’t You Need Subnets?
If you have fewer than 254 devices, no security concerns, and no performance issues, a single /24 might suffice.
If you have a huge IP range (e.g., 10.0.0.0/8) and no need for isolation, subnetting might be overkill initially. In the 192.168.1.0/24 example with 4 subnets, you’re preparing for scenarios like these by creating flexibility and control. Each /26 subnet (64 addresses, 62 usable) is enough for small groups while keeping them distinct. Does that give you a clearer picture of why subnetting comes up? Want to explore one of these scenarios in more detail?
Maximum Subnet
How do I determine the maximum number of Subnets I can break a network into?
To determine the maximum number of subnets you can break a network into, you need to focus on the number of bits available in the host portion of the IP address and how many of those bits you can borrow to create subnets, while still leaving enough bits for a functional subnet. Here’s how;
Step 1: Identify the Original Subnet Mask
The subnet mask tells you how many bits are in the network portion and how many are in the host portion.
• Example: For 192.168.1.0/24, the mask is /24 (255.255.255.0).
• Network bits: 24.
• Host bits: 32 (total IPv4 bits) - 24 = 8 host bits.
The host bits are what you can borrow to create subnets.
Step 2: Determine Borrowable Bits
You can borrow bits from the host portion to increase the network portion, creating more subnets. However, you must leave at least 2 bits for the host portion in each subnet:
• 1 bit for the network address.
• 1 bit for the broadcast address.
This ensures each subnet has at least 2 addresses, though ideally, you’d want usable host addresses (requiring at least 2 usable IPs, meaning 4 total addresses, or 2 host bits).
• With 8 host bits (like in a /24):
o Maximum borrowable bits = 8 - 2 = 6 bits (leaving 2 bits for hosts).
o If you borrow all 8, you’d have /32 (single IP), which isn’t a subnet.
Step 3: Calculate the Number of Subnets
The number of subnets is determined by the formula
2^n, where (n) is the number of bits borrowed.
• Borrow 1 bit: 2^1 = 2 subnets.
• Borrow 2 bits: 2^2 = 4 subnets.
• Borrow 3 bits: 2^3 = 8 subnets.
• Borrow 4 bits: 2^4 = 16 subnets.
• Borrow 5 bits: 2^5 = 32 subnets.
• Borrow 6 bits: 2^6 = 64 subnets (max practical for usable hosts in a /24).
Step 4: Check Host Count per Subnet
Borrowing bits reduces the number of host bits, affecting the number of addresses per subnet (2^h, where (h) is remaining host bits):
• /24 (0 borrowed): 8 host bits, 2^8 = 256 addresses, 254 usable.
• /25 (1 borrowed): 7 host bits, 2^7 = 128, 126 usable.
• /26 (2 borrowed): 6 host bits, 2^6 = 64, 62 usable.
• /27 (3 borrowed): 5 host bits, 2^5 = 32, 30 usable.
• /28 (4 borrowed): 4 host bits, 2^4 = 16, 14 usable.
• /29 (5 borrowed): 3 host bits, 2^3 = 8, 6 usable.
• /30 (6 borrowed): 2 host bits, 2^2 = 4, 2 usable.
• /31 (7 borrowed): 1 host bit, 2^1 = 2, 0 usable (point-to-point).
• /32 (8 borrowed): 0 host bits, 2^0 = 1, not a subnet.
The practical maximum assumes you want usable hosts, so stop at 2 host bits (/30 for a /24).
Step 5: Apply to Any Network
For any network:
- Find the number of host bits: 32−original mask.
- Max borrowable bits = host bits - 2 (for usable hosts).
- Max subnets = 2^max borrowable bits Examples: • 172.16.0.0/16: o Host bits: 32 - 16 = 16 o Max borrows: 16 - 2 = 14 o Max subnets: 2^{14} = 16,384, each /30 with 2 usable hosts. • 10.0.0.0/8: o Host bits: 32 - 8 = 24 o Max borrow: 24 - 2 = 22 o Max subnets: 2^{22} = 4,194,304, each /30. Quick Note: More subnets = fewer hosts per subnet.
Conclusion
Subnetting and how it works can be challenging topics, but this article should have provided you with a strong foundation in the basics. We’ve learned what subnets are, how to identify networks and hosts using IP addresses and subnet masks, how to find the maximum subnets, calculate the number of hosts within a subnet and real life applicable scenarios.
If you enjoyed the article, feel free to leave a comment, give it a shout-out and share it with others. Bueno!