IPv4 - IPv6 differences

Internet protocol version four (IPv4) dates from 1978. In the 1990's a new internet protocol called 'IPv6' (internet protocol version six) was developed. This document describes a few differences between the two.

IPv4 addresses

IPv4 uses 32 bit IP addresses. These are usually grouped into groups of 8 bits called bytes. The bytes are then translated into decimal numbers. These in turn have dots ('.') put between them;

 11000000  10101000  00000001  00101010

 192       168       1         42

 192.168.1.42

You can use this IP address to access a website with IP address 192.168.1.42;

 http://192.168.1.42/

It's more common to use a name instead though;

 http://www.example.org/

IPv6 addresses

IPv6 addresses are 128 bits or 16 bytes. This results in enough IP addresses to connect the entire universe to the internet. Many times over!
IPv6 addresses are not expressed as decimal, but as hexadecimal numbers. Which is in fact more convenient. Expressing IPv6 addresses as decimal numbers would make then way to long.

Hexadecimal

The table below shows four-bit numbers as binary, hexadecimal and decimal numbers. The first part of the table shows the meaning of the rightmost four bits in a byte, the second part the leftmost four bits in a byte;

Binary Hex  Dec 
xxxx 0000 0 0
xxxx 0001 1 1
xxxx 0010 2 2
xxxx 0011 3 3
xxxx 0100 4 4
xxxx 0101 5 5
xxxx 0110 6 6
xxxx 0111 7 7
xxxx 1000 8 8
xxxx 1001 9 9
xxxx 1010 a 10
xxxx 1011 b 11
xxxx 1100 c 12
xxxx 1101 d 13
xxxx 1110 e 14
xxxx 1111 f 15
0000 xxxx 0
0001 xxxx 16
0010 xxxx 32
0011 xxxx 48
0100 xxxx 64
0101 xxxx 80
0110 xxxx 96
0111 xxxx112
1000 xxxx128
1001 xxxx144
1010 xxxx160
1011 xxxx176
1100 xxxx192
1101 xxxx208
1110 xxxx224
1111 xxxx240

So 'fe' is 240 + 14 = 254. And 'ef' is 224 + 15 = 239.

Let's look at '192.168.1.42' again. The bytes are split into groups of four bits called nibbles;

 1100 0000  1010 1000  0000 0001  0010 1010

 c    0     a    8     0   1      2    a

Put the hex digits into groups of four and put colons (':') in between;

 c0a8:012a

Remove leading zeros after colons;

 c0a8:12a

A complete IPv6 address;

 2001:db8:1234:1:222:15ff:fe3f:b508

In decimal notation this would be;

 32.1.13.184.18.52.0.1.2.34.21.255.254.63.181.8

Which is much longer.

You can abbreviate long sequences of zeros, such as '0:0:0:0' to '::' (you can only do this ONCE per IPv6 address). So '::1' actually means '0:0:0:0:0:0:0:1'.

If you want to access a website using an IPv6 address instead of it's name, you have to enclose the IPv6 address in angle brackets ('[' and ']');

 http://[2001:db8:1234:1:222:15ff:fe3f:b508]/

It is of course, more convenient to use a name instead;

 http://www.example.org/