IP Addressing & Subnetting Basics

Understanding IPv4, Classes, and the role of Subnet Masks

An IP Address (Internet Protocol Address) is a unique numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. It serves two main functions: host or network interface identification and location addressing.

Types of IP Addresses

Public vs. Private IP Addresses

Public IPs are unique across the entire internet and are assigned by ISPs. Private IPs are used within local networks (LANs) and are not routable on the public internet.

Private IP Ranges (RFC 1918)

To preserve public IPv4 addresses, specific ranges were reserved for private use within LANs. These addresses cannot be routed over the internet.

Class Range CIDR
Class A 10.0.0.0 – 10.255.255.255 10.0.0.0/8
Class B 172.16.0.0 – 172.31.255.255 172.16.0.0/12
Class C 192.168.0.0 – 192.168.255.255 192.168.0.0/16

Network Part vs. Host Part

Every IP address is divided into two parts:

The Importance of Subnet Mask

The Subnet Mask is a 32-bit number that distinguishes the Network part from the Host part. It works by "masking" the network portion of the IP address.

For example, in the address 192.168.1.10 with a subnet mask of 255.255.255.0:
192.168.1 is the Network.
.10 is the Host.

IP Addressing Classes

IPv4 addresses were originally divided into classes to define network sizes:

Class Range (1st Octet) Default Subnet Mask Usage
Class A 1 – 126 255.0.0.0 (/8) Very large networks (ISPs, huge corps)
Class B 128 – 191 255.255.0.0 (/16) Medium-sized networks (Universities)
Class C 192 – 223 255.255.255.0 (/24) Small networks (Home, Small Business)
Class D 224 – 239 N/A Multicast groups
Class E 240 – 255 N/A Reserved for Research

Note: 127.0.0.0/8 is reserved for loopback testing (localhost).