IPv6 Addresses are 128bit as opposed to IPv4 which has 32 bit adddresses. IPv6 address are represented as 8 groups 4 hexadecimal numbers. This is is the first main difference from IPv4 which used 4 groups of decimal numbers to represent the IP address. As an example my home network has a default router with an IP address of:
Note that I am using RFC 3849 prefix 2001:0DB8:: reserved for documentation in this blog.
IPv6 addresses can be simplified by removing any group of four zeros between colons. The address can thus be simplified to:
The addresses can be simplified further by removing any colon that is in between collons resulting in:
Like most numbering schemes we can simplify this further by removing any leading zeros to get my final address which is:
This is not so bad now is it. Not that much different from the 192.168.2.1 addresses that you are used to.
Like IPv4 addresses IPv6 addresses have a network (prefix) portion and node (host) portion. In my networks case, I have been assigned the
network. This means that my network has a 56 bit mask of:
(or 255.255.255.255.255.255.255.0 old school IPv6 parlance)
This means I have an address range of
Good IPv6 subnetting says your subnets have to be /64 networks, meaning in my case that I have 256 (FF) subnets:
Each of these subnets has a node range that is 64bits using the first subnets the IP addresses for the nodes would be in the following range:
As you can see these are a lot of nodes, exactly 2^64 == 1.844674407370955e+19 nodes in each of these subnets.
There are two options in IPv6 for assigning the the node part of an IPv6 address. You can use DHCP, or let the nodes auto configure their own IP addresses. The recommended method is to let the nodes auto configure themselves by listening to a prefix advertised by a router.
DHCP6 is not different from IPv4 DHCP so I will not get that into it. Just note that not all Operating systems that claim to support IPv6 have a DHCP client available. If you are running Linux you can start the dhcp6c DHCP client to get a DHCP IPv6 address. DHCP6 is enabled by default in Windows 7 (and I hear in Vista as well, but I skipped that version of Windows). Mac OS X on the other hand does not have an option for DHCP6.
Auto Configuration; Prefix Announcements:
To cover all your bases, just enable prefix announcements and let the nodes auto configure themselves. For auto configuration to work with prefix announcements the subnet has to use a /64 mask. The network portion in an auto configured IPv6 address is based on the MAC address of the machine. In my Apple laptops case, I have
MAC addrees: C8:BC:C8:D3:7E:6E
IP Address: 2001:DB8:150F:150F:CABC:C8FF:FED3:7E6E
Where as a Linux box with a Giga-Byte motherboard has
MAC addrees: 6C:F0:49:E6:13:98
IP Address: 2001:DB8:150F:150F:6EF0:49FF:FEE6:1398
As you can see the generation scheme is quite simple. Add 2 to the first nibble (8 bits) son in my Macs case C8 becomes CA. The next two nibbles, and the last 3 nibbles are the rest of the MAC address. Note that the FF:FE is used in between as a filler as a MAC addresses only have 48 bits and we need 64 for the node address.
Prefix announcements can also send out IPv6 DNS server addresses, but not much else.
Auto Configuration; Stateless:
If there is no Prefix announcement from a router, the IPv6 nodes can still auto configure themselves with non routable Link Local addresses similar to the IPv4 169.254.x.x addresses. The method of generating the Link Local address is the same as I described in Prefix announcements, except the prefix is a predefined reserved FE80::/64. This is described in great detail in RFC 2462. To use my mac laptops case I would have
MAC addrees: C8:BC:C8:D3:7E:6E
IP Address: FE80::CABC:C8FF:FED3:7E6E
To summarize there are actually a couple of different address types referred to as “scopes” that are associated with IPv6. I will not attempt to describe them but will plagiarize the excellent description that I found on the University of Wisconsin knowledge base as they do an excellent job of describing them.
- Global scope addresses are the regular globally reachable address and often registered in DNS. For UW-Madison, the global prefix is 2607:f388::/32.
- Link-Local scope is used within a particular subnet only and are not routable at all. They start with the IPv6 prefix fe80::/64, unlike in IPv4 where link local addresses are used only if no valid IP is available, in IPv6 they are always configured.
- Loopback is the how a host can refer to itself, similar to 127.0.0.1 in IPv4. The IPv6 address is ::1/128 and is also called Host Scope.
- Multicast can be used both with link-local, site-local, and global scope. This is how, for example, nodes on a given LAN can find each other. Multicast addresses are in the range ff00::/8.
- Broadcast is not used in IPv6 in favor of Multicast.
- Site-Local scope is specific to an enterprise. However as an addressing range, it has been deprecated since 2004. Documentation that referrers to it or the range fec0::/10 is out of date.
- Uniform Local Addressing to some degree replaces site-local. ULA is similar to RFC 1918 address in IPv4, but with some differences. ULA is relatively new, and there still is an amount of churn in the standards bodies about how the addresses should be used.
In the next article I will go over my home network and how I set it up.