Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.
/ libndt Public archive

Experimental ndt5 and ndt7 client engine written in C++11

License

Notifications You must be signed in to change notification settings

measurement-kit/libndt

Repository files navigation

NDT Client Engine

GitHub license Github Releases Build Status codecov Build status Documentation

Note: this project has been archived. You should use the https://github.com/m-lab/ndt7-client-cc library instead.

tardis

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

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.

Cloning the repository

To develop libndt or run tests, you need a clone of the repository.

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

Building and testing

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

Updating dependencies

Vendored dependencies are in third_party. We include the complete path to where they can be found such that updating is obvious.