Introduction to IPv6
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