Transcript for:
Understanding IPv6 and Its Benefits

IPv6 is the future of the internet. In fact, you're using it right now and you might not even know it. If you have a smartphone near you, go ahead and turn off the Wi-Fi so that your device will be on cellular data and look up what your public IP is. Chances are it'll be a long string like this which is an IPv6 address. Now maybe you're wondering what is the reason for this and it's mostly due to the limitations of IPv4. When the internet was first created, nobody thought that it was going to be this huge popular thing that everybody would use and have most people owning multiple devices that need access to it as well. So IPv4, with its total of about 4.2 billion addresses, seemed like enough. But as the internet became more popular in the late 80s and early 90s, the creators of IPv4 realized... that the world was quickly running out of IP addresses. There were some solutions to slow the hemorrhaging of IP addresses before IPv6 could be completed, like network address translation, which essentially allows multiple devices that are on a single LAN to access the internet without each of them needing their own public IP address for it. You should check out my video on that if you're interested in the technical details of NAT. But with IPv6, it's unlikely that we'll start running out and need to do anything anytime soon to start conserving them because IPv6 is a 128-bit address. That means that with IPv6, there are 2 to the 128 possibilities or 340 trillion trillion trillion possible addresses. So to put that in perspective, the estimated number of bacteria on Earth is... 5 times 10 to the 30. So if each individual bacteria had 1 million smartphones, smartwatches, whatever kind of device can connect to a network, we could supply them all with IPv6 addresses and only use up less than 2% of that available address space. So this is what your standard IPv6 address looks like. Quite a few differences between this and IPv4. So instead of four octets, we have eight segments that are called hextets and we have colons that are separating those hextets instead of dots like we see with ipv4's octets and each digit in the hextets are done in hexadecimal which is probably where the name comes from so the value of each digit can be zero through f these addresses are really long and they get even longer when you translate them into binary because each value is going to represent four bits So for example this 2 would be 0010. Each of these zeros would just be four zeros in binary. The 1 would be 0001. We already know what that zero is going to be. Now the D represents 13 in base 10. So if you counted out 0 through 9 then A is 10, B is 11, C is 12, D is 13. and so in binary that would be 1 1 0 1. So it's important to understand how this hex to binary conversion works to understand the IPv6 subnetting. So subnetting is also pretty different with IPv6. So there is a network and a host section of IPv6 addresses just like IPv4. But typically an IPv6 address is going to be split right down the middle where the front half is the network part and the second half is going to be the host part. But IPv6 does not use a subnet mask. So instead you just write a dash and the number of network bits, which in this case is going to be 64 bits. And if you haven't noticed already, this address, it is pretty obnoxious. It's very long and nobody is going to want to... type that out again and again. So let me show you some ways that you can shorten it. So the first trick is to remove groups of zeros. You're going to get this a lot in IPv6 addresses because there's just so many of them. We usually don't need all of the hextets to get an available usable address. So very often you're going to see several of the hextets be all zeros. And when that happens, you can just compress them. into a single, well, into a double colon, like you see here. Now you can only do this once with all of the groups of zeros that are next to each other, which is why these four zeros here are untouched. I can't put another double colon here because if you had more than one double colon, It would be impossible to know how many groups of zeros each one had. You wouldn't know if back here was two groups or over here was two groups or this one was one group, this one was one group. It'd be impossible to know which one is which. So you can only do this once. Now, another trick is to remove all of the leading zeros from each hextet. So I took out the zero here from 0db8. And over here, there were... three leading zeros so I can just compress this whole thing down to a single zero and there you go so this is quite a bit shorter this is maybe two-thirds of the size of what we started with in our ipv6 address and like I said there's going to be a lot of them that have several hex tets that are all zeros so you can imagine there's going to be a lot of situations where you can shrink this down a whole lot maybe get it down to half of the size of what this is Now again, just like IPv4, there are IPv6 addresses that are designated for specific purposes. So far, what we've been looking at is a global unicast address, which essentially has the same purpose as an IPv4 public address. But there's no reason at all for all those different devices to just use one public IP address because, again, we have so many of them. So IPv6 can give... each individual device its own public IP address. So the first part of this address is the global prefix, which will always be 48 bits or more, and it's what your ISP is going to provide you with a block of IP addresses. Then next we have our subnet ID, which has 16 bits, which gives us over 65,000 possible subnets. And of course, finally, is our interface ID. Let's take a look at some of the other IPv6 address types. So we've got link local addresses, which are not globally routable. In fact, they aren't routable at all. They are used for addressing on a single link. They're primarily used for things like neighbor discovery, and they are the first addresses that are created on an interface before an IPv6 router has time to advertise all of its routes. They are designed to communicate with a single area of a network. not separated by any routers. It's pretty similar to the automatic private IP addresses that you see in IPv4 that begin with the 169.254 addresses. If you've ever seen those, you know what I'm talking about. So similar to those and its prefix is fe80 colon colon forward slash 10. So then we have loopback. That's going to be the same concept as IPv4 loopback, so it's used for testing the functionality of your network card without needing to actually connect to a network. Unspecified, this indicates the absence of an address. And one example of its use is in the source address field of an IPv6 packet that's sent by an initializing host before it has learned its own address. This is going to be written as all zeros so every single one of the hextets is all zeros that's why you can shorten it to just this double colon here unique local that's similar to an ipv4 private address so it's not globally routable it's just going to stay in the LAN you know whichever one router or couple of routers is in your organization the prefix to identify it is fc00 double colon forward slash seven. Embedded IPv4 is used to represent the IPv4 address space within the IPv6 address space. So that's pretty easy to do considering how much larger IPv6 is than IPv4. Obviously it can encompass all of that space and have many many more left over. That's mostly going to be used internally with APIs and operating systems for IPv4 to IPv6 compatibility. Multicast addresses are sent to a group of devices that are listening for that particular multicast address, and they are essentially an upgrade to IPv4's broadcast address because they don't force every single device to process the packet. So this is going to be especially useful for any type of low-powered devices. Things like embedded devices, which may be on a network running in a low power mode. And so the network interface is able to determine by itself whether the packet is important enough to actually wake up the main processor of the device out of that low power state to deal with the packet. These multicast addresses, they're always going to start with an FF. And then there's anycast, which allows us to assign the same IPv6 address to multiple devices. And when we do this, the data is going to be sent to the closest address that has that particular IP. IPv6 also has IPsec built into it which provides end-to-end per packet IP layer authentication and encryption. But one important thing to understand about this is that the IPsec is not automatically applied. It has to be enabled by the application developer, the systems administrator, and the end user for it to actually apply. So it's not a whole lot different than with IPv4. So... So with IPv4, you have the option of using IPsec. IPv6, you also have the option of using IPsec. Everyone has to have it put on. So now you understand the basics of IPv6, that mysterious long network number that you see when looking up your IP address. It should be a little bit more familiar now.