|
|
= sbws bandwidth scanner presentation =
|
|
|
# sbws bandwidth scanner presentation
|
|
|
|
|
|
See also juga's slides: https://juga0.github.io/tor_hackweek_bandwidth_slides/
|
|
|
|
|
|
== Why bandwidth scanners? ==
|
|
|
## Why bandwidth scanners?
|
|
|
|
|
|
Relays can lie about their bandwidths.
|
|
|
|
|
|
== How sbws works ==
|
|
|
## How sbws works
|
|
|
|
|
|
=== Threads ===
|
|
|
### Threads
|
|
|
|
|
|
sbws runs these threads:
|
|
|
* main thread
|
... | ... | @@ -22,7 +22,7 @@ Critical sections for threads: |
|
|
* relay priority: relay list
|
|
|
* measure relay: relay list, etc.
|
|
|
|
|
|
=== Measurement ===
|
|
|
### Measurement
|
|
|
|
|
|
sbws gets a list of relays from the consensus, and scans those relays.
|
|
|
It updates ever few minutes.
|
... | ... | @@ -39,7 +39,7 @@ Measure the speed |
|
|
|
|
|
The results are stored as lines of JSON.
|
|
|
|
|
|
=== Generate ===
|
|
|
### Generate
|
|
|
|
|
|
Every hour, the scanner generates a results file according to the Tor bandwidth file spec.
|
|
|
|
... | ... | @@ -48,13 +48,13 @@ The results are filtered: |
|
|
* ignore relays with fewer than 2 measurements
|
|
|
* ignore relays where the first and last measurements are less than 24 hours apart
|
|
|
|
|
|
==== Scaling ====
|
|
|
#### Scaling
|
|
|
|
|
|
Scale the relay's self-reported bandwidth by the measured bandwidth.
|
|
|
|
|
|
See the bandwidth file spec: "Torflow Scaling".
|
|
|
|
|
|
==== Format the bandwidth file ====
|
|
|
#### Format the bandwidth file
|
|
|
|
|
|
Header:
|
|
|
* Timestamp
|
... | ... | @@ -63,7 +63,7 @@ Header: |
|
|
Results:
|
|
|
* one relay per line: id and bandwidth, and other keys
|
|
|
|
|
|
== Questions ==
|
|
|
## Questions
|
|
|
|
|
|
It takes 24 hours to scan the entire network.
|
|
|
|
... | ... | |