LOGBOOK

HELP

Quiz Entry - updated: 2026.07.14

What are the two rules for compressing (shortening) IPv6 addresses?

Rule 1: omit leading zeros in each hextet. Rule 2: replace ONE contiguous run of all-zero hextets with :: (usable only once per address).

The two rules just remove zeros that the reader can unambiguously put back, so a full 128-bit address stays writable by hand. Rule 1 drops only leading zeros inside each 4-digit hextet (0db8db8); trailing zeros must stay, because db80 and 0db8 are different values. Rule 2 then collapses a whole run of all-zero hextets into a single ::. The reason :: may appear only once is that expansion works by counting the hextets present and padding the gap — two gaps would be impossible to size unambiguously, so an address like 2001::1::2 is illegal.

IPv6 compression: drop leading zeros, then collapse one zero run with ::

* The two compression rules applied in order, and why a second :: is illegal. *

IPv6 Address Compression Rules:

Rule 1: Omit Leading Zeros

  • Remove leading zeros within each hextet
  • Trailing zeros must remain
Original Compressed
01ab 1ab
00ab ab
000a a
0000 0

Rule 2: Double Colon (::)

  • Replace ONE sequence of consecutive all-zero hextets with ::
  • Can only be used ONCE per address (prevents ambiguity)

Example:

Full:       2001:0db8:0000:0000:0000:0000:0000:0001
Rule 1:     2001:db8:0:0:0:0:0:1
Rule 2:     2001:db8::1

Warning: Using :: twice is INVALID:

  • 2001::1::2 - Invalid! Can't determine how many zeros each :: represents

Go deeper:

From Quiz: NETW1 / IPv6 Addressing | Updated: Jul 14, 2026