Skip to content
Rob Jansen edited this page Jun 12, 2017 · 4 revisions

What is this?

This repository holds various prototype algorithms and protocols I developed for Tor while working on Tor research publications. There are several branches that hold various additions to Tor for various Tor versions. Explanations are below. Please keep in mind that this code represents research prototypes and as such is not guaranteed to work in all cases.

Notes on branches

Each branch shows the algorithm has been implemented or ported. Tags are created on each branch for specific versions of Tor. For example, a diff of the origin throttle-bitsplit-0.2.2.15-alpha tag and the tor tor-0.2.2.15-alpha tag should produce a patch with code added for the bitsplitting algorithm.

To get up and running:

$ git clone [email protected]:robgjansen/tor.git
$ cd tor
$ git remote add tor https://git.torproject.org/tor.git
$ git fetch tor

To view the tags:

$ git tag -l
$ git ls-remote --tags origin

To view the branches:

$ git branch -r | grep origin

research/throttling/bitsplit

Bitsplitting algorithm for adaptive throttling. Guard-to-client connections are throttled by fairly splitting bandwidth among all such connections. The algorithm adaptively modifies the per-connection bandwidth rate settings and can be enabled by setting the PerConnSplitBits config option to a non-zero value.

research/throttling/flag

Fingerprinting algorithm for adaptive throttling. If PerConnBWFingerprint is non-zero, guard-to-client connections are flagged if they use more than the FairEWMA portion of the bandwidth, the EWMA a connection would have if it was using exactly its fair share of bandwidth over time. Flagged connections are throttled at the PerConnBWFingerprint rate, until their EWMA falls below (PerConnBWPenalty * FairEWMA).

PerConnBWFingerprint and PerConnBWPenalty are config options, and disabled by default.

This algorithm requires each connection to track EWMA. The EWMA halflife for these connections can be set with PerConnHalflife and is used the same way as CircuitPriorityHalflife. PerConnHalflife defaults to 30 if not set and PerConnBWFingerprint is enabled.

PerConnHalflife cell counters can be tracked over time by setting config PerConnHalflifeVerbose to non-zero. This results in a log entry EVERY time the token buckets are refilled, so use with caution.

research/throttling/threshold

Threshold algorithm for adaptive throttling. Adaptively select the loudest config PerConnBWThreshold percent of connections and throttle them to the average throughput of the connection represented by PerConnBWThreshold (if PerConnBWThreshold is 10 and there are 100 connections, the throttle rate for the 10 loudest connections is the throughput of the 10th loudest connection).

Never throttle below config PerConnBWFloor Bps no matter what.

Throughputs for each connections are computed over the last config PerConnBWRefresh seconds.

Requires per-connection EWMA, so PerConnHalflife will be defaulted to 30 if not set and PerConnBWThreshold is enabled. PerConnHalflifeVerbose config can be set to non-zero to log per-connection cell counts over time. Use with caution as it generates lots of log entries.

research/lira/v1-squashed

TODO.

research/kist/v2-squashed

TODO.

research/taps/v1-squashed

TODO.

research/peerflow/v2-squashed

TODO.

tor/*

Branches created and maintained by The Tor Project.

Other notes

To start a new branch:

$ git checkout -b throttle-bitsplit tor-0.2.2.15-alpha
$ git push origin throttle-bitsplit
<make changes on the new branch, relative to the tagged Tor version>
$ git tag -s throttle-bitsplit-0.2.2.15-alpha throttle-bitsplit
$ git push origin throttle-bitsplit-0.2.2.15-alpha

To forward-port an existing branch:

$ git branch 0.2.3.8-alpha tor-0.2.3.8-alpha
$ git checkout throttle-bitsplit
$ git merge 0.2.3.8-alpha
<fix conflicts>
$ git commit
$ git tag -s throttle-bitsplit-0.2.3.8-alpha throttle-bitsplit
$ git push origin throttle-bitsplit-0.2.3.8-alpha

To re-tag after changes (this should be avoided):

$ git tag -d throttle-bitsplit-0.2.3.8-alpha
$ git push origin :refs/tags/throttle-bitsplit-0.2.3.8-alpha
$ git tag -s throttle-bitsplit-0.2.3.8-alpha throttle-bitsplit
$ git push origin throttle-bitsplit-0.2.3.8-alpha
Clone this wiki locally