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