IPv6 Structure — Understanding the Format of IPv6 Addresses¶
Unlike IPv4, which uses 32-bit addresses, IPv6 uses 128-bit addresses, providing an enormous address space for the future Internet. IPv6 addresses are written in hexadecimal notation, making them appear very different from IPv4 addresses. Understanding the structure of an IPv6 address is the first step toward learning IPv6 networking, routing, cloud networking, Kubernetes, and enterprise infrastructure. Every Linux administrator, DevOps engineer, Cloud Architect, Platform Engineer, Site Reliability Engineer (SRE), and Network Engineer should understand IPv6 address structure.
Learning Path¶
Course Progress
What You'll Learn¶
After completing this lesson, you'll be able to:
- Understand IPv6 address structure
- Read IPv6 addresses
- Understand hexadecimal notation
- Learn IPv6 address compression
- Understand prefix lengths
- Identify network and interface portions
- Display IPv6 addresses on Linux
Prerequisites¶
Complete:
- Module 2: IPv4 Addressing
- Why IPv6
Why Learn IPv6 Structure?¶
Suppose you see this address:
At first glance it looks confusing.
However, once you understand its structure, reading IPv6 addresses becomes straightforward.
IPv6 Address Size¶
IPv4:
IPv6:
This fourfold increase in address length enables a vastly larger address space.
IPv6 Address Format¶
An IPv6 address contains:
Each group contains:
Example:
IPv6 Layout¶
2001 : 0db8 : 85a3 : 0000 : 0000 : 8a2e : 0370 : 7334
| | | | | | | |
Group1 Group2 Group3 Group4 Group5 Group6 Group7 Group8
There are:
- 8 Groups
- 16 Bits per Group
- 128 Bits Total
Hexadecimal Numbers¶
IPv6 uses Hexadecimal (Base-16) instead of decimal.
Hexadecimal digits are:
Each hexadecimal digit represents:
Hexadecimal Example¶
Binary:
Hexadecimal:
Another example:
Using hexadecimal makes long binary addresses much easier to read.
IPv6 Group Size¶
Each group contains:
Example:
Binary:
Total Structure¶
Network Prefix and Interface Identifier¶
An IPv6 address is commonly divided into:
Example:
Prefix Length¶
Just like IPv4 uses Classless Inter-Domain Routing (CIDR):
IPv6 also uses prefix notation.
Example:
Meaning:
Leading Zero Suppression¶
Leading zeros within a group may be omitted.
Example:
Before:
After:
Only leading zeros may be removed.
Zero Compression¶
If one or more consecutive groups contain only zeros, they can be replaced with:
Example:
Before:
After:
Compression Rule¶
The double colon (::) can be used:
within a single IPv6 address.
Incorrect:
Correct:
Full vs Compressed Address¶
Full:
Compressed:
Both represent exactly the same IPv6 address.
Another Example¶
Full:
Compressed:
IPv6 Prefix Examples¶
| Prefix | Meaning |
|---|---|
| /32 | Large Network Allocation |
| /48 | Enterprise Site |
| /56 | Small Organisation |
| /64 | Standard LAN Subnet |
| /128 | Single Interface Address |
The /64 prefix is the most common subnet size in IPv6.
Why is /64 Common?¶
IPv6 was designed so that:
Many IPv6 features, including Stateless Address Autoconfiguration (SLAAC), assume a /64 subnet.
Example Address Breakdown¶
Address:
Network Prefix:
Host Portion:
IPv4 vs IPv6 Structure¶
| IPv4 | IPv6 |
|---|---|
| 32 Bits | 128 Bits |
| Decimal | Hexadecimal |
| 4 Octets | 8 Groups |
Dots (.) | Colons (:) |
| Maximum 255 per Octet | Four Hex Digits per Group |
Enterprise Example¶
Company Network:
Departments:
Each department receives its own /64 subnet.
Cloud Perspective¶
Cloud providers assign IPv6 prefixes to:
- Virtual Private Clouds (VPCs)
- Virtual Networks (VNets)
- Virtual Machines
- Kubernetes Clusters
- Load Balancers
Example:
Subnets:
Kubernetes Perspective¶
Modern Kubernetes clusters support IPv6.
Example:
Service:
IPv6 networking works similarly to IPv4 but with a much larger address space.
Linux Perspective¶
Display IPv6 addresses.
Display IPv6 routes.
Ping localhost over IPv6.
Hands-on Lab¶
Task 1¶
Display IPv6 addresses.
Task 2¶
Display IPv6 routing information.
Task 3¶
Compress the following IPv6 address:
Task 4¶
Expand the following IPv6 address:
Task 5¶
Identify:
- Network Prefix
- Interface Identifier
for:
Task 6¶
Explain why the following address is invalid:
Task 7¶
Create a comparison table showing the differences between IPv4 and IPv6 address structures.
Task 8¶
Research the IPv6 prefix assigned by your Internet Service Provider (ISP) or cloud provider (if available) and identify its prefix length.
Linux Commands¶
| Command | Purpose |
|---|---|
ip -6 addr | Display IPv6 addresses |
ip -6 route | Display IPv6 routes |
ping -6 | Test IPv6 connectivity |
hostname | Display hostname |
Common Mistakes¶
❌ Treating IPv6 like IPv4.
✅ Learn hexadecimal notation and IPv6 grouping.
❌ Using :: more than once.
✅ A double colon can appear only once in an IPv6 address.
❌ Removing trailing zeros.
✅ Only leading zeros within a group may be omitted.
❌ Forgetting prefix lengths.
✅ Always evaluate IPv6 addresses together with their prefix length.
❌ Assuming /64 is optional.
✅ /64 is the standard subnet size for most IPv6 LANs.
Best Practices¶
- Practice reading IPv6 addresses daily.
- Learn hexadecimal numbers thoroughly.
- Use compressed notation where appropriate.
- Understand both expanded and compressed formats.
- Standardise on
/64for IPv6 LAN subnets unless a specific design requires otherwise. - Document IPv6 addressing plans clearly.
Interview Questions¶
Beginner¶
- How many bits are in an IPv6 address?
- Why does IPv6 use hexadecimal?
- How many groups are in an IPv6 address?
- What does
/64represent?
Intermediate¶
- Explain IPv6 address compression.
- Why can
::only appear once? - Compare IPv4 and IPv6 address structures.
- What is the difference between the network prefix and the interface identifier?
Architect Level¶
- Design an IPv6 addressing scheme for an enterprise.
- Explain why
/64is the standard subnet size. - How would you allocate IPv6 prefixes for cloud and Kubernetes environments?
Summary¶
In this lesson, you learned:
- IPv6 address structure
- 128-bit addressing
- Hexadecimal notation
- Eight-group format
- Prefix lengths
- Leading zero suppression
- Zero compression
- Network prefix and interface identifier
- Linux IPv6 commands
IPv6 addresses are significantly larger than IPv4 addresses but follow a logical and consistent structure. Understanding hexadecimal notation, prefix lengths, and compression rules makes IPv6 addresses much easier to read and manage. These concepts form the foundation for IPv6 routing, address types, and automatic address configuration.
Key Takeaways¶
- IPv6 addresses are 128 bits long.
- An IPv6 address contains 8 groups of 4 hexadecimal digits.
- Leading zeros may be omitted within a group.
- Consecutive zero groups may be compressed using
::once per address. /64is the standard subnet size for most IPv6 networks.- IPv6 uses hexadecimal notation to represent large binary values efficiently.
What's Next?¶
In the next lesson, you'll learn about Types of IPv6 Addresses.
You'll explore:
- Unicast Addresses
- Multicast Addresses
- Anycast Addresses
- Global Unicast
- Link-Local Addresses
- Unique Local Addresses (ULA)
- Special IPv6 addresses
By the end of the lesson, you'll understand the different IPv6 address types, when each is used, and how they enable communication in enterprise, cloud, and Kubernetes environments.