Expand description
Reusable client/session/event layer for IRTT-compatible probes.
irtt-client opens IRTT-compatible sessions, sends echo probes, receives
replies, classifies loss/late/duplicate packets, and emits ClientEvent
values for callers to consume directly or aggregate with irtt-stats.
With the tokio feature enabled, AsyncClient provides the same low-level
lifecycle for callers that own a Tokio runtime and drive readiness directly.
Timing values intentionally preserve signed measurement semantics. When
server timing is available, RttSample::effective is adjusted for server
processing and can be negative if the reported server processing time exceeds
the raw client-observed RTT. Directional OneWayDelaySample values are
also signed when the required wall-clock timestamps are available; negative
values usually indicate client/server clock skew.
Client is the runtime-free low-level blocking adapter and requires no
Tokio dependency at all; it is what a caller without a runtime, or that
wants full control over its own event loop, should start from. With the
tokio feature, AsyncClient provides the corresponding low-level Tokio
adapter for a caller that owns a runtime and drives socket readiness
itself. Both adapters send one probe whenever called; callers own cadence
and run duration, using negotiation() after Open. Sends return a
SendReceipt after socket acceptance and session commitment;
SendProbeError distinguishes uncommitted failures from post-commit
failures carrying that receipt. Convert a receipt to ClientEvent for
presentation or statistics. managed owns
negotiated-interval scheduling, finite runs, and staggered/burst pacing:
ManagedClientTask /
ManagedClientHandle (tokio feature) run and control one or more
targets under a Tokio runtime, and BlockingManagedClient (tokio
feature) wraps that in a synchronous owner backed by its own dedicated
current-thread runtime for callers that want managed multi-target
behavior without touching Tokio themselves.
A successful OpenOutcome carries either SessionStarted (with a live
token) or NoTestCompleted (terminal, with no probe session). Lifecycle
events use these same payload types. Their NegotiationResult separates
typed AcceptedSessionParameters from the exact decoded peer Params and
accepted NegotiationChange records. Use accepted.interval and
accepted.duration for cadence and lifetime, accepted.dscp for the public
DSCP codepoint, and peer_params for wire diagnostics. Strict/Loose policy
compares the actual request and reply wire values before deriving accepted
semantics. Both adapters’ negotiation() accessors return only a live
session’s result; no-test completion leaves no current session.
See examples/ in the repository for a runnable example of each tier.
Modules§
Structs§
- Accepted
Session Parameters - Validated session semantics accepted after a successful Open exchange.
- Async
Client - Low-level Tokio IRTT client for one connected UDP target.
- Client
- Low-level synchronous IRTT client.
- Client
Config - Configuration for opening and running an IRTT client session.
- Client
Timestamp - Client-side timestamp captured in both wall-clock and monotonic time.
- HmacKey
- Shared HMAC key bytes. Debug output never includes the bytes or a fingerprint.
- Negotiation
Result - Accepted session semantics, exact protocol evidence, and accepted changes.
- NoTest
Completed - Successful negotiation-only exchange with no live probe session or token.
- OneWay
Delay Sample - Directional one-way delay samples computed from wall-clock timestamps.
- Open
Policy - Opening behavior shared by blocking, async, and managed clients.
- Packet
Meta - Receive-side packet metadata observed outside the IRTT wire protocol.
- Received
Stats Sample - Server-reported receive counters decoded from an echo reply.
- Recv
Budget - Bound for a single receive-drain operation.
- RttSample
- Round-trip timing for one echo reply.
- Send
Receipt - An Echo datagram accepted by the UDP socket and committed in session state.
- Server
Timing - Server-reported timing fields decoded from an echo reply.
- Session
Request - Requested IRTT protocol and session semantics, reusable across endpoints.
- Session
Started - Successful negotiation with a live session ready for echo probes.
- Signed
Duration - Signed nanosecond-backed duration used for derived timing values.
- Socket
Config - Local UDP socket options used by
ClientConfig.
Enums§
- Address
Family - Allowed remote address families. IPv6-only selection also sets IPV6_V6ONLY.
- Authentication
- Concrete authentication for a low-level client session.
- Client
Error - Failure reported while configuring, opening, running, receiving, closing, or joining an IRTT client session.
- Client
Event - Event emitted by an IRTT client session.
- Negotiation
Change - A semantic parameter change accepted during negotiation.
- Negotiation
Policy - How strictly to handle server-side negotiation restrictions.
- Open
Outcome - Result of the IRTT Open exchange, before any echo probes are driven.
- RunMode
- Mode requested during the IRTT open exchange.
- Send
Probe Error - Probe-send failure with an explicit socket-acceptance commitment boundary.
- Warning
Kind - Category for a non-fatal
ClientEvent::Warning.
Constants§
- MAX_
DSCP_ CODEPOINT - Largest valid DSCP codepoint accepted by client configuration.
- MAX_
SERVER_ FILL_ BYTES - Protocol compatibility bound for a requested
server_fillvalue, in UTF-8 bytes. - MAX_TTL
- Largest IPv4 TTL or IPv6 hop-limit value accepted by client configuration.
- MAX_
UDP_ PAYLOAD_ LENGTH - Largest UDP payload length accepted by client configuration, in bytes.