1

RFC4193 contains pseudo code for generation of IPv6 ULA (Unique Local Address). Do I have to follow this algorithm or is an arbitrary ULA valid?

   3.2.2. Sample Code for Pseudo-Random Global ID Algorithm

   The algorithm described below is intended to be used for locally
   assigned Global IDs.  In each case the resulting global ID will be
   used in the appropriate prefix as defined in Section 3.2.

     1) Obtain the current time of day in 64-bit NTP format [NTP].

     2) Obtain an EUI-64 identifier from the system running this
        algorithm.  If an EUI-64 does not exist, one can be created from
        a 48-bit MAC address as specified in [ADDARCH].  If an EUI-64
        cannot be obtained or created, a suitably unique identifier,
        local to the node, should be used (e.g., system serial number).

     3) Concatenate the time of day with the system-specific identifier
        in order to create a key.

     4) Compute an SHA-1 digest on the key as specified in [FIPS, SHA1];
        the resulting value is 160 bits.

     5) Use the least significant 40 bits as the Global ID.

     6) Concatenate FC00::/7, the L bit set to 1, and the 40-bit Global
        ID to create a Local IPv6 address prefix.

I would prefer if time was not a factor. Would it be acceptable to take the Link Local Address (Mac derived) and replace the first octet to convert it to ULA?

  • The point is that you want to create a unique 48-bit prefix that is unlikely to be chosen anywhere else by anyone else. A Link-Local address will only have 0 bits for the 40 bits that must be randomly chosen. That is not sufficient. You can use multiple /64 networks from the 65,536 available in the 48-bit prefix, but each 48-bit prefix cannot relate to another if you have multiple 48-bit prefixes, and they cannot be arranged to summarize. – Ron Maupin Jan 13 at 20:46
3

Regarding getting some bits from a link local address, not all addresses are suitable for that. Non MAC derived will not have any randomness, fe80::1 is used as everyone's gateway in some networks.

Technically, that algorithm is not required. But ULAs must be random. From section 3.2.1 immediately before that:

Locally assigned Global IDs MUST be generated with a pseudo-random algorithm consistent with [RANDOM]. Section 3.2.2 describes a suggested algorithm. It is important that all sites generating Global IDs use a functionally similar algorithm to ensure there is a high probability of uniqueness.

The suggested algorithm uses commonly available primitives as inputs, to be reliably unique. Possible that someone else could have the same MAC address, by not re-addressing a VM or the NIC vendor making a mistake. But also generating one with the same NTP timestamp is extremely unlikely. Certainly you can find implementations of this already written if you do not want to write code.

If you are using something else, don't use a purely MAC address based scheme. Perhaps read 40 bits from /dev/random.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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