Thrulay is a measurement tool suggested by Stanislav Shalunov. It performs TCP throughput ("bandwidth") tests similar to many other tools, but at the same time measures round-trip time.
Thrulay consists of a client and a server. The server listens on a TCP port, 5003 by default. The client opens a connection to the server, checks whether the protocol versions are compatible, and issues a "session proposal" to request a measurement. The proposal can be for a TCP or UDP session. After the server agrees to the session proposal, the client sends measurement data.
For TCP, the client can request specific values for the TCP window size and the block size used for measurement. The measurement data consists of blocks (for TCP) or datagrams (for UDP), which include timestamps. The server echoes these timestamps back to the sender, which can then compute the round-trip time for each block. The default block size is 8 KiB. For high-bandwidth paths, it can be useful to specify a larger value (such as 64 KiB) in order to reduce CPU overhead. The default value is kept low so that RTT measurements are still somewhat realistic for lower-bandwidth paths, e.g. paths including ADSL links.
For UDP, the client specifies client port number, packet rate, packet size, and the number of packets to be sent. In contrast to TCP measurements, the server doesn't echo back anything until the test is done. The UDP test measures one-way delay instead of round-trip time.
Stanislav Shalunov's original implementation. It was initially called
i2perf , but renamed to
thrulay to avoid confusion with
Bernhard Lutzmann's Google "summer of code" project included the following improvements as goals:
- TCP test: multi-stream support, statistics (throughput, minimum/average/maximum RTT)
- UDP test: send fine-grained Poisson test stream, statistics (quantiles, duplication, packet loss, reordering)
- Portable: runs on Linux, BSD (FreeBSD, OpenBSD, NetBSD), Mac OS X and Solaris
- Client authentication based on netmasks
- Uses faster gettimeofday() implementations if available
- IPv6 support
Huadong Liu developed this in another Google "summer of code" project. It includes the following enhancements:
- Multiple TCP and UDP streams using a event based implementation
- API for programmatic execution of thrulay tests;
- Platform independent (currently running on Linux, Solaris, FreeBSD and Mac OS X);
- Online calculation of 0/50/95th quantile of one way delay and number of loss periods;
- IPv6 support and client address based authentication.
The following shows a few examples of
thrulay in action. We use the
The server must be started before any tests are run. By default, it will put itself in the background and will continue to accept test requests from clients indefinitely.
This example shows a
thrulay-hd TCP test run between two hosts with Gigabit Ethernet connections. The base RTT as measured by (IPv6) ping is 4.3 milliseconds. The server (
atitlan=) is a GNU/Linux system, the client (=diotima=) r uns Solaris Express "Nevada" build 70. Note that IPv6 is being used, because the specified destination host =atitlan has both IPv4 and IPv6 addresses registered in the DNS. Results are displayed in one-second intervals throughout the duration of the test. We use the default duration of 60 seconds, but have shortened the output somewhat for readability.
Here is a ten-second UDP test run at a rate of 900 Mbit/s between the same pair of hosts. The Solaris host
diotima sends to the GNU/Linux host
atitlan . As one can see, there is no loss or reordering. We see that the measured delays are negative, which shows that those are indeed one-way delay measurements - imperfect clock synchronization combined with a short network path (about 340km) conspire to make the computed delays negative. In contrast to the TCP test, no results are shown until after the complete test stream has been sent.
doc/thrulay-protocol.txtThrulay protocol description, S. Shalunov, October 2005
thrulay-announcemailing list at Internet2
thrulay-usersmailing list at Internet2
http://thrulay.sourceforge.net/- original version by Stanislav Shalunov
http://thrulay-ng.sourceforge.net/- improved version by Bernhard Lutzmann
http://thrulay-hd.sourceforge.net/- improved version by Huadong Liu
thrulay-hddocumentation including a project report in PDFandPostScript formats
– Main.SimonLeinen - 28 Sep 2007