Understanding EUI-64 from IPv6

In this course we will see the EUI-64 method of IPv6. By the end of this course, you will be able to calculate a host address using the EUI-64 method of IPv6.

What is EUI-64 of IPv6?

EUI-64 (Extended Unique Identifier) is a method used to automatically configure host addresses when using IPv6.

Indeed, this allows a host wanting to use IPv6 to assign itself an IPv6 address. This is done using its own MAC address.

A device (computer, router, etc.) configured with IPv6 will use the MAC address of its interface to generate a unique 64-bit interface ID.

The problem is that, a MAC address is on 48 bits, so how to have the 64 bits for the interface ID which is 64 bits? Weird, isn’t it? Don’t worry, I’ll explain how it works.

IPv6 calculation EUI-64

The second part of an IPv6 unicast address (used to identify the network interface of a host) is usually a 64-bit interface identifier.

An interface ID is created by inserting FFFE hexadecimal characters in the middle of the MAC address of the interface.

Then the 7ᵉ bit of the first byte is switched to a 1 bit.

The EUI-64 interface ID is thus created in this way.

So here are the rules a host uses to create the interface ID:

  • 1. Divide the MAC address into two halves (6 hexadecimal digits each).
  • 2. Insert FFFE between the two, creating the interface ID.
  • 3. Invert the seventh bit of the interface ID.
Understanding EUI-64 from IPv6

For example, the MAC address of the host interface in the image above is: 00:0A:41:C4:6A:A2

The interface ID becomes: 02:0A:41:FF:FE :C4:6A :A2

The host or router will first invert the seventh bit from 0 to 1. Or from 1 to 0 if the initial bit is 1.

  • MAC addresses are in hexadecimal format: 00:0A:41:C4:6A:A2

In binary : 0000 0000 0000 1010 0100 0001 1100 0100 0110 1010 1010 0010

  • The host will invert the seventh bit and it becomes :

In binary : 0000 0010 0000 1010 0100 0001 1100 0100 0110 1010 1010 0010

  • This becomes in the following hexadecimal: 02:0A:41:C4:6A:A2

Then the router inserts FFFE in the middle of the address indicated above and we will finally have: 02:0A:41:FF:FE :C4:6A :A2

Thus, the interface ID will be: 02:0A:41:FF:FE:C4:6A:A2.

Now, to get an IPv6 address from EUI-64 :

  • We take the prefix which is for example FE80:0000:0000:0000 and the interface ID 02:0A:41:FF:FE:C4:6A:A2 which we have just calculated. We combine them by taking the prefix + the interface ID.
  • And so we have : FE80:0000:0000:0000:02:0A:41:FF:FE :C4:6A :A2
  • After simplification: FE80::02:0A:41:FF:FE :C4:6A :A2
  • Or : FE80::2:0A:41:FF:FE :C4:6A :A2

So we have our Link-local address: FE80::02:0A:41:FF:FE :C4:6A :A2

Understanding EUI-64 from IPv6

Summary IPv6 EUI-64 calculation

Here is a summary of the IPv6 EUI-64 calculation on this image (you can also see the table after the image):

Summary IPv6 EUI-64 calculation
MAC address00:0A:41:C4:6A:A2
In binary0000 0000 0000 1010 0100 0001 1100 0100 0110 1010 1010 0010
Reverse 7th bit0000 0010 0000 1010 0100 0001 1100 0100 0110 1010 1010 0010
MAC address after 7th bit inversion02:0A:41:C4:6A:A2
Addition of FFFF02:0A:41:FF:FE :C4:6A :A2
Adding the prefixFE80:0000:0000:0000:02:0A:41:FF:FE :C4:6A :A2
SimplifiedFE80::02:0A:41:FF:FE :C4:6A :A2
Or againFE80::2:0A:41:FF:FE :C4:6A :A2
Link-local addressFE80::02:0A:41:FF:FE :C4:6A :A2

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.