IPv4 and IPv6 – CompTIA A+ 220-1201 – 2.6

The Internet Protocol (IP) is the most popular protocol on the Internet. In this video, you’ll learn about IPv4 address structures, public IP addresses, private IP address ranges, and IPv6 address structures.


If you’ve ever communicated across a network, then you’ve probably used IP version 4. IPv4 is one of the most popular protocols in the world, and you need to know how to configure a system with IPv4 configuration parameters as part of the A+ exam objectives.

Not only do we need to understand IP version 4. We need to understand the most recent version of IP, which is IP version 6. There are some similarities in operation between these two different IP versions, but there are significant differences on how they look and how you configure them on a system.

IP version 4 is a 32-bit address. There are 32 1’s and zeros that work together to create that IP version 4 address. From a human perspective, it’s easier to represent this in a decimal form. And we represent it as four separate decimal numbers.

For example, on this address we have 192.168.1.131. And all of those together make up the IPv4 address. If you wanted to represent this in binary, you could write out all the ones and zeros associated with each of those numbers.

Each of those four numbers is referred to as an octet because it is made up of eight different ones or zeros. Sometimes we’ll refer to this as a byte or 8 individual bits. When you combine all of them together, you have 32 bits, which is also equal to 4 total bytes.

Another interesting thing to keep in mind is that these 8 bits together can consist of a number between 0 and 255, so none of these octets will ever exceed the value of 255.

For us to communicate across the public internet, every device needs to have a unique IP address. For example, one device could have an IP address of 1.1.1.1, and that device can communicate to a device that has an IP address of 2.2.2.2.

As you can probably tell, there’s a finite number of IPv4 addresses that you can create based on the combinations of numbers that might be available. And if you do the math, there are about 4.29 billion combinations of IPv4 addresses that you could create.

However, there are over 20 billion different devices connected to the internet, and that number is rapidly growing. So how do we connect and communicate between all of these different 20 billion devices if there’s only 4.29 billion addresses to go around?

One of the ways we’re able to do that is by taking some of those addresses and changing them into a private address, using a technology known as Network Address Translation, or NAT. On the internet, public addresses can talk to public addresses. But on a company’s network, there may be a single link out to the internet, where there might be a single public IP address. But inside of their private network may be hundreds or even thousands of other devices that we could assign a private address.

Private addresses allow us to communicate with each other inside of our private network. And using network address translation, we can communicate outside of our network. The benefit, though, is that none of those private addresses go towards that entire pool of IP version 4. This means that we could have hundreds or even thousands of those devices internally. And then when we need to communicate out to the internet, we can do that over a single IP version 4 address.

This range of private addresses that you might configure on your local network is defined in an RFC numbered 1918. RFC stands for Request For Comment. And in this particular form, this means it’s a standard that we use across the world for IPv4 addressing.

If we were to look at RFC 1918, you would see three separate ranges that you could use as private addresses on the inside of your network. And some of these addresses you’ve probably seen before.

For example, you can use the range 10.0.0.0 through 10.255.255.255. This allows us a combination of over 16 million different addresses that we could have inside of our network, which is probably why this is one of the most popular address ranges used inside of a large corporate network.

On a smaller network, you might use the range 172.16.0.0 through 172.31.255.255. This combination gives us just over 1 million addresses that we could use to define private devices on our internal network.

And if you use a network at home, then your local device probably assigns IP addresses using the last private range, 192.168.0.0 through 192.168.255.255. This provides a total number of just over 65,000 addresses. But for a network at home, that is plenty of IP addresses to use to be able to have a private network internally that you could then network address translate into a single address on the outside of your network.

When we started designing IPv6, being able to get around this problem with a limited number of IP addresses was one: of the major architectural concerns. For that reason, IPv6 addresses are much larger than IPv4. IP version 4 addresses are 32 bits in length. An IPv6 address is 128 bits in length. This greatly expands the size of available addresses to 340 undecillion addresses.

This means if there’s about 6.8 billion people, each one of those folks can have a very large number of addresses for each individual user. This greatly expands the number of addresses available across the world and removes any limitations that we previously had with IP version 4.

The structure of IPv6 is also very different. You’ll see IPv6 addresses written in hexadecimal format rather than decimal so that we can fit a lot more of this address into a smaller place.

For example, this is an IPv6 address written out with the hexadecimal ranges and double colons and colons to separate the different areas of the network. If we were to write this out in its full and complete form, it would be the one that is on the screen in the middle here of fe80:0000:0000:0000:5d18:0652:cffd:8f52.

That is a very large address to be able to write out. But it gives us enough addresses that we could use this across the world for the global internet and connect everyone who needs that connectivity.

Just like IP version 4, we can show IP version 6 addresses in binary. And in this particular case, instead of having an octet to be a single group, in this case, it’s double that size at 16 bits or 2 octets for each one of these groups. That’s another reason that we display this in hexadecimal form, rather than having very large numbers with periods in between. Instead, we can use hexadecimal to make this much smaller and use colons to separate each of these individual blocks within an IPv6 address.

And if you count up the IPv6 address in total, it’s 128 bits in length or a total of 16 bytes. Because the IPv6 address is much larger and much more difficult to memorize than IP version 4, DNS now becomes very important. Instead of having to memorize an IP version 6 address, we’ll rely on DNS to be able to reference these addresses by their fully-qualified domain name.

We also don’t do a lot of subnetting with IP version 6 because, quite frankly, we don’t need to. We have an enormous number of networks and an enormous number of devices that we could put on each of those networks. Usually, the first half of the IPv6 address, or the first 64 bits, are considered to be the network prefix, which means the default subnet mask for any IPv6 address is usually a /64.

That means the last 64 bits of the IPv6 address are used as the host address. So our network is the first half and the hosts are the second half. So if you’re designing and implementing an IPv6 network, you’re probably using the first half of that IPv6 address as the network prefix and the second half of the IPv6 address as the specific host ID.