IPv6 Default addresses for Ethernet

Last posting I was wondering about the IPv6 Address on my work machine. Seems that there is a scheme for generating an IPv6 address from an ethernet MAC address. From RFC 2426:

The OUI of the Ethernet address (the first three octets) becomes the

company_id of the EUI-64 (the first three octets).  The fourth and

fifth octets of the EUI are set to the fixed value FFFE hexadecimal.

The last three octets of the Ethernet address become the last three

octets of the EUI-64.   The Interface Identifier is then formed from the EUI-64 by

complementing the "Universal/Local" (U/L) bit, which is the next-to-

lowest order bit of the first octet of the EUI-64.  Complementing

this bit will generally change a 0 value to a 1, since an interface's

built-in address is expected to be from a universally administered

address space and hence have a globally unique value.  A universally

administered IEEE 802 address or an EUI-64 is signified by a 0 in the

U/L bit position, while a globally unique IPv6 Interface Identifier

is signified by a 1 in the corresponding position.  For further

discussion on this point, see [AARCH].

For example, the Interface Identifier for an Ethernet interface whose

built-in address is, in hexadecimal,

34-56-78-9A-BC-DE

would be

36-56-78-FF-FE-9A-BC-DE.

OK. For my machine the MAC address is: 00:18:8B:C4:28:4B. The IPv6 address is fe80::218:8bff:fec4:284b/64. Let’s ignore the leading fe80 for now. In IPv6 if a range is all zeros, it can be shorthanded like this ::. Note that this may mean :00:00:00:00:00:, not just :00:. The total number of bits has to add up to 128. The MAC address leads off with 00:18 In hex: The “next to lowest order bit of the first octet” is the equivalent of adding the number 2 to that leading 00, so it would look like this 02:18. In IPv6 we can lead off the leading Zero, and we do see that the IPv6 address starts off with 218. The next two hex digits are 8B in both the MAC address and the IPv6 address. Next we see ff:fe complying with “The fourth and fifth octets of the EUI are set to the fixed value FFFE hexadecimal.” And Both the MAC address and the IPv6 address end with C4:28:4B.

The next Paragraph of the RFC clears up the remainder of the format of the IPv6 address:

   The IPv6 link-local address [AARCH] for an Ethernet interface is
 formed by appending the Interface Identifier, as defined above, to

the prefix FE80::/64.

But what is this /64? From RFC 2373:

The text representation of IPv6 address prefixes is similar to the

   way IPv4 addresses prefixes are written in CIDR notation.  An IPv6

   address prefix is represented by the notation:      ipv6-address/prefix-length

where

ipv6-address    is an IPv6 address in any of the notations listed

                      in section 2.2.

prefix-length   is a decimal value specifying how many of the

                      leftmost contiguous bits of the address comprise

                      the prefix.

So the 64 leftmost bits are the prefix. Since an address in IPv6 is 128 Bits long, that means half is prefix, half is machine specific address. The Right 8 bytes are 02188bff fec4284b, which is the portion converted from the mac address.

So It seems that all Ethernet interfaces get a minimum of one IPv6 address at all times. Any address assigned by DHCP is in addition to this one address. My best guess at this reason is to standardize something like DHCP at the IP level as opposed to Ethernet. DHCP for IPv4 is defined specific to ethernet. If you were using a different architecture, you would have to use a separate protocol. My guess is that Infiniband and other modern networking architectures do something similar. Now one daemon can respond with IPv6 address regardless of the interface type.

Leave a Reply

Your email address will not be published. Required fields are marked *

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