NOYB
NOYB

Reputation: 695

For IPv6 address with multiple equal length consecutive zero blocks, which one should be compressed?

ex:

1:0:0:4:0:0:7:8
1::4:0:0:7:8
1:0:0:4::7:8

Read somewhere the left most should win tiebreaker. Is that correct? Is there a standard/requirement? From RFC 5952 2.2 it appears one can chose which group to compress.

If there is no standard/requirement, what are the pros/cons to left or right? Is there a convention?

Upvotes: 1

Views: 484

Answers (1)

Ron Maupin
Ron Maupin

Reputation: 6462

RFC 5952, A Recommendation for IPv6 Address Text Representation, which is a Standards Track RFC, explains that when given the choice of two equal-length, consecutive zero blocks, you must compress the leftmost zero block.

4.2.3. Choice in Placement of "::"

When there is an alternative choice in the placement of a "::", the longest run of consecutive 16-bit 0 fields MUST be shortened (i.e., the sequence with three consecutive zero fields is shortened in 2001: 0:0:1:0:0:0:1). When the length of the consecutive 16-bit 0 fields are equal (i.e., 2001:db8:0:0:1:0:0:1), the first sequence of zero bits MUST be shortened. For example, 2001:db8::1:0:0:1 is correct representation.

Upvotes: 2

Related Questions