Tyler's Site

Abstract

I am going to be making a series of blog posts going over IPv6, everything from some basic theory to actually getting it implemented into your network. This is the first post on the topic, and will mostly be going over the basic concepts of IPv6 as an introduction for anyone unfamiliar with IPv6; additionally, it will also be sharing the resources I have found for studying and learning IPv6.

Before going to far into this post, I want to preface it by saying this post is intended to be a primer for IPv6 and thus will not be complete. For more in-depth and thoroughly explained information on the subject, the main reference I am using to write this post is a book called Book 6 which has a lot more in-depth information than what I will include here. For those wanting to truly understand IPv6 in great detail, I would recommend giving that a read; the book has a lot of history and good practices when working with IPv6, complete with references on RFCs and case studies.

Where is IPv5?

Before really getting into anything to do directly with IPv6, let’s talk about IPv5. Specifically, where is version 5? IPv5 was a real protocol called Internet Stream Protocol, which was intended to be used for things like audio and video calls over the less than reliable Internet connections of the time.

Because the protocol was completely incompatible with IPv4, a new designation was required and 5 was the next available number. Eventually as Internet connections got faster and more reliable, ST became unnecessary and never saw real world use.

When IPv6 was defined later that year in RFC 1883, the headers were also completely incompatible with previous versions of IP, thus requiring a new designation number with the next available one being 6.

Why Learn IPv6?

So, why should you learn IPv6? put bluntly, most people’s answer on this is because they have to. Dealing with an IPv6 network is often spoken of as fondly as printers are among IT workers; given the massive annoyance that IPv6 is, why would you take the time to learn it if you don’t have to? The main reason I am putting in the effort to learn it is to better understand IP schemes on the open Internet; IPv6 adoption has grown massively over the last five years, and many countries have goals of having IPv6 majority within the next five to ten years. While it is unlikely that I will be working in a position that understanding IPv6 will be critical, it will not generally be problematic to bring such knowledge with me.

IPv6 Basics

So, why do people complain about learning IPv6 so much? IPv6 does not change fundamental networking concepts such as encapsulation and the OSI Model are the same as in IPv4; however, the implementation details between the two are very different. The core change that IPv6 brings over IPv4 is that addresses are 128 bit rather than 32 bit. Because of the sheer quantity of usable addresses in IPv6 vs IPv4 (340282366920938463463374607431768211456 vs 4294967296), the format changed from decimal notation to hexadecimal notation. By itself that change is not awful, however, the implications of this change cause a lot of headaches when trying to translate the ideas from IPv4 to IPv6. In general, IPv6 has a direct analog, if not re-implementation, of IPv4 concepts, but the details of implementing and maintaining them are quite different and often allow for more choice by the network operator.

Addressing

As stated above, IPv6 addresses use hexadecimal format for representing addresses, for example:

2001:0db8:aaaa:0000:0000:0000:9876:cafe

This address looks very annoying to deal with because it is quite long, and many of the characters are tedious to type (specifically the colons). While the intent is that IPv6 addresses should be copied and pasted, but on occasion that is not possible for one reason or another. Thankfully, IPv6 has some compression mechanisms that make dealing with addresses slightly less terrible. The first mechanism is to drop leading zeros in each chunk. Applying this to our previous address would change it to:

2001:db8:aaaa:0:0:0:9876:cafe

We can further compress the address with the second mechanism, which is to replace a consecutive grouping of zeros with a double colon like so:

2001:db8:aaaa::9876:cafe

The double colon can be used once per address, and can shorten as many or as few zeros as desired. Being able to only use it once per address is to avoid confusion on how many bits are zeros, as it would be impossible to be able to tell with 100% certainty how many consecutive chunks are zeros.

The details for representing IPv6 addresses is described in detail in RFC 5952 in section 4; in short that section describes:

Special Purpose IPv6 Addresses

Much like IPv4, some addresses and address ranges have a special reservation, and cannot be used for another purpose.

Address Types

The next detail to cover is address types and address prefixing. All IPv6 addresses are broken into two parts, the prefix and the Interface Identifier (IID). The prefix is the part of the address that identifies the subnet of the network; this is very similar to CIDR Notation for representing address ranges in IPv4. The IID is the part of the address that represents the specific device on the network. For privacy reasons (that being having an address that is not easily guessable) it is generally recommended that the IID be made of pseudo-random bits. One method of generating these pseudo-random bits was based around the MAC address of the device, however, that has since been deprecated.

Unicast Addresses

The most common type of addresses in the world of IPv6 is Routable Unicast Addresses; these tend to come in two varieties Globally Unique Addresses (GLA) and Unique Local Addresses (ULA) GUAs are intended to be publicly facing over the opened Internet and will usually belong to one of two glasses: Provider Independent (PI) and Provider Assigned (PA). Between the two, PA prefixes are usually preferred because all of the prefixes for a particular customer can be aggregated in one BGP-4 announcement, while each new PI prefix will add to the global routing tables and reducing performance.

ULAs are intended to be used locally and have the following benefits:

  1. They are self-allocated by a particular network for its own internal use.
  2. They are all under a /48 prefix that includes a locally assigned pseudo-random 40 bit part
  3. The MUST NOT be routed over the open Internet, so to remain private.

ULA prefixes usually start with ‘fd’, with many networks using fd00::/48. This is not good practice though because the merging of two such networks will break things.

Anycast Addresses

Anycast addresses are, for all intents and purposes, identical to unicast addresses. Thus any GUA or ULA can be treated as an anycast address. A special case for this is an address with the IID set to zero. This addresses is for use by the subnet-router anycast address. For example:

2001:db8:23:13fe::/64

Link Local Addresses (LLA) are strictly for use within a local network and will never be forwarded by a router, but will be forwarded by a layer 2 switch. This function is essential to reach the first-hop router. LLAs are specific to their interfaces; hosts with multiple interfaces will have different addresses on each one.

LLAs are shown by the zone at the end of the address, an example follows:

fe80::1234:0:abcd:13:fefe%eth0

Embedded IPv4 Addresses

It is possible to embed IPv4 addresses into IPv6 addresses in certain circumstances, but is a bit outside the depth of this post. For more information on the topic, refer to RFC 4038.

Multicast Addresses

All IPv6 multicast addresses are under the ff00::/8 prefix. That is, they all start with ff with the next 8 bits having a special meaning. These meanings are covered in subsection 2.7 of RFC 4291. # Address Configuration IPv6 has three main mechanisms for configuring addresses for end devices:

The static address configuration (manually setting an IP on each device) and DHCP operate in a very similar way to how they did in IPv4. SLAAC, however, is new and operates quite a bit differently to the other address configuration methods. Unfortunately, it is also one that cannot be ignored as it is very widely used by many end devices; for example, the Android operating system has no support for DHCPv6, only allowing for obtaining an IPv6 address via SLAAC.

SLAAC was first introduces in RFC 1971 and was created because during the creation of IPv6, DHCP was not commonly deployed on networks the same way it is today. Additionally, it was intended to make configuring networking devices on simple networks much easier by not requiring a separate configuration protocol. This results in things like neighbor discovery and router advertisement being a requirement for even complex IPv6 networks.

For SLAAC to work, the first-hop router on the network MUST listen to the link local all-routers multicast address, defined as ff02::2. New nodes will send a Router Solicitation ICMPv6 messages to that address. From there, each router will respond with a router advertisement; these router advertisements are rather complex, but are defined in RFC 4861 for those interested.

SLAAC is something that must be supported by all IPv6 nodes in the event that they find themselves on a network where it is the only method of acquiring an address.

Key Differences

For a TL;DR, these are some of the key take aways re-phrased from Book 6 in the ‘IPv6’ primary differences from IPv4 section:

For much more in-depth material on learning IPv6, that is a great resource to get started. For even more information, going through the RFCs outlined in that book is also a wonderful way to learn more about the standards, and how the technology is supposed to work. Often times, the RFCs also include specific recommendations on how things should be managed and best practices for dealing with many of the complexities in these networks.