-
Notifications
You must be signed in to change notification settings - Fork 83
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 :/
There was a problem hiding this 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.
proposals/XX-bw-xxx.txt
Outdated
@@ -0,0 +1,169 @@ | |||
Tor Bandwidth Measurements Document Format | |||
juga |
There was a problem hiding this comment.
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?
proposals/XX-bw-xxx.txt
Outdated
- Header (exactly once) | ||
- Relays measurements (zero or more times) | ||
|
||
2.1. Nonterminals |
There was a problem hiding this comment.
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"
proposals/XX-bw-xxx.txt
Outdated
|
||
[At start, exactly once.] | ||
|
||
timestamp = Int |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
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?] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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. |
There was a problem hiding this comment.
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.
proposals/XX-bw-xxx.txt
Outdated
|
||
Where: | ||
|
||
timestamp = Int |
There was a problem hiding this comment.
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.
proposals/XX-bw-xxx.txt
Outdated
|
||
rtt = Int | ||
|
||
The Round Trip Time to obtain 1 Byte of data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In milliseconds?
proposals/XX-bw-xxx.txt
Outdated
|
||
timestamp = Int | ||
|
||
The Unix Epoch time when the measurement was performed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In seconds
proposals/XX-bw-xxx.txt
Outdated
|
||
timestamp = Int | ||
|
||
The Unix Epoch time when the file was created. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In seconds.
proposals/XX-bw-xxx.txt
Outdated
|
||
The Round Trip Time to obtain 1 Byte of data. | ||
|
||
[juga: which arguments should be include from torflow?] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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. | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
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". |
There was a problem hiding this comment.
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.
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". |
There was a problem hiding this comment.
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.
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". |
There was a problem hiding this comment.
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.
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. |
There was a problem hiding this comment.
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.
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. |
There was a problem hiding this comment.
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.
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 |
There was a problem hiding this comment.
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.
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. |
There was a problem hiding this comment.
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.
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. |
There was a problem hiding this comment.
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.
proposals/XX-bw-xxx.txt
Outdated
|
||
The Unix Epoch time in seconds when the file was created. | ||
|
||
"version="version_number NL |
There was a problem hiding this comment.
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
proposals/XX-bw-xxx.txt
Outdated
|
||
[Zero or one time.] | ||
|
||
The Unix Epoch time in seconds when the file was created. |
There was a problem hiding this comment.
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.
proposals/XX-bw-xxx.txt
Outdated
|
||
[Zero or one time.] | ||
|
||
The Unix Epoch time in seconds when the file was created. |
There was a problem hiding this comment.
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.
proposals/XX-bw-xxx.txt
Outdated
|
||
[Zero or more times.] | ||
|
||
Future releases may include additional key_value header lines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Future format versions?
proposals/XX-bw-xxx.txt
Outdated
[One time.] | ||
|
||
The header ends. | ||
For documents generated before this specification, the header ends |
There was a problem hiding this comment.
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.
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. | ||
|
There was a problem hiding this comment.
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.
proposals/XX-bw-xxx.txt
Outdated
next section. | ||
|
||
If a header line does conform to this format, the line SHOULD be ignored by | ||
parsers. |
There was a problem hiding this comment.
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.
This comment was marked as resolved.
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. |
There was a problem hiding this comment.
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)...
proposals/XX-bw-xxx.txt
Outdated
"bw=" bandwidth | ||
|
||
Where bandwidth is the aggregated measured bandwidth of this relay, | ||
in kilobytes per second. |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
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:
- 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not
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.