Subnetting: Concepts, Examples, and Best Practices

What is Subnetting?

Subnetting is the process of dividing a single network (IP address range) into smaller, logical sub-networks called subnets.

Purpose includes:

  • Improving network organization and management.
  • Enhancing security by isolating segments.
  • Reducing broadcast domains for better performance.
  • Efficient utilization of IP address space.

IP Address Structure Refresher

An IPv4 address consists of 32 bits displayed as 4 octets in dotted decimal notation (e.g., 192.168.10.5).

Network Portion: The leftmost bits identifying the network.
Host Portion: The rightmost bits identifying individual devices within the network.

Example: For 192.168.10.5 with subnet mask 255.255.255.0,
Network: 192.168.10.0
Host: .5

Subnet Masks

Subnet masks define which part of the IP address is network and which is host.

FormatExample
Dotted Decimal 255.255.255.0
Binary 11111111.11111111.11111111.00000000

Default Masks:

  • Class A: 255.0.0.0
  • Class B: 255.255.0.0
  • Class C: 255.255.255.0

How Subnetting Works

By borrowing bits from the host portion, subnetting creates more networks (subnets) while reducing hosts per subnet.

More bits set to 1 in the mask means more subnets but fewer hosts per subnet.

Calculating Subnets and Hosts

FormulaExplanation
Number of Subnets = 2^n n = number of bits borrowed from host portion
Number of Hosts per Subnet = 2^h – 2 h = number of host bits remaining (subtract 2 for network and broadcast addresses)

Example 1: Subnetting a Class C Network

Network: 192.168.10.0/24 (default mask: 255.255.255.0)
Goal: 4 subnets

  1. 4 subnets → borrow 2 bits (2² = 4)
  2. New subnet mask = 255.255.255.192 (/26)
  3. Subnet ranges:
    • 192.168.10.0/26: Hosts .1–.62 (network .0, broadcast .63)
    • 192.168.10.64/26: Hosts .65–.126
    • 192.168.10.128/26: Hosts .129–.190
    • 192.168.10.192/26: Hosts .193–.254
  4. Hosts per subnet = 2⁶ – 2 = 62

Example 2: Subnetting a Class B Network

Network: 172.16.0.0/16 (default mask: 255.255.0.0)
Borrow 4 bits → New mask: 255.255.240.0 (/20)

  • Number of subnets = 2⁴ = 16
  • Hosts per subnet = 2¹² – 2 = 4094

Variable Length Subnet Masking (VLSM)

VLSM allows subnets of different sizes within the same network, optimizing IP usage by allocating just enough addresses per subnet.

Example:

  • Subnet for 50 hosts: use /26 (62 hosts)
  • Subnet for 10 hosts: use /28 (14 hosts)

Subnetting and CIDR (Classless Inter-Domain Routing)

CIDR expresses subnet masks with slash notation (e.g., 192.168.1.0/24) and supports route aggregation, which summarizes multiple networks to simplify routing.

Subnet Zero and All-Ones Subnet

Both the first subnet (all subnet bits 0) and the last subnet (all subnet bits 1) are now usable, though legacy systems might restrict their use.

Best practice: Consider both valid unless your network equipment limits otherwise.

Private IP Address Subnetting

Organizations commonly subnet private IP ranges (e.g., 192.168.0.0/16) to isolate departments, enhance security, and manage efficiently.

Subnetting Tools and Calculators

Many online subnet calculators (e.g., SolarWinds, IPcalc) automate subnet calculations, but manual practice is essential for certification exams.

Troubleshooting Subnetting Issues

  • Overlapping subnets
  • Misconfigured subnet masks
  • Ignoring network and broadcast addresses

Symptoms include devices unable to communicate, routing errors, or broadcast storms.

Key Points & Tips for the Exam

  • Master binary-to-decimal conversions for IPs and masks.
  • Calculate number of subnets and hosts accurately.
  • Determine subnet ranges including network, broadcast, and usable host addresses.
  • Understand and apply VLSM concepts for efficient IP allocation.
  • Practice CIDR notation and route aggregation.
  • Always subtract 2 addresses for network and broadcast in host calculations.
  • Be comfortable subnetting private IP spaces in real-world designs.

Sample Step-by-Step Subnetting Exercise

Question: Subnet 192.168.10.0/24 into 8 subnets.

Solution:

  1. 8 subnets → borrow 3 bits (2³=8)
  2. New mask: /27 (24+3=27) → 255.255.255.224
  3. Hosts per subnet: 2^(32–27) – 2 = 2⁵ – 2 = 30
  4. Subnet ranges:
    • 192.168.10.0/27 (.1–.30)
    • 192.168.10.32/27 (.33–.62)
    • 192.168.10.64/27 (.65–.94)
    • 192.168.10.96/27 (.97–.126)
    • 192.168.10.128/27 (.129–.158)
    • 192.168.10.160/27 (.161–.190)
    • 192.168.10.192/27 (.193–.222)
    • 192.168.10.224/27 (.225–.254)

When to Use Subnetting

  • Departmental segmentation
  • Security zoning
  • Network scalability and organization
  • Efficient IP allocation
  • Minimizing broadcast domains

Subnetting Quiz

1. What is subnetting?

Correct answer is B. Subnetting divides one network into smaller logical subnets to improve management and performance.

2. How many hosts per subnet are available with a /26 subnet mask?

Correct answer is D. A /26 mask leaves 6 bits for hosts: 2^6 - 2 = 62 usable hosts per subnet.

3. What formula calculates the number of subnets created by borrowing bits?

Correct answer is A. The number of subnets is 2 raised to the number of bits borrowed.

4. In the subnet 192.168.10.0/27, what is the range of valid host addresses?

Correct answer is C. Hosts range excludes network (.0) and broadcast (.31) addresses, so valid hosts are .1 to .30.

5. What is Variable Length Subnet Masking (VLSM)?

Correct answer is B. VLSM allows subnets of varying sizes in one network to minimize IP waste.

6. How many subnets and hosts per subnet are created by borrowing 4 bits from a Class B network?

Correct answer is A. Borrowing 4 bits creates 16 (2^4) subnets; remaining 12 bits give 2^12 - 2 = 4094 hosts.

7. What is CIDR notation for a subnet mask of 255.255.255.192?

Correct answer is D. 255.255.255.192 corresponds to /26 (26 bits set to 1).

8. What are subnet zero and all-ones subnet?

Correct answer is B. Subnet zero (all subnet bits 0) and all-ones subnet (all subnet bits 1) are now generally usable.

9. Which of these is NOT a typical use of subnetting?

Correct answer is C. Subnetting does not change IP address length; it segments networks.

10. Why is subnetting important in network design?

Correct answer is A. Subnetting helps organize networks, improve security, and reduce broadcast traffic.

← Back to Home