Documentation
¶
Overview ¶
Package ping is CION's SCMP-echo application, the network's probe: its resident prober measures the paths the node's picks and leases ask it to, and publishes their records on the node bus. The echo mechanics it rides, and the client behind `cion ping`, are the ping library's; the responder that answers is the node's own, part of the core.
Index ¶
Constants ¶
const ( // Heartbeat bounds how long a silent failure of a path in use goes // unseen, a burst's second beside it. Heartbeat = 5 * time.Second // RouteProbe spaces the probes of a priced route: a requester that // prices its routes each half minute reads a probe from within its last // pricing. RouteProbe = 30 * time.Second // SlowProbe matches the cadence at which registrations and lookups // refresh the segments the candidates are composed from. SlowProbe = time.Minute // HotWindow is how long after its last pick, use, or pricing a // destination is hot. HotWindow = time.Minute // BurstProbes and BurstSpacing shape a burst: five probes over a second. BurstProbes = 5 BurstSpacing = 200 * time.Millisecond // ProbeWait is how long a probe waits for its answer. ProbeWait = time.Second // Budget is the probes a second the prober sends at most, node-wide. Budget = 20 )
The prober's pacing. A destination is hot for HotWindow after its last pick, use, or pricing: its path in use and the path its lease weighs are probed every Heartbeat, its priced routes every RouteProbe, and its standby and its suspect every SlowProbe, each first at once. Until its requests lapse, its path in use and the path its lease weighs are probed every SlowProbe, its other paths not at all. A caller's confirmation of a path counts as its routine probe. A lost probe of a path in use, weighed, priced, or suspect, and a caller's doubt newer than a path's last answer, call a burst, which decides the path: an answer keeps or clears it, a burst lost whole ejects it.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Echoer ¶ added in v0.0.10
type Echoer interface {
// Send sends an echo request to the host in dst over the path.
Send(dst addr.IA, host netip.Addr, path *spath.Decoded, seq uint16) error
// Replies delivers each reply to one of the prober's own requests.
Replies() <-chan pinglib.Reply
// ReadReplies reads the replies until ctx ends.
ReadReplies(ctx context.Context) error
}
Echoer sends the prober's echo requests and delivers the replies to them.
type Prober ¶ added in v0.0.10
type Prober struct {
// contains filtered or unexported fields
}
Prober is the resident ping application: it probes the paths the node's requesters ask it to, by SCMP echo to each destination's responder, and publishes each path's record. One loop owns its state; the replies and the resolutions reach it from loops of their own.
func NewProber ¶ added in v0.0.10
func NewProber(cfg ProberConfig) *Prober
NewProber returns a prober over the configured topics, echoes, and resolutions.
func NewResident ¶ added in v0.0.10
func NewResident(cfg ResidentConfig) (*Prober, error)
NewResident binds the prober's two conns, one its echoes ride and one its resolutions read alone, and returns the prober over the node's bus. The replies to the probes of paths in use go to the echo conn's ECN state.
type ProberConfig ¶ added in v0.0.10
type ProberConfig struct {
// Requests is the topic of the paths to measure.
Requests *bus.Topic[bus.PathRequests]
// Measurements is the topic the paths' records are published on.
Measurements *bus.Topic[bus.PathMeasurements]
// InterfaceDown is the topic whose signals call bursts.
InterfaceDown *bus.Topic[bus.InterfaceDownState]
// Echo sends the probes and delivers their replies.
Echo Echoer
// Resolve resolves each destination's responder host.
Resolve pinglib.Resolver
// Answer hands dst's rate the reply to a probe of its path in use:
// whether it came back marked, and when the probe was sent.
Answer func(dst addr.IA, marked bool, sent time.Time)
}
ProberConfig configures a prober.