IP Addressing & Subnetting
Learn about IPv4 and IPv6 addresses, network masks, classes, CIDR notation, and how subnetting divides networks.
What is an IP Address?
An IP (Internet Protocol) Address is a unique numerical label assigned to each device connected to a computer network. It serves two primary functions: host or network interface identification, and location addressing.
IPv4 vs. IPv6
There are two main versions of IP addresses in use today:
- IPv4 (IP version 4) — 32-bit address represented in dotted-decimal format (e.g.,
192.168.1.1). It allows for approximately 4.3 billion unique addresses, which is no longer enough for all the devices in the world. - IPv6 (IP version 6) — 128-bit address represented in hexadecimal colon-separated format (e.g.,
2001:db8:3333:4444:5555:6666:7777:8888). It provides an astronomically large number of addresses (3.4 × 1038).
IPv4 Structure & Subnet Masks
An IPv4 address consists of two parts: the Network ID and the Host ID. The division is determined by the Subnet Mask.
- An IP of
192.168.1.50with a Subnet Mask of255.255.255.0means:- Network ID:
192.168.1.0 - Host ID:
.50
- Network ID:
CIDR Notation
Classless Inter-Domain Routing (CIDR) simplifies subnet masks by representing the number of "1" bits in the mask with a slash followed by a number:
255.255.255.0is written as/24(24 bits of 1s:11111111.11111111.11111111.00000000).255.255.0.0is written as/16.255.0.0.0is written as/8.
Public vs. Private IP Addresses
- Public IP Addresses — Unique worldwide. Routeable on the internet. Assigned by ISPs.
- Private IP Addresses — Used inside local networks (LANs). Non-routeable on the internet. Reusable across different LANs. Defined by RFC 1918:
10.0.0.0to10.255.255.255172.16.0.0to172.31.255.255192.168.0.0to192.168.255.255
What is Subnetting?
Subnetting is the practice of dividing a large network into smaller, logical subnetworks (subnets). Benefits include:
- Security — Separates departments or systems so they cannot communicate directly without a router.
- Performance — Reduces broadcast traffic size.
- Management — Makes troubleshooting and organizing IP allocations easier.
What's Next?
Learn how routers use IP addresses to send data in Routing & Switching, or discover how we map human-friendly names to these numbers in DNS Explained.