[Scamper-dev] skitter/scamper API

David Moore dmoore at caida.org
Tue Jun 17 19:00:30 PDT 2003


So it would be good to have some sort of common API to read files
written by skitter and scamper.  It might be good to have a similar
(modulo ip address type) disk format also, but at the moment,
I consider that a separate issue.


So here is strawman proposal #1 (in semi-C++ not really STL notation):

Some sort of smart datafile.open() function which can tell which
kind of file it is.  Fails if it can't open it.  And datafile.close().

Some sort of datafile.type() and datafile.version() functions which
return the type (skitter, scamper, traceroute text, whatever) of
what was opened and the version of that file format.

Some sort of datafile.features() function which returns an object
which has additional accessor functions to check for presence of
particular features (relative to the whole trace), like iRTT on/off
or global settings, etc.

Some sort of datafile.eof() and datafile.err() functions which tell
you when you've hit the end of the file and if there is an error.
If you want exceptions, now's the time to say so.

Some sort of traceptr = datafile.nexttrace() which returns a pointer
to a trace object or NULL if eof() or err().

Perhaps a traceptr->features() to deal with case that some features could
be trace specific instead of file specific?

Some sort of traceptr->FIELD() accessor functions for extracting
base parameters for the trace (but not each hop).  Potentially
you might do:
    if (traceptr->features()->has_field("RTT")) {
	printf("RTT: %u\n", traceptr->RTT());
    }
    if (traceptr->features()->has_field("returned_ttl")) {
	printf("TTL: %u\n", traceptr->returned_ttl());
    }

Some sort of pathptr = traceptr->path() which returns a either an
iterator or a vector of hops or something like that (someone vote).
Maybe it's just hopptr = traceptr->nexthop() and it returns NULL at
the end.

Some sort of hopptr->FIELD() accessor functions for extracing the per-hop
parameters for the trace.  Perhaps again with checking to see if
that particular field is defined for this file/trace(/hop?).


Some of the fields might be computed from actual ones in the raw data.
We may or may not chose to export those raw fields.  Perhaps it would
be good to have some accessor functions which would let you get at the
raw fields for a particular format, but people should generally
be discouraged from using them.

-- david


More information about the Scamper-dev mailing list