Difference Between ipv4 and ipv6

The Internet Protocol (IP) system designates how networked devices can address one another across the internet. The first major version of IP, IPv4, was deployed to the public ARPANET in 1983. IPv4 uses 4 one byte segments to designate a devices address, this 32-bit address space allows for 232 addresses to be used in total. The next major iteration of IP is called IPv6 and it uses a 128-bit address space allowing for significantly more IP addresses to be assigned.

Basics of Internet Protocol

Regardless of the version the Internet Protocol is the main set of rules for distribution packets of data across networks. There are two main jobs that this takes care of: standardizing the format of packet headers and routing the best path to transmit said packets. A great comparison to IP is to think of it how the postal system works – they both dictate how an address is assigned to a location(device) and the path that items take to get to its destination.

Anatomy of an IPv4 vs IPv6

Both major versions of the Internet Protocol do effectively the same things but IPv6 allows for more addresses by using a 128-bit address space instead of 32-bit. So if IPv4 uses 4 one byte segments then IPv6 must use 16 one byte segments, right? It’s a fair assumption but not exactly right since they would be nearly impossible to manage by humans. Lets take a look at why that is the case.

IPv4 notation formats

With an IPv4 our 32-bits of addresses can be represented in a few different ways. For people the most common format to use is the dot notation which uses 4 one byte segments. Each segment, being one byte, can range from 0 to 255. The dot notation for IPv4 looks like this:

192.168.1.1

You may even notice the one in our example as familiar, that’s because this is within the private range of IPv4 and is an address commonly used for home Internet Routers.

Another way of looking at this IP address though would be in its binary format, this would be a lot closer to what the computers relate to. Hover since it’s in binary it’s literally just a string of 1’s and 0’s – so a little hard for humans to remember. Since this format isn’t very easy to remember (or particularly useful) we’ll just skim over it for now.

The final format to be aware of is the CIDR notation which is related to the way the allocate public IPs to private entities(CIDR). Rather than indicating a single IP address the CIDR notation can be used to represent either a range, or a single address. Overall this looks very similar to the normal dot notation, however it also includes a suffix that reflects the subnet mask. The subnet mask is a component that indicates how many addresses the CIDR address contains.

For example to represent the single address used above in CIDR notation you would see:

192.168.1.1/32

IPv6 notation formats

On the other hand, when using an IPv6 since they are significantly longer than IPv4 the format is a bit different.Since the IPv6 address space is four times larger than the IPv4 address space using the same dot notation would be unwieldy. Instead of being decimal based and dot separated, they use hexadecimal digits and a colon based separator. In addition, rather than 4 groups they are made up of 8 groups of four hexadecimal digits. This notation for IPv6 looks like:

2001:0db8:0000:0042:0000:8a2e:0370:7334

As you can see an IPv6 looks like a rather lengthy string of text. These addresses however can be reduced to shorter strings in many cases, the above address is just not a good example of this to show the full format. When ISPs began assigning users IPv6 addresses it was pretty common to give them a whole /64 CIDR range, meaning there’s a good chance your devices IPv6 might have continuous 0’s in it. This is significant because when that occurs you can reduce the group(s) into a single :: (double colon).

For example if our IP was this instead:

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

Then we can simplify to:

2001:0db8::8a2e:0370:7334

This can even be used for a single segment of all 0’s meaning even our original IPv6 example could have worked. However this reduction technique can only be done a single time. Meaning you have to make a choice where to do it and when, in our original example it doesn’t matter much. You could see either:

2001:0db8::0042:0000:8a2e:0370:7334

Or:

2001:0db8:0000:0042::8a2e:0370:7334

Both examples are accurate to the rule of IPv6 short hands and shorten it equally. In cases where you have on segment of all zeroes, and another instance of multiple segments of all zeroes you should collapse multiple at once. So this IPv6 address here:

2001:0db8:0000:0042:0000:0000:0370:7334

Would be transformed into:

2001:0db8:0000:0042::0370:7334

Overall Takeaway

So we know that the Internet Protocol is designed to address devices and transmit packets between them. Nothing changes here about this depending on the version you’re using. The biggest difference between the two versions are the number of publicly available addresses and format of the addresses. IPv4 has a 32-bit address space which limits it to 232 available addresses and IPv6 has a 128-bit address space limiting to 2128 addresses.

So that’s the gist of it, there are more underlying (and heavily technical) details that have changed too. However for a cursory view at the difference between them this is what matters most. The adoption of IPv6 helps pave a new way to connect the internet and brings potential for even more people (and devices) to participate. It’s a great step for growth overall and may lead way to a connected world we can only imagine.

Author Bio

About the Author: Dan Pock

Dan Pock does Technical Writing & Marketing at Liquid Web with a background in System Administration, Public Relations, and Customer Service.

His favorite things include: his cats, Oscar Boots and Dash Nouget; experimenting with PHP; and making up recipes (or at least attempting to). You can find his coding hijinks on GitHub, where he shares most of his projects and open source work.

Here's 75 % off, Launch a New VPS Today. Find out why 30,000 customers have chosen our Best-in-Class Performance & 24x7 Heroic Support