What is IPv4?
IPv4 (Internet Protocol version 4) is the fourth version of the Internet Protocol and the first to be widely deployed, using 32-bit addresses to identify devices on networks and route traffic across the internet.IPv4 Address Structure
IPv4 Address Format:
┌─────────┬─────────┬─────────┬─────────┐
│ Octet 1 │ Octet 2 │ Octet 3 │ Octet 4 │
│ 8 bits │ 8 bits │ 8 bits │ 8 bits │
└─────────┴─────────┴─────────┴─────────┘
192 . 0 . 2 . 1
Binary: 11000000.00000000.00000010.00000001
Decimal: 192.0.2.1
Total: 32 bits = 2^32 = 4,294,967,296 addresses
Address Classes (Historical)
| Class | Range | Default Mask | Network Bits | Host Bits | Networks |
|---|---|---|---|---|---|
| A | 1.0.0.0 - 126.255.255.255 | 255.0.0.0 | 8 | 24 | 126 |
| B | 128.0.0.0 - 191.255.255.255 | 255.255.0.0 | 16 | 16 | 16,384 |
| C | 192.0.0.0 - 223.255.255.255 | 255.255.255.0 | 24 | 8 | 2,097,152 |
Reserved Address Ranges
| Range | Purpose |
|---|---|
| 10.0.0.0/8 | Private network (Class A) |
| 172.16.0.0/12 | Private network (Class B) |
| 192.168.0.0/16 | Private network (Class C) |
| 127.0.0.0/8 | Loopback (localhost) |
| 169.254.0.0/16 | Link-local (APIPA) |
| 192.0.2.0/24 | Documentation (TEST-NET-1) |
| 0.0.0.0/8 | Current network |
| 255.255.255.255 | Broadcast |
IPv4 vs IPv6 Comparison
| Feature | IPv4 | IPv6 |
|---|---|---|
| Address size | 32 bits | 128 bits |
| Address format | Dotted decimal | Hexadecimal with colons |
| Total addresses | ~4.3 billion | ~340 undecillion |
| Example | 192.0.2.1 | 2001:db8::1 |
| NAT required | Often | Rarely |
| Configuration | DHCP/manual | SLAAC/DHCPv6 |
IPv4 Exhaustion
IPv4 Address Depletion Timeline:
├── 2011: IANA pool exhausted
├── 2011-2015: Regional pools depleted (APNIC, RIPE, ARIN)
├── 2017: LACNIC exhausted
├── 2019: AFRINIC final /8
└── Present: Secondary market, NAT, IPv6 transition
Common Uses in DNS
| DNS Record | Purpose | Example |
|---|---|---|
| A Record | Maps domain to IPv4 | example.com A 192.0.2.1 |
| PTR Record | Reverse DNS | 1.2.0.192.in-addr.arpa PTR example.com |
Mitigation Strategies
- NAT (Network Address Translation): Share public IPs among private hosts
- CIDR (Classless Inter-Domain Routing): More efficient address allocation
- IPv6 Transition: Dual-stack, tunneling, translation
- Address markets: Transfer unused allocations
Best Practices
1. Plan for IPv6: New deployments should be dual-stack
2. Use private addresses internally: Reserve public IPs for edge services
3. Document allocations: Track IP usage to avoid conflicts
4. Implement proper subnetting: Efficient use of available addresses
5. Configure both A and AAAA records: Support both IPv4 and IPv6 clients
IPv4 remains the backbone of internet communication while IPv6 adoption grows to address exhaustion challenges.