Documentation ¶
Overview ¶
Package tracer takes care of all interaction with traceroute systems.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMetaline ¶
func GetMetaline(conn connection.Connection, isCache bool, cachedUUID string) []byte
GetMetaline returns the what the first line of the output jsonl file should be. Parameter isCache indicates whether this meta line is for an original trace test or a cached test, and parameter cachedUUID is the original test if isCache is 1.
Types ¶
type Metadata ¶
type Metadata struct { UUID string TracerouteCallerVersion string CachedResult bool CachedUUID string }
Metadata is the first line of the traceroute .jsonl file.
TODO: move this struct to ETL parser.
type Scamper ¶ added in v0.5.0
type Scamper struct {
Binary, OutputPath string
ScamperTimeout time.Duration
TracelbPTR bool
TracelbWaitProbe int
}
Scamper uses scamper in non-daemon mode to perform traceroutes. This is much less efficient, but when scamper crashes, it has a much lower "blast radius".
func (*Scamper) DontTrace ¶ added in v0.5.0
func (*Scamper) DontTrace(conn connection.Connection, err error)
DontTrace does not perform a trace that would have been performed, had the previous round not already returned an error. This should increment a counter that tracks the number of tests which have been "transitively failed".
func (*Scamper) Trace ¶ added in v0.5.0
func (s *Scamper) Trace(conn connection.Connection, t time.Time) (out []byte, err error)
Trace starts a new scamper process running the paris-traceroute algorithm to every node. This uses more resources per-traceroute, but segfaults in the called binaries have a much smaller "blast radius".
func (*Scamper) TraceFromCachedTrace ¶ added in v0.5.0
func (s *Scamper) TraceFromCachedTrace(conn connection.Connection, t time.Time, cachedTest []byte) error
TraceFromCachedTrace creates test from cached trace.
type ScamperDaemon ¶
ScamperDaemon contains a single instance of a scamper process. Once the ScamperDaemon has been started, you can call Trace and then all traces will be centrally run and managed.
This approach has the advantage that all traces are centrally managed, which helps prevent problems with overlapping traces. It has the disadvantage that all traces are centrally managed, so if the central daemon goes wrong for some reason, there is a much larger blast radius.
func (*ScamperDaemon) MustStart ¶
func (d *ScamperDaemon) MustStart(ctx context.Context)
MustStart starts a scamper binary running and listening to the given context. There should only be a single instance of scamper being run by traceroute-caller, and if it can't start, then traceroutes can not be performed.
We expect this function to be mostly used as a goroutine:
go d.MustStart(ctx)
func (*ScamperDaemon) Trace ¶
func (d *ScamperDaemon) Trace(conn connection.Connection, t time.Time) (out []byte, err error)
Trace starts a sc_attach connecting to the scamper process for each connection.
func (*ScamperDaemon) TraceAll ¶
func (d *ScamperDaemon) TraceAll(connections []connection.Connection)
TraceAll runs N independent traces on N passed-in connections.