Skip to content
ndt5 and ndt7 client engine written in C++11
C++ CMake Shell
Branch: master
Clone or download
Latest commit a73b9cb Dec 6, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.appveyor.yml appveyor: don't build for win32 Oct 6, 2019
.clang-format
.codedocs Start cleaning up API following @pboothe suggestions (#26) Jun 9, 2018
.gitignore
.travis.yml Start preparing for libndt v0.27.0 (#108) Sep 19, 2019
AUTHORS
CMakeLists.txt Do not use amalgamated header for developing (#149) Dec 5, 2019
Doxyfile
LICENSE
MKBuild.yaml Do not use amalgamated header for developing (#149) Dec 5, 2019
README.md Start preparing for libndt v0.27.0 (#108) Sep 19, 2019
api.hpp Continue refactoring libndt (#142) Nov 18, 2019
curlx_test.cpp
docker.sh Start preparing for libndt v0.27.0 (#108) Sep 19, 2019
impl.hpp Do not print Err::broken_pipe during NDT c2s test. Dec 6, 2019
libndt-client.cpp
libndt-standalone-builds.cpp Do not use amalgamated header for developing (#149) Dec 5, 2019
libndt_test.cpp Do not use amalgamated header for developing (#149) Dec 5, 2019
preamble.hpp Do not use amalgamated header for developing (#149) Dec 5, 2019
sys.hpp
sys_test.cpp Continue refactoring libndt (#142) Nov 18, 2019

README.md

NDT Client Engine

GitHub license Github Releases Build Status codecov Build status Documentation

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.

Getting started

Make sure you download nlohmann/json single include header json.hpp before proceeding. The minimum supported version is v3.0.0. Put json.hpp in the current working directory.

Libndt depends on OpenSSL (for TLS support and in the future for WebSocket support) and cURL (to autodiscover servers). CMake will fail if such dependencies are not installed.

Then, download 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 "json.hpp"  // MUST be included before libndt
#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; libndt.hpp for the full API.

See libndt-client.cpp for a comprehensive usage example.

Cloning the repository

To develop libndt or run tests, you need a clone of the repository. Make sure you pass the --recursive flag to properly fetch all sub-repositories.

git clone --recursive https://github.com/measurement-kit/libndt

Building and testing

We use CMake for building libndt for testing. CMake will search for OpenSSL and cURL, defining the above described macros if they are found. CMake also downloads a recent version of nlohmann/json and puts it in the current directory, so you do not have to worry about this aspect.

To see the exact dependencies required on Debian, please check out the Dockerfile used when testing in Travis-CI.

Build and run tests with:

cmake .
cmake --build .
ctest -a --output-on-failure .

Command line client

Building with CMake also builds a simple command line client. Get usage info by running:

./libndt-client -help
You can’t perform that action at this time.