Internet Protocol version 4 (IPv4) addresses form the numerical foundation of internet communication, providing unique identifiers that enable devices to locate and communicate with each other across global networks. Despite the transition toward IPv6, understanding IPv4 addressing remains essential for network professionals, as billions of devices continue to use IPv4 and the addressing concepts directly translate to newer protocols.

IPv4 Address Structure

An IPv4 address consists of 32 binary bits, organized into four 8-bit octets. Each octet represents a decimal value from 0 to 255, resulting in the familiar dotted-decimal notation such as 192.168.1.1. This notation makes IPv4 addresses human-readable while maintaining the 32-bit structure that computers use for routing calculations.

The 32-bit address space provides approximately 4.3 billion unique addresses. While this number seemed generous when IPv4 was designed in the 1970s, the explosive growth of the internet has consumed nearly the entire address space. Address exhaustion led to the development of subnetting, Network Address Translation (NAT), and ultimately IPv6 to extend addressing capability.

Address Classes

IPv4 originally defined five address classes based on the value of the first octet. These classes determined the default network portion and host portion of each address, providing a basic framework for address allocation. While classful addressing has been superseded by Classless Inter-Domain Routing (CIDR), understanding classes remains important for comprehending historical address allocation and some legacy configurations.

Class A (1-126): Class A addresses begin with a first octet between 1 and 126. The first octet defines the network, while the remaining three octets identify hosts within that network. This provides 126 networks with approximately 16.7 million hosts each, suitable for extremely large organizations. The address 127.0.0.1 is reserved for loopback testing and is not allocated as a usable network address.

Class B (128-191): Class B addresses use the first two octets for network identification, with the first octet between 128 and 191. This allows approximately 16,384 networks with 65,534 hosts each. The second octet is included in the network portion, meaning the network address spans 16 bits total.

Class C (192-223): Class C addresses use the first three octets for network identification, with the first octet between 192 and 223. This provides over 2 million networks with up to 254 hosts each. Class C addresses are the most common for small to medium organizations due to their manageable host count per network.

Class D (224-239): Class D addresses are reserved for multicast groups. Unlike unicast addresses assigned to individual devices, multicast addresses identify groups of devices that receive the same traffic. Multicast is used for streaming media, online gaming, and routing protocol communications.

Class E (240-255): Class E addresses were reserved for experimental use and are not available for general allocation. The address range 240.0.0.0 through 255.255.255.254 falls into this category.

Private Address Ranges

Certain IPv4 address ranges are reserved for private networks that do not communicate directly with the public internet. These addresses enable organizations to build internal networks without consuming globally unique addresses. Traffic to and from private addresses must be translated using NAT before accessing the internet.

The private address ranges defined in RFC 1918 include 10.0.0.0/8 (approximately 16.8 million addresses), 172.16.0.0/12 (approximately 1 million addresses), and 192.168.0.0/16 (approximately 65,000 addresses). Organizations commonly use the 10.0.0.0/8 range for large internal networks, 172.16.0.0/12 for medium-sized deployments, and 192.168.x.x for small office and home networks.

The loopback address 127.0.0.1/8 allows a device to send traffic to itself for testing purposes. Traffic sent to any address in the 127.0.0.0/8 range remains local to the device and never traverses the network. Additionally, link-local addresses in the 169.254.0.0/16 range enable automatic address configuration when DHCP servers are unavailable.

Special Addresses

Beyond private addresses, several other IPv4 ranges serve special purposes. 0.0.0.0/8 represents "this network" and is used by hosts during the boot process. The broadcast address 255.255.255.255 reaches all hosts on the local network segment. Directed broadcasts to network addresses (such as 192.168.1.255 for the 192.168.1.0/24 network) allow communication with all hosts within a specific subnet.

Documentation and example addresses are defined in RFC 5737 to prevent confusion with real deployments. The ranges 192.0.2.0/24, 198.51.100.0/24, and 203.0.113.0/24 are designated for use in documentation and should not be routed on public networks. Similarly, TEST-NET addresses (192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24) serve educational and documentation purposes.

Subnet Masks

Subnet masks determine which portion of an IPv4 address identifies the network and which portion identifies the host. Written in dotted-decimal notation (255.255.255.0) or CIDR notation (/24), subnet masks separate the network prefix from the host identifier. The network portion contains all 1s in binary, while the host portion contains all 0s.

Standard subnet masks include /8 (255.0.0.0), /16 (255.255.0.0), and /24 (255.255.255.0), corresponding to Class A, B, and C networks respectively. Variable Length Subnet Masks (VLSM) allow organizations to use non-standard masks that better match their address requirements, reducing waste and improving routing efficiency.

Address Allocation and Management

Internet Registry allocations are managed by regional internet registries (RIRs) including ARIN (North America), RIPE NCC (Europe), APNIC (Asia Pacific), LACNIC (Latin America), and AfriNIC (Africa). These registries allocate address blocks to local internet registries (ISPs), which in turn assign addresses to end-user organizations.

The historical classful allocation scheme proved inefficient, leading to address exhaustion. CIDR (Classless Inter-Domain Routing) replaced classful routing, allowing prefix lengths from /8 to /32 and enabling more granular address allocation. This change extended the IPv4 lifetime by allowing efficient use of remaining addresses.

Conclusion

IPv4 addressing, despite its limitations and eventual replacement by IPv6, remains fundamental to computer networking. Understanding address structure, classes, private ranges, and subnet masks provides the foundation for network design, configuration, and troubleshooting. While IPv6 adoption accelerates, the concepts and principles of IPv4 addressing continue to inform network professional practice and will remain relevant for decades to come.