SkillAgentSearch skills...

Irtt

Isochronous Round-Trip Tester

Install / Use

/learn @heistp/Irtt
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

IRTT (Isochronous Round-Trip Tester)

IRTT measures round-trip time, one-way delay and other metrics using UDP packets sent on a fixed period, and produces both user and machine parseable output.

IRTT has reached version 0.9.1. I would appreciate any feedback, which you can send under Issues. However, it could be useful to first review the Roadmap section of the documentation before submitting a new bug or feature request.

Table of Contents

  1. Motivation
  2. Goals
  3. Features
  4. Limitations
  5. Installation
  6. Documentation
  7. Frequently Asked Questions
  8. Roadmap
  9. Changes
  10. Thanks

Motivation

Latency is an under-appreciated metric in network and application performance. As of this writing, many broadband connections are well past the point of diminishing returns when it comes to throughput, yet that’s what we continue to take as the primary measure of Internet performance. This is analogous to ordinary car buyers making top speed their first priority.

There is a certain hard to quantify but visceral “latency stress” that comes from waiting in expectation after a web page click, straining through a delayed and garbled VoIP conversation, or losing at your favorite online game (unless you like “lag” as an excuse). Those who work on reducing latency and improving network performance characteristics beyond just throughput may be driven by the idea of helping relieve this stress for others.

IRTT was originally written to improve the latency and packet loss measurements for the excellent Flent tool, but should be useful as a standalone tool as well. Flent was developed by and for the Bufferbloat project, which aims to reduce "chaotic and laggy network performance," making this project valuable to anyone who values their time and sanity while using the Internet.

Goals

The goals of this project are to:

  • Accurately measure latency and other relevant metrics of network behavior
  • Produce statistics via both human and machine parseable output
  • Provide for reasonably secure use on both public and private servers
  • Support small enough packet sizes for VoIP simulation
  • Support relevant socket options, including DSCP
  • Use a single UDP port for deployment simplicity
  • Keep the executable size small enough for use on embedded devices
  • Provide an API for embedding and extensibility

Features:

  • Measurement of:
  • Statistics: min, max, mean, median (for most quantities) and standard deviation
  • One nanosecond time precision on Linux and OS/X, and 100ns on Windows
  • Robustness in the face of clock drift and NTP corrections through the use of both wall and monotonic clocks
  • Binary protocol with negotiated format for test packet lengths down to 16 bytes (without timestamps)
  • HMAC support for private servers, preventing unauthorized discovery and use
  • Support for a wide range of Go supported platforms
  • Timer compensation to improve sleep send schedule accuracy
  • Support for IPv4 and IPv6
  • Public server protections, including:
    • Three-way handshake with returned 64-bit connection token, preventing reply redirection to spoofed source addresses
    • Limits on maximum test duration, minimum interval and maximum packet length, both advertised in the negotiation and enforced with hard limits to protect against rogue clients
    • Packet payload filling to prevent relaying of arbitrary traffic
  • Output to JSON
  • An available SmokePing probe (code)

Limitations

See the LIMITATIONS section of the irtt(1) man page.

Installation

To install IRTT manually or build from source, you must:

  1. Install Go
  2. Install irtt: go install github.com/heistp/irtt/cmd/irtt@latest
  3. For convenience, copy the irtt executable, which should be in $HOME/go/bin, or $GOPATH/bin if you have $GOPATH defined, to somewhere on your PATH.

If you want to build the source for development, you must also:

  1. Install the pandoc utility for generating man pages and HTML documentation from their markdown source files. This can be done with apt-get install pandoc on Debian flavors of Linux or brew install pandoc on OS/X. See the Pandoc site for more information.
  2. Install the stringer utility by doing go install golang.org/x/tools/cmd/stringer@latest. This is only necessary if you need to re-generate the *_string.go files that are generated by this tool, otherwise the checked in versions may also be used.
  3. Use build.sh to build during development, which helps with development related tasks, such as generating source files and docs, and cross-compiling for testing. For example, build.sh min linux-amd64 would compile a minimized binary for Linux on AMD64. See build.sh for more info and a "source-documented" list of platforms that the script supports. See this page for a full list of valid GOOS GOARCH combinations. build.sh install runs Go's install command, which puts the resulting executable in $GOPATH/bin.

If you want to build from a branch, you should first follow the steps above, then from the github.com/heistp/irtt directory, do:

  1. git checkout branch
  2. go get ./...
  3. go install ./cmd/irtt or ./build.sh and move resulting irtt executable to install location

Building for iOS:

I have no way to verify this, but I received a report that the following is "close to but not quite the right command" to cross-compile for iOS:

GOOS=ios GOARCH=arm64 IPHONEOS_DEPLOYMENT_TARGET=14.0 CGO_ENABLED=1 CGO_CFLAGS="-arch arm64 -isysroot `xcrun --sdk iphoneos --show-sdk-path` -mios-version-min=10.0" CGO_LDFLAGS="-arch arm64 -isysroot `xcrun --sdk iphoneos --show-sdk-path`" go build -o irtt cmd/irtt/main.go

Please file an issue if you get this working so I can update the doc.

Documentation

After installing IRTT, see the man pages and their corresponding EXAMPLES sections to get started quickly:

Frequently Asked Questions

  1. Why not just use ping?

    Ping may be the preferred tool when measuring minimum latency, or for other reasons. IRTT's reported mean RTT is likely to be a bit higher (on the order of a couple hundred microseconds) and a bit more variable than the results reported by ping, due to the overhead of entering userspace, together with Go's system call overhead and scheduling variability. That said, this overhead should be negligible at most Internet RTTs, and there are advantages that IRTT has over ping when minimum RTT is not what you're measuring:

    • In addition to round-trip time, IRTT also measures OWD, IPDV and upstream vs downstream packet loss.
    • Some device vendors prioritize ICMP, so ping may not be an accurate measure of user-perceived latency.
    • IRTT can use HMACs to protect private servers from unauthorized discovery and use.
    • IRTT has a three-way handshake to prevent test traffic redirection from spoofed source IPs.
    • IRTT can fill the payload (if included) with random or arbitrary data.
    • On Windows, ping has a precision of 0.5ms, while IRTT uses high resolution timer functions for a precision of 100ns (high resolution wall clock only available on Windows 8 or Windows 2012 Server and later).

    Also note the following behavioral differences between ping and IRTT:

    • IRTT makes a stateful connection to the server, whereas ping is stateless.
    • By default, ping waits for a reply before sending its next request, while IRTT keeps sending requests on the specified interval regardless of whether or not replies are received. The effect of this, for example, is that a fixed-length pause in server packet processing (with packets buffered during the pause) will look like a single high RTT in ping, and multiple high then descending RTTs in IRTT for the duration of the maximum RTT.
  2. Is there a public server I can use?

    There is a test server running at `irtt.heistp.n

Related Skills

View on GitHub
GitHub Stars220
CategoryDevelopment
Updated21d ago
Forks26

Languages

Go

Security Score

100/100

Audited on Mar 11, 2026

No findings