When an interface generate an autoconfigured Global Unicast IPv6 Address, there should be some mechanism to guarantee the uniqueness of autoconfigured Global Unicast IPv6 Addresses.
IPv6 has a method (as defined in RFC 4291) to generate a 64 bit interface part (host part) of the Global Unicast IPv6 Address from the interface MAC address. MAC Addresses are considered as Globally Unique addresses and therefore the IPv6 address derived from MAC address also should be Globally Unique. The EUI-64 method of generating an Global Unicast IPv6 Address involves selecting the 6 byte (48 bit) interface MAC address and the and then generating a Global Unicast IPv6 Address by expanding it into a 64 bit interface part (host part).
To make a Global Unicast IPv6 Address unique, IPv6 insert 2 bytes (16 bits) into the middle of the MAC address. The 48 bit MAC address is divided into two 3 byte parts a binary number 1111111111111110 (0xFFFE in hexadecimals) is inserted in between them to make complete 64 bits.
Also the 7th bit (from left) in the MAC address is flipped. Which means, if the 7th bit in the MAC address (from left) is 1, change it to 0 or if the 7th bit (from left) in the MAC address is 0, change it to 1.
The 7th bit (from left) in the MAC address is called as Universal/Local (U/L) bit. Universal/Local (U/L) bit is used to indicate whether the address is universally assigned or locally assigned. The Universal/Local (U/L) bit set to 0 means that it is IEEE assigned MAC address. The Universal/Local (U/L) bit set to 1, means that the MAC address is locally assigned.
The reason behind flipping the Universal/Local (U/L) bit is for better compressibility of IPv6 addresses.
Refer the screen shot given below.
As marked, the MAC address of the interface is 00:AB:29:8C:3E:00 and the autoconfigured EUI-64 Global Unicast IPv6 Address is 2001:db8:aaaa:1:2ab:29ff:fe8c:3e00/64.
The following table explains how EUI-64 Global Unicast IPv6 Address 2001:db8:aaaa:1:2ab:29ff:fe8c:3e00/64 is generated automatically from the MAC address 00:AB:29:8C:3E:00.
|MAC Address with
0xFF:FE added in middle to make it 64 bits
| 64 bit Host part
|64 bit Host part (in binaries)
|64 bit Host part
in binaries and 7th bit flipped
|64 bit Host part
(in hexadecimals and 7th bit flipped)
|Global Unicast IPv6 address with network prefix 2001:db8:aaaa:1::/64 added
As shown in the above table, the EUI-64 Global Unicast IPv6 address 2001:db8:aaaa:1:2ab:29ff:fe8c:3e00/64 for the Ethernet interface eth0, is derived from the MAC address of that interface.
Well, everything looks good. But, what about an interface which does not has a MAC address? You may aware that a Serial Interface in a Cisco router does not has a MAC address. RFC 4291 states that if there is no MAC address available for a network interface, borrow a MAC address from another interface which has a MAC address. Good idea!!!