Question

Difficulty: MediumIPv6 Addressing and Deployment

A network administrator is documenting the configuration of a enterprise web server. The server interface is assigned the uncompressed IPv6 address 2001:0db8:0000:0001:0000:0000:0000:00202001:0\text{db}8:0000:0001:0000:0000:0000:0020. What is the correctly formatted, compressed IPv6 address according to RFC 5952 standard rules?

Answer: 2001:db8:0:1::20 / 2001:DB8:0:1::20

Answer

2001:db8:0:1::20
According to RFC 5952 standard rules for IPv6 address representation: 1) Leading zeros within each 16-bit field must be removed (`0db8` -> `db8`, `0001` -> `1`, `0020` -> `20`). 2) The longest contiguous sequence of all-zero 16-bit fields must be replaced with `::`. The sequence of three zero fields at hextets 5, 6, and 7 is longer than the single zero at hextet 3. Therefore, `0000:0000:0000` is compressed to `::`, while hextet 3 is represented as a single `0`. The resulting canonical address is `2001:db8:0:1::20`.

Step-by-Step Solution

1
Suppress leading zeros in each 16-bit hexadecimal field.
The fields `0db8`, `0000`, `0001`, and `0020` become `db8`, `0`, `1`, and `20` respectively.
RFC 5952 requires that leading zeros in any hextet must be omitted (e.g., `0db8` -> `db8`, `0001` -> `1`).
2
Identify all zero fields and locate the longest consecutive run of all-zero fields.
There is a single zero field at hextet 3 (`0`) and a run of three consecutive zero fields at hextets 5, 6, and 7 (`0000:0000:0000`).
RFC 5952 states that the double colon `::` must replace the single longest contiguous sequence of all-zero fields.
3
Apply double-colon `::` compression to the longest zero run.
Hextets 5, 6, and 7 are replaced by `::`, while hextet 3 remains as a single `0`.
The single zero at hextet 3 cannot be replaced with `::` because a double colon can only appear once in an address, and the run of three zeros takes precedence.
4
Combine the fields into the finalized compressed address string.
`2001:db8:0:1::20`
This represents the strict RFC 5952 canonical representation of the IPv6 address.

Key Concept

RFC 5952 IPv6 Address Text Representation Rules
Rate this question