6

I am setting up a virtual lab environment in the cloud to experiment with IPv6 networks.

Bear with me please, I'm new to networking and my grasp of the whole IPv6 subject is quite shaky. Please correct me if I misunderstand any of the IPv6 concepts or my terminology is wrong etc.

So what I am trying to do is creating a Link (or Subnet) consisting of Unique Local Addresses (ULA).

Regarding RFC 4193 the structure is the following:

  Prefix            FC00::/7 prefix to identify Local IPv6 unicast
                    addresses.

L Set to 1 if the prefix is locally assigned. Set to 0 may be defined in the future. See Section 3.2 for additional information.

Global ID 40-bit global identifier used to create a globally unique prefix. See Section 3.2 for additional information.

Subnet ID 16-bit Subnet ID is an identifier of a subnet within the site.

Interface ID 64-bit Interface ID as defined in [ADDARCH].

What I'm struggling with is generating the Pseudo-Random Global ID. RFC 4193 also specifies an algorithm to do so:

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.

This algorithm will result in a Global ID that is reasonably unique and can be used to create a locally assigned Local IPv6 address prefix.

Step 2) is what I'm having problems with. https://cd34.com/rfc4193/ implements the RFC 4193 algorithm utilizing a MAC address.

But what MAC address do I use?

I believe that if I just use the MAC of my physical Ethernet interface of my home PC I'm fine, right? If I understand correctly I could only run into the problem of the Global ID not being unique if someone generated a Global ID with the same MAC address at the exact same time.

snrrn
  • 163
  • 6

2 Answers2

8

Remember, the purpose of the algorithm is to avoid everyone picking FD00::/48 so they can abbreviate everything with the double colon. (Or other "easy" ones like FDAA:AAAA::/48, etc).

The section right above it (3.2.1) identifies that the formula in 3.2.2 is merely a suggested formula, not directed:

3.2.1.  Locally Assigned Global IDs

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.

As long as you use something with at least as much randomness of what is outlined in 3.2.2, you will be fine.

The suggested formula provides two starting values: the current time, and the local system's MAC address. This creates two seed values for the final random output.

If you were picking your own values, you would want to pick a value that would be different every time you generated a new /48 (like the current time), and something that would be different if two people on opposite ends of the world happened to generate their ULA address space at the exact same second (like their individual MAC addresses).

So what MAC address? Whichever you want... your phone, your home PC, your work PC, your buddies VM on his hypervisor, etc. So long as you pick one that you would likely not pick again if you are faced with generating another ULA address scope in the future -- even a random series of 48 bits would also do the trick.

Eddie
  • 15,286
  • 6
  • 46
  • 84
4

The MAC address would be the MAC address of the interface on which you want to assign the network, but as it says, it can be some other unique identifier. MAC addresses only need to be unique on the LAN where they are connected, but they are probably unique in a much larger context.

Ron Maupin
  • 102,040
  • 26
  • 123
  • 202