rbmk

module
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: GPL-3.0

README

Really Basic Measurement Kit (RBMK)

GoDoc Build Status codecov

RBMK is a CLI tool for performing low-level, scriptable network measurements.

Features

  1. Run commands you already know (e.g., rbmk dig, rbmk curl).

  2. Measure fundamental network operations: DNS, HTTP(S), TCP, TLS, and STUN.

  3. Obtain structured logs in JSONL format for easy analysis using --logs FILE.

  4. Organize measurements as portable shell scripts run using rbmk sh.

  5. Support shell scripting with built-in commands like rbmk tar, and rbmk mv.

  6. Get extensive help using rbmk help and rbmk tutorial.

Use Cases

RBMK is mostly useful when investigating network anomalies, including outages, misconfigurations, censorship, and performance issues.

Minimum Required Go Version

Go 1.25

Installation

go install -v -tags netgo github.com/rbmk-project/rbmk/cmd/rbmk@latest

Quick Start

These examples demonstrate how to use RBMK for common network measurements:

# Resolve a domain name
rbmk dig +short=ip example.com
93.184.215.14

# Make an HTTP request
rbmk curl -vo index.html https://example.com/

# Combine dig and curl for step-by-step measurement
addr=$(rbmk dig +short=ip example.com | rbmk head -n 1)
rbmk curl --resolve example.com:443:$addr https://example.com/

# Use --logs to get structured logs in JSONL format
rbmk dig --logs dns.jsonl +short=ip example.com
rbmk curl --logs http.jsonl -vo index.html https://example.com/

For a quick introduction with more examples, run:

rbmk intro

For comprehensive usage documentation, run:

rbmk tutorial

Build Tags

RBMK supports the following build tags to customize the build:

Feature Flag Description
netgo Use pure-Go functions instead of linking the C stdlib.
rbmk_disable_markdown Disables Markdown rendering in help text, reducing binary size.

You can pass those flags to go install or go build. For example:

go install -v -tags netgo,rbmk_disable_markdown github.com/rbmk-project/rbmk/cmd/rbmk@latest

Commands

  1. Core Measurement Commands: curl, dig, nc, stun.

  2. Unix-like Commands for Scripting: cat, head, mkdir, mv, rm, sh, tar.

  3. RBMK-Specific Commands for Scripting: ipuniq, markdown, pipe, random, timestamp.

  4. Helper Commands: intro, tutorial, version.

Each command supports the --help flag for detailed usage information.

For example:

rbmk curl --help

Release Builds

You need GNU make installed. Run:

make release

Run make without arguments to see all available targets.

Documentation

Read the packages documentation at pkg.go.dev/rbmk-project/rbmk.

Architecture

Documentation:

Main Entry Point:

  • cmd/rbmk: The main RBMK command-line tool.

Go Packages:

  • pkg/cli: CLI implementation.
  • pkg/common: Common utilities and helpers.
  • pkg/dns: DNS measurement implementation.
  • pkg/x: Experimental Go packages.

Build System:

Contributing

Contributions are welcome! Please submit pull requests using GitHub.

License

SPDX-License-Identifier: GPL-3.0-or-later

Directories

Path Synopsis
cmd
rbmk command
Command rbmk implements the `rbmk` command.
Command rbmk implements the `rbmk` command.
pkg
Package pkg contains public packages.
Package pkg contains public packages.
cli
Package cli implements the `rbmk` command.
Package cli implements the `rbmk` command.
cli/cat
Package cat implements the `rbmk cat` command.
Package cat implements the `rbmk cat` command.
cli/curl
Package curl implements the `rbmk curl` command.
Package curl implements the `rbmk curl` command.
cli/dig
Package dig implements the `rbmk dig` command.
Package dig implements the `rbmk dig` command.
cli/head
Package head implements the `rbmk head` command.
Package head implements the `rbmk head` command.
cli/internal/markdown
Package markdown contains code to optionally render markdown files.
Package markdown contains code to optionally render markdown files.
cli/internal/qa
Package qa provides support for quality assurance testing of the RBMK command line tool.
Package qa provides support for quality assurance testing of the RBMK command line tool.
cli/internal/rootcmd
Package rootcmd contains shared code to implement the `rbmk` command.
Package rootcmd contains shared code to implement the `rbmk` command.
cli/internal/testable
Package testable provides thread-safe singletons for overriding fundamental RBMK dependencies in integration tests.
Package testable provides thread-safe singletons for overriding fundamental RBMK dependencies in integration tests.
cli/intro
Package intro implements the `rbmk intro` Command.
Package intro implements the `rbmk intro` Command.
cli/ipuniq
Package ipuniq implements the `rbmk ipuniq` command.
Package ipuniq implements the `rbmk ipuniq` command.
cli/markdown
Package markdown implements the `rbmk markdown` command.
Package markdown implements the `rbmk markdown` command.
cli/mkdir
Package mkdir implements the `rbmk mkdir` command.
Package mkdir implements the `rbmk mkdir` command.
cli/mv
Package mv implements the `rbmk mv` command.
Package mv implements the `rbmk mv` command.
cli/nc
Package nc implements the `rbmk nc` command.
Package nc implements the `rbmk nc` command.
cli/pipe
Package pipe implements the `rbmk pipe` command.
Package pipe implements the `rbmk pipe` command.
cli/random
Package random implements the `rbmk random` command.
Package random implements the `rbmk random` command.
cli/rm
Package rm implements the `rbmk rm` command.
Package rm implements the `rbmk rm` command.
cli/sh
Package sh implements the `rbmk sh` command.
Package sh implements the `rbmk sh` command.
cli/stun
Package stun implements the `rbmk stun` command.
Package stun implements the `rbmk stun` command.
cli/tar
Package tar implements the `rbmk tar` command.
Package tar implements the `rbmk tar` command.
cli/timestamp
Package timestamp implements the `rbmk timestamp` command.
Package timestamp implements the `rbmk timestamp` command.
cli/version
Package version implements the `rbmk version` command.
Package version implements the `rbmk version` command.
common
Package common contains simple, common packages used by other packages.
Package common contains simple, common packages used by other packages.
common/climain
Package climain implements a command's main function.
Package climain implements a command's main function.
common/cliutils
Package cliutils provides utilities for building command-line interfaces.
Package cliutils provides utilities for building command-line interfaces.
common/closepool
Package closepool allows pooling io.Closer instances and closing them in a single operation.
Package closepool allows pooling io.Closer instances and closing them in a single operation.
common/dialonce
Package dialonce provides a way to ensure we dial just once.
Package dialonce provides a way to ensure we dial just once.
common/errclass
Package errclass implements error classification.
Package errclass implements error classification.
common/fsx
Package fsx allows abstracting the file system.
Package fsx allows abstracting the file system.
common/httpconntrace
Package httpconntrace provides a way to trace the local and remote endpoints used by an HTTP connection while performing an *http.Client request.
Package httpconntrace provides a way to trace the local and remote endpoints used by an HTTP connection while performing an *http.Client request.
common/httpslog
Package httpslog implements structured logging for HTTP clients.
Package httpslog implements structured logging for HTTP clients.
common/internal/fsmodel
Package fsmodel provides an abstract file system model.
Package fsmodel provides an abstract file system model.
common/mocks
Package mocks contains mocks for standard library types.
Package mocks contains mocks for standard library types.
common/netipx
Package netipx contains net/netip extensions.
Package netipx contains net/netip extensions.
dns
Package dns contains DNS-related functionality.
Package dns contains DNS-related functionality.
dns/dnscore
Package dnscore provides a DNS resolver, a DNS transport, a query builder, and a DNS response parser.
Package dnscore provides a DNS resolver, a DNS transport, a query builder, and a DNS response parser.
dns/dnscoretest
Package dnscoretest contains fake servers to test dnscore.
Package dnscoretest contains fake servers to test dnscore.
x
Package x contains experimental packages.
Package x contains experimental packages.
x/netcore
Package netcore provides a TCP/UDP dialer and a TLS dialer.
Package netcore provides a TCP/UDP dialer and a TLS dialer.
x/netsim
Package netsim provides a simple network simulation framework that developers can use to write integration tests.
Package netsim provides a simple network simulation framework that developers can use to write integration tests.
x/netsim/censor
Package censor implements common internet censorship techniques for testing.
Package censor implements common internet censorship techniques for testing.
x/netsim/dns
Package models the distributed DNS database.
Package models the distributed DNS database.
x/netsim/geolink
Package geolink models a geographic point-to-point link.
Package geolink models a geographic point-to-point link.
x/netsim/link
Package link models a point-to-point network link.
Package link models a point-to-point network link.
x/netsim/packet
Package packet contains *Packet and the related definitions.
Package packet contains *Packet and the related definitions.
x/netsim/router
Package router provides network routing capabilities for testing.
Package router provides network routing capabilities for testing.

Jump to

Keyboard shortcuts

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