IPv6 Generated with EUI-64 Has a Strange Bit Inside

UPDATE on 22 Mar 2018:
Although the article is correctly explaining the IPv6 address generated in the example at the bottom, it seems that the process of generating the IPv6 address with EUI-64 has been changed from what is described in RFC2373 to something like RFC4291 and then to something like RFC7217. Thanks to @FernandoGont for pointing to this issue. A new article is here which describes newly suggested technique on how SLAAC implementation should work in new network device/NIC implementations.

What is universal/local bit in IPv6 EUI-64 address?

One of my readers contacted me with an interesting question in comments of “IPv6 – SLAAC EUI-64 Address Format” article. The question was:

“How come that the ipv6 address after the prefix is 21C:C4FF:FECF:4ED0 if the mac address is 00-1C-C4-CF-4E-D0?”

Of course, we all know from the previous article that EUI-64 process is taking the interface MAC address (if that is an Ethernet interface) and it creates 64 bits Interface ID with it by shimming additional FFFE (16bits in hex) in between the MAC address bits.

The reader was confused with an additional change that I did not cover in that article which is called universal/local bit of the IPv6 address Interface ID part.

Let’s go.

IPv6 address is 128 bit. First ‘n’ bits (first 64 bits of EUI-64 created IPv6 address) are called “subnet prefix” and the other half of bits are called “Interface ID”.

If we use EUI-64 process to generate a unique IPv6 address of the interface, then we are generating Interface ID from MAC address (or some other kind of L2 address if this is not about Ethernet).

|                     n bits                     |   128-n bits   |
+------------------------------------------------+----------------+
|                  subnet prefix                 |  interface ID  |
+------------------------------------------------+----------------+

On RFC 2373 page 18 chapter: “APPENDIX A : Creating EUI-64 based Interface Identifiers”, you can find that 7th bit on Interface ID part of an IPv6 address (the last 64 bits) is called “universal/local bit”.

If this bit is set to “0” it indicates local scope IPv6 address and if it is “1” then the generated IPv6 address has global scope (it is globally unique).

Basically, if you configure the IPv6 address with EUI-64 then it will have this bit set to “1” if the interface has an MAC address. If the interface has non, like the serial interface or tunnel endpoint, then this bit will be set to “0” telling us that the EUI-64 process didn’t have means to guarantee global IPv6 uniqueness. No globally unique MAC, no guarantee of globally unique IPv6.

Here’s my example from the first article  … binarized 🙂

Interface MAC:

00-1C-C4-CF-4E-D0

001CC4CF4ED0

‭0000 0000 – 0001 1100 – 1100 0100 – 1100 1111 – 0100 1110 – 1101 0000‬

Then changing the 7th bit to “1”:

‭0000 0010 – 0001 1100 – 1100 0100 – 1100 1111 – 0100 1110 – 1101 0000‬

The interface ID hex is then beginning with:

0       2         1       C  ……

Interface ID:

021C:C4FF:FECF:4ED0

IPv6 EUI-64 generated:

2001:1234:AD:5555:21C:C4FF:FECF:4ED0/64

 

Here are some great related articles about IPv6:
Check it out! This is all about IPv6

Leave a Reply