1

Consider this MAC : a4:ba:db:fe:b24b.

The method "SLAAC" allows us to generate an IPv6 from this MAC:

  1. First we put fffe in the fourth and fifth bytes

  2. Then, we invert the 7th bit of the first byte.

Thus, the SLAAC-generated IPv6 address should be generated as described below:

  1. Putting fffe : a4:b1:db:feff:feb2:4B

  2. Inverting the 7th bit : a6:b1:db:feff:feb2:4B

Finally, the IPv6 address should be : a6:b1:db:feff:feb2:4B.

However, my teacher found this IPv6 : a6ba:dbff:fefe:b24b.

Why?

2 Answers 2

2

It appears that you are confusing bytes with words. In an IPv4 (and often in a MAC) address, each separated section is a single byte, but in IPv6, each section is two bytes (16-bit word). You seem to keep the IPv4 thinking. Your original is putting bytes into separate words, but you need to combine two byte into a single word. For example, the fffe will end up in two separate words because there will be three bytes on either side of it, so you will have a colon between the ff and the fe. You should end up with four words (64 bits), separated by colons, but you are trying to create six words (96 bits).

RFC 4291, IP Version 6 Addressing Architecture, Appendix A, Creating Modified EUI-64 Format Interface Identifiers details the original process:

Links or Nodes with IEEE 802 48-bit MACs

[EUI64] defines a method to create an IEEE EUI-64 identifier from an IEEE 48-bit MAC identifier. This is to insert two octets, with hexadecimal values of 0xFF and 0xFE (see the Note at the end of appendix), in the middle of the 48-bit MAC (between the company_id and vendor-supplied id). An example is the 48-bit IEEE MAC with Global scope:

|0              1|1              3|3              4|
|0              5|6              1|2              7|
+----------------+----------------+----------------+
|cccccc0gcccccccc|ccccccccmmmmmmmm|mmmmmmmmmmmmmmmm|
+----------------+----------------+----------------+

where "c" is the bits of the assigned company_id, "0" is the value of the universal/local bit to indicate Global scope, "g" is individual/group bit, and "m" is the bits of the manufacturer- selected extension identifier. The interface identifier would be of the form:

|0              1|1              3|3              4|4              6|
|0              5|6              1|2              7|8              3|
+----------------+----------------+----------------+----------------+
|cccccc1gcccccccc|cccccccc11111111|11111110mmmmmmmm|mmmmmmmmmmmmmmmm|
+----------------+----------------+----------------+----------------+

When IEEE 802 48-bit MAC addresses are available (on an interface or a node), an implementation may use them to create interface identifiers due to their availability and uniqueness properties.

Basically, you split the 48-bit MAC address in half, insert fffe in the middle, and flip the U/L bit. This results in a 64-bit Interface Identifier from a 48-bit MAC address. When you split the resulting 64 bits of the IID into four 16-bit words separated by colons, you get what your instructor has.

Starting with your MAC address, a4:ba:db:fe:b24b:

  • You have six bytes in your MAC address: a4badbfeb24b
  • Split those into two sets of three bytes: a4badb and feb24b
  • Insert fffe in the middle, and you you end up with eight bytes: a4badbfffefeb24b
  • Separate the 16-bit words by colons: a4ba:dbff:fefe:b24b
  • Flip the U/L bit: a6ba:dbff:fefe:b24b

That means your 64-bit IPv6 IID is a6ba:dbff:fefe:b24b, which is what you instructor has.


Many people had concerns about the original SLAAC method of IPv6 address generation. The primary concern is that a user could be tracked by MAC address, regardless of where the user connected to the public Internet.

There are subsequent RFCs to address this perceived weakness and allow for privacy extensions and random address generation. For example, RFC 4941, Privacy Extensions for Stateless Address Autoconfiguration in IPv6:

Abstract

Nodes use IPv6 stateless address autoconfiguration to generate addresses using a combination of locally available information and information advertised by routers. Addresses are formed by combining network prefixes with an interface identifier. On an interface that contains an embedded IEEE Identifier, the interface identifier is typically derived from it. On other interface types, the interface identifier is generated through other means, for example, via random number generation. This document describes an extension to IPv6 stateless address autoconfiguration for interfaces whose interface identifier is derived from an IEEE identifier. Use of the extension causes nodes to generate global scope addresses from interface identifiers that change over time, even in cases where the interface contains an embedded IEEE identifier. Changing the interface identifier (and the global scope addresses generated from it) over time makes it more difficult for eavesdroppers and other information collectors to identify when different addresses used in different transactions actually correspond to the same node.

Many OSes have adopted Privacy Extensions and random addressing as the default behavior. It is now fairly rare to find a device where the addresses are generated by the original SLAAC method.

-2
A link-local address is formed by combining the well-known link-local
prefix FE80::0 [RFC4291] (of appropriate length) with an interface
identifier as follows:

1.  The left-most 'prefix length' bits of the address are those of
    the link-local prefix.

2.  The bits in the address to the right of the link-local prefix are
    set to all zeroes.

3.  If the length of the interface identifier is N bits, the right-
    most N bits of the address are replaced by the interface
    identifier.

https://www.rfc-editor.org/rfc/rfc4862#section-5.3

Applying this algorithm to your address gives:

fe80::a4ba:dbfe:b24b

I've no idea where the algorithm your teacher uses comes from.

It does not seem to be this algorithm either: https://www.rfc-editor.org/rfc/rfc7217#section-5

1
  • 2
    RFC 4291, IP Version 6 Addressing Architecture, Appendix A, Creating Modified EUI-64 Format Interface Identifiers details the process. Basically, you split the 48-bit MAC address in half, insert fffe in the middle, and flip the U/L bit. This results in a 64-bit Interface Identifier from a 48-bit MAC address.
    – Ron Maupin
    Commented May 11, 2017 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.