The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in IETF BCP14 (RFC2119 & RFC8174)
Universal Unique Identifier (UUID) are used to uniquely identify a "thing". UUIDs shall be used in uProtocol the UUID shall be used to uniquely identify messages (events) sent between uEs and between devices.
UUIDv1 through 4 are defined in RFC4122 and have been deployed throughout the Internet and in applications for many years. A new RFC draft draft-ietf-uuidrev-rfc4122bis proposes three new types of RFCs, UUIDv6, v7, and v8.
uProtocol shall define its own format of UUID (using UUIDv8 specification) so that:
-
ID is sortable
-
Timestamp is based on the reliable (and widely used) Unix Epoch
-
Large random number to ensure the UUIDs retain the required level of unguessability through underlying entropy
-
Support for <1ms precision without
-
ID generation is efficient
The following will elaborate on the uProtocol UUIDv8 bit allocations:
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | unix_ts_ms | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | unix_ts_ms | ver | counter | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |var| rand_b | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | rand_b | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Field | RFC2119 |
---|---|
unix_ts_ms |
|
ver |
|
counter |
|
var |
|
rand_b |
|