IPv6 addresses: notation, compression and address types
Read a 128-bit address
IPv6 uses 128-bit addresses, usually written as eight groups of four hexadecimal digits separated by colons. Each digit represents four bits; each group represents 16 bits. Unlike dotted-decimal IPv4, a short IPv6 string can represent many omitted zero digits. Both lines below describe the same address. All documentation addresses in this chapter are for offline illustrations, not deployment.
2001:0db8:0000:0000:0000:0000:0000:00012001:db8::1Compress and expand without changing the address
Remove leading zeros inside each group, never trailing zeros. For canonical hexadecimal text, use lowercase, replace the longest run of at least two all-zero groups with ::, and choose the leftmost run if tied. Use :: at most once. To expand, count the explicit groups and insert enough zero groups to reach eight, then pad each group to four digits. A single zero group remains 0 in canonical text. The examples below show an equal-length tie and a single zero group.
2001:db8:0:0:1:0:0:2 -> 2001:db8::1:0:0:22001:db8:1:0:2:3:4:5 -> 2001:db8:1:0:2:3:4:5Recognize address types and scope
Unicast identifies one interface; multicast targets a group; anycast assigns the same address to multiple interfaces and routing selects one destination according to its metric and policy, not necessarily geographic distance. IPv6 has no broadcast address. A global unicast address can be used across networks if assigned and routed appropriately; the familiar 2000::/3 space also contains special-purpose blocks, so a matching prefix alone does not establish Internet reachability. Unique local addresses (fc00::/7, locally generated addresses use fd00::/8) are for limited routing domains. Link-local fe80::/10 stays on one link; a zone identifier may be needed to select the interface, and is not part of the 128 address bits. ::1 is loopback, :: is unspecified, ff00::/8 is multicast and 2001:db8::/32 is reserved for documentation. A host may have several IPv6 addresses on one interface.
fe80::a link-localfd12:3456:789a::1 unique local::1 loopback:: unspecifiedff02::1 link-local all-nodes multicast2001:db8::1 documentationAvoid ambiguous shorthand
2001::db8::1 is invalid because there is no unique way to decide how many zeros belong to each compression marker. 2001:db8:1 is also invalid as a full address because it has too few groups without ::. A text comparison is not a reliable equality check: normalize or compare the numeric values. Try expanding 2001:db8:4::a and explain why fe80::1 alone may not identify an interface on a multi-interface host. Continue to prefix allocation.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
IPv6 addresses: notation, compression and address types — knowledge check
Apply IPv6 concepts to fictional offline scenarios.
How many bits are in one IPv6 hexadecimal group?
Which canonical text represents 2001:0DB8:0000:0000:0000:0000:0000:000A?
Which address has link-local unicast scope?
What does IPv6 use instead of a broadcast address for group delivery?
Why might a zone identifier accompany fe80::1?