Updated on February 26, 2025
IPv4, or Internet Protocol version 4, is a core technology that makes modern networking possible. It helps devices identify each other, communicate, and send data across the internet and private networks.
That said, IPv4 has its limitations—most notably, the shortage of available addresses. This issue led to the creation of IPv6. In this blog, we’ll explore IPv4 in detail, covering its architecture, how it works, its features, and the challenges that highlight the need for IPv6.
Definition and Core Concepts
What Is IPv4?
IPv4 is a connectionless protocol that works at Layer 3 (Network Layer) of the OSI model. It identifies devices on a network and ensures data packets reach their destination. Using 32-bit addresses, IPv4 can provide about 4.3 billion unique addresses—a number that once seemed enough but has since fallen short.
IPv4 Address Structure
IPv4 addresses are composed of four 8-bit octets, written in the familiar dotted decimal format (e.g., 192.168.1.1). Each octet can range from 0 to 255.
- Public vs. Private Addresses
- Public IPv4 addresses are globally unique and used to identify devices on the internet.
- Private IPv4 addresses, defined by RFC 1918, are restricted to internal networks (e.g., 192.168.0.0/16).
- Unicast, Broadcast, and Multicast Addresses
- Unicast is for one-to-one communication.
- Broadcast is for one-to-all communication within a network.
- Multicast allows one-to-many communication but only to subscribers of a specific group.
How IPv4 Works
Packet-Based Communication
IPv4 transmits data in the form of packets. Each packet contains two critical components:
- Header – Includes source and destination IP addresses, along with other metadata like Time-to-Live (TTL).
- Payload – Holds the actual data being sent (e.g., an email or web page request).
Routing and Address Resolution
IPv4 uses routing tables to determine the best path for a packet. When traveling across networks, the Address Resolution Protocol (ARP) maps IP addresses to MAC (Media Access Control) addresses, ensuring that packets reach their intended devices.
Fragmentation and Reassembly
When a data packet exceeds the Maximum Transmission Unit (MTU) size of a network, it is fragmented into smaller packets. Once these packets arrive at the destination, IPv4 ensures they are reassembled in the correct order.
Key Features and Components of IPv4
Hierarchical Addressing
IPv4 implements hierarchical addressing to logically organize networks, facilitating efficient routing and traffic management.
Subnetting and CIDR
- Subnetting divides a network into smaller sub-networks, making better use of available IP addresses.
- CIDR (Classless Inter-Domain Routing) replaces the traditional class system, allowing variable-length subnet masks for more efficient allocation.
Network Address Translation (NAT)
NAT allows multiple devices within a private network to share a single public IP address. This has significantly extended the lifespan of IPv4 by conserving public addresses.
Best-Effort Delivery
IPv4 operates on a “best-effort” delivery model. It does not guarantee successful delivery of packets, leaving reliability to higher-layer protocols like TCP.
IPv4 Addressing and Subnetting
IPv4 Address Classes
IPv4 addresses are categorized into five classes based on their leading bits and range.
- Class A (1.0.0.0 – 126.255.255.255): For large networks, with up to 16 million hosts.
- Class B (128.0.0.0 – 191.255.255.255): For medium-sized networks, with up to 65,536 hosts.
- Class C (192.0.0.0 – 223.255.255.255): For small networks, with up to 254 hosts.
- Class D (224.0.0.0 – 239.255.255.255): For multicast applications.
- Class E (240.0.0.0 – 255.255.255.255): Reserved for experimental use.
Subnetting
Subnetting uses subnet masks to divide networks into smaller segments. Common subnet masks include:
- 255.255.255.0 (/24): Supports 256 IPs per subnet.
- 255.255.0.0 (/16): Supports 65,536 IPs per subnet.
IPv4 Address Exhaustion and Workarounds
The Exhaustion Problem
With the rapid growth of the internet—fueled by smartphones, IoT, and global connectivity—the pool of available IPv4 addresses has been nearly depleted.
Workarounds to Address Shortages
- CIDR reduces address waste by enabling more flexible allocations.
- Private IP Addressing & NAT allows devices in private networks to communicate using shared public IPs.
- Migration to IPv6 expands address space to accommodate future growth, supporting approximately 3.4 x 10^38 unique addresses.
Security Considerations in IPv4
Challenges
- IP Spoofing: Attackers disguise their source IP address to impersonate legitimate devices.
- Man-in-the-Middle (MitM) Attacks: The lack of encryption in IPv4 enables unauthorized interception of data.
- No Native Authentication: IPv4 does not include built-in security mechanisms like IPsec, which are standard in IPv6.
Best Practices
- Implement firewalls to block unauthorized traffic.
- Use VPNs to encrypt communications.
- Transition to IPv6 for its built-in security features.
Key Terms Appendix
- IPv4 Address: A unique 32-bit identifier assigned to a device on a network.
- Subnet Mask: Differentiates the network and host portions of an IP address.
- NAT (Network Address Translation): Maps multiple private IPs to a single public IP, conserving address space.
- ARP (Address Resolution Protocol): Resolves IP addresses to MAC addresses on a network.
- CIDR (Classless Inter-Domain Routing): Enables efficient allocation of IP addresses outside the traditional class system.
- IPv6: The successor to IPv4, offering vastly expanded address capacity.
- Public vs. Private IPs: Public addresses are globally routable, while private addresses are used within local networks.