IP Addressing and Subnetting: A Quick Guide

What is an IP Address?

Understand the fundamentals of IP addressing and subnetting, including network segmentation, subnet masks, and efficient IP allocation for better connectivity and security. An IP (Internet Protocol) Address is a unique identifier assigned to each device in a network for communication.

IPv4 (32-bit): Example – 192.168.1.1

IPv6 (128-bit): Example – 2001:0db8:85a3:0000:0000:8a2e:0370:7334

IP addressing and subnetting

IPv4 addresses are divided into five classes

ClassStarting IPEnding IPDefault Subnet MaskUsage
A1.0.0.0126.255.255.255  255.0.0.0   Large Networks
B128.0.0.0  191.255.255.255 255.255.0.0Medium Networks
C192.0.0.0223.255.255.255  255.255.255.0 Small Networks
D  224.0.0.0   239.255.255.255   N/A Multicasting
E240.0.0.0255.255.255.255  N/A   Experimental

* Class D & E are reserved for special use (Multicast & Research).

Public vs Private IP Addresses:

Public IPs: Assigned by ISPs, used on the internet. Example – 8.8.8.8 (Google DNS)

Private IPs: Used in local networks, not routable on the internet.

Class  Private IP Range
A10.0.0.0   –   10.255.255.255
B172.16.0.0   –   172.31.255.255
C  192.168.0.0   –    192.168.255.255

Dividing a Network into Smaller Networks

1.Subnet Mask:

Determines which part of an IP is network and which part is host.

Example:

  • 255.255.255.0 → /24 → 256 addresses
  • 255.255.255.128 → /25 → 128 addresses

2.Formula for Subnet Calculation:

  • Number of Subnets = 2^borrowed bits

Borrowed bits = Bits taken from the host portion to extend the network portion.

  • Number of Hosts per Subnet = 2^ (remaining bits) – 2

Subtract 2 addresses (Network & Broadcast)

Example:  Given IP: 192.168.1.0/26

                    Subnet Mask: 255.255.255.192

Hosts per Subnet:   2^6 – 2 = 26

Subnets Available:  2^2 = 4

(Since 2 bits are borrowed from host bits)

    .  Subnet Block Size

         Block Size = 256−Subnet Mask’s Last Octet

         Example: If Subnet Mask = 255.255.255.192, then

             256−192=64

         So, each subnet will have 64 IPs.

Subnet Mask Calculation Formula

1. Convert CIDR to Subnet Mask

    If given CIDR notation (/N), convert it to subnet mask:

  • CIDR Prefix /N means the first N bits are 1s in binary.
  • Convert this to decimal format.

           Example: /26 to Subnet Mask:

        /26 = 11111111.11111111.11111111.11000000 (Binary)

                     = 255.255.255.192 (Decimal)

2.Quick CIDR to Subnet Mask Chart

CIDRSubnet MaskHosts per Subnet
/30  255.255.255.2522
/29255.255.255.2486
/28255.255.255.24014
/27  255.255.255.22430
/26   255.255.255.19262
/25  255.255.255.128126
/24255.255.255.0  254
/23255.255.254.0510
/22  255.255.252.01022
   

Scroll to Top