Summary
Highlights
IPv4 is a fundamental network protocol. It's a 32-bit address, represented in four decimal numbers called octets (e.g., 192.168.1.131). Each octet is 8 bits (a byte) and can range from 0 to 255. A full IPv4 address is 32 bits or 4 bytes long.
Every device on the public internet needs a unique IPv4 address. There are approximately 4.29 billion IPv4 addresses. However, with over 20 billion internet-connected devices, a mechanism like Network Address Translation (NAT) is used to conserve public IPv4 addresses. NAT allows internal private addresses to communicate externally through a single public IP.
RFC 1918 defines ranges of private IP addresses for internal networks that do not count towards the public IPv4 address pool. Common ranges include: 10.0.0.0/8 (over 16 million addresses) for large networks, 172.16.0.0/12 (over 1 million addresses) for medium networks, and 192.168.0.0/16 (over 65,000 addresses) often used in home networks.
IPv6 was designed to overcome the address limitations of IPv4. It uses a 128-bit address, providing a massive 340 undecillion possible addresses, effectively eliminating address scarcity. This allows many addresses per person globally.
IPv6 addresses are represented in hexadecimal format (e.g., fe80:0000:0000:0000:5d18:0652:cffd:8f52) rather than decimal to condense the longer address. Each segment is 16 bits (2 octets), and the total address is 128 bits or 16 bytes. Colons separate the 8 blocks of hexadecimal characters.
Due to the length and complexity of IPv6 addresses, DNS becomes crucial for users to access resources by name rather than memorizing addresses. Subnetting is less common in IPv6 because of the immense address space. The first 64 bits typically serve as the network prefix, with a default subnet mask of /64, and the remaining 64 bits are for the host address.