Skip to content

About

Simple Two-Way Active Measurement Protocol (STAMP)

Resources

Contributing

Security policy

Stars

12 stars

Watchers

1 watching

Forks

Repository files navigation

stamp-suite

stamp-suite measures round-trip time, loss, one-way delay and residual bit errors using STAMP (RFC 8762 and RFC 8972). One binary sends test packets and reports results, or reflects them with --is-reflector.

CI Latest version License

New to STAMP? Read the protocol overview first.

Quick start

stamp-suite -h shows everyday options and examples. Use stamp-suite --help or man stamp-suite for the complete option reference.

Start a reflector. It listens on UDP port 862, which on Linux needs root or CAP_NET_BIND_SERVICE:

sudo stamp-suite --is-reflector

From another host, send 100 test packets 100 ms apart and print each result:

stamp-suite --remote-addr 192.0.2.20 --count 100 --send-delay 100ms -R

Without root, run the reflector on a high port and point the sender at it:

stamp-suite --is-reflector --local-port 8620
stamp-suite --remote-addr 192.0.2.20 --remote-port 8620

The sender prints a summary when it finishes or when you press Ctrl-C. More examples:

# Measure two reflectors at once; each report carries a target label
stamp-suite --remote-addr 192.0.2.20,198.51.100.7 --count 0 --duration 60

# 4000 packets per second, Poisson-spaced, JSON lines on stdout
stamp-suite --remote-addr 192.0.2.20 --send-delay 250us --send-schedule poisson \
  --count 0 --duration 600 --output-format json > results.jsonl

With --timeout 0 the sender never gives up on a probe, so on a long run every lost probe stays in memory. --max-pending-probes 4096 caps that: at the cap, the oldest unanswered probe is counted as lost, and reports list these evictions separately. The default, 0, means no cap. See pending-probe retention.

For repeated runs, use a TOML file and override individual values on the CLI. The sender and reflector examples work together on loopback port 8620:

# Run these in separate terminals from the checkout
stamp-suite --config examples/reflector.toml
stamp-suite --config examples/sender.toml --count 20

Installed DEB/RPM packages keep these files in /usr/share/doc/stamp-suite/examples/; binary archives include an examples/ directory. See configuration files for service settings, session provisioning and policies.

The reflector starts in open mode and answers anyone who can reach it. On an untrusted network, restrict access and turn on authenticated mode.

Two reflector options drop bad packets before they can create or update a session. --validate-base-fields drops packets with an incomplete base, a zero Error Estimate multiplier or an invalid PTP nanoseconds value; see base-field validation. --validate-tlv-framing drops packets whose TLVs are cut short; see TLV framing admission.

What it supports

  • Round-trip time, loss, and forward and reverse one-way delay. One-way delay needs synchronized clocks; see Timestamps and clocks.
  • Open and authenticated (HMAC) modes, stateless and stateful reflection, and RFC 8972 TLVs.
  • RFC 9503 return-path control, numeric RFC 9534 Micro-session IDs, and RFC 10052 reflected test packet control. Physical LAG member association and steering are not implemented; SR-MPLS return paths receive U.
  • Three IETF drafts: reflected IP headers (draft-ietf-ippm-stamp-ext-hdr-26, Types 246/247), CoS and ECN (draft-ietf-bpm-stamp-cos-ecn-00) and residual bit error rate (draft-ietf-bpm-stamp-ber-01). The header and BER TLVs use experimental codepoints, so both peers must agree on them. On Linux, an authenticated IPv4 BER sender can send checksum-zero requests with --zero-udp-checksum.
  • Text, JSON lines and CSV output. Optional Prometheus metrics, SNMP AgentX sub-agent and reflector control API.

Supported profiles and limits lists what each feature leaves out. For example, the RFC admission rules apply only to provisioned sessions, header reflection depends on the receiver backend, route-MTU sizing needs Linux, Windows or (for IPv6) macOS, and the AgentX sub-agent is read-only. The conformance matrices link each requirement of the frozen revisions to the code and tests that implement it, including the rows that are only Partial.

Installation

Release packages

Each GitHub release has DEB and RPM packages for Linux x86_64 and aarch64, built with all Cargo features. They install /usr/bin/stamp-suite, the man page, the SNMP MIB, a systemd unit and the stamp service account.

sudo apt install ./stamp-suite_*_amd64.deb    # Debian, Ubuntu
sudo dnf install ./stamp-suite-*.x86_64.rpm   # Fedora, RHEL
sudo systemctl enable --now stamp-suite

The packaged service runs a reflector in open mode. Configure authentication before exposing it to an untrusted network; see security.

The release workflow builds plain binary tarballs for these Linux targets and for macOS on Apple silicon and Intel, plus a Windows x64 ZIP, source and cargo vendor tarballs.

From source

Building needs Rust 1.87 or newer. Debian trixie ships Rust 1.85, which is too old, so install a newer toolchain there. The prebuilt packages need no compiler.

cargo install stamp-suite                       # from crates.io
cargo build --release --features metrics,control,hwtstamp   # from a checkout

Building on Windows needs the Npcap SDK; running needs Npcap. The Windows release includes metrics and the control API; SNMP and kernel timestamps are Unix-only. Windows builds reserve 4 MiB for the main thread stack.

Nix, Gentoo and OpenWrt

nix build
nix run . -- --is-reflector

The Gentoo overlay maps Cargo features to USE flags and installs systemd and OpenRC services. dist/openwrt/ holds an OpenWrt recipe template and procd init script. Use the release asset stamp-suite-VERSION-openwrt.mk as its Makefile; it pins the checksum of that release’s source archive. See release procedures for building the recipe from local release inputs.

Platforms and Cargo features

Platform Receiver backend Requirements
Linux nix UDP socket No raw-socket privilege; ports below 1024 need CAP_NET_BIND_SERVICE
macOS nix UDP socket No raw-socket privilege
Windows pnet capture Npcap

The backend is chosen at build time. Both backends read the received TTL or Hop Limit. On Linux the nix backend can reflect IPv6 extension headers, but reflecting the fixed IP header needs the pnet backend. Either way, the reflector returns header data only to senders you list with --reflect-ipv6-ext-header-from or --reflect-fixed-header-from. See header reflection.

No Cargo feature is on by default.

Cargo feature Effect
ttl-pnet Uses the pnet capture backend on Linux and macOS. On Linux it needs CAP_NET_RAW or root.
ttl-nix Matters only together with ttl-pnet: it keeps the nix backend, as --all-features does. Linux and macOS use nix without it.
metrics Adds --metrics, a Prometheus endpoint at http://127.0.0.1:9090/metrics by default.
control Adds --control, the reflector's HTTP API for keys, sessions, limits, drain and shutdown, with optional HTTPS.
snmp Adds --snmp, a read-only AgentX sub-agent (Unix only) for mibs/STAMP-SUITE-MIB.mib.
hwtstamp Uses kernel timestamps (Linux receive and transmit, macOS receive) and, with --hwtstamp on, Linux NIC hardware timestamps.

--metrics, --control and --snmp fail at startup when the binary was built without the feature.

Documentation

Document Contents
Protocol overview STAMP concepts, the extensions implemented here, glossary
Usage Configuration file, sender, reflector, timestamps, networking, observability
Security Threat model, HMAC keys and rotation, service hardening
Control API Reflector HTTP API endpoints
Measurements What each reported value means and its limits
Statistics Quantile precision and retention
Architecture Modules, receiver backends, packet processing, TLV reference
Conformance Per-clause evidence for each RFC and draft
Benchmarks Throughput/latency tools, live --memory observations, and --inventory, --sessions, --headers, --header-bytes and --headers-denied workloads
Release procedures Platform and integration checks run before a release
Contributing Building, testing, linting and submitting changes
Vulnerability reporting How to report a security problem
Changelog Changes in each release

The man page (man stamp-suite) lists every option. stamp-suite --help prints the same list.

Versioning

Within 1.x, the RFC-based features keep their CLI options, TOML keys and wire behavior: RFC 8762, RFC 8972, RFC 9503, RFC 9534 and RFC 10052.

These can change in a minor release:

  • Extensions that follow IETF drafts: BER, CoS/ECN and reflected headers (Types 246/247). Their options, defaults and wire formats follow the draft revision each release implements, and their codepoints are experimental.
  • The minimum supported Rust version.
  • The Rust library API, which is internal.

CHANGELOG.md lists every such change under "Breaking changes".

Contributing

See CONTRIBUTING.md. Open an issue before starting a large change.

Authors and license

Maintained by Piotr Olszewski, with contributors. Licensed under the MIT license. Binary distributions include generated dependency copyright notices and license texts in THIRD_PARTY_NOTICES.txt. See release procedures.

About

Simple Two-Way Active Measurement Protocol (STAMP)

Resources

Contributing

Security policy

Stars

12 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages