Irtt
Isochronous Round-Trip Tester
Install / Use
/learn @heistp/IrttREADME
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
- Motivation
- Goals
- Features
- Limitations
- Installation
- Documentation
- Frequently Asked Questions
- Roadmap
- Changes
- 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:
- RTT (round-trip time)
- OWD (one-way delay), given external clock synchronization
- IPDV (instantaneous packet delay variation), usually referred to as jitter
- Packet loss, with upstream and downstream differentiation
- Out-of-order (measured using late packets metric) and duplicate packets
- Bitrate
- Timer error, send call time and server processing time
- 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:
- Install Go
- Install irtt:
go install github.com/heistp/irtt/cmd/irtt@latest - For convenience, copy the
irttexecutable, which should be in$HOME/go/bin, or$GOPATH/binif you have$GOPATHdefined, to somewhere on yourPATH.
If you want to build the source for development, you must also:
- Install the
pandocutility for generating man pages and HTML documentation from their markdown source files. This can be done withapt-get install pandocon Debian flavors of Linux orbrew install pandocon OS/X. See the Pandoc site for more information. - Install the
stringerutility by doinggo install golang.org/x/tools/cmd/stringer@latest. This is only necessary if you need to re-generate the*_string.gofiles that are generated by this tool, otherwise the checked in versions may also be used. - Use
build.shto 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-amd64would compile a minimized binary for Linux on AMD64. Seebuild.shfor 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 installruns 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:
git checkout branchgo get ./...go install ./cmd/irttor./build.shand move resultingirttexecutable 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
-
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.
-
Is there a public server I can use?
There is a test server running at `irtt.heistp.n
Related Skills
node-connect
344.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
99.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
