IPv4 (Internet Protocol version 4) is the fourth version of the Internet Protocol, utilizing 32-bit addresses to identify devices on a network and route data packets across the internet. Providing a theoretical maximum of approximately 4.3 billion unique addresses, it was the first version of the protocol to be widely deployed and remains a foundational standard for network communication. While IPv6 is its intended successor, IPv4 continues to carry a massive share of global traffic through address-conservation techniques.
How it works
An IPv4 address is written in dot-decimal notation, consisting of four 8-bit numbers (octets) ranging from 0 to 255 separated by periods, such as 172.16.254.1. Each address is divided into a network portion and a host portion using a subnet mask or CIDR notation (for example, /24), allowing routers to determine whether a destination is on the local network or needs to be forwarded elsewhere.
As a connectionless network-layer protocol, IPv4 sends each packet independently without guaranteeing delivery, ordering, or data integrity. Reliability and error recovery are handled by transport-layer protocols like TCP, while real-time, lower-overhead traffic often uses UDP.
- Header Structure: A standard IPv4 header is 20 bytes long and carries metadata including Source Address, Destination Address, Protocol number, and a header checksum.
- TTL (Time to Live): A counter field decremented by one at every router hop; if it reaches zero, the packet is discarded to prevent infinite routing loops.
- Fragmentation: The process of splitting packets into smaller pieces when they exceed the Maximum Transmission Unit (MTU) of an intermediate network link.
Because the 4.3 billion address pool has been exhausted, modern deployments rely heavily on NAT (Network Address Translation) and private IP ranges (defined in RFC 1918: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16) so many internal servers or containers can share a single public IPv4 address.
Example
On a Linux server, you can inspect assigned IPv4 addresses, subnet masks, and network interfaces using the ip utility:
ip -4 addr show eth0
Typical output shows both the assigned address in CIDR notation and the broadcast address:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP
inet 203.0.113.42/24 brd 203.0.113.255 scope global eth0
valid_lft forever preferred_lft forever
What matters when choosing a server or hosting
- Public IPv4 availability and cost: Because unallocated public IPv4 space is scarce, many cloud and VPS providers charge extra monthly fees for dedicated IPv4 addresses or offer IPv6-only instances by default.
- Floating or Elastic IPs: Look for providers that let you reassign a static public IPv4 address between instances so you can fail over or rebuild servers without waiting for DNS propagation.
- Private networking support: Ensure the host provides isolated RFC 1918 private networks so database and application servers can communicate internally without consuming public IPv4 addresses or incurring public bandwidth charges.
- IP reputation and reverse DNS (rDNS): If your server sends transactional email, verify that the assigned IPv4 address is not on spam blocklists and that the host allows custom PTR records.
Common mistakes
- Hardcoding ephemeral IPv4 addresses: Binding configurations directly to a dynamic public IP rather than a DNS hostname or private address causes outages when an instance reboots or migrates.
- Overlapping private subnets: Assigning the same RFC 1918 range (such as
192.168.1.0/24) across multiple VPCs or VPN-connected offices breaks routing between environments. - Blocking ICMP entirely: Dropping all ICMP packets on a firewall breaks Path MTU Discovery, causing silent packet drops and stalled connections when fragmentation is disabled.
- Using real public IPs in documentation or labs: Always use reserved documentation blocks (
192.0.2.0/24,198.51.100.0/24, or203.0.113.0/24) instead of arbitrary addresses that belong to live organizations.
FAQ
Why is IPv4 still used if IPv6 has been available for a long time?
IPv4 and IPv6 are not directly backward-compatible without translation mechanisms. Because legacy applications, ISP networks, and enterprise hardware still rely on IPv4, dual-stack deployments remain standard to ensure universal reachability.
Can a single server have multiple IPv4 addresses?
Yes. A single network interface can bind multiple IPv4 addresses (IP aliasing), which is commonly used to isolate TLS certificates, separate outbound mail streams, or route traffic to different services on the same port.
What is the difference between a public and a private IPv4 address?
A public IPv4 address is globally unique and routable across the open internet, whereas a private IPv4 address is reserved for internal local networks and must pass through NAT to reach external destinations.