## Difference between an IPv4 and IPv6 address

Table des matières

In this course, we will see the difference between an IPv4 and IPv6 address. At the end of the reading, you will be able to identify and differentiate between an IPv4 and IPv6 address.

The difference between an IPv4 and IPv6 address is that IPv4 is encoded on 32 bits and in decimal notation, while IPv6 is encoded on 128 bits and in hexadecimal notation. You will get the details as you continue reading.

## What is an IP address?

An IP (Internet Protocol) is therefore a numerical identifier assigned to each device connected to a computer network for communication.

It is also defined as a numerical address assigned to each device on a network.

An IP address therefore has two main functions, which are network interface identification and addressing the location of a device.

To date, there are two versions of IP addresses:

• IPv4 address (version 4) ;

What is IPv4?

IPv4 (Internet Protocol version 4) is version 4 of IP, which allows all machines on a computer network to communicate with each other.

An IPv4 address is therefore encoded on 32 bits and has a decimal notation. It is composed of four numbers, each between 0 and 255 and separated by dots.

The example above represents the IP address and its subnet mask, in which each group of numbers separated by dots is called an octet.

In total, 4,294,967,296 or 232 unique IPv4 addresses can therefore be allocated in theory.

The IPv4 address is therefore represented in decimal to facilitate reading, but in reality computers interpret them in binary.

It should be noted that computers only understand binaries. The binary number can be 1 or 0.

An IPv4 address is therefore composed of four bytes. Each byte is composed of 8 bits, so 8 bits x 4 = 32 bits.

Each bit in a byte can therefore be 1 or 0. If the bit is 1, the number it represents will count, and if the bit is 0, the number it represents does not count.

## What is IPv6?

Internet Protocol version 6 (IPv6), is the version 6 of the Internet Protocol and was created to overcome the problem of shortage of IPv4 addresses.

IPv6 works in the same way as IPv4, assigning unique IP addresses to devices to enable them to communicate over a computer network.

However, an IPv6 address is much longer than an IPv4 address, because IPv6 is encoded on 128 bits.

Which is in total 2128 (the answer gives something like 2128 = 340,282,366,920,938,463,374,607,431,768,211,456). That’s a lot of IP addresses.