CAIDA CoralReef Exercises


Timestamps --more than meets the eye
(no unix version)

Standard intro to all exercises. This includes:

Level

Introductory.

Prerequisites

System Resources

Timestamps

Conceptually a CoralReef trace is a series of records. Each record
describes a cell or a packet recorded from a communications link.
Each record contains a timestamp that records the time at which this
cell was captured by the monitor. This exercises examines these
timestamps.

Preparation

Obtain the following traces:

A large number of ``packet header traces'', containing the first 48
bytes (Why 48 bytes?) of each IP packet are available at
http://moat.nlanr.net/Traces/
Typically the traces include data from two interfaces, one collecting
data from each direction.

The names of these traces consist of a three letter code, a Unix
timestamp, and an extension indicating the format of the trace.

If you need to convert the Unix timestamp to a date and time try

date -r time_value or perl -e 'print scalar(localtime(time_value));
These will give date and time in your local time zone.

For this exercise we have fetched three traces for you. They are
stored in /usr/local/tonym The patch file you need for the
coral install is also there.

Printing timestamps

The coral application \verb+crl_timestamps+ prints timestamp information
about each cell. The three columns of its output are:


2. The timestamp indicating the cell was recorded.
3. The difference between the current timestamp and the
timestamp for the previous cell on this interface.

A closer look

Some difficulties arise when working with traces because of their
size. Some of these difficulties are related to the time it takes to
process the trace. This is especially true if interpreted languages
like perl are used (which is the case with crl_timestamps).

A more significant problem is the difficulty of verifying that the
data collected is reasonable. It is valuable to develop strategies
for making some simple validity checks on the data. In the case of
timestamps we know they should always increase in value and under
normal circumstances, should increase at a roughly constant rate,
without any sudden changes.

One way to verify this is to plot the timestamp value against the
cell number. To do this you need to:

You will notice that there is a discontinuity near the start of the
trace. At about cell 1300 the timestamps return to 0 and start
again. Most of the NLANR traces have this discontinuity near the
start.

To understand this behaviour you need to know a little about the way
the monitor is constructed. Most monitors have two cards ATM
interface cards, one to monitor each direction of the link. The cards
are operated by firmware which is downloaded to the card at the
beginning of a measurement. Once this firmware is loaded the card
starts recording data. It is desirable to have the timestamps as
close as possible on the two cards so once both are operational the
monitor system resets both cards timestamps at the same time.

Because of this behaviour any analysis that uses timestamps should
discard the early part of the trace. The average cell rate you
calculated earlier will be wrong.

While the difference between the correct and incorrect calculations is
not large in this case similar hidden behaviour in cell traces can
affect the analysis of the traces.

Another trace

Repeat the timestamp graph with the ACK-dag-19990708-121553-0-160000-161000.crl trace.

You will notice that through most of the trace the timestamps have
large values (they do not start at 0 like the NLANR ODU trace) but go
to 0 at the end of the trace. The timestamps are large because,
unlike the NLANR traces the DAG traces derive their timestamps from an
external real time reference (the global positioning system, GPS,
is used to provide an accurate time reference). The timestamps are
seconds and fractions of seconds from 1 January 1970.

%\unixnaieve {This odd sounding format is used because it is based on
the way Unix keeps the time and there are routines provided under Unix
to convert these times to a human readable string.}

The timestamps go to 0 at the end of the trace because the raw file
format used for CoralReef is based around blocks of packets or cells
but the DAG monitor is not. A partly filled block of cells is
padded with zeros by the conversion software.

Inter-cell time distribution

Researchers are often interesting in the typical time between cells
of the distribution of cell inter-arrival times. For example the
designers of a high speed switch might want to know the shortest and
most common inter cell times and the percentages of cells at those
times.

Combining traces

Because of the external time source, which synchronises both interface
cards in a DAG monitor, the cells in the traces collected for the
two directions can be combined and, if sorted on timestamp, the
cells will be correctly ordered between the two traces. This is not
the case for traces collected where the two cards are independent
because the separate clocks in the cards will drift slightly over time
and cells that are reported in one order might have occurred in a
different order.

This ordering problem makes some kinds of analysis impossible. For
example with correctly ordered cells retransmission can be detected
when data is seen after it has been acknowledged. If the
ordering of cells can not be relied on this analysis will not be
meaningful.

If two or more traces are listed on the crl_timestamps command
line (and most other coral applications) coral will merge the data from the
two files as the data is processed so that the cells or packets are
processed in order.

Conclusion

The concept of timestamps and card interfaces is a simple one but
practical considerations make timestamps more difficult to deal with.
The large size of traces requires care to ensure that the methodology
accounts for all the events in the trace, not just the most common
events.

For assessment hand in the results of each of the questions you
answered.