Subject: [ipfix] [issue] INFO-24 High-res time encoding

From: Falko Dressler <[email-masked]>
Date: Tue, 25 Nov 2003 20:16:46 +0100

Issue: INFO-24  Encoding options for high-resolution timestamps
Description:
http://ipfix.doit.wisc.edu/archive/2214.html

Various encoding options for high-resolution timestamps for recommended 
or optional usage.

Available types:

* NTP format (8 byte)
   2 Parts: seconds (4 byte) / 1/2**32 fraction of seconds)

* Posix timeval
   2 Parts: seconds (4 byte) / nanoseconds (4 byte)

* Milliseconds sinch EPOCH (8 byte)

* Micro/Nanoseconds since EPOCH (8 byte, rollover!)

--
Help        mailto:[email-masked] and say "help" in message body
Unsubscribe mailto:[email-masked] and say
"unsubscribe ipfix" in message body
Archive     http://ipfix.doit.wisc.edu/archive/

---

From: Sebastian Zander <[email-masked]>
Date: Wed, 26 Nov 2003 15:21:28 +0100

Hi,

common time formats are:

- time_t: seconds since epoch (4 byte)
- struct timeval: seconds, microseconds since epoch (8 byte)
- struct timespec (POSIX): seconds, nanoseconds since epoch (8 byte)
- NTP: seconds, 1/2^32 fraction since epoch (8 byte)

Unix epoch is 1970 whereas NTP epoch is 1900. Therefore some conversion is
needed to convert from NTP to one of the others.

The size of the first 3 depend on the architecture. On my machine (Intel) they
have the sizes above but on other platforms this may be different AFAIK on Alpha
a long is 8 bytes.

I'd like to see a timestamp format with second resolution which can be used
where a higher granularity is not required (e.g. accounting) and saves some
bytes on the wire. Another type with at least microsecond resolution should
be available for cases where a higher granularity is required (e.g. delay
measurement)

NTP makes the most of the bits (in terms of resolution ;-) and is an IETF
standard. Coversion to time_t etc. is simple.

Cheers,

Sebastian

-- 
Sebastian Zander                         E-mail: [email-masked]
Fraunhofer FOKUS / METEOR                Tel: +49-30-3463-7287
Kaiserin-Augusta-Allee 31                Fax: +49-30-3463-8287
D-10589 Berlin, Germany                  www.fokus.fraunhofer.de/usr/sebastian.zander