Commit ab71dc06 authored by Matt Traudt's avatar Matt Traudt
Browse files

Update docs to reflect commands instead of scripts

parent 092b0fb5
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
It doesn't get simplier than this, folks. It doesn't get simplier than this, folks.
Run server.py on the same machine as a relay with an exit policy that allows Run `sbws server` on the same machine as a relay with an exit policy that
exiting to itself on a single port. (Notice: it won't get the exit flag) allows exiting to itself on a single port. (Notice: it won't get the exit flag)
Run scanner.py on a well-connected machine on the Internet. Run `sbws client` on a well-connected machine on the Internet.
The scanner builds two hop circuits consisting of the relay being measured and The scanner builds two hop circuits consisting of the relay being measured and
the helper relay running server.py. Over these circuits it measures RTT and the helper relay running server.py. Over these circuits it measures RTT and
...@@ -22,7 +22,7 @@ Clone the repo ...@@ -22,7 +22,7 @@ Clone the repo
sbws client -h sbws client -h
sbws server -h sbws server -h
# Authenticating to server.py # Authenticating to `sbws server`
Generate a password and store in passwords.txt. It must be 64 characters (or Generate a password and store in passwords.txt. It must be 64 characters (or
bytes?) long and valid unicode. Just use regular ASCII 1-byte chars, as in this bytes?) long and valid unicode. Just use regular ASCII 1-byte chars, as in this
...@@ -30,44 +30,11 @@ example please. Multiple passwords may be specified, one per line. ...@@ -30,44 +30,11 @@ example please. Multiple passwords may be specified, one per line.
(</dev/urandom tr -dc 'a-zA-Z0-9' | head -c 64; echo '') | tee -a passwords.txt (</dev/urandom tr -dc 'a-zA-Z0-9' | head -c 64; echo '') | tee -a passwords.txt
The scanner will pick the first password and use it always. The server will The client will pick the first password and use it always. The server will
accept any password in the file. accept any password in the file.
---------- ----------
Some quick notes to get you started
scanner.py is the client; server.py is the server. The server needs to run next
to an "exit" relay (only needs to allow exiting to one IP+port on its own
machine).
**scanner.py** is the client that ties everything together. It creates a
circuit builder, relay list, and result dump. It creates a pool of worker
threads to perform measurements. It currently performs one measurement per
relay (in random order) and then quits. Obviously that (and a lot else) needs
to change.
**scanner.py: measure_relay** is the function that runs in a worker thread to
do a measurement. After building a two-hop circuit through the target relay and
the helper "exit" relay and attaching a stream to that circuit, it tells the
server to send 16 KiB. It times how long that takes. If it takes less than a
second, it tells the server to send 10x as much and repeats. If it took longer
than a second, it tells the server to send the amount that we predict would
take just over 5s to send. Once we have a measurement that took longer than 5s,
it sends the resulting speed (and other metadata) to the result dump.
The scanner still needs some work. For example, maybe we should only take a
result that takes between 5s and 10s to retrieve instead of just greater than
5s. Maybe we need to take a small number of similarly sized measurements and
only use the maximum as the result.
**generate-v3bw.py** takes the results from the last 5 days of measurements and
generates a file ready for the bandwidth authorities to consume. It uses the
median measuremnt from the last 5 days, *which is a temporary thing until we
think about what we actually want to do (max? EWMA?)*. It scales the results so
that it can have comparible results to other systems (assuming they use the
same scale).
**lib/circuitbuilder.py** Only one subclass of CircuitBuilder is used as of **lib/circuitbuilder.py** Only one subclass of CircuitBuilder is used as of
this writing, and that is GapsCircuitBuilder. Oddly enough, there are no gaps this writing, and that is GapsCircuitBuilder. Oddly enough, there are no gaps
in the circuits we ask it to build. in the circuits we ask it to build.
...@@ -255,7 +255,7 @@ def gen_parser(sub): ...@@ -255,7 +255,7 @@ def gen_parser(sub):
help='Number of measurements to make in parallel') help='Number of measurements to make in parallel')
p.add_argument('--helper-relay', type=str, required=True, p.add_argument('--helper-relay', type=str, required=True,
help='Relay to which to build circuits and is running ' help='Relay to which to build circuits and is running '
'the server.py') 'the sbws server')
p.add_argument('--password-file', type=str, default='passwords.txt', p.add_argument('--password-file', type=str, default='passwords.txt',
help='Read the first line and use it as the password ' help='Read the first line and use it as the password '
'when authenticating to the server.') 'when authenticating to the server.')
......
...@@ -56,7 +56,7 @@ def gen_parser(sub): ...@@ -56,7 +56,7 @@ def gen_parser(sub):
p = sub.add_parser('generate', p = sub.add_parser('generate',
formatter_class=ArgumentDefaultsHelpFormatter) formatter_class=ArgumentDefaultsHelpFormatter)
p.add_argument('--result-directory', default='dd', type=str, p.add_argument('--result-directory', default='dd', type=str,
help='Where result data from scanner.py is stored') help='Where result data from the sbws client is stored')
p.add_argument('--output', default='/dev/stdout', type=str, p.add_argument('--output', default='/dev/stdout', type=str,
help='Where to write v3bw file') help='Where to write v3bw file')
p.add_argument('--scale-max', default=50000000, type=int, p.add_argument('--scale-max', default=50000000, type=int,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment