commit 6e83258c9282d51358c82eb7fc84232dfebfbde3 Author: juga0 juga@riseup.net Date: Thu Feb 18 12:21:50 2021 +0000
fix: doc: Separate Torflow/sbws differences
into a new file. --- docs/source/differences.rst | 36 ++++++++++++++++++++++++++++++++++++ docs/source/index.rst | 3 ++- docs/source/torflow_aggr.rst | 35 ----------------------------------- 3 files changed, 38 insertions(+), 36 deletions(-)
diff --git a/docs/source/differences.rst b/docs/source/differences.rst new file mode 100644 index 0000000..6f904e5 --- /dev/null +++ b/docs/source/differences.rst @@ -0,0 +1,36 @@ +.. _differences: + +Differences between Torflow aggregation and sbws scaling (May 2020) +------------------------------------------------------------------- + +Torflow does not exclude relays because of having "few" measurements or "close" +to each other for that relay. + +If there are not new measurements for a relay, Torflow uses the previous +calculated bandwidth, instead of the new value:: + + # If there is a new sample, let's use it for all but guards + if n.measured_at > prev_votes.vote_map[n.idhex].measured_at: + + [snip] + + else: + # Reset values. Don't vote/sample this measurement round. + n.revert_to_vote(prev_votes.vote_map[n.idhex]) + +The oldest measurements Toflow seems to take are from 4 weeks ago, while sbws +oldest measurements are 5 days old:: + + GUARD_SAMPLE_RATE = 2*7*24*60*60 # 2wks + + [snip] + + MAX_AGE = 2*GUARD_SAMPLE_RATE + + [snip] + + # old measurements are probably + # better than no measurements. We may not + # measure hibernating routers for days. + # This filter is just to remove REALLY old files + if time.time() - timestamp > MAX_AGE: diff --git a/docs/source/index.rst b/docs/source/index.rst index 53c3886..85f8591 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -41,12 +41,13 @@ Included in the documenting how_works generator + torflow_aggr + differences code_design state config config_tor sbws - torflow_aggr implementation bandwidth_distribution tor_bandwidth_files diff --git a/docs/source/torflow_aggr.rst b/docs/source/torflow_aggr.rst index bc9420d..e9ae3b6 100644 --- a/docs/source/torflow_aggr.rst +++ b/docs/source/torflow_aggr.rst @@ -385,41 +385,6 @@ Per relay scaled bandwidth rounding Finally, the new scaled bandwidth is expressed in kilobytes and rounded a number of digits.
-Differences between Torflow aggregation and sbws scaling (May 2020) -------------------------------------------------------------------- - -Torflow does not exclude relays because of having "few" measurements or "close" -to each other for that relay. - -If there are not new measurements for a relay, Torflow uses the previous -calculated bandwidth, instead of the new value:: - - # If there is a new sample, let's use it for all but guards - if n.measured_at > prev_votes.vote_map[n.idhex].measured_at: - - [snip] - - else: - # Reset values. Don't vote/sample this measurement round. - n.revert_to_vote(prev_votes.vote_map[n.idhex]) - -The oldest measurements Toflow seems to take are from 4 weeks ago, while sbws -oldest measurements are 5 days old:: - - GUARD_SAMPLE_RATE = 2*7*24*60*60 # 2wks - - [snip] - - MAX_AGE = 2*GUARD_SAMPLE_RATE - - [snip] - - # old measurements are probably - # better than no measurements. We may not - # measure hibernating routers for days. - # This filter is just to remove REALLY old files - if time.time() - timestamp > MAX_AGE: -
.. _README.spec.txt: https://gitweb.torproject.org/torflow.git/tree/NetworkScanners/BwAuthority/R... .. _PID Controller: https://en.wikipedia.org/wiki/PID_controller