tracer

package
v0.11.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package tracer takes care of all interactions with the traceroute tools, currently only scamper. This package supports two types of traceroutes among the many that scamper can run: MDA and regular:

  • MDA traceroute (tracelb) finds load balanced paths between two addresses by varying the first 4 bytes of the transport header, but keeping the first 4 bytes constant when probing consecutive hops. the -P parameter to tracelb says what type of probes to send, and while the names have overlap with the -P parameter to trace, they mean different things.
  • Regular traceroute using Paris algorithm (trace -P icmp-paris) finds a single path between two addresses by keeping the first 4 bytes of the transport header constant.

See scamper's man page for more details.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyUUID is returned when a required UUID is empty.
	ErrEmptyUUID = errors.New("uuid is empty")
)

Functions

This section is empty.

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 {
	// contains filtered or unexported fields
}

Scamper invokes an instance of the scamper tool for each traceroute.

func NewScamper added in v0.10.0

func NewScamper(cfg ScamperConfig) (*Scamper, error)

NewScamper validates the specified scamper configuration and, if successful, returns a new Scamper instance. Otherwise, it returns nil and an error.

func (*Scamper) CachedTrace added in v0.10.0

func (s *Scamper) CachedTrace(uuid string, t time.Time, cachedTrace []byte) ([]byte, error)

CachedTrace creates an updated traceroute using the given uuid and time based on the traceroute cache.

func (*Scamper) DontTrace added in v0.5.0

func (*Scamper) DontTrace()

DontTrace is called when a previous traceroute that we were waiting for fails. It increments a counter that tracks the number of these failures.

func (*Scamper) Trace added in v0.5.0

func (s *Scamper) Trace(remoteIP, uuid string, t time.Time) ([]byte, error)

Trace starts a new scamper process to run a traceroute based on the traceroute type and saves it in a file.

func (*Scamper) WriteFile added in v0.11.0

func (s *Scamper) WriteFile(uuid string, t time.Time, data []byte) error

WriteFile writes the given data to a file in the configured Scamper output path using the given UUID and time.

type ScamperConfig added in v0.10.0

type ScamperConfig struct {
	Binary           string
	OutputPath       string
	Timeout          time.Duration
	TraceType        string
	TracelbPTR       bool
	TracelbWaitProbe int
}

ScamperConfig contains configuration parameters of scamper.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL