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

Initial import, still WIP #4

Closed
wants to merge 46 commits into from
Closed

Conversation

juga0
Copy link
Contributor

@juga0 juga0 commented Apr 19, 2018

With changes after @teor2345 review on tor-dev ml.
Unfortunately lost all the granular commits changing line by line :/
I can rebase and make granular commits if need.
This PR is mostly to be reviewed by @teor2345 as i itwould be more difficult in ml, at least for all the format related changes.

With changes after T. review on tor-dev ml.
Unfortunately lost all the granular ci changing line by line :/
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Looks great!
Let's make these minor tweaks, then send it to tor-dev for review again.

Please open a ticket on trac for merging this spec into torspec.

@@ -0,0 +1,169 @@
Tor Bandwidth Measurements Document Format
juga
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: center name using spaces?

- Header (exactly once)
- Relays measurements (zero or more times)

2.1. Nonterminals
Copy link
Contributor

Choose a reason for hiding this comment

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

You could call this "Definitions"


[At start, exactly once.]

timestamp = Int
Copy link
Contributor

Choose a reason for hiding this comment

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

You could define timestamp in the definitions section

Copy link
Contributor

Choose a reason for hiding this comment

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

But say what time it represents here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should i use "=" or "::=" for the definitions?

If a header line does conform to this format, the line SHOULD be ignored by
parsers.

[juga: how the header ends?, just when a relay measurement is found?]
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, sounds good to me.

Copy link
Contributor

Choose a reason for hiding this comment

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

I assume that's how Tor does it.

Documents generated before this specification do not contain this line,
and the version_number is considered to be "1.0.0".
This line is ignored by any Tor version released before this specification,
April 2018.
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to implement this feature in Tor, and then put the Tor version that implements the feature in this spec.
We can just put "TODO" for now.

See https://trac.torproject.org/projects/tor/ticket/3723


Where:

timestamp = Int
Copy link
Contributor

Choose a reason for hiding this comment

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

You can define timestamp in the definitions section, and say what time it represents here.


rtt = Int

The Round Trip Time to obtain 1 Byte of data.
Copy link
Contributor

Choose a reason for hiding this comment

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

In milliseconds?


timestamp = Int

The Unix Epoch time when the measurement was performed.
Copy link
Contributor

Choose a reason for hiding this comment

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

In seconds


timestamp = Int

The Unix Epoch time when the file was created.
Copy link
Contributor

Choose a reason for hiding this comment

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

In seconds.


The Round Trip Time to obtain 1 Byte of data.

[juga: which arguments should be include from torflow?]
Copy link
Contributor

Choose a reason for hiding this comment

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

Please include node_id, bw, nick.
I don't think there is a lot of value in documenting legacy systems.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, there is an example in the appendix, and you have referenced the documentation.

and the version_number is considered to be "1.0.0".
This line is ignored by any Tor version released before this specification,
April 2018.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add software and software_version lines as well?

For example:

software=sbws
software_version=0.1.0

The default software should be torflow and there should be no default version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only in the sample data or in the definition/format sections too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

k, i answer myself, should be in definition/format sections too

@teor2345
Copy link
Contributor

teor2345 commented Apr 20, 2018 via email


New implementations SHOULD include this line.
For documents generated following this specification,
the version_number MUST be "1.1.0".
Copy link
Contributor

@teor2345 teor2345 Apr 21, 2018

Choose a reason for hiding this comment

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

Can we just say that version is the version of the file format?

For example, torflow could add version=1.0.0 and change nothing else, and that would be ok.

For documents generated following this specification,
the version_number MUST be "1.1.0".
Documents generated before this specification do not contain this line,
and the version_number is considered to be "1.0.0".
Copy link
Contributor

@teor2345 teor2345 Apr 21, 2018

Choose a reason for hiding this comment

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

No need to say when the document was generated.
That way, torflow can keep on generating valid documents without this line.


New implementations SHOULD include this line.
Documents generated before this specification do not contain this line,
and the software is considered to be "Torflow".
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to say when the document was generated.
That way, torflow can keep on generating valid documents without this line.


The version of the software that created the document.
New implementations SHOULD include this line.
Documents generated before this specification do not contain this line.
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to say when the document was generated.
That way, torflow can keep on generating valid documents without this line.

1. Scope and preliminaries

This document describes the format of Tor's bandwidth measurements
document, version 1.1.0 and later.
Copy link
Contributor

Choose a reason for hiding this comment

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

The document describes version 1.0.0 and later. The current version is 1.1.0.

Documents generated before this specification do not contain this line,
and the version_number is considered to be "1.0.0".
This line is ignored by any Tor version released before this specification.
TODO: implement this feature in tor
Copy link
Contributor

Choose a reason for hiding this comment

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

Please say that this line was added in version 1.1.0.

New implementations SHOULD include this line.
Documents generated before this specification do not contain this line,
and the software is considered to be "Torflow".
This line is ignored by any Tor version released before this specification.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please say that this line was added in version 1.1.0.

The version of the software that created the document.
New implementations SHOULD include this line.
Documents generated before this specification do not contain this line.
This line is ignored by any Tor version released before this specification.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please say that this line was added in version 1.1.0.


The Unix Epoch time in seconds when the file was created.

"version="version_number NL
Copy link
Contributor

Choose a reason for hiding this comment

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

If you like, you can put a space in here:
"version=" version_number NL


[Zero or one time.]

The Unix Epoch time in seconds when the file was created.
Copy link
Contributor

Choose a reason for hiding this comment

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

When the scanner was launched?
Added in 1.1.0.


[Zero or one time.]

The Unix Epoch time in seconds when the file was created.
Copy link
Contributor

Choose a reason for hiding this comment

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

Of the earliest measurement used to create the file?
Added in 1.1.0.


[Zero or more times.]

Future releases may include additional key_value header lines.
Copy link
Contributor

Choose a reason for hiding this comment

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

Future format versions?

[One time.]

The header ends.
For documents generated before this specification, the header ends
Copy link
Contributor

@teor2345 teor2345 Apr 29, 2018

Choose a reason for hiding this comment

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

Please say "version 1.0.0 documents", because torflow will continue to generate documents without newlines after this specification is merged.

For documents generated before this specification, the header ends
when the first relay measurement line is found conforming to the
next section.

Copy link
Contributor

Choose a reason for hiding this comment

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

Added in 1.1.0.

next section.

If a header line does conform to this format, the line SHOULD be ignored by
parsers.
Copy link
Contributor

Choose a reason for hiding this comment

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

This sentence should be up near the key_value paragraph.

software=sbws
software_version=0.1.0
scanner_started=1523911756
earliest_measurement=1523911757

This comment was marked as resolved.

Parsers MUST NOT rely on the order of these additional lines.
Additional header lines will be accompanied by a minor version increment.
Additional header lines MUST NOT use any keywords specified in the
relay measurements format.
Copy link
Contributor

Choose a reason for hiding this comment

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

Scanner implementations may add additional lines by (following a process)...

"bw=" bandwidth

Where bandwidth is the aggregated measured bandwidth of this relay,
in kilobytes per second.

This comment was marked as outdated.

Copy link
Contributor

Choose a reason for hiding this comment

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

Where bandwidth is the aggregated measured bandwidth of this relay.
Torflow scales bandwidths to kilobytes per second. If different
implementations or configurations are used in votes for the same
network, their measurements MAY need further scaling.

And let's put this in Appendix B:

Here is simple scaling method:

  1. Calculate the measured bandwidth per relay by dividing the total
    voted bandwidth by the number of relays voted for. In the public tor
    network, this is approximately 7500 as of April 2018.
  2. Calculate a quota for the bandwidth authority by multiplying the
    per-relay average by the number of relays voted for.
  3. Calculate a scaling factor by dividing the quota by the total
    measured bandwidth in this bandwidth authority's upcoming vote.
  4. Multiply each measured bandwidth by the scaling factor.

Now, the total bandwidth in the upcoming vote is approximately
equal to the quota.

If the total bandwidth is zero, all relays should be given equal
weights.

@@ -128,6 +128,8 @@ It consists of:
Additional header lines will be accompanied by a minor version increment.
Additional header lines MUST NOT use any keywords specified in the
relay measurements format.
If a header line does conform to this format, the line SHOULD be
Copy link
Contributor

Choose a reason for hiding this comment

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

Does not

juga0 and others added 7 commits April 29, 2018 08:18
Also allow software_version to be any versioning scheme,
not just semantic versioning.
Also, expand the bandwidth section.
Add additional restrictions that parsers are likely to expect.
Reformat the relay section so its intending matches the header section.
juga0 added a commit to juga0/torspec that referenced this pull request Apr 29, 2018
@juga0
Copy link
Contributor Author

juga0 commented May 1, 2018

Work continuing now in https://github.com/juga0/torspec/tree/bandwidth-file-spec branch, as i forgot the first import with the version sent to @Tor-Dev
@teor2345 should i close this PR and open one with that other branch, so it's clear which is the branch there'll be last changes?.

@teor2345
Copy link
Contributor

teor2345 commented May 1, 2018

There are lots of comments on this branch. Let's start again with a new branch.

@teor2345 teor2345 closed this May 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants