Introduction to IPv6

Note: Anything in this
fonts
or
fonts
means that you’ll be typing in the terminal or what you’ll be seeing in the terminal.

IPv6 Background

For the entirety of this course so far, you have been using IPv4. As you learned in the introduction to IPs, an IP is a 32-bit number represented as X.X.X.X. Since the adoption of IPv4, it has become apparent that the over 4 billion IPv4 addresses simply isn’t enough for a widespread digital world. The primary goal of IPv6 is to increase the size of a single address from 32 bits all the way up to 128 bits long. This means that IPv6 has more than 3 x 10 ^ 38 addresses, effectively removing any concept of scarcity in IP addresses.
Although IPv6 was adopted in 2012, it is still rarely used in basic networking as less people are familiar with it than IPv4. Still, learning to use IPv6 addresses will only become more and more important as the world slowly shifts from using IPv4.

 

IPv6 Addressing

Unlike IPv4, IPv6 uses a hexadecimal representation of addresses rather than decimal. This means that there are 16 “digits” and rather than counting 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12…, you count 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A…
This helps lower the number of characters you have to type by allowing fewer characters to represent larger numbers. In case you haven’t seen an IPv6 address yet, this is an example of what an IP address would look like:

 

2001:0db8:85a3:0000:0000:8a2e:0370:7334

Obviously, that looks very long to type out, but luckily IPv6 is designed to allow us to shorten it wherever possible without losing any information. The first is that we can remove any 0s at the start of each segment of the address, so this IP is equivalent to the example above.
2001:db8:85a3:0:0:8a2e:370:7334

 

IPv6 also is designed so that if you have multiple segments of the address in a row that are just 0, you can replace those with just “::”. Again, this shortens the example to:
2001:db8:85a3::8a2e:370:7334

 

In this example, while that didn’t shorten the address significantly, in the case of an IP address that we might be assigning by hand, such as a router, it can turn this:
2001:0db8:0000:0000:0000:0000:0000:0001

Into this:
2001:db8::1

Note that providing the “::” to shorten multiple zeros is only allowed once per IP address. So this address:
2001:0db8:0000:0000:0001:0000:0000:0001

Can be shortened to either of these:
2001:db8:0000:0000:1::1
2001:0db8::1:0000:0000:1


But NOT this:
2001:0db8::1::1

 

Subnets

Subnets in IPv6 work very similarly to IPv4 subnets.
For example, if you wanted a network that looked like this where the Xs are just usable IPs:
2001:db8::X:X:X:X

You would define the subnet as:
2001:db9::/64


With IPv6, pretty much the smallest subnet ever used is a /64 network, like the one above. This means that there are still 64 bits for usable IP address inside that one subnet. That means that the purpose of having larger subnets, like a /48, is almost entirely for organizational purposes or routing so that you can split them up into small /64s, not size like the case was with IPv4. You’ll notice that even when we do Point-to-Point links with IPv6, we still use a /64 because that is the standard for IPv6. There has been some debate over whether to use a /64 or a /127 for point-to-point links, and different people do it different ways, but for the purpose of our labs, we’ll stick to the standard of never going smaller than a /64 subnet.

 

Address Configuration with IPv6

One of the biggest changes you run into early with IPv6 is the change in how hosts auto configure themselves in an IPv6 network. With IPv4, we setup a DHCP server which hands out IP addresses to the hosts and tells them information about the network, such as the default gateway and DNS servers. With IPv6, DHCP is still used for providing some of that information, but not as much as it did in IPv4. Most of the configuration, however, is done with what is called Router Advertisements, or RAs for short. Routers are setup to automatically send out periodic updates to every host on a subnet, whether it has a connected IP or not. These RAs contain information about the network, specifically the subnet prefix and length, as well as where the router is on the network. The host then uses Stateless Address Autoconfiguration or SLAAC to assign itself and IP on the network that is unique from every other host on the network. We’ll not go into details of how that works, here, but it uses information from the MAC address to calculate a new IPv6 address for itself.
As I mentioned earlier, DHCP is still used with IPv6. The most important function of DHCP is to provide hosts with the DNS servers for the network, but if configured, it also can provide other numerous options the same way it does in IPv4. When configuring the routers, you can actually provide instructions in the RAs to make hosts use the DHCP server for configuring an IP address, but in most cases SLAAC does the job well enough for us.

 

Link Local Addressing

Link local addresses were already used in IPv4, but with IPv6 they become much more widely used and important. A link local address is an address that the host assigns itself when it doesn’t have another routable address. For IPv4, these addresses fall into the subnet 169.254.0.00/16. You’ll notice these addresses in IPv4 specifically when a host sends out a DHCP request and doesn’t get a reply. The host will then just configure itself with an address on that subnet, so it is still able to communicate with other hosts who have link local addresses despite not having a configured IP address.
Similar to IPv4, IPv6 uses link local addresses in the subnet fe80::/10. The major difference, however, is that with IPv6, link local addresses are required on an interface for communication between hosts, even when the interface has another configured IP on the interface. This means that when you run a command like “ip a”, on interfaces that you have configured IPv6, there will be at least 2 addresses: One address that was configured statically, through SLAAC, or through DHCP, and then another on the subnet fe80::/10 that is the link local address.