A recommendation for a canonical text representation format of IPv6 addresses is presented in this section. The recommendation in this document is one that complies fully with [RFC4291], is implemented by various operating systems, and is human friendly. The recommendation in this section SHOULD be followed by systems when generating an address to be represented as text, but all implementations MUST accept and be able to handle any legitimate [RFC4291] format. It is advised that humans also follow these recommendations when spelling an address.

4.1. Handling Leading Zeros in a 16-Bit Field

Leading zeros MUST be suppressed. For example, 2001:0db8::0001 is not acceptable and must be represented as 2001:db8::1. A single 16- bit 0000 field MUST be represented as 0.

Too right, you MUST drop the zeros. Less typing.

4.2. “::” Usage

4.2.1. Shorten as Much as Possible

The use of the symbol “::” MUST be used to its maximum capability. For example, 2001:db8:0:0:0:0:2:1 must be shortened to 2001:db8::2:1. Likewise, 2001:db8::0:1 is not acceptable, because the symbol “::” could have been used to produce a shorter representation 2001:db8::1.

Good, no more stupid IPv6 ambiguous question on Cisco tests.

4.2.2. Handling One 16-Bit 0 Field

The symbol “::” MUST NOT be used to shorten just one 16-bit 0 field. For example, the representation 2001:db8:0:1:1:1:1:1 is correct, but 2001:db8::1:1:1:1:1 is not correct.

Not sure about this one, but it helps with parsing of scripts I believe.

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.

4.3. Lowercase

The characters “a”, “b”, “c”, “d”, “e”, and “f” in an IPv6 address MUST be represented in lowercase.

Good, now I don’t need the shift key or the caps lock key anymore.

And this is one of my favourites:

Notes on Combining IPv6 Addresses with Port Numbers

There are many different ways to combine IPv6 addresses and port numbers that are represented in text. Examples are shown below.

The situation is not much different in IPv4, but the most ambiguous case with IPv6 is the second bullet. This is due to the “::”usage in IPv6 addresses. This style is NOT RECOMMENDED because of its ambiguity. The [] style as expressed in [RFC3986] SHOULD be employed, and is the default unless otherwise specified. Other styles are acceptable when there is exactly one style for the given context and cross-platform portability does not become an issue. For URIs containing IPv6 address literals, [RFC3986] MUST be followed, as well as the rules defined in this document.

The EtherealMind View

Good. Nice, tidy, rules driven.

Thankyou for listening.

About Greg Ferro

Human Infrastructure for Data Networks. 25 year survivor of Corporate IT in many verticals, tens of employers working on a wide range of networking solutions and products.

Host of the Packet Pushers Podcast on data networking at http://packetpushers.net- now the largest networking podcast on the Internet.

One of the things that annoys me is that there isn’t an accepted name for the 16-bit fields. In IPv4 we call the groupings octets for obvious reasons, there is no accepted name in v6. This usually results in calling them by various names and spending far longer trying to describe them than you do actually working on IPv6 😉

This has certainly streamlined conversations, and we have both used it several times in presentations at various conferences. It started off as an in joke, and then other people started using the term as well.

PS – The name comes from an episode of The Simpsons when they were debating about what to call something.

Network Break Podcast

Network Break is round table podcast on news, views and industry events. Join Ethan, Drew and myself as we talk about what happened this week in networking. In the time it takes to have a coffee.

Packet Pushers Weekly

A podcast on Data Networking where we talk nerdy about technology, recent events, conduct interviews and more. We look at technology, the industry and our daily work lives every week.