4. Addressing IPv6
So, if you thought subnetting
IPv4 was confusing, wait until you meet its younger brother, IPv6!
That's actually only a joke. In truth, addressing IPv6 isn't as bad as
you would think. But when most people even look at IPv6 addresses, they
immediately assume they must be inherently evil because of their obvious
unreadability. If you look at an IPv6 address like
4305:A93E:BADC:8956:3586:8D9C:7032:1423, it looks like garbage. You may
know instinctively upon seeing it that it's been laid out in IPv6
format, but it just seems like a lot of random numbers and letters
thrown together in one place. Thankfully, there's a lot of reason behind
the seeming randomness.
4.1. IPv6 Shorthand Notation
One of the quickest ways
you can identify and evaluate an IPv6 address is by using its shorthand
notation. As you can tell, a full-length IPv6 address is very long. But
thankfully, most of the time, you will see a lot of zeros in an IPv6
address. A very realistic example of one you may encounter is the
reserved multicast address FF02:0000:0000:0000:0000:0000:0001:0002.
As you can see, this
particular address has a seemingly excessive amount of zeros (25, in
fact). Accordingly, you can shorten this by using the :: notation, which
essentially means "use zeros until." When you see this symbol start,
from that point on, you can insert zeros until you reach a number. Then,
after this number, you can see how many sets of single : have been used
to see what octet it represents. And just to make things even easier,
if an octet is preceded by a few zeros, such as the octet 0002, you
simply write this as 2 behind the : symbol. This sounds complicated, but
it's actually pretty easy. The previous example in shorthand would be
FF02::1:2.
In plain English, this means
"FF02 is my first octet; then I keep going until I reach an octet that
ends in 1, and then my last octet has a 2." Let's try it—it will
probably make sense if you do it one part at a time by using a simple
step-by-step procedure:
Count
how many octets are at the end. In this case, there are two octets. One
octet contains one, and the other octet contains two.
Place
zeros until you reach the first of the octets at the end. Here, you
start with FF02 and then place zeroes until the seventh octet, which
ends in a 2:
FF02:0000:0000:0000:0000:0000:0001:XXXX
Check the remaining octets for possible shorthand; then place zeros to fill them in.
You
have one octet that has two written in shorthand. Therefore, the octet
must be 0002. And thus, you have the complete address:
FF02:0000:0000:0000:0000:0000:0001:0002.
4.2. Anatomy of IPv6
IPv6 addresses are beautiful
because of their absolute simplicity. Before, when you dealt with an
IPv4 address, there was a lot of confusion. What part of the address
belongs to the Internet service provider? Where is the subnet portion of
the address? Better yet, where is the host? In IPv6, these are no
longer concerns.
All IPv6 addresses can be
broken down into two distinct portions, which can further be subdivided
to a point that just about every portion of the address is accounted
for. On the base level, IPv6 addresses are broken into two 64-bit
portions, one of which is called the prefix portion and one of which is called the host portion, or the interface ID. Visually, the address looks like Figure 7.
In one fell swoop, you can
cover the second portion of the address. It's just the host portion of
the network. In more technical terms, the 65th to the 128th bit of your
address is completely dedicated to assigning the address to your hosts.
That's a lot of hosts! It's more, in fact, than even some of the largest
enterprises on the planet would ever use. However, when the IEEE
designed IPv6, it didn't want to run into a situation where anyone would
ever have to worry about having "enough" host addresses ever again. I
think it's safe to say they've succeeded. 2⁁64 is such a large number
that if you were to take that many pennies and stack them up one after
another, you'd be able to reach Mars more than 300,000 times. Or, if
you'd like to think of it in more Microsoft terms, you'd be able to have
230,584,300 times the amount of money of Bill Gates (when he was worth
80 billion).
The first portion of an IPv6 address, called the address prefix,
is a little bit more complicated, but not too much so. To begin, one of
the real issues that IPv6 was meant to fix was to give service
providers their own reserved section of the IP address that would
identify whatever service provider was issuing the address. Accordingly,
the IEEE assigned the first 48 bits of the prefix portion of the
address to the service provider. Then, with the remaining 16 bits, it
allocated a portion to be used for subnet addressing. You can see
another visual interpretation of this in Figure 8.
The main reason that only 16 bits
has been assigned to the subnet portion is actually pretty reasonable.
After all, how often do you run across an organization that will need
more than 65,536 subnets? The answer is not very often. And thus, only a
small portion of the overall 128 bits is assigned. In just a moment,
I'll go over how subnetting this portion of an address is slightly
different than it was with IPv4. But for the moment, I'll take a step
back and talk about those first 48 bits before the 16 bits of the subnet
portion.
There are three organizations that take a bite out of the first 48 bits of addresses. These are the ICANN, RIR, and ISPs:
Internet Corporation for Assigned Names and Numbers (ICANN)
Regional Internet Registry (RIR)
Your Internet service provider (ISP)
Thankfully, the exact scope of
the importance of these organizations is outside the objectives of this
exam. Suffice to say, the Internet address prefix goes through three
filters going from ICANN to RIR to ISP that more and more uniquely
define the coverage area of these addresses.
4.3. IPv6 Address Types
One of the biggest changes
that came with IPv6 was the complete and total removal of the concept
of a broadcast address. And if you ask most busy administrators, that's a
good thing. The reason is that IPv6 has instead replaced the need for
broadcast addresses with the concept of multicast addressing. The word multicast
is getting a little ahead of myself, so I'll start by defining the
three different types of addresses that are available to you in IPv6:
Unicast
A unicast address is an
address that is assigned to a particular host so that host, and only
that one particular host, can send and receive data. It's equivalent to
saying "You and only you are identified as this."
Multicast
A multicast address is
effectively a grouping of addresses that is addressed for the point of
sending and receiving information to that group. So, if you wanted to
send a broadcast of information, you could send it to a particular
multicast group.
Anycast
The name is a bit confusing,
but an anycast address is similar to a multicast address in that it's
sent to a particular group of addresses, but only the address "nearest"
to it. So, instead of sending it to every member of the group, it sends
to a particularly near member of that group.
For the purposes of this
book, I'll concentrate on unicast addresses, because they're what you as
an administrator most care about. Concepts such as multicast addressing
are more designed toward network administration and engineering,
because they determine what particular routing protocols are used and
where they can and cannot be broadcast throughout the network.
4.4. IPv6 Static and Dynamic Addressing
Just like IPv4, IPv6
addresses can be assigned both dynamically and statically. If an
administrator for some reason wants to assign a particular address to
some device within their network, they most certainly may. Furthermore,
there are plenty of new methods to dynamically assign IPv6 addresses to
devices through the use of Dynamic Host Control Protocol version 6
(DHCPv6).
However, there are a few
differences to which you need to pay careful attention. In particular,
you need to be interested in the conventions IPv6 uses to effectively
assign addresses throughout the entire network. In total, there are four
possible combinations—two of which are used for static addressing and
two of which are used for dynamic. I'll talk about the static methods
and dynamic methods.
4.4.1. EUI-64
One of the great
benefits of having such an incredibly long host field is not only the
ability to have an absolutely gargantuan number of hosts but also the
ability to specify a great deal of uniqueness toward an individual
address. As you're familiar with from your study of basic networking, an
individual interface normally contains two addresses, a logical
Internet protocol address (IP) and a physical MAC address. In IPv4, the
MAC address happened to be larger than the IP address. That is, IPv4
addresses were only 32 bits in length, but MAC addresses were 48 bits in
length. The original purpose for this design (and still the purpose to
this day) is twofold. First, a MAC address specifies a unique physical
address for your computer. Second, it provides an address that a switch
can use to forward a frame. Just in case you haven't seen one in a
while, a typical MAC address looks like this:
00-1A-A0-05-2A-B7
Normally, a MAC address is
divided into six different sets of two hex numbers for readability;
let's do something different for a moment and split the example address
into two sets of six hex numbers. The reason why will become clear in a
moment.
001AA0 052AB7
Now that you've separated
these two values, let's shift gears for a moment. Remember earlier when
you read that IPv4 addresses were smaller than MAC addresses? Well, that
simply isn't the case with IPv6. In fact, just the host portion alone
is 16 bits larger than the entire MAC address.
Accordingly, a few
networking geniuses decided it would be really fun (and really easy) to
sort of semi-use the MAC address in the host field. It gives a unique
address, and to boot, it allows static addressing without the need to
manual enter every single number.
I say that the address is
"semi-used" because in order to complete the 64-bit host fields, you're
lacking 16 bits. Thus, you need to insert 16 bits somewhere in the host
field to make up for this lack of bits. To do this, you use the hex
field:
FFFE
Then, just to establish a little
uniqueness (and for a few more technical reasons that are beyond the
scope of this book), the seventh bit of the MAC address is flipped. So,
for this example, the address is as follows:
001AA0052AB7
To achieve 7 bits, you need
only the first two values (00). Thus, you take those first two hex
numbers and convert them into binary:
00000000
And then, you "flip" the seventh bit:
00000010
In hex, this value comes out to 02. Thus, your new address is as follows:
021A:A0FF:FE05:2AB7
Visually, you can think of it like Figure 9.
4.4.2. Manual Assignment
The second way an
address can be assigned statically in IPv6 is by doing it the
old-fashioned way. And, although it may be a lot more tedious to
implement, it's certainly more easily explained. Just like in IPv4, you
can manually punch in an address piece by piece. The only real
difference is that one takes decimal notation and the other takes
hexadecimal notation and a subnet prefix. You can see the Windows Server
2008 manual assignment dialog box in Figure 10.
It may be old-fashioned, but it still works!
4.4.3. DHCPv6
In DHCPv6 there are two supported states of DHCP: stateful and stateless.
Stateful DHCP is similar to what you've experienced in the past with
DHCPv4; it just means that DHCP tracks the state of the interfaces it
communicates with, such as information regarding the client and how long
the lease on the dynamic address exists. The only real difference is
that DHCPv4 uses broadcasts in order to find a DHCP. Clients, when first
connected, essentially advertise themselves on their subnet by saying
"Here I am!" And then the DHCP server responds accordingly. Although
this works fine for DHCPv4, unfortunately DHCPv6 doesn't use broadcasts.
So, it sets aside a default multicast address that I told you you'd
probably see sometime in the future. That address is the following:
FF02:0000:0000:0000:0000:0000:0001:0002
In stateless DHCP, the "state
information" (whether an interface is up or down, how long the lease
exists, and so on) is ignored. Typically, stateless DHCP is used in
conjunction with stateless autoconfiguration,
which is a method used by IPv6 to automatically assign addresses to
given interfaces based on their EUI-64 address. The main difference
between stateless and stateful is that stateless doesn't remember IP
addresses, but it can still supply information such as a DNS server.