Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: new testhelper and the websteps experiment prototype #432

Merged
merged 132 commits into from
Aug 17, 2021

Conversation

kelmenhorst
Copy link
Contributor

@kelmenhorst kelmenhorst commented Aug 16, 2021

This is the extension of #431, and my final deliverable for GSoC 2021.

The diff introduces:

  1. The new testhelper which supports testing multiple IP endpoints per domain and introduces HTTP/3 control measurements. The specification of the testhelper can be found at th-007-websteps: websteps test helper spec spec#219. The testhelper algorithm consists of three main steps:

    • InitialChecks verifies that the input URL can be parsed, has an expected scheme, and contains a valid domain name.

    • Explore enumerates all the URLs that it discovers by redirection from the original URL, or by detecting h3 support at the target host.

    • Generate performs a step-by-step measurement of each discovered URL.

  2. A prototype of the corresponding new experiment websteps which uses the control measurement of the testhelper to know which URLs to measure, and what to expect. The prototype does not yet have:

    • unit and integration tests,

    • an analysis tool to compare the control and the probe measurement.

This PR is my final deliverable as it is the outcome of the trials, considerations and efforts of my GSoC weeks at OONI.
It fully integrates HTTP/3 (QUIC) support which has been only used in the urlgetter experiment until now.

Related issues: ooni/probe#1729 and ooni/probe#1733.

Copy link
Contributor

@bassosimone bassosimone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Your work looks good to me! I am going to merge this branch into the main branch and then I continue the development of the new experiment!

🥳🥳🥳🥳

case "user-agent":
case "accept":
case "accept-language":
case "user-agent", "accept", "accept-language":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bug fix for the oohelperd code (which is not used in production yet).

if req.Header.Get("content-type") != "application/json" {
w.WriteHeader(400)
return
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we are being less strict in terms of what we require in input.

@@ -50,7 +47,8 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
}
// We assume that the following call cannot fail because it's a
// clearly serializable data structure.
data, _ = json.Marshal(cresp)
data, err = json.Marshal(cresp)
runtimex.PanicOnError(err, "json.Marshal failed")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we are asserting that the JSON serialization cannot fail.

internal/cmd/oohelperd/internal/nwcth/explore.go Outdated Show resolved Hide resolved
internal/cmd/oohelperd/internal/nwcth/generate.go Outdated Show resolved Hide resolved
internal/engine/allexperiments.go Outdated Show resolved Hide resolved
internal/engine/experiment/websteps/model.go Outdated Show resolved Hide resolved
internal/engine/experiment/websteps/websteps.go Outdated Show resolved Hide resolved
internal/engine/experiment/websteps/websteps.go Outdated Show resolved Hide resolved
@bassosimone bassosimone merged commit c31591f into master Aug 17, 2021
@bassosimone bassosimone deleted the feature/websteps branch August 17, 2021 08:29
bassosimone added a commit that referenced this pull request Aug 17, 2021
We started doing this in #432.

This work is part of ooni/probe#1733.
bassosimone added a commit that referenced this pull request Aug 17, 2021
We started doing this in #432.

This work is part of ooni/probe#1733.
ainghazal pushed a commit to ainghazal/probe-cli that referenced this pull request Mar 8, 2022
This is the extension of ooni#431, and my final deliverable for GSoC 2021.

The diff introduces:

1) The new `testhelper` which supports testing multiple IP endpoints per domain and introduces HTTP/3 control measurements. The specification of the `testhelper` can be found at ooni/spec#219. The `testhelper` algorithm consists of three main steps:

   * `InitialChecks` verifies that the input URL can be parsed, has an expected scheme, and contains a valid domain name.

   * `Explore` enumerates all the URLs that it discovers by redirection from the original URL, or by detecting h3 support at the target host.

   * `Generate` performs a step-by-step measurement of each discovered URL.

2) A prototype of the corresponding new experiment `websteps` which uses the control measurement of the `testhelper` to know which URLs to measure, and what to expect. The prototype does not yet have:

   * unit and integration tests,

   * an analysis tool to compare the control and the probe measurement.

This PR is my final deliverable as it is the outcome of the trials, considerations and efforts of my GSoC weeks at OONI. 
It fully integrates HTTP/3 (QUIC) support which has been only used in the `urlgetter` experiment until now.

Related issues: ooni/probe#1729 and ooni/probe#1733.
ainghazal pushed a commit to ainghazal/probe-cli that referenced this pull request Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants