Documentation
¶
Overview ¶
Package ping is CION's SCMP-echo application: the network's health probe and the first resident of the pkg/apps namespace — a consumer of the path library (pkg/libs/scion) beside the control plane. A pinger resolves the freshest path to a destination, sends a count of requests, and reports per-reply RTT, the reply's path hops, and a loss summary; the responder that answers them is the node's own, part of the core, so the pinger is the application's whole surface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Conn is the pinger's socket; its port becomes the echo identifier the
// replies return to.
Conn *scion.Conn
// Paths resolves paths to the destination.
Paths Paths
// Dst is the destination ISD-AS.
Dst addr.IA
// DstHost is the destination's underlay host address, which the
// responder's socket is bound to.
DstHost netip.Addr
// Count is the number of requests to send.
Count int
// Interval is the time between requests.
Interval time.Duration
// Wait bounds the wait for each reply before it counts as lost.
Wait time.Duration
// Ready bounds the wait for the network to serve before the counted
// run: the first path resolution is retried within it and uncounted
// warm-up requests leave until one is answered. Zero resolves once and
// counts at once; a destination no path resolves for, within the bound
// when set, is an error either way, never a hang.
Ready time.Duration
// Log receives a line per reply and the summary; nil discards them.
Log func(string, ...any)
}
Config configures one ping run.
type ReplyStat ¶
type ReplyStat struct {
// Seq is the reply's sequence number.
Seq uint16
// RTT is the time from sending the request to reading the reply.
RTT time.Duration
// Hops is the number of hop fields of the reply's arrival path — the
// reversed road the reply came by; a one-hop arrival counts one hop.
Hops int
// Segments is the number of segments of the arrival path.
Segments int
}
ReplyStat is one matched reply.
type Report ¶
type Report struct {
// Sent is the number of requests sent.
Sent int
// Received is the number of requests answered.
Received int
// Replies holds one statistic per received reply.
Replies []ReplyStat
// Reresolves is the number of path resolutions beyond the first: expiry
// or send errors re-resolved mid-run.
Reresolves int
}
Report summarizes a ping run.
func Run ¶
Run sends Count echo requests at Interval, matching replies by identifier and sequence. The path is resolved once and re-resolved whenever it expired or a send failed; the run continues either way. Ready bounds the wait for a network still converging — the first resolution retried within it, uncounted warm-up requests leaving until one is answered — so the counted run reports the network, not its bring-up. A destination no path resolves for, within Ready when set, is an error, not a hang.