Note: this project has been archived. You should use the https://github.com/m-lab/ndt7-client-cc library instead.
Libndt is a Network-Diagnostic-Tool (NDT) single-include C++11 client library. NDT is a widely used network performance test that measures the download and upload speed, and complements these measurements with kernel-level measurements. NDT is the most popular network performance test hosted by Measurement Lab.
This library implements all flavours of NDT. The code implementing the legacy NDT protocol (i.e., no JSON, no WebSocket, no TLS, no ndt7) is the most stable, tested, and peer reviewed code. The JSON, WebSocket, and TLS flavoured NDT code is in beta stage. Ndt7 code is in alpha stage.
Libndt depends on OpenSSL (for TLS support and in the future for WebSocket support) and cURL (to autodiscover servers).
Download single_include/libndt.hpp and put it in the current working directory.
This example runs a NDT download-only nettest with a nearby server. Create
a file named main.cpp
with this content.
#include "libndt.hpp"
int main() {
using namespace measurement_kit;
libndt::Client client;
client.run();
}
Compile with g++ -std=c++11 -Wall -Wextra -I. -o main main.cpp
.
See codedocs.xyz/measurement-kit/libndt for API documentation; include/libndt/libndt.hpp for the full API.
See libndt-client.cpp for a comprehensive usage example.
To develop libndt or run tests, you need a clone of the repository.
git clone https://github.com/measurement-kit/libndt
Build and run tests with:
cmake .
cmake --build .
ctest -a --output-on-failure .
Building with CMake also builds a simple command line client. Get usage info by running:
./libndt-client -help
Vendored dependencies are in third_party
. We include the complete path to
where they can be found such that updating is obvious.