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

IPv4 addresses are divided into five classes
| Class | Starting IP | Ending IP | Default Subnet Mask | Usage |
| A | 1.0.0.0 | 126.255.255.255 | 255.0.0.0 | Large Networks |
| B | 128.0.0.0 | 191.255.255.255 | 255.255.0.0 | Medium Networks |
| C | 192.0.0.0 | 223.255.255.255 | 255.255.255.0 | Small Networks |
| D | 224.0.0.0 | 239.255.255.255 | N/A | Multicasting |
| E | 240.0.0.0 | 255.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 |
| A | 10.0.0.0 – 10.255.255.255 |
| B | 172.16.0.0 – 172.31.255.255 |
| C | 192.168.0.0 – 192.168.255.255 |
Subnetting
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
| CIDR | Subnet Mask | Hosts per Subnet |
| /30 | 255.255.255.252 | 2 |
| /29 | 255.255.255.248 | 6 |
| /28 | 255.255.255.240 | 14 |
| /27 | 255.255.255.224 | 30 |
| /26 | 255.255.255.192 | 62 |
| /25 | 255.255.255.128 | 126 |
| /24 | 255.255.255.0 | 254 |
| /23 | 255.255.254.0 | 510 |
| /22 | 255.255.252.0 | 1022 |
