1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
_ ___ ____ ____ ____ _ _
|_|_ _ / _ \/ ___/ ___|| _ \ _ _ _ _(_) __| |
_|_||_| | | | \___ \___ \| |_) | | | | | | | | |/ _` |
|_||_|_| | |_| |___) |__) | __/ | |_| | |_| | | (_| |
|_|_|_| \___/|____/____/|_| \__,_|\__,_|_|\__,_|
OSSP uuid - Universally Unique Identifier
OVERVIEW
A UUID consists of 128 bits (16-octets) which are split into 6
octet-bounded unsigned integer fields ("time_low", "time_mid",
"time_hi_and_version", "clk_seq_hi_res", "clk_seq_low" and "node") and
where two fields are multiplexed with a fixed size 4-bit "version" and
a variable sized 2-3 bit "variant" field.
The UUID octets are counted from left to right 15 to 0 and the bits
in each octet are counted from left to right 7 to 0 (most significant
bit first, least significant bit last). The unsigned integer fields
formed out of multiple octets are stored in "network byte order" (most
significant octet first, least significant octet last). A UUID is
stored and transmitted from left to right, i.e., in "network byte
order" with the most significant octet first and the least significant
octet last.
Illustration 1:
(single octet array, less compact, more annotations)
Bits: [4] [2-3]
Field: version variant
MSO -->| |<-- -->| |<-- LSO
\ | | | | /
Octet: 15 14 13 12 11 10 | |9 8 | | 7 6 5 4 3 2 1 0
+------++------++------++------++------++------++------++------++------++------++------++------++------++------++------++------+
UUID: | || || || || || |#### || |##: || || || || || || || |
+------++------++------++------++------++------++------++------++------++------++------++------++------++------++------++------+
Bit: 76543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210
/| || || || || || |\
MSB | || || || || || | LSB
|<---------------------------->||<------------>||<------------>||<---->||<---->||<-------------------------------------------->|
time_hi clk_seq clk_seq
Field: time_low time_mid _and_version _hi_res _low node
Bits: [32] [16] [16] [5-6] [8] [48]
Illustration 2:
(two octet arrays, more compact, less annotations)
[4]
version
-->| |<--
| |
| | [16]
[32] [16] | |time_hi
time_low time_mid | _and_version
|<---------------------------->||<------------>||<------------>|
| MSO || || | |
| / || || | |
| 15 14 13 12 || 11 10 || |9 8 |
7654321076543210765432107654321076543210765432107654321076543210
/+------++------++------++------++------++------++------++------+~
MSB | || || || || || |#### || | ...
+------++------++------++------++------++------++------++------+~
~+------++------++------++------++------++------++------++------+
... ##: || || || || || || || | LSB
~+------++------++------++------++------++------++------++------+/
7654321076543210765432107654321076543210765432107654321076543210
| | 7 || 6 || 5 4 3 2 1 0 |
| | || || / |
| | || || LSO |
|<---->||<---->||<-------------------------------------------->|
|clk_seq clk_seq node
|_hi_res _low [48]
|[5-6] [8]
| |
-->| |<--
variant
[2-3]
|