[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nm-wg] 1st draft of timestamp doc
As promised, and probably sooner than anyone expected, a first draft of
the NM-WG timestamp document. I used XML Schema despite my distaste for
it as a schema language, partially because it is the de facto language
and partially to force simplicity (since anything moderately complex
becomes a beast in XML Schema), and partially to emphasize the
inheritance relationships (RELAX-NG doesn't "do" inheritance).
Those who wish to be co-author, contact me and/or the list and we can
arrange who gets the next edit token, etc. I currently hold the edit
token, if such a thing becomes necessary. General comments and
criticisms also welcome (with the usual caveat that you risk getting hit
up to be a co-author).
-Dan
Timestamps for Network Measurements
Draft version 29 June 2004
1. Introduction
Timestamps are an integral part of network measurements. In order to
exchange these measurements, we need a framework for describing the
timestamps associated with the measurements. Different types of
measurement contexts will have different requirements and capabilities
in this regard, so we attempt to produce a framework for describing
timestamps and not just a single "correct" format. XML and XML Schema
will be used where wire formats are discussed.
2. Notational Conventions
This namespace is not (yet) fixed, so this document will
represent it as "http://www.ggf.org/nmwg". The namespace prefix will be
"nm:". In the XML schema fragments, the prefix used for XML Schema elements will
be "xsd:".
Names are in "TitleCase".
3. Base timestamp format
The "base" timestamp is nothing more than a container in the NM-WG
namespace. The XML Schema declaration for this is simply:
<xsd:complexType name="Timestamp"/>
4. Preferred timestamp format
In absence of other considerations, the preferred timestamp format is
the NTP format, a 64-bit number where the first 32 bits are the
seconds and the last 32 bits are the fractional seconds. To this we
add two sub-fields, resolution and accuracy. Resolution is a 64-bit
number in the same format as the timestamp, indicating the smallest
time that can occur between two successive timestamp values. Accuracy
is a place-holder so the semantics are not defined. Both resolution
and accuracy are optional.
This results in the following XML Schema:
<xsd:simpleType name="Hex64">
<xsd:restriction base="xsd:hexBinary">
<xsd:length value="8" fixed="true"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="NTPTimestamp">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="tns:Timestamp">
<xsd:sequence>
<xsd:element name="Time" type="tns:Hex64"/>
<xsd:element name="Resolution" type="tns:Hex64" minOccurs="0"/>
<xsd:element name="Accuracy" type="tns:Hex64" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
5. Other timestamp formats
5.1. ISO8601 Timestamp
The preferred human-understandable timestamp format, the preferred is a
particular variation of ISO8601 [ISO8601],
"YYYY-MM-DDThh:mm:ss.<frac>Z". The <frac> represents fractional
seconds. For example "2004-06-29T17:11:13.163853Z". This is similar to
the XML Schema 'dateTime' type, and therefore the XML Schema
representation is a 'restriction' of that type with the above
restrictions remaining textual.
<xsd:element name="ISOTimestamp">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="tns:Timestamp">
<xsd:sequence>
<xsd:element name="Time">
<xsd:simpleType>
<xsd:restriction base='xsd:dateTime'/>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
5.2. Single-source timestamp
The above timestamps are mostly intended to represent a globally
synchronized clock. The process of synchronization means that the
timestamps from a single source may "pause" or even go backwards in
order to compensate for drift from the perceived actual (global)
time. To represent a nanosecond-resolution single-source clock that is
monotonic increasing, the preferred timestamp format is instead a long
integer number of nanoseconds and an optional, opaque, source identifier.
<xsd:element name="SingleSourceTimestamp">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="tns:Timestamp">
<xsd:sequence>
<xsd:element name="Time" type="xsd:unsignedLong"/>
<xsd:element name="Source" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
6. Full XML Schema
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.ggf.org/nmwg"
targetNamespace="http://www.ggf.org/nmwg">
<xsd:complexType name="Timestamp"/>
<xsd:simpleType name="Hex64">
<xsd:restriction base="xsd:hexBinary">
<xsd:length value="8" fixed="true"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="NTPTimestamp">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="tns:Timestamp">
<xsd:sequence>
<xsd:element name="Time" type="tns:Hex64"/>
<xsd:element name="Resolution" type="tns:Hex64" minOccurs="0"/>
<xsd:element name="Accuracy" type="tns:Hex64" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="ISOTimestamp">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="tns:Timestamp">
<xsd:sequence>
<xsd:element name="Time">
<xsd:simpleType>
<xsd:restriction base='xsd:dateTime'/>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="SingleSourceTimestamp">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="tns:Timestamp">
<xsd:sequence>
<xsd:element name="Time" type="xsd:unsignedLong"/>
<xsd:element name="Source" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
</xsd:schema>
7. Examples
7.1. Preferred (NTP) timestamp
<nm:NTPTimestamp xmlns:nm="http://www.ggf.org/nmwg">
<Time>DEADBEEFDEADBEEF</Time>
</nm:NTPTimestamp>
7.2. Other timestamps
{T.B.D.}
8. References
{T.B.D.}
[ISO8601]
[NTP]
[NM-WG]
9. Authors
Dan Gunter, dkgunter@lbl.gov