Network Working Group Paul J. Leach, Microsoft
INTERNET-DRAFT Rich Salz, Certco
<draft-leach-uuids-guids-01.txt>
Category: Standards Track
Expires August 4, 1998 February 4, 1998
UUIDs and GUIDs
STATUS OF THIS MEMO
This document is an Internet-Draft. Internet-Drafts are working
documents of the Internet Engineering Task Force (IETF), its areas,
and its working groups. Note that other groups may also distribute
working documents as Internet-Drafts.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress".
To learn the current status of any Internet-Draft, please check the
"1id-abstracts.txt" listing contained in the Internet-Drafts Shadow
Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe),
munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or
ftp.isi.edu (US West Coast).
Distribution of this document is unlimited. Please send comments to
the authors or the CIFS mailing list at <cifs@discuss.microsoft.com>.
Discussions of the mailing list are archived at
<URL:http://discuss.microsoft.com/archives/index.
ABSTRACT
This specification defines the format of UUIDs (Universally Unique
IDentifier), also known as GUIDs (Globally Unique IDentifier). A UUID
is 128 bits long, and if generated according to the one of the
mechanisms in this document, is either guaranteed to be different
from all other UUIDs/GUIDs generated until 3400 A.D. or extremely
likely to be different (depending on the mechanism chosen). UUIDs
were originally used in the Network Computing System (NCS) [1] and
later in the Open Software Foundation's (OSF) Distributed Computing
Environment [2].
This specification is derived from the latter specification with the
kind permission of the OSF.
Table of Contents
1. Introduction .......................................................3
[Page 1]
Internet-Draft UUIDs and GUIDs (DRAFT) 02/04/98
2. Motivation .........................................................3
3. Specification ......................................................3
3.1 Format............................................................4
3.1.1 Variant......................................................4
3.1.2 UUID layout..................................................5
3.1.3 Version......................................................5
3.1.4 Timestamp....................................................6
3.1.5 Clock sequence...............................................6
3.1.6 Node.........................................................7
3.1.7 Nil UUID.....................................................7
3.2 Algorithms for creating a time-based UUID.........................7
3.2.1 Basic algorithm..............................................7
3.2.2 Reading stable storage.......................................8
3.2.3 System clock resolution......................................8
3.2.4 Writing stable storage.......................................9
3.2.5 Sharing state across processes...............................9
3.2.6 UUID Generation details......................................9
3.3 Algorithm for creating a name-based UUID.........................10
3.4 Algorithms for creating a UUID from truly random or pseudo-random
numbers .............................................................11
3.5 String Representation of UUIDs...................................12
3.6 Comparing UUIDs for equality.....................................12
3.7 Comparing UUIDs for relative order...............................13
3.8 Byte order of UUIDs..............................................13
4. Node IDs when no IEEE 802 network card is available ...............14
5. Obtaining IEEE 802 addresses ......................................15
6. Security Considerations ...........................................15
7. Acknowledgements ..................................................15
Leach, Salz expires Aug 1998 [Page 2]
Internet-Draft UUIDs and GUIDs (DRAFT) 02/04/98
8. References ........................................................15
9. Authors' addresses ................................................16
10.Notice ............................................................16
11.Full Copyright Statement ..........................................16
Appendix A _ UUID Sample Implementation...............................17
Appendix B _ Sample output of utest...................................27
Appendix C _ Some name space IDs......................................27
1. Introduction
This specification defines the format of UUIDs (Universally Unique
IDentifiers), also known as GUIDs (Globally Unique IDentifiers). A
UUID is 128 bits long, and if generated according to the one of the
mechanisms in this document, is either guaranteed to be different
from all other UUIDs/GUIDs generated until 3400 A.D. or extremely
likely to be different (depending on the mechanism chosen).
2. Motivation
One of the main reasons for using UUIDs is that no centralized
authority is required to administer them (beyond the one that
allocates IEEE 802.1 node identifiers). As a result, generation on
demand can be completely automated, and they can be used for a wide
variety of purposes. The UUID generation algorithm described here
supports very high allocation rates: 10 million per second per
machine if you need it, so that they could even be used as
transaction IDs.
UUIDs are fixed-size (128-bits) which is reasonably small relative to
other alternatives. This fixed, relatively small size lends itself
well to sorting, ordering, and hashing of all sorts, storing in
databases, simple allocation, and ease of programming in general.
3. Specification
A UUID is an identifier that is unique across both space and time,
with respect to the space of all UUIDs. To be precise, the UUID
consists of a finite bit space. Thus the time value used for
constructing a UUID is limited and will roll over in the future
(approximately at A.D. 3400, based on the specified algorithm). A
UUID can be used for multiple purposes, from tagging objects with an
extremely short lifetime, to reliably identifying very persistent
objects across a network.
Leach, Salz expires Aug 1998 [Page 3]
Internet-Draft UUIDs and GUIDs (DRAFT) 02/04/98
The generation of UUIDs does not require that a registration
authority be contacted for each identifier. Instead, it requires a
unique value over space for each UUID generator. This spatially
unique value is specified as an IEEE 802 address, which is usually
already available to network-connected systems. This 48-bit address
can be assigned based on an address block obtained through the IEEE
registration authority. This section of the UUID specification
assumes the availability of an IEEE 802 address to a system desiring
to generate a UUID, but if one is not available section 4 specifies a
way to generate a probabilistically unique one that can not conflict
with any properly assigned IEEE 802 address.
3.1 Format
In its most general form, all that can be said of the UUID format is
that a UUID is 16 octets, and that some bits of octet 8 of the UUID
called the variant field (specified in the next section) determine
finer structure.
3.1.1 Variant
The variant field determines the layout of the UUID. That is, the
interpretation of all other bits in the UUID depends on the setting
of the bits in