ooni-probe-cli/internal/tutorial
Simone Basso 85664f1e31
feat(torsf): collect tor logs, select rendezvous method, count bytes (#683)
This diff contains significant improvements over the previous
implementation of the torsf experiment.

We add support for configuring different rendezvous methods after
the convo at https://github.com/ooni/probe/issues/2004. In doing
that, I've tried to use a terminology that is consistent with the
names being actually used by tor developers.

In terms of what to do next, this diff basically instruments
torsf to always rendezvous using domain fronting. Yet, it's also
possible to change the rendezvous method from the command line,
when using miniooni, which allows to experiment a bit more. In the
same vein, by default we use a persistent tor datadir, but it's
also possible to use a temporary datadir using the cmdline.

Here's how a generic invocation of `torsf` looks like:

```bash
./miniooni -O DisablePersistentDatadir=true \
           -O RendezvousMethod=amp \
           -O DisableProgress=true \
           torsf
```

(The default is `DisablePersistentDatadir=false` and
`RendezvousMethod=domain_fronting`.)

With this implementation, we can start measuring whether snowflake
and tor together can boostrap, which seems the most important thing
to focus on at the beginning. Understanding why the bootstrap most
often does not converge with a temporary datadir on Android devices
remains instead an open problem for now. (I'll also update the
relevant issues or create new issues after commit this.)

We also address some methodology improvements that were proposed
in https://github.com/ooni/probe/issues/1686. Namely:

1. we record the tor version;

2. we include the bootstrap percentage by reading the logs;

3. we set the anomaly key correctly;

4. we measure the bytes send and received (by `tor` not by `snowflake`, since
doing it for snowflake seems more complex at this stage).

What remains to be done is the possibility of including Snowflake
events into the measurement, which is not possible until the new
improvements at common/event in snowflake.git are included into a
tagged version of snowflake itself. (I'll make sure to mention
this aspect to @cohosh in https://github.com/ooni/probe/issues/2004.)
2022-02-07 17:05:36 +01:00
..
experiment/torsf feat(torsf): collect tor logs, select rendezvous method, count bytes (#683) 2022-02-07 17:05:36 +01:00
generator doc(measurex): explain how to write experiments (#529) 2021-09-30 01:36:03 +02:00
measurex fix(measurex): allow API user to choose parallelism (#581) 2021-11-05 14:37:03 +01:00
netxlite doc(netxlite): revamp the documentation (#523) 2021-09-29 20:21:25 +02:00
README.md doc(tutorial): explain the big picture (#582) 2021-11-05 14:51:14 +01:00

Tutorials: writing OONI nettests

This package contains a living tutorial explaining how to write OONI nettests. The code in here is based on existing nettests.

Because it's committed to the probe-cli repository and depends on real OONI code, it should always be up to date.

Index

  • Rewriting the torsf experiment: this tutorial explains to you how to write a simple experiment. After reading it, you will understand the interfaces between an experiment and the OONI core. What this tutorial does not teach you, though, is how to tell the OONI core about this experiment. To see how to do that, you should check how we do that in internal/engine/allexperiments.go.

  • Using the measurex package to write network experiments: this tutorial explains to you how to use the measurex library to write networking code that generates measurements using the OONI data format. You will learn how to perform DNS, TCP, TLS, QUIC, HTTP, HTTPS, and HTTP3 measurements.

  • Low-level networking using netxlite: this tutorial introduces you to the netxlite networking library. This is the underlying library used by measurex as well as by many other libraries inside OONI. You need to know about this library to contribute to measurex as well as to other parts of the OONI core that perform network operations.

Therefore, after reading these tutorials, you should have a better understanding of how an experiment interacts with the OONI core, as well as of which libraries you can use to write experiments.

Regenerating the tutorials

(cd ./internal/tutorial && go run ./generator)