torproject / torspec Public
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
Conversation
With changes after T. review on tor-dev ml. Unfortunately lost all the granular ci changing line by line :/
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.
proposals/XX-bw-xxx.txt
Outdated
| @@ -0,0 +1,169 @@ | |||
| Tor Bandwidth Measurements Document Format | |||
| juga | |||
proposals/XX-bw-xxx.txt
Outdated
| - Header (exactly once) | ||
| - Relays measurements (zero or more times) | ||
|
|
||
| 2.1. Nonterminals |
proposals/XX-bw-xxx.txt
Outdated
|
|
||
| [At start, exactly once.] | ||
|
|
||
| timestamp = Int |
proposals/XX-bw-xxx.txt
Outdated
| 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?] |
proposals/XX-bw-xxx.txt
Outdated
| 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. |
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.
proposals/XX-bw-xxx.txt
Outdated
|
|
||
| Where: | ||
|
|
||
| timestamp = Int |
You can define timestamp in the definitions section, and say what time it represents here.
proposals/XX-bw-xxx.txt
Outdated
|
|
||
| rtt = Int | ||
|
|
||
| The Round Trip Time to obtain 1 Byte of data. |
proposals/XX-bw-xxx.txt
Outdated
|
|
||
| timestamp = Int | ||
|
|
||
| The Unix Epoch time when the measurement was performed. |
proposals/XX-bw-xxx.txt
Outdated
|
|
||
| timestamp = Int | ||
|
|
||
| The Unix Epoch time when the file was created. |
proposals/XX-bw-xxx.txt
Outdated
|
|
||
| The Round Trip Time to obtain 1 Byte of data. | ||
|
|
||
| [juga: which arguments should be include from torflow?] |
Please include node_id, bw, nick.
I don't think there is a lot of value in documenting legacy systems.
Also, there is an example in the appendix, and you have referenced the documentation.
proposals/XX-bw-xxx.txt
Outdated
| 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. | ||
|
|
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.
Only in the sample data or in the definition/format sections too?
k, i answer myself, should be in definition/format sections too
|
On 21 Apr 2018, at 02:42, juga0 ***@***.***> wrote:
should i use "=" or "::=" for the definitions?
dir-spec uses both, but mostly "::=".
https://gitweb.torproject.org/torspec.git/tree/dir-spec.txt#n212
So let's pick "::=" and be consistent.
Using "::=" also makes it easier to tell the difference between definitions:
version ::= Int "." Int "." Int ArgumentChar*
and declarations:
"software_version=" version
|
proposals/XX-bw-xxx.txt
Outdated
|
|
||
| New implementations SHOULD include this line. | ||
| For documents generated following this specification, | ||
| the version_number MUST be "1.1.0". |
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.
proposals/XX-bw-xxx.txt
Outdated
| 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". |
No need to say when the document was generated.
That way, torflow can keep on generating valid documents without this line.
proposals/XX-bw-xxx.txt
Outdated
|
|
||
| New implementations SHOULD include this line. | ||
| Documents generated before this specification do not contain this line, | ||
| and the software is considered to be "Torflow". |
No need to say when the document was generated.
That way, torflow can keep on generating valid documents without this line.
proposals/XX-bw-xxx.txt
Outdated
|
|
||
| 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. |
No need to say when the document was generated.
That way, torflow can keep on generating valid documents without this line.
proposals/XX-bw-xxx.txt
Outdated
| 1. Scope and preliminaries | ||
|
|
||
| This document describes the format of Tor's bandwidth measurements | ||
| document, version 1.1.0 and later. |
The document describes version 1.0.0 and later. The current version is 1.1.0.
proposals/XX-bw-xxx.txt
Outdated
| 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 |
proposals/XX-bw-xxx.txt
Outdated
| 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. |
proposals/XX-bw-xxx.txt
Outdated
| 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. |
proposals/XX-bw-xxx.txt
Outdated
|
|
||
| [Zero or one time.] | ||
|
|
||
| The Unix Epoch time in seconds when the file was created. |
proposals/XX-bw-xxx.txt
Outdated
|
|
||
| [Zero or one time.] | ||
|
|
||
| The Unix Epoch time in seconds when the file was created. |
Of the earliest measurement used to create the file?
Added in 1.1.0.
proposals/XX-bw-xxx.txt
Outdated
|
|
||
| [Zero or more times.] | ||
|
|
||
| Future releases may include additional key_value header lines. |
proposals/XX-bw-xxx.txt
Outdated
| [One time.] | ||
|
|
||
| The header ends. | ||
| For documents generated before this specification, the header ends |
Please say "version 1.0.0 documents", because torflow will continue to generate documents without newlines after this specification is merged.
proposals/XX-bw-xxx.txt
Outdated
| For documents generated before this specification, the header ends | ||
| when the first relay measurement line is found conforming to the | ||
| next section. | ||
|
|
proposals/XX-bw-xxx.txt
Outdated
| next section. | ||
|
|
||
| If a header line does conform to this format, the line SHOULD be ignored by | ||
| parsers. |
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 has been hidden.
This comment has been hidden.
Sorry, something went wrong.
proposals/XX-bw-xxx.txt
Outdated
| 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. |
Scanner implementations may add additional lines by (following a process)...
proposals/XX-bw-xxx.txt
Outdated
| "bw=" bandwidth | ||
|
|
||
| Where bandwidth is the aggregated measured bandwidth of this relay, | ||
| in kilobytes per second. |
This comment has been hidden.
This comment has been hidden.
Sorry, something went wrong.
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:
- 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. - Calculate a quota for the bandwidth authority by multiplying the
per-relay average by the number of relays voted for. - Calculate a scaling factor by dividing the quota by the total
measured bandwidth in this bandwidth authority's upcoming vote. - 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.
proposals/XX-bw-xxx.txt
Outdated
| @@ -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 | |||
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.
|
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 |
|
There are lots of comments on this branch. Let's start again with a new branch. |
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.
The text was updated successfully, but these errors were encountered: