summaryrefslogtreecommitdiff
path: root/doc/path-spec.txt
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-10-01 21:59:09 +0000
committerNick Mathewson <nickm@torproject.org>2006-10-01 21:59:09 +0000
commit57ffca883d586c0b7e20eea2460587b409f9b302 (patch)
treec308225bb41ec570809042c114a89b9982fef11c /doc/path-spec.txt
parent219ad6395cea5403857c3adf1b938741dba79c4f (diff)
downloadtor-57ffca883d586c0b7e20eea2460587b409f9b302.tar.gz
tor-57ffca883d586c0b7e20eea2460587b409f9b302.zip
r8826@totoro: nickm | 2006-10-01 17:58:45 -0400
Disprefer exit nodes for entry, middle positions (fixes bug 200). Also, switch to using a uint64_t to hold "total bandwidth for all nodes" under consideration; crypt_rand_int would have died at 2GB/s network capacity. svn:r8571
Diffstat (limited to 'doc/path-spec.txt')
-rw-r--r--doc/path-spec.txt27
1 files changed, 18 insertions, 9 deletions
diff --git a/doc/path-spec.txt b/doc/path-spec.txt
index 77c0da2590..cfffd5289d 100644
--- a/doc/path-spec.txt
+++ b/doc/path-spec.txt
@@ -157,15 +157,24 @@ of their choices.
below)
- XXXX Choosing the length
- For circuits that are not "fast", when choosing among multiple
- candidates for a path element, we choose randomly. For "fast" circuits,
- we choose
- a given router with probability proportional to its advertised bandwidth
- [the smaller of the 'rate' and 'observed' arguments to the "bandwidth"
- element in its descriptor]. If a router's advertised bandwidth is greater
- than MAX_BELIEVEABLE_BANDWIDTH (1.5 MB/sec), we clip to that value.
-
- (XXXX We should do something to shift traffic away from exit nodes.)
+ For circuits that do not need to be not "fast", when choosing among
+ multiple candidates for a path element, we choose randomly.
+
+ For "fast" circuits, we a given router as an exit with probability
+ proportional to its advertised bandwidth [the smaller of the 'rate' and
+ 'observed' arguments to the "bandwidth" element in its descriptor]. If a
+ router's advertised bandwidth is greater than MAX_BELIEVEABLE_BANDWIDTH
+ (1.5 MB/sec), we clip to that value.
+
+ For non-exit positions on "fast" circuits, we pick routers as above, but
+ we weight the clipped advertised bandwidth of Exit-flagged nodes depending
+ on the fraction of bandwidth available from non-Exit nodes. Call the
+ total clipped advertised bandwidth for Exit nodes under consideration E,
+ and the total clipped advertised bandwidth for non-Exit nodes under
+ consideration N. If E<N/2, we do not consider Exit-flagged nodes.
+ Otherwise, we weight their bandwidth with the factor (E-N/2)/(N+E-N/2) ==
+ (2E - N)/(2E + N). This ensures that bandwidth is evenly distributed over
+ nodes in 3-hop paths.
Additionally, we may be building circuits with one or more requests in
mind. Each kind of request puts certain constraints on paths: