loom

module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: Apache-2.0

README

loom

loom is a distributed network traffic generation and measurement system for Linux. It weaves many independent traffic flows — raw protocols and realistic application behaviors — across many machines, on a schedule you define, and measures what happens in real time.

Think of it as iperf when you want a quick number, and a programmable traffic fabric when you don't: one command for a point-to-point throughput test, or a declarative scenario driving dozens of agents with overlapping, randomized flows.

$ loom run --rate 50Mbps --duration 5s
[   1.0s]   49.98 Mbps      4459 pkts     5.95 MB
[   2.0s]   50.01 Mbps      4461 pkts     5.95 MB
...
--- summary ---
  duration : 5s
  sent     : 29.7 MB in 22300 packets
  avg rate : 49.9 Mbps

Why loom

  • One tool, two modes. A single-flow CLI for quick tests, and a control plane that runs multi-point scenarios across a fleet of agents.
  • Realistic, not just packet-blasting. Raw UDP/TCP today; HTTPS/VoIP/SSH/ Prometheus/FTP behavior emulation on the roadmap.
  • Fast where it counts. A zero-copy data plane with pluggable backends — kernel sockets by default, AF_XDP for line-rate, DPDK to come — behind one interface, so speed is a backend choice, not a rewrite.
  • Measurement-first. Streaming and end-of-run throughput, latency, jitter, and loss; one-way delay and NIC hardware timestamping are designed in.
  • Reproducible. Seeded scenarios replay identically, so you can compare runs and catch regressions.

Get started

You are… Start here
New to loom Getting StartedCore Concepts
Evaluating / an expert ArchitecturePerformance
Deploying it Deployment
Looking something up Reference · Scenario schema

The full manual lives in docs/.

Install

curl -fsSL https://raw.githubusercontent.com/bgrewell/loom/main/scripts/install.sh | bash

Installs loom, loomd, and loomctl — prebuilt binaries when available, else built from source. upgrade.sh and uninstall.sh are the counterparts; tuning and options are in scripts/README.md.

Or with the Go toolchain:

go install github.com/bgrewell/loom/cmd/loom@latest     # the CLI
go install github.com/bgrewell/loom/cmd/loomd@latest    # the agent
go install github.com/bgrewell/loom/cmd/loomctl@latest  # the controller

Linux only for now. See Getting Started for a guided first run.

Status

Active development. The architecture is settled and the single-host engine, distributed control plane, telemetry, and an AF_XDP datapath are in; application emulations and a web dashboard are next. Design decisions are recorded as ADRs in DECISIONS.md; the plan is in docs/roadmap.md.

License

Apache-2.0.

Directories

Path Synopsis
api
cmd
loom command
Command loom is the loom CLI — the primary human interface to the traffic generation & measurement system.
Command loom is the loom CLI — the primary human interface to the traffic generation & measurement system.
loomctl command
Command loomctl is the loom controller — it loads a scenario and drives it across agents (DESIGN.md §11).
Command loomctl is the loom controller — it loads a scenario and drives it across agents (DESIGN.md §11).
loomd command
Command loomd is the loom agent — the only component that touches the wire.
Command loomd is the loom agent — the only component that touches the wire.
Package control implements the loom.v1.Control gRPC service — the controller<->agent control plane (DESIGN.md §8).
Package control implements the loom.v1.Control gRPC service — the controller<->agent control plane (DESIGN.md §8).
Package controller orchestrates a scenario across agents: it resolves the endpoints each event runs between, plans the timeline, and at each fire wires a receiver and a sender on the right agents and starts them.
Package controller orchestrates a scenario across agents: it resolves the endpoints each event runs between, plans the timeline, and at each fire wires a receiver and a sender on the right agents and starts them.
core
accounting
Package accounting turns hot-path byte/packet counters into windowed throughput rates.
Package accounting turns hot-path byte/packet counters into windowed throughput rates.
components
Package components bundles the pluggable registries (datapath/generator/ scheduler/payload) into one injectable value (ADR-0022), so a flow builder or an agent depends on an explicit Components rather than reaching into global singletons.
Package components bundles the pluggable registries (datapath/generator/ scheduler/payload) into one injectable value (ADR-0022), so a flow builder or an agent depends on an explicit Components rather than reaching into global singletons.
contract
Package contract holds shared conformance checks that every implementation of a core interface must pass.
Package contract holds shared conformance checks that every implementation of a core interface must pass.
datapath
Package datapath is the packet-I/O backend abstraction.
Package datapath is the packet-I/O backend abstraction.
emul
Package emul is loom's application-behavior emulation engine: realistic traffic *shapes* (VoIP, HTTPS browsing, Prometheus, SSH) compiled to one shared behavior-script primitive and run over any datapath.
Package emul is loom's application-behavior emulation engine: realistic traffic *shapes* (VoIP, HTTPS browsing, Prometheus, SSH) compiled to one shared behavior-script primitive and run over any datapath.
flow
Package flow is the atomic unit of traffic: a generator paced by a scheduler, sent over a datapath, accounted, and bounded by a stop condition.
Package flow is the atomic unit of traffic: a generator paced by a scheduler, sent over a datapath, accounted, and bounded by a stop condition.
generator
Package generator produces a flow's traffic content: it decides what bytes go in each packet, using a payload source.
Package generator produces a flow's traffic content: it decides what bytes go in each packet, using a payload source.
latency
Package latency measures round-trip latency with typed results and an interval sampling model.
Package latency measures round-trip latency with typed results and an interval sampling model.
log
Package log provides the two halves of loom's logging model (DESIGN.md §6): a lock-free, non-blocking hot-path event Ring drained off the data plane, and an async leveled Logger for control/diagnostic output.
Package log provides the two halves of loom's logging model (DESIGN.md §6): a lock-free, non-blocking hot-path event Ring drained off the data plane, and an async leveled Logger for control/diagnostic output.
payload
Package payload generates the bytes a flow sends.
Package payload generates the bytes a flow sends.
pump
Package pump is the data-plane inner loop: it draws packets from a generator, paces them with a scheduler, sends them over a datapath, and records them in accounting.
Package pump is the data-plane inner loop: it draws packets from a generator, paces them with a scheduler, sends them over a datapath, and records them in accounting.
registry
Package registry provides a generic, concurrency-safe name→factory registry.
Package registry provides a generic, concurrency-safe name→factory registry.
report
Package report turns a flow's live counters into streaming interval reports and an end-of-run summary, emitted to a pluggable sink (human/json/...).
Package report turns a flow's live counters into streaming interval reports and an end-of-run summary, emitted to a pluggable sink (human/json/...).
scenario
Package scenario is the parsed model of a loom scenario file (docs/scenario-schema.md): endpoints, defaults, and a timeline of events with the value grammar (via core/units).
Package scenario is the parsed model of a loom scenario file (docs/scenario-schema.md): endpoints, defaults, and a timeline of events with the value grammar (via core/units).
scheduler
Package scheduler paces packets within a single flow (intra-flow rate control).
Package scheduler paces packets within a single flow (intra-flow rate control).
selection
Package selection resolves scenario endpoint selectors against the endpoint set: names, oneOf/allOf/any modes, and tag expressions like tags(all(10g, not(win))).
Package selection resolves scenario endpoint selectors against the endpoint set: names, oneOf/allOf/any modes, and tag expressions like tags(all(10g, not(win))).
stats
Package stats provides streaming measurement math — running mean/variance, jitter, and sequence-based loss/duplicate/reorder detection — as pure values with no global state.
Package stats provides streaming measurement math — running mean/variance, jitter, and sequence-based loss/duplicate/reorder detection — as pure values with no global state.
timeline
Package timeline turns a scenario's timeline into a schedule of "fires" — when each event (and each repeat instance) should start — and drives them in real time.
Package timeline turns a scenario's timeline into a schedule of "fires" — when each event (and each repeat instance) should start — and drives them in real time.
timesync
Package timesync computes the clock offset and round-trip delay between two hosts from the four-timestamp NTP exchange (DESIGN.md §10, ADR-0010).
Package timesync computes the clock offset and round-trip delay between two hosts from the four-timestamp NTP exchange (DESIGN.md §10, ADR-0010).
units
Package units parses the scenario value grammar — rates, sizes, durations, and "lo..hi" ranges of each (docs/scenario-schema.md).
Package units parses the scenario value grammar — rates, sizes, durations, and "lo..hi" ranges of each (docs/scenario-schema.md).

Jump to

Keyboard shortcuts

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