Soru

Zorluk: OrtaIPv6 Addressing and Deployment

A network engineer is documenting the IPv6 address allocation for an enterprise router interface. The fully expanded, uncompressed address assigned to the interface is 2001:0db8:0000:0042:0000:0000:0000:0007. According to RFC 5952 rules, what is the correctly compressed and canonicalized representation of this IPv6 address?

Cevap: 2001:db8:0:42::7

Cevap

2001:db8:0:42::7
According to RFC 5952 standards for IPv6 address canonicalization: 1) Leading zeros within each 16-bit field must be removed (0db8 -> db8, 0042 -> 42, 0007 -> 7). 2) A single all-zero field is written as 0. 3) The double-colon (::) must be used to compress the longest contiguous sequence of all-zero fields. In this address, the sequence of three zeros (0000:0000:0000) is longer than the single zero field, making 2001:db8:0:42::7 the only correct canonical compressed address.

Adım Adım Çözüm

1
Suppress leading zeros in each 16-bit hexadecimal field (hextet).
2001:0db8 becomes 2001:db8; 0000 becomes 0; 0042 becomes 42; 0000:0000:0000 becomes 0:0:0; 0007 becomes 7. The intermediate string is 2001:db8:0:42:0:0:0:7.
RFC 5952 requires removing leading zeros within each hextet while preserving a single zero for any all-zero hextet.
2
Identify all contiguous sequences of all-zero hextets and select the longest sequence to compress using double-colon (::).
Sequence 1 is at index 3 (length 1: '0'). Sequence 2 is at indices 5-7 (length 3: '0:0:0'). The longer sequence (length 3) is replaced with '::'.
RFC 5952 specifies that double-colon (::) must replace the longest contiguous run of all-zero hextets. Shorter single-zero hextets must remain as a single '0'.
3
Combine the compressed sections into the final canonical IPv6 address.
2001:db8:0:42::7
Ensures full compliance with RFC 5952 formatting and lowercase hexadecimal standards.

Anahtar Kavram

RFC 5952 IPv6 Address Compression and Canonical Representation
Bu soruyu puanla