IPv6 Addressing
Because IPv4 only supports roughly 4.3 billion addresses, the rapid growth of the Internet led to an address shortage. IPv6 (Internet Protocol version 6) was developed to solve this problem permanently.
Structure of an IPv6 Address
An IPv6 address is 128 bits long (compared to IPv4's 32 bits). This provides a virtually limitless number of addresses ($3.4 \times 10^38$).
IPv6 addresses are represented as eight groups of four hexadecimal digits, separated by colons.
Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Address Simplification Rules
Because IPv6 addresses are long, there are rules to shorten them:
- Omit Leading Zeros: Within any group, you can remove leading zeros.
0db8becomesdb80000becomes0
- Double Colon
::: Consecutive groups of all zeros can be replaced with a double colon::. This can only be done once per address.- The example above becomes:
2001:db8:85a3::8a2e:370:7334
- The example above becomes:
IPv6 Subnetting
IPv6 does not use traditional subnet masks (like 255.255.255.0). Instead, it relies entirely on CIDR notation (prefix length).
Example: 2001:db8:abcd:0012::/64
The /64 means the first 64 bits represent the network routing prefix and the subnet ID, while the remaining 64 bits are the interface ID (identifying the specific host).
A /64 subnet is the standard size for most IPv6 LANs and contains enough addresses for $1.8 \times 10^19$ devices!
Types of IPv6 Addresses
Unlike IPv4, IPv6 does not use broadcast addresses. It uses three main types:
- Unicast: Identifies a single interface. Traffic sent here goes to one specific device.
- Global Unicast: Equivalent to public IPv4 addresses (routable on the internet).
- Link-Local: Equivalent to APIPA (169.254.x.x) in IPv4. Used only on a local network segment. Always starts with
fe80::.
- Multicast: Sent to multiple interfaces in a defined group. Replaces IPv4 broadcasts. Starts with
ff00::. - Anycast: Assigned to multiple devices. Traffic is routed to the "nearest" device sharing that address. Great for load balancing and DNS.
Linux Configuration
You can view your IPv6 addresses using the standard ip command in Linux:
ip -6 address show
You will almost always see a link-local (inet6 fe80:...) address even if your ISP does not yet support global IPv6.