Question

Difficulty: MediumIPv6 Addressing and Prefixes

Match each fully expanded IPv6 address on the left with its standard canonical compressed representation on the right according to RFC 5952 rules.

  • 2001:0db8:0000:0000:0042:0000:0000:00012001:db8::42:0:0:1
  • 2001:0db8:0000:00ab:0000:0000:0000:00012001:db8:0:ab::1
  • fe80:0000:0000:0000:0000:0000:0000:0001fe80::1
  • 2001:0db8:0000:0000:0000:00b0:0000:00002001:db8::b0:0:0

Answer

The correct pairings match each expanded IPv6 address to its RFC 5952 canonical compressed form: 2001:0db8:0000:0000:0042:0000:0000:0001 pairs with 2001:db8::42:0:0:1; 2001:0db8:0000:00ab:0000:0000:0000:0001 pairs with 2001:db8:0:ab::1; fe80:0000:0000:0000:0000:0000:0000:0001 pairs with fe80::1; and 2001:0db8:0000:0000:0000:00b0:0000:0000 pairs with 2001:db8::b0:0:0.
The correct pairings strictly adhere to RFC 5952 canonical formatting rules: leading zeros within any 16-bit field are omitted, the single longest contiguous sequence of zero-value 16-bit fields is replaced with ::, and when sequences of zero fields are equal in length, the first sequence is compressed.

Step-by-Step Solution

1
Remove leading zeros from each 16-bit hexadecimal field (hextet).
Fields such as '0db8' become 'db8', '0042' becomes '42', '0000' becomes '0', and '0001' becomes '1'.
RFC 5952 requires leading zeros to be suppressed in every hextet.
2
Identify contiguous zero hextets and apply the double colon (::) compression rule.
For 2001:0db8:0000:0000:0042:0000:0000:0001, there are two equal runs of 2 zero hextets. Compress the first run to yield 2001:db8::42:0:0:1.
When zero sequences are of equal length, RFC 5952 requires compressing the first sequence.
3
Evaluate remaining addresses for longest zero sequence compression.
Compress the sequence of 3 zero hextets in 2001:0db8:0000:00ab:0000:0000:0000:0001 to get 2001:db8:0:ab::1, and the 6 zero hextets in fe80:0000:0000:0000:0000:0000:0000:0001 to get fe80::1.
The double colon must represent the maximum possible consecutive zero hextets when lengths differ.

Key Concept

IPv6 Address Compression and Canonical Representation (RFC 5952)
Rate this question