Skip to content
docker native ndt5 and ndt7 server with prometheus integration
Go JavaScript HTML CSS Shell Dockerfile
Branch: master
Clone or download
bassosimone ndt7: implement v0.8.0 of the spec (#183)
* ndt7/download/sender: simplify random message generation

As already mentioned in a comment, we don't need to ensure that we
are generating ASCII because the spec does not require that.

Therefore, simplify a little bit the codebase.

* download: implement bulk message size scaling

* ndt7: upgrader: configure large buffers

It does not seem to have big effects for cloud tests, but still
this feels like the correct thing to do.

While there, move the upgrader into handler because otherwise one
that is importing the ndt7 package won't have buffers and, also,
critically, CORS configured.

* fix(handler.go): don't warn and close after failed upgrade

The code in gorilla/websocket already replies for us.

* ndt7: fix usage of read,write deadlines

A deadline is not a timeout. We oughta set the deadline once at the
beginning such that I/O fails as soon as it should.

Also, the functions for setting deadlines in gorilla/websocket
return an error, therefore, check the error.

* ndt7: improve usage of deadlines

Now that we've fixed the place where we set deadlines, let's turn our
attention onto the values of the deadlines.

It does not make any sense to set a long deadline in the closer where
instead we aim to cut it short at this point of the experiment.

For all senders, the correct I/O deadline is 13 seconds rather than
10 seconds, because that gives some leeway for closing the connection
in a clean way when everything is good.

* ndt7/receiver: simplify looping until ctx is done

This is a pattern that @pboothe recommended some time ago.

* model: adapt to changes in ndt7-spec v0.8.0

* fix(cmd/ndt-client): repair build

* Address feedback by @pboothe
Latest commit 5b7940b Sep 20, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bbr ndt7: implement v0.8.0 of the spec (#183) Sep 20, 2019
cmd/ndt-client ndt7: implement v0.8.0 of the spec (#183) Sep 20, 2019
data Add schema version to NDTResult struct (#174) Aug 20, 2019
fdcache Initial implementation of ndt7 upload (#99) Apr 12, 2019
html fix(ndt5/c2s): start upload when connection is ready (#172) Aug 19, 2019
logging ndt-cloud -> ndt-server Jan 11, 2019
metadata Convert ClientMetadata map types to []metadata.NameValue (#176) Aug 22, 2019
metrics Improve error & panic metrics (#169) Aug 9, 2019
ndt5 Add a timeout to prevent slow-clients causing goroutine leaks (#184) Sep 16, 2019
ndt7 ndt7: implement v0.8.0 of the spec (#183) Sep 20, 2019
platformx Make sure macOS works with reduced functionality (#101) Apr 12, 2019
spec spec/ndt7: address several outstanding issues (#180) Sep 11, 2019
tcpinfox Adds tcpinfo to web100 export data. (#177) Aug 23, 2019
testdata package.json to get the dependencies for the client Feb 8, 2019
version ndt-cloud -> ndt-server Jan 11, 2019
.gitignore Update .gitignore (#87) Mar 22, 2019
.travis.yml travis: use xenial so we can set socket cookies (#102) Apr 11, 2019
AUTHORS Initial implementation of ndt7 upload (#99) Apr 12, 2019
Dockerfile docker: reduce privileges when running for testing (#140) Jul 3, 2019
LICENSE Initial commit Sep 22, 2017
README.md Rewrite upload using download code (#148) Jul 25, 2019
TestDockerfile Fix tabs Aug 6, 2019
build.sh Adds a metric that encodes the commit hash of the code. Apr 2, 2019
cloud-config.yaml Updates rather substantially the NDT GCE VM deploy script. (#2) May 21, 2018
collectd.prom Updates rather substantially the NDT GCE VM deploy script. (#2) May 21, 2018
deploy_ndt_to_gce.sh Updates rather substantially the NDT GCE VM deploy script. (#2) May 21, 2018
gen_local_test_certs.bash docker: reduce privileges when running for testing (#140) Jul 3, 2019
lame_duck.prom Updates rather substantially the NDT GCE VM deploy script. (#2) May 21, 2018
ndt-server.go ndt7: implement v0.8.0 of the spec (#183) Sep 20, 2019
ndt-server_test.go Smooth c2s (#179) Sep 4, 2019
test.sh add vet etl to test.sh Jul 6, 2019

README.md

GoDoc Build Status Coverage Status Go Report Card

ndt-server

This repository contains a ndt5 and ndt7 server written in Go. This code may compile under many systems, including macOS and Windows, but is specifically designed and tested for running on Linux 4.17+.

To run the server locally, generate local self signed certificates (key.pem and cert.pem) using bash and OpenSSL

./gen_local_test_certs.bash

build the docker container for ndt-server

docker build . -t ndt-server

prepare the runtime environment

install -d certs datadir
mv key.pem cert.pem certs

enable BBR (with which ndt7 works much better)

sudo modprobe tcp_bbr

and run the ndt-server binary container

docker run --network=bridge                \
           --publish 443:4443              \
           --volume `pwd`/certs:/certs:ro  \
           --volume `pwd`/datadir:/datadir \
           --read-only                     \
           --user `id -u`:`id -g`          \
           --cap-drop=all                  \
           ndt-server                      \
           -cert /certs/cert.pem           \
           -key /certs/key.pem             \
           -datadir /datadir               \
           -ndt7_addr :4443

Once you have done that, you should have a ndt5 server running on ports 3001 (legacy binary flavour), 3002 (WebSocket flavour), and 3010 (secure WebSocket flavour); a ndt7 server running on port 443 (over TLS and using the ndt7 WebSocket protocol); and Prometheus metrics available on port 9990.

Try accessing these URLs in your browser (for URLs using HTTPS, certs will appear invalid to your browser, but everything is safe because this is a test deployment, hence you should ignore this warning and continue):

Replace localhost with the IP of the server to access them externally.

You can’t perform that action at this time.