-
Notifications
You must be signed in to change notification settings - Fork 11
Discussion: MAC Address usage within UUIDs #13
Comments
The reasons for not using MAC address are:
It says SHOULD NOT instead of MUST NOT because it's still at the discretion of the implementation, it's just not recommended. |
The original author of this issue might want to correct me, but it seems that there are two interpretations of the question in this issue and @bradleypeabody may have responded to the wrong one: the word “fake” in the title is key. The first is about the choice between using real MAC addresses and pseudorandom numbers in the node ID field, in general; RFC 4122 §4.5 already discusses the possibility of using either but explicitly leaves the choice to the creator of the UUID (though arguably it treats the real MAC address case as the primary one). If the experience of the authors of this draft suggests that, fifteen years later, it is worth elevating the pseudorandom number case to a SHOULD, I’m willing to believe them. So, no argument here. The second is about the conflict between the ways 4122 and this draft specify for putting a pseudorandom number in the node ID. This draft (in its v6 section—I haven’t looked at v7 and v8 in detail) tells you to just chuck 48 bits of randomness there. RFC 4122 instead respects the internal structure of MAC addresses by instructing people to set 47 of the 48 bits randomly, but set the I/G bit (“unicast/multicast”, least significant bit of the first octet) to one, on the theory that a real network card’s MAC address is not ever going to be a multicast one. (It also notes that the proper way would instead be to set the next bit, U/L, which is explicitly intended to mark MAC addresses that do not fit into the IEEE-managed namespace, but people have been using multicast addresses before the RFC was written so that’s what the RFC documents.) Thus this draft has a collision probability that is √2 times less (by having an additional bit of randomness) but 4122 allows detecting whether a node ID should be interpreted as a real MAC address (by isolating the random and non-random node ID spaces from each other). Yes, the RFC 4122 way is kind of awkward and clunky and in an ideal world we probably wouldn’t have used it. But in a world where it is already specified for v1 UUIDs, is it worth having a different one for v6 UUIDs, just to have one more random bit to play with? I can believe there is a different and valid reason, but I don’t see it written down anywhere. |
... And now that I’ve taken the time to write all of this down, it finally occurs to me that maybe the main thrust of the draft here is that the node ID should not, in fact, identify nodes in any sense, but should instead be generated anew for each UUID (in order to e.g. avoid exposing how many UUID-generating hosts there are), which 4122 §4.5 does not technically prohibit but does not really seem to anticipate. But while the algorithm in §4.3.4 does tell you to use fresh randomness, 11 items down, I have to admit that this intention was never clear to me from the language in §4.3.3 (quoted in the original issue text) even though I’ve reread the v6 parts of the draft several times over the last couple of weeks. In fact, it still reads as “don’t use real MAC addresses (because security) or set the multicast bit (because we said so)” to me, not “generate fresh random node IDs for each UUID, dummy”. So even if you think setting the multicast bit as in 4122 is not worth it and don’t want to explain why (?), it seems that §4.3.3 could still use a clarification and/or an explicit comparison to 4122 §4.5. |
That is a lot of text. My point was that RFC 4122 Section 4.5 has two options: use MAC address OR use some random with setting a specific bit to 1. So, if we are talking about this spec... I would just write that UUIDv6 follows Section 4.5, but maybe you can add one sentence to tell that it isn't recommended. |
So, in conclusion: I would like if the UUIDv6 spec tells me:
In that case, UUIDv6 follows RFC 4122 Section 4.5 and still gives possibility for custom node-id. |
The general ideas that the draft is intended to communicate are:
What is the use case for interpreting this data? The purpose of the MAC address from RFC4122 is to obtain a unique value, not to communicate the MAC address of the system to the recipient. So why would the recipient of a UUID need to know if this part is a MAC address or random data? If there is a good answer to this question, then I think it's worth revisiting, but if not, then hopefully the intention behind just using random data is clear - it's just intended to produce a unique value, we're not concerned with reading the MAC address from it after. |
Draft 03 Security Considerations is more or less the same. |
FWIW ... at one point in time it was very hard to seed a good random number generator on some devices ( particularly ones without human IO ). Today most those devices have hardware RNG support. Given the privacy issues of MAC, I think we should be looking at totally phasing out any MAC based UUID. |
Do you mean Hardware random number generator? It would be great to use it to generate the "seed" for a faster cryptographically secure pseudorandom number generator - for UUID |
In section 4.3.3 (UUIDv6 Node Usage) of this specification, there is the following text:
May I ask what the motivation is for this section that tells me that I "SHOULD NOT"?
I know that using MAC addresses isn't fully secure, but to fix that, RFC 4122 also has Section 4.5. This section says if you cannot use or don't want to use MAC addresses, you can set one bit to 1 (that is always 0 in normal MAC addresses) and generate some 47-bit integer for the remaining bits. However, section 4.3.3 also says I "SHOULD NOT" use Section 4.5.
I don't see any problem with accepting Section 4.5, because setting that unicast/multicast bit makes it more secure (and the only difference is that your generated id isn't 48 bits, but just 47 bits).
The text was updated successfully, but these errors were encountered: