Skip to content

Latest commit

 

History

History
58 lines (43 loc) · 4.48 KB

README.md

File metadata and controls

58 lines (43 loc) · 4.48 KB

NLNOG Ring bi-directional MTR

License MIT Brought by Enix

A tool to automatically run My Traceroute (MTR) instances between a subset of the NLNOG Ring nodes and a single node called "root". MTRs are run in both directions : from the root as well as towards the root. This provides useful insights regarding issues (such as packet loss or increased latency) on the paths between the nodes.

The remote ("non-root") nodes can either be chosen at random from the full list of nodes, manually selected using their short hostname (without .ring.nlnog.net) or a combination of both.

The root node must be specified using its short hostname, and is the node you want to check connectivity to/from. It is usually your node.

Installation

You have to be a member of the NLNOG ring, and have the correct configuration in .ssh/config or use an SSH agent. If your SSH key is passphrase-protected (it should !), the agent is mandatory.

Clone this repository, and either install the python dependencies using pip install -r requirements.txt or, if you do not want to mess with your python packages or virtual environments, launch the software using Docker (see below).

Usage

$ ./ring-mtr.py --help
usage: ring-mtr.py [-h] [-u USER] [-r ROOT] [-n NUMBER] [-f [FORCE ...]] [-c CYCLES] [--connect-timeout CONNECT_TIMEOUT] [-4] [-6] [--retries RETRIES]

Perform a MTR towards and from a subset of NLNOG ring nodes

options:
  -h, --help            show this help message and exit
  -u USER, --user USER  SSH user.
                        Required, can be set using the env var RING_MTR_USER
  -r ROOT, --root ROOT  Ring node to/from which all MTRs will be performed.
                        Required, can be set using the env var RING_MTR_ROOT
  -n NUMBER, --number NUMBER
                        Number of ring nodes to randomly select (can be 0).
                        Defaults to 10, can be set using the env var RING_MTR_NUMBER
  -f [FORCE ...], --force [FORCE ...]
                        Force some nodes (short hostnames) to be present in the list if they have not been selected already.
                        Can be set using the env var RING_MTR_FORCE , in a comma-separated list.
  -c CYCLES, --cycles CYCLES
                        MTR report cycles.
                        Defaults to 10, can be set using the env var RING_MTR_CYCLES
  --connect-timeout CONNECT_TIMEOUT
                        Timeout, in seconds, when connecting to the nodes.
                        Defaults to 30, can be set using the env var RING_MTR_CONNECT_TIMEOUT
  -4, --ipv4            Force IPv4 MTRs. Mutually exclusive with --ipv6
                        Default to false, can be set by setting the env var RING_MTR_FORCE_IPV4 to 'true'
  -6, --ipv6            Force IPv6 MTRs. Mutually exclusive with --ipv4
                        Default to false, can be set by setting the env var RING_MTR_FORCE_IPV6 to 'true'
  --retries RETRIES     Number of retries when connecting to the nodes.
                        Defaults to 1, can be set using the env var RING_MTR_CONNECT_RETRIES

Using docker

You must have a working SSH agent, as its socket is mounted into the container and used to provide auth to ring nodes.

Copy the file ring-mtr.example.env into ring-mtr.env and adapt the values, especially the username.

Then, run docker compose run ring-mtr. You can use a mix of environment variables and command-line flags.