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
- The New Way of Generating IPv6 – SLAAC EUI-64 Address Format
- IPv6 addresses – What is IPv6?
- NDP – Neighbor Discovery Protocol
- IPv6 – SLAAC Stateless Address Autoconfiguration
- IPv6 – SLAAC EUI-64 Address Format
- IPv6 Generated with EUI-64 Has a Strange Bit Inside
- IPv6 First-Hop Security
- IPv6 Implementation beyond theory & How playing with RA messages may be issue-istic
- IPv6 RA Router Advertisement and all the flags inside
- Solicited-node multicast address
- Source-based routing in IPv4 and IPv6 networks
- What’s that % sign after ipconfig IPv6 address?
- IPv6 Day – 6 June 2012.