bgunderlay bgunderlay bgunderlay

Easy IPv4 Subnetting and Mask Calculation Method

In the realm of network engineering and administration, understanding how to efficiently subdivide IP networks into smaller, manageable segments—known as subnetting—is fundamental. With the advent of IPv4’s limited address space, subnetting has become an essential skill to optimize the use of IP addresses.

Understanding the Basics of IPv4 Subnetting

IPv4 addresses consist of 32 bits, typically represented in decimal format as four octets separated by dots (e.g., 192.168.1.1). Subnetting involves dividing a network into smaller networks (subnets) to improve network management and security. This division is achieved through the subnet mask, which determines how many bits are used for the network portion and how many for the host portion of an address.

The Simple 6-Step Subnetting Method

To simplify subnetting, follow this straightforward six-step method, which can be applied to any IPv4 address:

Step 1: Find the Subnet Number

  1. Subtract the prefix number from /32: For example, for a /29 prefix, it’s 32 – 29 = 3.
  2. Calculate the Subnet Mask: Convert the remaining bits to binary and sum them up to find the subnet mask.

Step 2: Determine the Subnet Size

  1. Calculate the subnet size: Use the formula 2^n (where n is the number of host bits) to find how many addresses are in each subnet.

Step 3: Identify the Broadcast Address

  1. Subtract 1 from the subnet size: This gives you the broadcast address for the subnet.

Step 4: Locate the IP Address Subnet

  1. Identify which subnet block the IP address falls into: This determines the range of valid host addresses.

Step 5: Calculate Valid Hosts

  1. Determine the number of valid hosts per subnet: Subtract 2 from the subnet size (for the network and broadcast addresses).

Example

Following this method, the subnetting details for the IP address 10.20.4.13 with a /29 prefix are as follows:

  1. Subnet Address: 10.20.4.8/29
  2. First Valid Host Address: 10.20.4.9
  3. Last Valid Host Address: 10.20.4.14
  4. Broadcast Address: 10.20.4.15
  5. Subnet Mask: 255.255.255.248

Variable Length Subnet Mask (VLSM) Table

A Variable Length Subnet Mask (VLSM) allows for the subnet masks of variable lengths to be used within the same network, providing more flexibility and efficiency in IP address allocation. Here’s a brief overview:

Prefix sizeNetwork maskUsable hosts per subnet
/1128.0.0.02,147,483,646
/2192.0.0.01,073,741,822
/3224.0.0.0536,870,910
/4240.0.0.0268,435,454
/5248.0.0.0134,217,726
/6252.0.0.067,108,862
/7254.0.0.033,554,430
Class A
/8255.0.0.016,777,214
/9255.128.0.08,388,606
/10255.192.0.04,194,302
/11255.224.0.02,097,150
/12255.240.0.01,048,574
/13255.248.0.0524,286
/14255.252.0.0262,142
/15255.254.0.0131,070
Class B
/16255.255.0.065,534
/17255.255.128.032,766
/18255.255.192.016,382
/19255.255.224.08,190
/20255.255.240.04,094
/21255.255.248.02,046
/22255.255.252.01,022
/23255.255.254.0510
Class C
/24255.255.255.0254
/25255.255.255.128126
/26255.255.255.19262
/27255.255.255.22430
/28255.255.255.24014
/29255.255.255.2486
/30255.255.255.2522
/31255.255.255.2540 (special use)
/32255.255.255.2550 (single host)

Conclusion

Subnetting is a critical skill in network design and management, enabling the efficient use of IP addresses and enhanced network security. By mastering the easy six-step method outlined above, network administrators and engineers can simplify the subnetting process. Remember, practice is key to becoming proficient in subnetting and mask calculations. With these tools and methods, navigating the complexities of IPv4 networks becomes a more manageable and straightforward task.

Evgeny Sevastyanov

Client Support Teamleader

    Ready to get started?

    Articles
    A Beginner’s Guide to Subnetting IPv4 and IPv6 Addresses (2026 Update)
    A Beginner’s Guide to Subnetting IPv4 and IPv6 Addresses (2026 Update)

    A Beginner’s Guide to Subnetting IPv4 and IPv6 Addresses Subnetting is a critical

    More
    IPv4 Leasing Revolution: Why Smart Businesses Are Ditching Ownership in 2025
    IPv4 Leasing Revolution: Why Smart Businesses Are Ditching Ownership in 2025

    Why IPv4 Leasing Is Becoming the Smart Choice for Businesses in 2025 1. Introduction

    More
    Network Isolation Revolution: IPv4 Marketplace Insights for Enterprise Security
    Network Isolation Revolution: IPv4 Marketplace Insights for Enterprise Security

      As CEO of InterLIR, I’ve witnessed firsthand how network isolation strategies

    More
    What is ASN?
    What is ASN?

    What is an ASN? ASN stands for Autonomous System Number. It is a unique identifier

    More
    How Anycast DNS Actually Works (And Why Your Network Needs It)
    How Anycast DNS Actually Works (And Why Your Network Needs It)

    Anycast DNS: A Leader’s Guide to Protecting Your Digital Infrastructure Executive

    More
    Why RPKI Matters: Securing Your Company’s Internet Traffic
    Why RPKI Matters: Securing Your Company’s Internet Traffic

    RPKI Certification: A Leader’s Guide to Internet Routing Security Executive

    More
    Why RIPE Address Policy Matters for Your Company’s Digital Future
    Why RIPE Address Policy Matters for Your Company’s Digital Future

    Executive Summary: What You Need to Know 🎯 Strategic Importance – Internet

    More
    AWS Outages: The CEO’s Guide to Preventing Downtime & Protecting Revenue
    AWS Outages: The CEO’s Guide to Preventing Downtime & Protecting Revenue

      When AWS DynamoDB failed in October 2025, thousands of businesses discovered that

    More
    What I Wish CEOs Knew About Managing IP Reputation Risk
    What I Wish CEOs Knew About Managing IP Reputation Risk

    Executive Summary: What You Need to Know 🎯 IP reputation directly impacts your

    More
    How to Create a Subnet and Configure Routing
    How to Create a Subnet and Configure Routing

    Mastering Subnetting and Routing for Modern Networks Why Subnetting Matters in Today’s

    More