How to build an IPv6 address

An IPv6 address is composed by 8 fields of 16 bits and is represented like this:

x:x:x:x:x:x:x:x

Where each x is an hexadecimal value. If, in one of the fields we have zeros at the left it is not necessary to write them, also if a field has only zeros its representation can be simplified.

For example:

1080:0:0:0:8:800:200C:417A

Simplified will be like this: 1080::8:800:200C:417A

0:0:0:0:0:0:0:1

Simplified: ::1

Addresses are formed like this:




Where:

Site prefix: Composed of 48 bits. Describes the public topology that the ISP asigns.

Subnet ID: Composed of 16 bits. Is assign by the user or the site administrator. The subnet ID describes the private topology, also denominated site topology.

Interface ID: Composed of 64 bits. Contains the interface ID, also denominated token. The interface ID is configurated automatically using the MAC address of the interface or manually with the EUI64 format.

To convert the MAC address using the EUI64 format we just have to use this simple formula. But first let's see the parts of a MAC address.

Example:

00:04:AC:66:7D:47

The first field of 8 bits, in this case: 00. Is the universal/local bit (seventh bit).
The second and third field of 8 bits, in this case: 04:AC are the company ID.
And the three remaining fields, in this case: 66:7D:47 are the ID established by the company.

EUI64 convertion formula:

02:[company ID]:FF:FE:[ID established by the company]

Then using the MAC address of the example, the EUI64 format would be:

02:04:AC:FF:FE:66:7D:47

And finally to use this format as the interface ID of the IPv6 address, two fields of 8 bits have to be grouped to make fields of 16 bits:

0204:ACFF:FE66:7D47

Simplified: 204:ACFF:FE66:7D47

Now that we have the interface ID we can make an IPv6 address (this example uses an IPv6 global address):

2002:A09:807::204:ACFF:FE66:7D47



Some types of IPv6 addresses:

Non-specified address (0:0:0:0:0:0:0:0): This address shall never be asign to a node. This address indicates the absence of an address.

Link-local address: A link-local address is asign automatically to an IPv6 interface when it is activated.

Site-local address: It's an established range of addresses that are similar to the IPv4 private addresses. These addresses are used preferentially inside a site or in a LAN.

Global address: It's also an established range of addresses that are similar to the IPv4 public addresses.





 

And that's all hope it helps :)

Comentarios

Entradas populares de este blog

Como calcular permisos de umask

Configuración de un DNS IPv6 local en Linux con Bind

Permisos Unix: Los bits SUID, SGID y sticky